/* ==========================================================================
   US TaxDesk — shared stylesheet
   Clean, professional, neutral + trustworthy blue palette
   ========================================================================== */

:root {
  --navy: #0f2f4c;
  --blue: #1a6fb5;
  --blue-dark: #145a94;
  --accent: #2e9e6e;
  --ink: #1c2530;
  --muted: #5b6774;
  --line: #e5e9ef;
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --bg-soft-2: #eef3f8;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 47, 76, .06), 0 8px 24px rgba(15, 47, 76, .06);
  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--navy);
  letter-spacing: .04em;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}
.nav-links { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.nav-links a {
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 500;
  font-size: .96rem;
}
.nav-links a:hover { background: var(--bg-soft-2); text-decoration: none; }
.nav-links a.active { color: var(--blue); }
.nav-cta {
  background: var(--blue);
  color: #fff !important;
}
.nav-cta:hover { background: var(--blue-dark); }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; }

/* Header controls: language + theme toggles (always visible) */
.nav-controls { display: flex; align-items: center; gap: 8px; margin-left: 10px; }
.icon-btn {
  height: 38px; min-width: 38px; padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 600; font-size: .9rem; line-height: 1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.icon-btn:hover { border-color: var(--blue); color: var(--blue); }
.theme-btn { font-size: 1.05rem; }

/* Subscribe sits in the right-hand controls, next to the language toggle */
.nav-controls .nav-cta {
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .9rem;
  display: inline-flex;
  align-items: center;
  color: #fff !important;
}

/* Language flag dropdown */
.lang-menu { position: relative; flex: 0 0 auto; }
.lang-trigger {
  height: 38px; padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font); font-size: .95rem;
  transition: border-color .2s ease;
}
.lang-trigger:hover { border-color: var(--blue); }
.lang-flag { font-size: 1.15rem; line-height: 1; }
.lang-trigger .caret { color: var(--muted); transition: transform .2s ease; }
.lang-trigger[aria-expanded="true"] .caret { transform: rotate(180deg); }
.lang-list {
  position: absolute; right: 0; top: calc(100% + 8px);
  margin: 0; padding: 6px;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  min-width: 172px;
  z-index: 60;
}
.lang-list li { margin: 0; }
.lang-list button {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border: 0; border-radius: 7px;
  background: none; color: var(--ink);
  font-family: var(--font); font-size: .93rem;
  cursor: pointer; text-align: left;
}
.lang-list button:hover { background: var(--bg-soft-2); }

/* Dark-mode toggle SWITCH (role="switch") */
.theme-toggle {
  position: relative;
  width: 54px; height: 30px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft-2);
  cursor: pointer;
  padding: 0;
  transition: background .85s ease, border-color .85s ease;
}
.theme-toggle .thumb {
  position: absolute;
  top: 50%; left: 3px;
  transform: translateY(-50%);
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15,47,76,.3);
  display: grid; place-items: center;
  font-size: 13px; line-height: 1; color: #b8860b;
  transition: left .85s cubic-bezier(.4, 0, .2, 1);
}
.theme-toggle[aria-checked="true"] { background: var(--blue); border-color: var(--blue); }
.theme-toggle[aria-checked="true"] .thumb { left: 27px; color: var(--navy); }
.theme-toggle:hover { border-color: var(--blue); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--bg-soft) 0%, #fff 100%);
  border-bottom: 1px solid var(--line);
  padding: 80px 0 72px;
}
.hero .eyebrow {
  color: var(--blue);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: .8rem;
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -.02em;
  margin: 0 0 18px;
  color: var(--navy);
  max-width: 16ch;
}
.hero p.lead {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 30px;
}
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .05s ease, background .2s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); margin-left: 10px; }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section.alt { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.section-head.left { text-align: left; margin-left: 0; }
.section-head h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  color: var(--navy);
  letter-spacing: -.02em;
  margin: 0 0 12px;
}
.section-head p { color: var(--muted); font-size: 1.1rem; margin: 0; }

