/*
 * Theme Name:   EditorialGlow Child
 * Theme URI:    https://editorialglow.com
 * Description:  Premium Amazon Affiliate Review Hub — Luxury Editorial Aesthetic. Child theme for Kadence WP (also compatible with Blocksy and GeneratePress — change Template value to match your parent).
 * Author:       EditorialGlow Studio
 * Author URI:   https://editorialglow.com
 * Template:     kadence
 * Version:      1.0.0
 * Requires at least: 6.0
 * Requires PHP:  8.0
 * License:      GPL-2.0-or-later
 * License URI:  https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:  editorialglow
 *
 * ============================================================
 * STEP 1: EDITORIALGLOW LIQUID DESIGN SYSTEM
 * ============================================================
 */

/* ─────────────────────────────────────────────
   1.0  CUSTOM PROPERTY TOKEN MAP
   ───────────────────────────────────────────── */
:root {
  /* Brand Color Palette */
  --eg-ivory:           #FAF9F6;    /* Background — organic soft off-white */
  --eg-ivory-100:       #F3F1EC;    /* Slightly deeper ivory for card surfaces */
  --eg-ivory-200:       #EAE7DF;    /* Section dividers, borders */
  --eg-charcoal:        #1A1A1A;    /* Primary text — deep slate */
  --eg-charcoal-60:     #666260;    /* Secondary text, captions */
  --eg-charcoal-30:     #B3B1AF;    /* Placeholder text, muted elements */
  --eg-gold:            #C5A059;    /* Primary accent — muted champagne gold */
  --eg-gold-light:      #D4B47A;    /* Hover state gold */
  --eg-gold-dark:       #A8863D;    /* Active/pressed gold */
  --eg-gold-10:         rgba(197, 160, 89, 0.10);  /* Gold wash backgrounds */
  --eg-gold-20:         rgba(197, 160, 89, 0.20);  /* Subtle gold highlights */

  /* Neutral Grays */
  --eg-white:           #FFFFFF;
  --eg-gray-50:         #F8F7F4;
  --eg-gray-100:        #EFEFED;
  --eg-gray-200:        #DDDBD7;
  --eg-gray-400:        #9E9C99;

  /* Semantic / Status */
  --eg-success:         #4A7C59;    /* Muted forest green */
  --eg-danger:          #8B3A3A;    /* Deep muted red */
  --eg-info:            #3A6B8B;    /* Deep slate blue */

  /* Shadows */
  --eg-shadow-xs:       0 1px 3px rgba(26, 26, 26, 0.06);
  --eg-shadow-sm:       0 2px 8px rgba(26, 26, 26, 0.08);
  --eg-shadow-md:       0 8px 24px rgba(26, 26, 26, 0.10);
  --eg-shadow-lg:       0 16px 48px rgba(26, 26, 26, 0.12);
  --eg-shadow-gold:     0 4px 20px rgba(197, 160, 89, 0.25);

  /* Border Radius */
  --eg-radius-xs:       4px;
  --eg-radius-sm:       8px;
  --eg-radius-md:       12px;
  --eg-radius-lg:       20px;
  --eg-radius-xl:       32px;
  --eg-radius-full:     9999px;

  /* Typography */
  --eg-font-serif:      'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --eg-font-sans:       'Inter', 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  --eg-font-mono:       'Courier New', Courier, monospace;

  /* Type Scale (fluid clamp) */
  --eg-text-xs:         clamp(0.75rem,  1.2vw, 0.875rem);
  --eg-text-sm:         clamp(0.875rem, 1.4vw, 1rem);
  --eg-text-base:       clamp(1rem,     1.6vw, 1.125rem);
  --eg-text-lg:         clamp(1.125rem, 2vw,   1.25rem);
  --eg-text-xl:         clamp(1.25rem,  2.4vw, 1.5rem);
  --eg-text-2xl:        clamp(1.5rem,   3vw,   2rem);
  --eg-text-3xl:        clamp(2rem,     4vw,   2.75rem);
  --eg-text-4xl:        clamp(2.5rem,   5vw,   3.5rem);
  --eg-text-5xl:        clamp(3rem,     6vw,   4.5rem);

  /* Spacing */
  --eg-space-1:         0.25rem;
  --eg-space-2:         0.5rem;
  --eg-space-3:         0.75rem;
  --eg-space-4:         1rem;
  --eg-space-6:         1.5rem;
  --eg-space-8:         2rem;
  --eg-space-10:        2.5rem;
  --eg-space-12:        3rem;
  --eg-space-16:        4rem;
  --eg-space-20:        5rem;
  --eg-space-24:        6rem;

  /* Layout */
  --eg-container-xs:    640px;
  --eg-container-sm:    768px;
  --eg-container-md:    1024px;
  --eg-container-lg:    1280px;
  --eg-container-xl:    1440px;

  /* Z-Index Scale */
  --eg-z-base:          1;
  --eg-z-dropdown:      100;
  --eg-z-sticky:        200;
  --eg-z-overlay:       300;
  --eg-z-modal:         400;
  --eg-z-toast:         500;

  /* Motion */
  --eg-ease-luxury:     cubic-bezier(0.25, 1, 0.5, 1);
  --eg-duration-fast:   0.15s;
  --eg-duration-base:   0.25s;
  --eg-duration-slow:   0.4s;
  --eg-duration-xslow:  0.7s;

  /* Line Heights */
  --eg-leading-tight:   1.25;
  --eg-leading-snug:    1.4;
  --eg-leading-base:    1.6;
  --eg-leading-loose:   1.8;
}

