/*
Theme Name: Justin Hà Travel Blog
Theme URI: https://justintravelguide.com
Author: Justin Hà
Author URI: https://justintravelguide.com
Description: A clean, fresh, ocean-inspired personal travel blog theme for Vietnam travel content. SEO-friendly, AdSense-ready, affiliate-ready, accessible, and fast.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: justin-travel-blog
Tags: travel, blog, ocean, clean, personal, seo, responsive, accessibility-ready, glassmorphism
*/

/* ============================================================
   GLOBAL DESIGN TOKENS
   Shared across ALL templates. Do NOT duplicate in template files.
   ============================================================ */

:root {
  /* ── Brand Colors ── */
  --color-brand-primary:         #0E7490;
  --color-brand-primary-hover:   #155E75;
  --color-brand-primary-soft:    #E0F7FA;

  --color-brand-secondary:       #14B8A6;
  --color-brand-secondary-hover: #0F766E;
  --color-brand-secondary-soft:  #CCFBF1;

  --color-brand-accent:          #F4B860;
  --color-brand-accent-hover:    #D99A3D;
  --color-brand-accent-soft:     #FFF3D6;

  /* ── Ocean & Travel ── */
  --color-ocean-deep:   #164E63;
  --color-ocean-blue:   #0EA5E9;
  --color-ocean-light:  #E0F2FE;
  --color-teal-fresh:   #2DD4BF;
  --color-sand-light:   #FAF3E3;
  --color-sand-warm:    #F5E6C8;

  /* ── Neutrals ── */
  --color-white:          #FFFFFF;
  --color-black:          #111827;
  --color-text-primary:   #1F2937;
  --color-text-secondary: #4B5563;
  --color-text-muted:     #6B7280;
  --color-text-inverse:   #FFFFFF;

  /* ── Surfaces ── */
  --color-surface-base:      #FFFFFF;
  --color-surface-muted:     #F8FAFC;
  --color-surface-soft-blue: #F0F9FF;
  --color-surface-soft-teal: #F0FDFA;
  --color-surface-sand:      #FFFBF0;
  --color-surface-raised:    #FFFFFF;

  /* ── Borders ── */
  --color-border-light:  #E5E7EB;
  --color-border-medium: #CBD5E1;
  --color-border-strong: #94A3B8;

  /* ── States ── */
  --color-state-success: #16A34A;
  --color-state-warning: #F59E0B;
  --color-state-error:   #DC2626;
  --color-state-info:    #0284C7;

  /* ── Focus ── */
  --color-focus-ring: #0EA5E9;

  /* ── Affiliate / Monetization ── */
  --color-affiliate-bg:     #F0FDFA;
  --color-affiliate-border: #99F6E4;
  --color-affiliate-cta:    #0E7490;

  /* ── AdSense Placeholders ── */
  --color-ad-bg:     #F8FAFC;
  --color-ad-border: #E5E7EB;
  --color-ad-label:  #94A3B8;

  /* ── Liquid Glass Tokens ── */
  --glass-bg:           rgba(255, 255, 255, 0.72);
  --glass-bg-dark:      rgba(22, 78, 99, 0.85);
  --glass-bg-deep:      rgba(15, 40, 55, 0.92);
  --glass-border:       rgba(255, 255, 255, 0.60);
  --glass-border-dark:  rgba(255, 255, 255, 0.15);
  --glass-blur:         blur(20px);
  --glass-blur-heavy:   blur(32px);
  --glass-shadow:       0 8px 32px rgba(14, 116, 144, 0.12), 0 2px 8px rgba(14, 116, 144, 0.08);
  --glass-shadow-dark:  0 8px 40px rgba(0, 0, 0, 0.30);
  --glass-highlight:    linear-gradient(135deg, rgba(255,255,255,0.30) 0%, rgba(255,255,255,0.06) 100%);

  /* ── Typography ── */
  --font-family-heading: "Inter", "Poppins", Arial, sans-serif;
  --font-family-body:    "Inter", Arial, sans-serif;
  --font-family-serif:   "Lora", Georgia, serif;

  --font-size-xs:   12px;
  --font-size-sm:   14px;
  --font-size-base: 16px;
  --font-size-md:   18px;
  --font-size-lg:   22px;
  --font-size-xl:   28px;
  --font-size-2xl:  36px;
  --font-size-3xl:  48px;
  --font-size-4xl:  60px;

  --font-weight-regular:  400;
  --font-weight-medium:   500;
  --font-weight-semibold: 600;
  --font-weight-bold:     700;

  --line-height-tight:   1.2;
  --line-height-heading: 1.25;
  --line-height-body:    1.7;
  --line-height-relaxed: 1.85;

  /* ── Spacing ── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  96px;
  --space-10: 128px;

  /* ── Border Radius ── */
  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   24px;
  --radius-xl:   32px;
  --radius-full: 999px;

  /* ── Shadows ── */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.14);

  /* ── Motion ── */
  --motion-fast:   150ms;
  --motion-normal: 250ms;
  --motion-slow:   400ms;
  --motion-ease:   ease;

  /* ── Containers ── */
  --container-sm: 720px;
  --container-md: 960px;
  --container-lg: 1180px;
  --container-xl: 1320px;
}

/* ============================================================
   GLOBAL RESET & BASE
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px; /* offset for sticky header */
}

body {
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-body);
  color: var(--color-text-primary);
  background-color: var(--color-surface-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-brand-primary);
  text-decoration: none;
  transition: color var(--motion-fast) var(--motion-ease);
}

a:hover {
  color: var(--color-brand-primary-hover);
}

/* ── Accessibility: Skip Link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-brand-primary);
  color: var(--color-text-inverse);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  font-weight: var(--font-weight-semibold);
  z-index: 10000;
  transition: top var(--motion-fast) var(--motion-ease);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ── Focus Styles ── */
:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* ── Container Utility ── */
.jt-container {
  width: 100%;
  max-width: var(--container-lg);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.jt-container--wide {
  max-width: var(--container-xl);
}

/* ============================================================
   BACK-TO-TOP BUTTON
   Injected by main.js — styles must be global
   ============================================================ */

.jt-back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 900;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  color: var(--color-brand-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity var(--motion-normal) var(--motion-ease),
    transform var(--motion-normal) var(--motion-ease),
    background var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease);
  pointer-events: none;
}

.jt-back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.jt-back-to-top:hover {
  background: var(--color-brand-primary);
  color: var(--color-text-inverse);
  box-shadow: 0 8px 24px rgba(14, 116, 144, 0.35);
  transform: translateY(-2px);
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
