/* ==========================================================================
   EGGCELLENT AGENCY — REFINEMENT LAYER (Phases 3–6, Oct 2026)
   Loaded after styles.css. Introduces design tokens and normalises spacing,
   containers and typography without changing brand colours or content.
   Rollback: remove the <link> to this file in index.html.
   ========================================================================== */

:root {
  /* Type scale (~1.25), fluid at the top end */
  --fs-xs: 0.8125rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: clamp(1.25rem, 1.05rem + 0.8vw, 1.5rem);
  --fs-2xl: clamp(1.625rem, 1.3rem + 1.4vw, 2.25rem);
  --fs-3xl: clamp(2rem, 1.45rem + 2.4vw, 3.125rem);
  --lh-tight: 1.12;
  --lh-snug: 1.25;
  --lh-body: 1.65;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700; --fw-black: 800;

  /* 4px-based spacing */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.5rem; --space-6: 2rem; --space-7: 3rem; --space-8: 4rem; --space-9: 6rem;
  --gutter: clamp(1rem, 0.6rem + 1.8vw, 2rem);
  --section-gap: clamp(1.25rem, 0.8rem + 1.6vw, 2.5rem);   /* half the gap between stacked sections */
  --card-pad: clamp(1.25rem, 0.75rem + 2.4vw, 3rem);
  --container: 1200px;
  --measure: 65ch;
  --radius-sm: 10px; --radius-md: 14px; --radius-lg: 22px;
  --tap: 44px;
  --shadow-card: 0 1px 2px rgba(59, 35, 20, 0.04), 0 8px 24px rgba(59, 35, 20, 0.05);
}

/* --------------------------------------------------------------------------
   1. CONTAINERS & GUTTERS (C2, H3)
   -------------------------------------------------------------------------- */
.container,
#cms-homepage-content .cms-public-section > .container {
  width: min(100% - 2 * var(--gutter), var(--container));
  max-width: var(--container);
  margin-inline: auto;
  padding-left: 0;
  padding-right: 0;
}
.nav-container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }

/* --------------------------------------------------------------------------
   2. SECTION RHYTHM (H1) — sections are transparent bands with one consistent
   vertical rhythm; the "card" look moves onto the contained inner wrapper so
   cards align with the header instead of touching the viewport edges.
   -------------------------------------------------------------------------- */
.cms-public-section { margin: 0 !important; }
.cms-public-section.section-padding,
.cms-public-section.section-padding-compact,
.cms-public-section:not(.hero-section) {
  padding-top: var(--section-gap) !important;
  padding-bottom: var(--section-gap) !important;
}
.page-view > .cms-page-container > .cms-public-section:last-child,
.page-view .cms-page-container > .cms-public-section:last-child { padding-bottom: calc(var(--section-gap) * 2) !important; }