/* ─────────────────────────────────────────────
   1.1  GOOGLE FONTS IMPORT
   ───────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

/* ─────────────────────────────────────────────
   1.2  GLOBAL RESET & BASE STYLES
   ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  background-color: var(--eg-ivory);
  color: var(--eg-charcoal);
  font-family: var(--eg-font-sans);
  font-size: var(--eg-text-base);
  font-weight: 400;
  line-height: var(--eg-leading-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ─────────────────────────────────────────────
   1.3  TYPOGRAPHY HIERARCHY
   ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--eg-font-serif);
  font-weight: 600;
  line-height: var(--eg-leading-tight);
  letter-spacing: -0.02em;
  color: var(--eg-charcoal);
}

h1 { font-size: var(--eg-text-5xl); font-weight: 700; }
h2 { font-size: var(--eg-text-4xl); }
h3 { font-size: var(--eg-text-3xl); }
h4 { font-size: var(--eg-text-2xl); }
h5 { font-size: var(--eg-text-xl);  }
h6 { font-size: var(--eg-text-lg);  }

p {
  font-family: var(--eg-font-sans);
  font-size: var(--eg-text-base);
  line-height: var(--eg-leading-base);
  color: var(--eg-charcoal);
  max-width: 70ch;
}

a {
  color: var(--eg-gold);
  text-decoration: none;
  transition:
    color var(--eg-duration-slow) var(--eg-ease-luxury),
    opacity var(--eg-duration-slow) var(--eg-ease-luxury);
}

a:hover {
  color: var(--eg-gold-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

strong, b { font-weight: 600; }
em, i { font-style: italic; }

blockquote {
  border-left: 3px solid var(--eg-gold);
  padding: var(--eg-space-4) var(--eg-space-6);
  margin: var(--eg-space-6) 0;
  font-family: var(--eg-font-serif);
  font-style: italic;
  font-size: var(--eg-text-xl);
  color: var(--eg-charcoal-60);
  background: var(--eg-gold-10);
  border-radius: 0 var(--eg-radius-sm) var(--eg-radius-sm) 0;
}

/* ─────────────────────────────────────────────
   1.4  PAGE FADE-IN ANIMATION (Zero CLS)
   ───────────────────────────────────────────── */
@keyframes eg-page-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Contain animation to a wrapper, not <body>, to avoid layout shifts */
.eg-page-wrapper {
  animation: eg-page-fade-in var(--eg-duration-xslow) var(--eg-ease-luxury) both;
  will-change: opacity, transform;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .eg-page-wrapper {
    animation: none;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─────────────────────────────────────────────
   1.5  LAYOUT CONTAINERS
   ───────────────────────────────────────────── */
.eg-container {
  width: 100%;
  max-width: var(--eg-container-lg);
  margin-inline: auto;
  padding-inline: clamp(1rem, 5vw, 3rem);
}

.eg-container--narrow {
  max-width: var(--eg-container-sm);
}

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

/* ─────────────────────────────────────────────
   1.6  BUTTON SYSTEM
   ───────────────────────────────────────────── */
.eg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--eg-space-2);
  padding: var(--eg-space-3) var(--eg-space-8);
  font-family: var(--eg-font-sans);
  font-size: var(--eg-text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--eg-radius-full);
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color var(--eg-duration-slow) var(--eg-ease-luxury),
    color            var(--eg-duration-slow) var(--eg-ease-luxury),
    box-shadow       var(--eg-duration-slow) var(--eg-ease-luxury),
    transform        var(--eg-duration-slow) var(--eg-ease-luxury);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.eg-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--eg-shadow-gold);
}

