/* ─────────────────────────────────────────────
   immi.tv — Shared Chrome Styles
   Nav + Ticker + Trust Bar + Mobile Menu
   Single source of truth. All pages link this.
───────────────────────────────────────────── */

/* ── Design tokens (chrome-relevant subset) ── */
:root {
  --warm-white:   #FAFAF5;
  --cream:        #F5F0E8;
  --cream-dark:   #EDE5D4;
  --forest:       #166534;
  --forest-mid:   #15803D;
  --forest-light: #DCFCE7;
  --forest-faint: #F0FDF4;
  --amber:        #D97706;
  --brown:        #1C1917;
  --stone:        #78716C;
  --stone-light:  #A8A29E;
  --border:       #E7E2D9;
  --border-dark:  #D4CFC6;
  --white:        #FFFFFF;
  --ticker-bg:    #1C1917;
  --ticker-text:  #F5F0E8;
  --ticker-dot:   #EF4444;
  --ticker-sep:   #D97706;
  --nav-h:        60px;
  --ticker-h:     32px;
  --trust-bar-h:  40px;
  --offset:       calc(var(--nav-h) + var(--ticker-h) + var(--trust-bar-h)); /* 132px */
}

/* ── TV logo animations ── */
@keyframes tv-flicker {
  0%, 88%, 100%  { opacity: 0.8;  fill: var(--forest); }
  90%            { opacity: 0.25; fill: var(--amber); }
  92%            { opacity: 0.9;  fill: var(--forest); }
  95%            { opacity: 0.15; }
  97%            { opacity: 0.85; fill: var(--forest); }
}
@keyframes antenna-sway {
  0%, 100% { transform: rotate(0deg); transform-origin: bottom center; }
  30%      { transform: rotate(-4deg); transform-origin: bottom center; }
  70%      { transform: rotate(3deg); transform-origin: bottom center; }
}
@keyframes tv-glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 0px rgba(22,101,52,0)); }
  50%      { filter: drop-shadow(0 0 5px rgba(22,101,52,0.5)); }
}

.tv-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  animation: tv-glow-pulse 4s ease-in-out infinite;
}
.tv-icon { width: 36px; height: 32px; flex-shrink: 0; }
.tv-screen { fill: var(--forest); animation: tv-flicker 5s ease-in-out infinite; }
.tv-antenna-l { animation: antenna-sway 6s ease-in-out infinite; }
.tv-antenna-r { animation: antenna-sway 6s ease-in-out infinite reverse; }
.logo-text {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--brown);
  letter-spacing: -0.02em;
  line-height: 1;
}
.logo-text span { color: var(--forest); }

/* ─────────────────────────────────────────────
   FIXED NAV
───────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-links { display: flex; gap: 24px; list-style: none; }
.nav-links a {
  color: var(--stone);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--brown); }
.nav-links a.nav-active { color: var(--forest); font-weight: 600; }

/* ── Geo toggle ── */
.nav-geo {
  display: inline-flex;
  align-items: center;
  background: var(--warm-white);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px;
  gap: 2px;
}
.nav-geo-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 5px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--stone);
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-geo-btn.active { background: var(--forest); color: var(--white); }
.flag-svg {
  width: 22px; height: 15px;
  border-radius: 2px;
  border: 0.5px solid rgba(0,0,0,0.15);
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.nav-actions { display: flex; gap: 8px; align-items: center; }
.nav-btn-ghost {
  color: var(--stone);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.15s;
}
.nav-btn-ghost:hover { border-color: var(--forest); color: var(--forest); }
.nav-btn-primary {
  background: var(--forest);
  color: var(--white);
  padding: 9px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.nav-btn-primary:hover { background: var(--forest-mid); }

/* ── Free Tools dropdown ── */
.nav-item-dd { position: relative; list-style: none; }
.nav-dd {
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 6px;
  display: none;
  z-index: 300;
}
/* Right-aligned dropdown for items near the right edge of the nav */
.nav-dd-right { left: auto; right: 0; }
.nav-item-dd:hover .nav-dd { display: block; }
.nav-dd-inner {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(28,25,23,0.12);
  min-width: 244px;
  padding: 8px;
  overflow: hidden;
}
.nav-dd-inner-wide {
  min-width: 480px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 8px;
  padding: 12px;
}
/* Two-column layout: each col is a grid child that stacks items vertically */
.nav-dd-col {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.nav-dd-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--stone-light);
  padding: 2px 8px 8px;
}
/* Full-width separator and cross-country row span both columns */
.nav-dd-sep-full,
.nav-dd-row-full {
  grid-column: 1 / -1;
}
.nav-dd-sep-full {
  height: 1px;
  background: var(--border);
  margin: 8px 0 4px;
}
.nav-dd-row-full {
  display: flex;
  gap: 4px;
}
/* Legacy single-separator rule (kept for backward compat) */
.nav-dd-sep {
  grid-column: 1 / -1;
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.nav-dd-inner-wide .nav-dd-item { grid-column: auto; }
.nav-dd-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 14px;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s;
}
.nav-dd-item:hover { background: var(--forest-faint); }
.nav-dd-item:hover .nav-dd-item-name { color: var(--forest); }
.nav-dd-item-icon { font-size: 16px; line-height: 1.3; flex-shrink: 0; }
.nav-dd-item-text { display: flex; flex-direction: column; gap: 2px; }
.nav-dd-item-name { font-size: 13px; font-weight: 500; color: var(--brown); }
.nav-dd-item-sub { font-size: 11px; color: var(--stone-light); font-weight: 400; line-height: 1.4; }
/* Small badge to distinguish calculators/tools from guide links in dropdowns */
.nav-dd-tool-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--forest-faint);
  color: var(--forest);
  border: 1px solid var(--forest-mid);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1.6;
}