.cms-public-section.cms-type-text_only,
.cms-public-section.cms-type-text_image_right,
.cms-public-section.cms-type-image_left_text {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.cms-public-section.cms-type-text_only > .container,
.cms-public-section.cms-type-text_image_right > .container,
.cms-public-section.cms-type-image_left_text > .container {
  background: var(--card-surface-color, var(--bg-biscuit));
  border: 1.5px solid var(--amber-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--card-pad) !important;
}
.cms-grid-2col,
.cms-grid-2col.grid-2 {
  gap: clamp(1.5rem, 1rem + 2.5vw, 3.5rem) !important;
  align-items: center !important;
}
@media (max-width: 899px) {
  .cms-grid-2col, .cms-grid-2col.grid-2 { grid-template-columns: 1fr !important; }
}
.cms-media-wrapper { border-radius: var(--radius-md); }
.cms-media-img { border-radius: var(--radius-md) !important; aspect-ratio: 4 / 3; height: auto !important; max-height: 420px !important; }

/* Static (non-CMS) page sections */
.page-view > section.section-padding,
.page-view section.section-padding:not(.cms-public-section) {
  padding-top: clamp(1.5rem, 1rem + 2.5vw, 3.5rem);
  padding-bottom: clamp(2rem, 1rem + 4vw, 5rem);
}
.section-header { margin-bottom: clamp(1.5rem, 1rem + 1.5vw, 2.5rem); }
.section-header.center { max-width: 760px; margin-inline: auto; }

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY (M1, M2, M3, H9)
   -------------------------------------------------------------------------- */
body { font-size: var(--fs-base); line-height: var(--lh-body); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }

.hero-headline,
.page-view h1 {
  font-size: var(--fs-3xl) !important;
  line-height: var(--lh-tight) !important;
  font-weight: var(--fw-black) !important;
  letter-spacing: -0.025em;
  margin: 0 0 var(--space-4) !important;
}
/* Promoted page titles on sub-pages are slightly smaller than the home hero */
.page-view:not(#page-home) h1 { font-size: clamp(1.875rem, 1.4rem + 2vw, 2.75rem) !important; }

.section-title,
.cms-public-section .cms-heading,
.cms-public-section .section-title,
.wide-casting-banner-title,
.cms-public-section h2 {
  font-size: var(--fs-2xl) !important;
  line-height: var(--lh-snug) !important;
  font-weight: var(--fw-black) !important;
  letter-spacing: -0.02em;
  margin: var(--space-2) 0 var(--space-4) !important;
}
h3, .cms-public-section h3 { font-size: var(--fs-xl); line-height: var(--lh-snug); font-weight: var(--fw-bold); }
h4, .talent-name { font-weight: var(--fw-bold); line-height: 1.3; }
h5, .footer-col h5 { font-weight: var(--fw-bold); }

.section-eyebrow,
.cms-eyebrow,
.cms-public-section .cms-eyebrow,
.cms-public-section .section-eyebrow,
.hero-eyebrow {
  font-size: var(--fs-xs) !important;
  font-weight: var(--fw-bold) !important;
  letter-spacing: 0.1em !important;
  line-height: 1.4;
  margin-bottom: var(--space-1);
}

.section-desc,
.cms-body,
.cms-public-section .cms-body,
.cms-public-section .section-desc,
.hero-subtitle {
  font-size: var(--fs-base) !important;
  line-height: var(--lh-body) !important;
  max-width: var(--measure);
}
.hero-subtitle { font-size: var(--fs-md) !important; max-width: 34rem; margin-bottom: var(--space-5) !important; }
.section-header.center .section-desc,
.cta-banner .section-desc,
.cms-type-text_only .section-desc { margin-inline: auto !important; }
.cms-body p + p { margin-top: var(--space-3); }

/* Weight hierarchy: 800 is reserved for h1/h2 and numbers */
.btn-pill-gold, .btn-outline-gold, .btn-whatsapp-primary, .admin-tab-btn { font-weight: var(--fw-bold) !important; }
.nav-links a { font-weight: var(--fw-semibold); }
.footer-links a { font-weight: var(--fw-medium); }
.filter-label, label { font-weight: var(--fw-semibold); }
.hero-trust-item { font-weight: var(--fw-semibold); }

/* Logo sub-label legibility (L1) */
.brand-sub { font-size: 0.75rem; letter-spacing: 0.18em; }

/* --------------------------------------------------------------------------
   4. HERO COMPOSITION (H2, H4)
   -------------------------------------------------------------------------- */
.hero-section {
  padding-top: clamp(1.5rem, 0.5rem + 3.5vw, 4rem) !important;
  padding-bottom: clamp(2.5rem, 1rem + 5vw, 5.5rem) !important;
  margin-bottom: 0 !important;
}
.hero-grid { gap: clamp(2rem, 1rem + 3vw, 4rem) !important; align-items: center; }
@media (min-width: 1025px) { .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) !important; } }
.hero-ctas { gap: var(--space-3) !important; margin-bottom: var(--space-5); }
.hero-trust-row { gap: var(--space-2) !important; margin-top: 0 !important; }
.hero-trust-item { font-size: var(--fs-sm) !important; padding: 0.4rem 0.85rem !important; min-height: 36px; }
.hero-img { width: 100%; height: auto; display: block; border-radius: var(--radius-lg); }

.hero-callout-card {
  margin-top: var(--space-5);
  padding: var(--space-4) var(--space-5);
  max-width: 36rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--amber-border);
  border-left: 4px solid var(--yolk-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}
.hero-callout-title {
  margin: 0 0 var(--space-1);
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  line-height: 1.4;
  color: var(--cocoa-heading);
}
#cms-hero-callout-body {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--toasted-brown);
}
.hero-callout-statements {
  display: flex !important;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--fs-sm);
  font-style: italic;
  color: var(--toasted-muted);
}

/* The CMS page background artwork has a fixed natural height; fade the hero's lower
   edge into the page colour so the artwork no longer ends in a hard line mid-content. */
#page-home .hero-section {
  background: linear-gradient(to bottom, transparent 0%, transparent 55%, var(--page-base-color, var(--bg-eggshell)) 96%) !important;
}

/* --------------------------------------------------------------------------
   5. BUTTONS, CONTRAST & TOUCH TARGETS (M6, M7)
   -------------------------------------------------------------------------- */