.eg-btn:active {
  transform: translateY(0);
  box-shadow: var(--eg-shadow-xs);
}

/* Gold CTA (primary conversion) */
.eg-btn--gold {
  background-color: var(--eg-gold);
  color: var(--eg-white);
}

.eg-btn--gold:hover {
  background-color: var(--eg-gold-light);
  color: var(--eg-white);
}

/* Dark CTA */
.eg-btn--dark {
  background-color: var(--eg-charcoal);
  color: var(--eg-ivory);
}

.eg-btn--dark:hover {
  background-color: #2D2D2D;
  color: var(--eg-ivory);
}

/* Ghost / Outline */
.eg-btn--outline {
  background-color: transparent;
  color: var(--eg-gold);
  border: 1.5px solid var(--eg-gold);
}

.eg-btn--outline:hover {
  background-color: var(--eg-gold-10);
}

/* Large CTA variant */
.eg-btn--lg {
  padding: var(--eg-space-4) var(--eg-space-10);
  font-size: var(--eg-text-base);
  border-radius: var(--eg-radius-md);
}

/* ─────────────────────────────────────────────
   1.7  CARD SYSTEM
   ───────────────────────────────────────────── */
.eg-card {
  background: var(--eg-white);
  border-radius: var(--eg-radius-lg);
  box-shadow: var(--eg-shadow-sm);
  overflow: hidden;
  transition:
    box-shadow   var(--eg-duration-slow) var(--eg-ease-luxury),
    transform    var(--eg-duration-slow) var(--eg-ease-luxury);
}

.eg-card:hover {
  box-shadow: var(--eg-shadow-md);
  transform: translateY(-4px);
}

.eg-card__image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  transition: transform var(--eg-duration-xslow) var(--eg-ease-luxury);
}

.eg-card:hover .eg-card__image {
  transform: scale(1.04);
}

.eg-card__body {
  padding: var(--eg-space-6);
}

.eg-card__label {
  font-family: var(--eg-font-sans);
  font-size: var(--eg-text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--eg-gold);
  margin-bottom: var(--eg-space-2);
}

.eg-card__title {
  font-family: var(--eg-font-serif);
  font-size: var(--eg-text-xl);
  color: var(--eg-charcoal);
  margin-bottom: var(--eg-space-3);
  line-height: var(--eg-leading-snug);
}

.eg-card__excerpt {
  font-size: var(--eg-text-sm);
  color: var(--eg-charcoal-60);
  line-height: var(--eg-leading-base);
}

/* ─────────────────────────────────────────────
   1.8  HEADER / NAVIGATION
   ───────────────────────────────────────────── */
.eg-header {
  position: sticky;
  top: 0;
  z-index: var(--eg-z-sticky);
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--eg-ivory-200);
  transition: box-shadow var(--eg-duration-slow) var(--eg-ease-luxury);
}

.eg-header.is-scrolled {
  box-shadow: var(--eg-shadow-sm);
}

.eg-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

/* ─────────────────────────────────────────────
   1.9  BRAND ASSET PLACEHOLDERS (Customizer hooks)
   ───────────────────────────────────────────── */
/*
 * These regions are populated via the WordPress Customizer:
 *   Appearance → Customize → Site Identity → Logo / Site Icon
 *
 * The min-width / min-height prevent layout shift before
 * the image loads — matching your actual logo dimensions.
 */
.eg-logo {
  display: block;
  min-width: 180px;
  min-height: 40px;
  /* Aspect-ratio locks the reserved space to your logo's proportions */
  aspect-ratio: 4.5 / 1;
}

.eg-logo img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Favicon is managed by WordPress (Site Identity → Site Icon)
   We reserve its space here only in the admin bar context    */
.eg-favicon-placeholder {
  width: 32px;
  height: 32px;
  background: var(--eg-gold-10);
  border-radius: var(--eg-radius-xs);
}