/* ─────────────────────────────────────────────
   LIVE TICKER
───────────────────────────────────────────── */
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes live-blink {
  0%, 49%  { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.live-ticker {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  z-index: 199;
  height: var(--ticker-h);
  background: var(--ticker-bg);
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 2px solid var(--amber);
}
.ticker-label {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border-right: 1px solid rgba(255,255,255,0.12);
  background: var(--ticker-bg);
  z-index: 2;
  position: relative;
}
.ticker-live-dot {
  width: 8px; height: 8px;
  background: var(--ticker-dot);
  border-radius: 50%;
  animation: live-blink 1s step-start infinite;
  box-shadow: 0 0 6px rgba(239,68,68,0.6);
}
.ticker-live-text {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ticker-dot);
  text-transform: uppercase;
}
.ticker-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: ticker-scroll 45s linear infinite;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-item {
  display: inline-flex;
  align-items: center;
  padding: 0 24px;
}
.ticker-item-country {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-right: 8px;
}
.ticker-item-text {
  font-size: 12px;
  color: var(--ticker-text);
  font-weight: 400;
}
.ticker-sep {
  color: var(--ticker-sep);
  font-size: 14px;
  padding: 0 8px;
  opacity: 0.5;
}

/* ─────────────────────────────────────────────
   TRUST BAR
───────────────────────────────────────────── */
.trust-bar-sticky {
  position: fixed;
  top: calc(var(--nav-h) + var(--ticker-h));
  left: 0; right: 0;
  z-index: 198;
  height: var(--trust-bar-h);
  background: var(--forest);
  padding: 0 48px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
}
.trust-bar-sticky .trust-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: nowrap;
}
.trust-bar-sticky .trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-right: 1px solid rgba(255,255,255,0.12);
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
}
.trust-bar-sticky .trust-item:first-child { padding-left: 0; }
.trust-bar-sticky .trust-item:last-child { border-right: none; padding-right: 0; }
.trust-bar-sticky .trust-item strong { color: var(--white); }
.trust-bar-sticky .trust-icon { font-size: 13px; }