/* ---------- Feature cards ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.card .ic {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--bg-soft-2); color: var(--blue);
  display: grid; place-items: center; margin-bottom: 16px;
}
.card h3 { margin: 0 0 8px; color: var(--navy); font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); }

/* ---------- Video grid ---------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.video-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.video-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(15,47,76,.12); }
.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-soft-2);
  overflow: hidden;
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-thumb .play {
  position: absolute; inset: 0; margin: auto;
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(15,47,76,.82);
  display: grid; place-items: center;
  transition: background .2s ease;
}
.video-card:hover .play { background: var(--blue); }
.video-thumb .play svg { fill: #fff; margin-left: 3px; }
.video-body { padding: 18px 20px 22px; }
.video-body h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--navy); line-height: 1.35; }
.video-body .meta { color: var(--muted); font-size: .85rem; }

.notice {
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  color: var(--muted);
  font-size: .95rem;
}

/* Cookie consent banner */
.consent-bar {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 200;
  background: var(--navy);
  color: #eaf1f8;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(15,47,76,.28);
}
.consent-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.consent-text { margin: 0; font-size: .92rem; max-width: 62ch; color: #dce6f2; }
.consent-actions { display: flex; gap: 10px; flex-shrink: 0; }
.consent-btn {
  padding: 9px 20px;
  border-radius: 9px;
  font-weight: 600;
  font-size: .92rem;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: var(--font);
}
.consent-btn.accept { background: var(--blue); color: #fff; }
.consent-btn.accept:hover { background: var(--blue-dark); }
.consent-btn.decline { background: transparent; color: #dce6f2; border-color: rgba(255,255,255,.35); }
.consent-btn.decline:hover { border-color: #fff; color: #fff; }
@media (max-width: 560px) {
  .consent-inner { flex-direction: column; align-items: stretch; gap: 12px; }
  .consent-actions { justify-content: flex-end; }
}

/* "Coming soon" placeholder shown until the YouTube channel is connected */
.videos-soon {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 24px;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--navy);
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.notice code { background: #fff; border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; font-size: .85em; }

/* ---------- Blog ---------- */
.post-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.post-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
  display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(15,47,76,.12); }
.tag {
  display: inline-block;
  font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--blue); background: var(--bg-soft-2);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 14px;
}
.post-card h3 { margin: 0 0 10px; font-size: 1.3rem; color: var(--navy); line-height: 1.3; }
.post-card p { margin: 0 0 18px; color: var(--muted); }
.post-card .read { margin-top: auto; font-weight: 600; color: var(--blue); }
.post-meta { color: var(--muted); font-size: .85rem; margin-bottom: 4px; }

/* ---------- Article ---------- */
.article { padding: 56px 0 80px; }
.article-wrap { max-width: 720px; margin: 0 auto; }
.article .kicker { color: var(--blue); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: .8rem; }
.article h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); color: var(--navy); line-height: 1.15; letter-spacing: -.02em; margin: 12px 0 14px; }
.article .byline { color: var(--muted); font-size: .95rem; margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.article-body { font-size: 1.12rem; }
.article-body h2 { color: var(--navy); font-size: 1.5rem; margin: 40px 0 14px; letter-spacing: -.01em; }
.article-body h3 { color: var(--navy); font-size: 1.2rem; margin: 28px 0 10px; }
.article-body p { margin: 0 0 20px; }
.article-body ul, .article-body ol { margin: 0 0 20px; padding-left: 24px; }
.article-body li { margin-bottom: 8px; }
.article-body table {
  width: 100%; border-collapse: collapse; margin: 8px 0 28px; font-size: .98rem;
}
.article-body th, .article-body td { border: 1px solid var(--line); padding: 11px 14px; text-align: left; }
.article-body th { background: var(--bg-soft); color: var(--navy); font-weight: 600; }
.article-body tr:nth-child(even) td { background: var(--bg-soft); }
.callout {
  background: var(--bg-soft);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 0 0 26px;
  color: var(--ink);
}
.callout strong { color: var(--navy); }
.disclaimer {
  margin-top: 40px; padding: 18px 20px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  font-size: .9rem; color: var(--muted);
}
.back-link { display: inline-block; margin-bottom: 24px; color: var(--muted); font-weight: 500; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--navy), var(--blue-dark));
  color: #fff;
  border-radius: 16px;
  padding: 48px;
  text-align: center;
}
.cta-band h2 { margin: 0 0 10px; font-size: 1.8rem; }
.cta-band p { margin: 0 auto 24px; max-width: 46ch; color: rgba(255,255,255,.85); }
.cta-band .btn-primary { background: #fff; color: var(--navy); }
.cta-band .btn-primary:hover { background: #eaf1f8; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: #cdd8e4;
  padding: 52px 0 32px;
  margin-top: 0;
}
.footer-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; margin-bottom: 32px; }
.footer-brand { max-width: 320px; }
.footer-brand .brand { color: #fff; margin-bottom: 12px; }
.footer-brand p { color: #9fb2c6; margin: 0; font-size: .95rem; }
.footer-col h4 { color: #fff; font-size: .95rem; margin: 0 0 12px; }
.footer-col a { color: #cdd8e4; display: block; padding: 4px 0; font-size: .93rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 20px;
  font-size: .85rem;
  color: #8ea2b8;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* ---------- Article reader aside (share + reading progress) ---------- */
.reader-aside {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.reader-aside .reader-label {
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.reader-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform .1s ease, background .2s ease, border-color .2s ease;
}
.reader-btn:hover { transform: translateY(-2px); text-decoration: none; }
.reader-btn svg { width: 18px; height: 18px; fill: var(--navy); transition: fill .2s ease; }
.reader-btn.x:hover  { background: #000;      border-color: #000; }
.reader-btn.fb:hover { background: #1877f2;   border-color: #1877f2; }
.reader-btn.li:hover { background: #0a66c2;   border-color: #0a66c2; }
.reader-btn:hover svg { fill: #fff; }

.reader-ring {
  position: relative;
  width: 56px; height: 56px;
  margin-top: 6px;
}
.reader-ring svg { width: 56px; height: 56px; transform: rotate(-90deg); }
.reader-ring .ring-track { fill: none; stroke: var(--line); stroke-width: 4; }
.reader-ring .ring-fill  { fill: none; stroke: var(--blue); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .1s linear; }
.reader-ring .ring-num {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: .78rem; font-weight: 700; color: var(--navy);
}

/* Hide the rail when there isn't room beside the 720px article column */
@media (max-width: 1180px) {
  .reader-aside { display: none; }
}

/* ---------- Logo / branding ---------- */
/* Footer seal sits on navy — give it a subtle white coin so it reads */
.footer-brand .mark {
  background: #fff;
  padding: 2px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.15);
}

/* Homepage hero as two columns with the seal alongside */
.hero-flex {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero-logo {
  justify-self: center;
  width: 100%;
  max-width: 340px;
  filter: drop-shadow(0 12px 30px rgba(15,47,76,.18));
}
.hero-flex .hero-copy h1 { max-width: none; }

@media (max-width: 820px) {
  .hero-flex { grid-template-columns: 1fr; gap: 8px; text-align: center; }
  .hero-flex .hero-copy p.lead { margin-left: auto; margin-right: auto; }
  .hero-logo { max-width: 220px; margin-top: 20px; order: -1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid-3, .video-grid { grid-template-columns: repeat(2, 1fr); }
  .post-grid { grid-template-columns: 1fr; }
  .nav-links {
    display: none;
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 10px 16px 16px; gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
}
@media (max-width: 560px) {
  .grid-3, .video-grid { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 48px; }
  .cta-band { padding: 32px 22px; }
  .btn-ghost { margin-left: 0; margin-top: 10px; }
}

/* ==========================================================================
   Dark mode — activated by data-theme="dark" on <html>
   Remaps the color tokens and fixes the few surfaces hard-coded to white.
   ========================================================================== */
html[data-theme="dark"] {
  --navy: #eaf1f8;      /* headings + brand text become light */
  --blue: #4d9fe0;
  --blue-dark: #3d8ccb;
  --ink: #e6edf5;
  --muted: #9fb0c2;
  --line: #2a3644;
  --bg: #0f1720;
  --bg-soft: #151e29;
  --bg-soft-2: #1d2836;
  --shadow: 0 1px 3px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.45);
}
html[data-theme="dark"] .site-header { background: rgba(15,23,32,.85); }
html[data-theme="dark"] .nav-toggle svg { stroke: #eaf1f8; }
html[data-theme="dark"] .hero {
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
}
html[data-theme="dark"] .card,
html[data-theme="dark"] .video-card,
html[data-theme="dark"] .post-card,
html[data-theme="dark"] .reader-btn,
html[data-theme="dark"] .notice code { background: var(--bg-soft); }
html[data-theme="dark"] .btn-ghost { background: var(--bg-soft); color: var(--navy); }
html[data-theme="dark"] .video-body h3,
html[data-theme="dark"] .post-card h3,
html[data-theme="dark"] .card h3 { color: var(--navy); }
html[data-theme="dark"] .site-footer { background: #0a0f16; }
html[data-theme="dark"] .footer-brand p { color: #9fb0c2; }
html[data-theme="dark"] .cta-band { background: linear-gradient(135deg, #13233a, #1b4869); }
html[data-theme="dark"] .cta-band .btn-primary { background: #eaf1f8; color: #0f2f4c; }
html[data-theme="dark"] .cta-band .btn-primary:hover { background: #ffffff; }
html[data-theme="dark"] .consent-bar { background: #0b1119; }
html[data-theme="dark"] .videos-soon { background: var(--bg-soft); }
html[data-theme="dark"] .reader-btn svg { fill: #eaf1f8; }