.btn-pill-gold, a.btn-pill-gold, button.btn-pill-gold,
.btn-outline-gold, a.btn-outline-gold, button.btn-outline-gold { min-height: var(--tap); }
/* Darker end of the existing amber gradient so white label text meets 4.5:1 */
.btn-pill-gold, a.btn-pill-gold, button.btn-pill-gold { background: linear-gradient(135deg, #b45309 0%, #92400e 100%); }
.topic-chip { min-height: var(--tap); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--amber-accent); flex-shrink: 0; }
.checkbox-label, label:has(> input[type="checkbox"]) { min-height: var(--tap); align-items: center; }
.mobile-toggle { min-width: var(--tap); min-height: var(--tap); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--amber-accent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   6. FLOATING WHATSAPP (H5, M7)
   -------------------------------------------------------------------------- */
.floating-wa-btn { background: #0E7A6E !important; box-shadow: 0 8px 22px rgba(14, 122, 110, 0.35), 0 2px 6px rgba(0, 0, 0, 0.15) !important; min-height: var(--tap); }
.floating-wa-btn:hover { background: #075E54 !important; }
@media (max-width: 768px) {
  .floating-wa-btn {
    width: 56px; height: 56px;
    padding: 0 !important;
    justify-content: center;
    border-radius: 50% !important;
    right: 14px !important; bottom: 14px !important;
  }
  .floating-wa-btn .wa-btn-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
  .floating-wa-btn .wa-btn-icon { width: 28px; height: 28px; }
  .site-footer { padding-bottom: 88px !important; }
}

/* --------------------------------------------------------------------------
   7. BLOG GRID & SHORT PAGES (C1, M5)
   -------------------------------------------------------------------------- */
#blog-articles-mounting-root { gap: clamp(1rem, 0.5rem + 1.5vw, 2rem) !important; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 380px)) !important; justify-content: center; }
.blog-card { background: var(--card-surface-color, #fff); box-shadow: var(--shadow-card); }
.page-view.active { min-height: calc(100vh - 76px); }

/* --------------------------------------------------------------------------
   8. FOOTER
   -------------------------------------------------------------------------- */
.site-footer { padding-top: clamp(2.5rem, 1.5rem + 3vw, 4rem); border-top: 1px solid var(--amber-border) !important; }
.footer-grid { gap: clamp(1.5rem, 1rem + 2vw, 2.5rem); }

/* --------------------------------------------------------------------------
   9. ADMIN DASHBOARD & CMS (admin audit)
   -------------------------------------------------------------------------- */
#page-sign-in .container { max-width: 1240px !important; }
#adminLoggedOutView .contact-card-box { max-width: 440px; }
.admin-tab-nav { flex-wrap: wrap; overflow-x: visible; gap: var(--space-2); }
@media (max-width: 768px) {
  .admin-tab-nav { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .admin-tab-btn { scroll-snap-align: start; }
}
.admin-tab-btn { min-height: var(--tap); }
.admin-stats-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-4); }
.admin-stat-label { font-weight: var(--fw-bold); }
.admin-table th { font-size: var(--fs-xs); letter-spacing: 0.06em; white-space: nowrap; }
.admin-table td { vertical-align: middle; }
.admin-table select, .admin-table .form-select { min-width: 150px; }
.admin-date-cell { white-space: nowrap; }
.admin-table td:last-child { white-space: nowrap; }
/* CMS reorder buttons carried text labels inside a fixed 32px square, so labels overlapped */
.btn-cms-reorder { width: auto !important; height: auto !important; min-height: 34px; padding: 0.35rem 0.7rem !important; white-space: nowrap; font-size: 0.8rem !important; font-weight: var(--fw-semibold) !important; gap: 0.3rem; }
.cms-btn-icon { min-height: 34px; white-space: nowrap; }
.cms-section-card { border-radius: var(--radius-md); }

/* --------------------------------------------------------------------------
   10. FORMS ON SMALL SCREENS & SMALL-TEXT CONTRAST
   -------------------------------------------------------------------------- */
@media (max-width: 599px) {
  #pageJoinRegForm [style*="grid-template-columns: 1fr 1fr 1fr"],
  #pageJoinRegForm [style*="grid-template-columns: 1fr 1fr;"],
  .form-row-2col { grid-template-columns: 1fr !important; }
}
.form-input, .form-select, .form-textarea { min-height: var(--tap); }
.cms-badge-type { color: #92400e; }
.nav-links a, .nav-link, .btn-sign-in { min-height: var(--tap); display: inline-flex; align-items: center; }
input[type="checkbox"], input[type="radio"] { width: 22px !important; height: 22px !important; }
.cms-badge, .talent-badge-cat { font-size: 0.75rem !important; }