/* ─────────────────────────────────────────────
   MOBILE NAV — hamburger + drawer
───────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--brown);
  font-size: 22px;
  line-height: 1;
}
.nav-mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(12px);
  z-index: 300;
  padding: 16px 20px 24px;
  border-bottom: 2px solid var(--border);
  box-shadow: 0 8px 32px rgba(28,25,23,0.12);
  overflow-y: auto;
  max-height: calc(100vh - var(--nav-h));
}
.nav-mobile-menu.open { display: block; }
.nav-mobile-links { list-style: none; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 12px; }
.nav-mobile-links li a {
  display: block;
  padding: 12px 4px;
  font-size: 16px;
  font-weight: 500;
  color: var(--brown);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.nav-mobile-links li:last-child a { border-bottom: none; }
.nav-mobile-geo {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.nav-mobile-geo .nav-geo-btn { flex: 1; padding: 10px 8px; font-size: 13px; text-align: center; }
.nav-mobile-actions { display: flex; flex-direction: column; gap: 10px; }
.nav-mobile-actions .nav-btn-ghost,
.nav-mobile-actions .nav-btn-primary {
  display: block;
  text-align: center;
  padding: 13px;
  font-size: 15px;
}

/* ─────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────── */
footer {
  background: var(--forest);
  padding: 56px 48px 40px;
}
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-top {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-logo-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-logo-text {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 700;
  color: white;
}
.footer-logo-text span { color: white; }
.footer-brand p { font-size: 13px; color: white; line-height: 1.6; margin-bottom: 16px; }
.footer-cred { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 4px;
  color: white;
}
.footer-compliance { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.footer-compliance-line { font-size: 11px; color: white; line-height: 1.5; }
.footer-compliance-line strong { color: white; font-weight: 600; }
.footer-compliance-line a { color: white; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.4); }
.footer-compliance-line a:hover { color: white; }
.footer-rcic-badge { margin-top: 12px; display: inline-block; background: var(--white); border-radius: 6px; padding: 10px 16px; }
.footer-rcic-badge img { display: block; height: 56px; width: auto; }
.footer-col h5 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: white;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 13px; color: white; text-decoration: none; transition: color 0.1s; }
.footer-col a:hover { color: rgba(255,255,255,0.75); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; }
.footer-copy { font-size: 12px; color: white; }
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { font-size: 12px; color: white; text-decoration: none; }

/* ─────────────────────────────────────────────
   EMBED MODE — hide all chrome
───────────────────────────────────────────── */
.embed-mode #site-chrome,
.embed-mode #site-footer,
.embed-mode nav,
.embed-mode .live-ticker,
.embed-mode .trust-bar-sticky,
.embed-mode .nav-mobile-menu { display: none !important; }
.embed-mode body { padding-top: 0 !important; }

/* ─────────────────────────────────────────────
   RESPONSIVE — MEDIUM DESKTOP (1024–1279px)
   Compact nav: tighten gaps, drop ghost button
───────────────────────────────────────────── */
@media (min-width: 1024px) and (max-width: 1279px) {
  nav { padding: 0 16px; overflow: visible; }
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 13px; }
  .nav-btn-ghost { display: none; }
  .nav-geo-btn { padding: 4px 7px; font-size: 10px; }
  .nav-btn-primary { padding: 8px 14px; font-size: 13px; }
  /* Prevent wide dropdowns from overflowing viewport at compact-desktop width */
  .nav-dd-inner-wide {
    min-width: 260px;
    grid-template-columns: 1fr;
  }
  .nav-dd-inner-wide .nav-dd-sep-full,
  .nav-dd-inner-wide .nav-dd-row-full {
    grid-column: 1;
  }
}

/* ─────────────────────────────────────────────
   RESPONSIVE — TABLET (769–1023px)
   Hamburger replaces full nav
───────────────────────────────────────────── */
@media (min-width: 769px) and (max-width: 1023px) {
  nav { padding: 0 20px; }
  .nav-links, .nav-geo, .nav-actions { display: none; }
  .nav-hamburger { display: flex; align-items: center; }
  .footer-top { grid-template-columns: 1.3fr 1fr 1fr 1fr; }
}

/* ─────────────────────────────────────────────
   RESPONSIVE — MOBILE (≤768px)
───────────────────────────────────────────── */
@media (max-width: 768px) {
  nav { padding: 0 20px; }
  .nav-links, .nav-geo, .nav-actions { display: none; }
  .nav-hamburger { display: flex; align-items: center; }

  .trust-bar-sticky {
    padding: 0 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .trust-bar-sticky .trust-bar-inner {
    justify-content: flex-start;
    gap: 0;
    min-width: max-content;
  }
  .trust-bar-sticky .trust-item { padding: 0 12px; font-size: 11px; }

  footer { padding: 40px 20px 28px; }
  .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
  .footer-bottom-links { flex-wrap: wrap; justify-content: center; }
}