/* ─────────────────────────────────────────────
   1.10  GLOBAL GOLD ACCENT UTILITIES
   ───────────────────────────────────────────── */
.eg-text-gold        { color: var(--eg-gold); }
.eg-text-charcoal    { color: var(--eg-charcoal); }
.eg-text-muted       { color: var(--eg-charcoal-60); }
.eg-bg-ivory         { background-color: var(--eg-ivory); }
.eg-bg-gold-wash     { background-color: var(--eg-gold-10); }
.eg-border-gold      { border: 1px solid var(--eg-gold); }
.eg-divider          { border: none; border-top: 1px solid var(--eg-ivory-200); margin: var(--eg-space-8) 0; }

/* Gold underline decorative accent for section headings */
.eg-heading-accent {
  position: relative;
  display: inline-block;
}
.eg-heading-accent::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 48px;
  height: 2px;
  background: var(--eg-gold);
  border-radius: var(--eg-radius-full);
  transition: width var(--eg-duration-slow) var(--eg-ease-luxury);
}
.eg-heading-accent:hover::after { width: 100%; }

/* ─────────────────────────────────────────────
   1.11  FORM INPUTS
   ───────────────────────────────────────────── */
.eg-input,
.eg-textarea,
.eg-select {
  width: 100%;
  padding: var(--eg-space-3) var(--eg-space-4);
  font-family: var(--eg-font-sans);
  font-size: var(--eg-text-base);
  color: var(--eg-charcoal);
  background: var(--eg-white);
  border: 1.5px solid var(--eg-gray-200);
  border-radius: var(--eg-radius-sm);
  outline: none;
  transition:
    border-color var(--eg-duration-slow) var(--eg-ease-luxury),
    box-shadow   var(--eg-duration-slow) var(--eg-ease-luxury);
}

.eg-input:focus,
.eg-textarea:focus,
.eg-select:focus {
  border-color: var(--eg-gold);
  box-shadow: 0 0 0 3px var(--eg-gold-10);
}

.eg-input::placeholder,
.eg-textarea::placeholder {
  color: var(--eg-charcoal-30);
}

/* ─────────────────────────────────────────────
   1.12  BADGE / TAG SYSTEM
   ───────────────────────────────────────────── */
.eg-badge {
  display: inline-block;
  padding: var(--eg-space-1) var(--eg-space-3);
  font-size: var(--eg-text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--eg-radius-full);
}

.eg-badge--gold {
  background: var(--eg-gold);
  color: var(--eg-white);
}

.eg-badge--outline {
  border: 1px solid var(--eg-gold);
  color: var(--eg-gold);
}

.eg-badge--dark {
  background: var(--eg-charcoal);
  color: var(--eg-ivory);
}

/* ─────────────────────────────────────────────
   1.13  STAR RATING DISPLAY
   ───────────────────────────────────────────── */
.eg-stars {
  display: inline-flex;
  gap: 2px;
  color: var(--eg-gold);
  font-size: var(--eg-text-base);
}

/* ─────────────────────────────────────────────
   1.14  READING PROGRESS BAR
   ───────────────────────────────────────────── */
.eg-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--eg-gold);
  z-index: calc(var(--eg-z-sticky) + 10);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.1s linear;
  will-change: transform;
}

/* ─────────────────────────────────────────────
   1.15  FOOTER
   ───────────────────────────────────────────── */
.eg-footer {
  background: var(--eg-charcoal);
  color: var(--eg-ivory-200);
  padding: var(--eg-space-16) 0 var(--eg-space-8);
}

.eg-footer a {
  color: var(--eg-gold-light);
  transition: color var(--eg-duration-slow) var(--eg-ease-luxury);
}

.eg-footer a:hover {
  color: var(--eg-gold);
}

.eg-footer__affiliate-notice {
  text-align: center;
  font-size: var(--eg-text-xs);
  color: var(--eg-gray-400);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: var(--eg-space-6);
  margin-top: var(--eg-space-8);
}

/* ─────────────────────────────────────────────
   1.16  SCROLLBAR STYLING
   ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--eg-ivory-100); }
::-webkit-scrollbar-thumb { background: var(--eg-gray-200); border-radius: var(--eg-radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--eg-gold); }

/* ─────────────────────────────────────────────
   1.17  SELECTION COLOR
   ───────────────────────────────────────────── */
::selection {
  background: var(--eg-gold-20);
  color: var(--eg-charcoal);
}
