/* ==========================================================================
   iTax Planner  — inner pages
   Built on the landing-page tokens in site.css: page heroes, editorial
   articles, service pages, hubs, legal pages and sidebars.
   ========================================================================== */

/* ---------- page hero ---------- */
.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--ink);
  color: #fff;
  padding-block: calc(var(--header-h) + clamp(2.5rem, 5vw, 4.5rem)) clamp(2.75rem, 5vw, 4.5rem);
}
.page-hero__media { position: absolute; inset: 0; z-index: -2; }
.page-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(100deg, rgba(5, 22, 38, .96) 0%, rgba(5, 22, 38, .88) 45%, rgba(5, 22, 38, .58) 100%),
    radial-gradient(120% 120% at 90% 0%, rgba(0, 114, 187, .38), transparent 60%);
}
.page-hero--plain { background: linear-gradient(115deg, var(--ink) 0%, var(--ink-800) 62%, #0a3a5f 100%); }
.page-hero--plain::after { display: none; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: clamp(1.5rem, 3vw, 2.25rem); font-size: 12px; color: rgba(255, 255, 255, .55); }
.crumbs li { display: inline-flex; align-items: center; gap: 10px; }
.crumbs li + li::before { content: "/"; color: rgba(255, 255, 255, .28); }
.crumbs a { transition: color .2s; }
.crumbs a:hover { color: #fff; }
.crumbs [aria-current="page"] { color: rgba(255, 255, 255, .82); }

.page-hero h1 {
  max-width: 22ch;
  font-family: var(--font-heading);
  font-size: clamp(2.35rem, 5.1vw, 4.15rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.page-hero h1 strong { font-weight: 500; color: #8fd0f3; }
.page-hero__lead { max-width: 43rem; margin-top: 22px; font-size: clamp(1rem, 1.15vw, 1.1875rem); line-height: 1.6; color: rgba(255, 255, 255, .74); }
.page-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 28px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .5); }
.page-hero__meta span { display: inline-flex; align-items: center; gap: 8px; }
.page-hero__meta span + span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--orange); }
.page-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* ---------- shared inner layout ---------- */
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: clamp(2rem, 4.5vw, 4.5rem); align-items: start; }
.page-aside { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 18px; }

.aside-card { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--ink); color: rgba(255, 255, 255, .68); padding: 30px 28px; box-shadow: var(--shadow); }
.aside-card::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(0, 114, 187, .5), transparent 70%); pointer-events: none; }
.aside-card h2 { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 500; line-height: 1.2; letter-spacing: -.025em; color: #fff; }
.aside-card p { margin: 12px 0 20px; font-size: 14px; line-height: 1.6; }
.aside-card .btn { width: 100%; }
.aside-card__list { display: grid; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: 13px; }
.aside-card__list a { display: flex; align-items: center; gap: 10px; color: rgba(255, 255, 255, .82); }
.aside-card__list a:hover { color: #fff; }
.aside-card__list svg { flex: 0 0 auto; color: var(--orange); }

.aside-nav { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 22px 24px; }
.aside-nav h2 { margin-bottom: 10px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.aside-nav a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink); transition: color .2s; }
.aside-nav a:first-of-type { border-top: 0; }
.aside-nav a span { color: var(--orange); transition: transform .2s; }
.aside-nav a:hover { color: var(--blue); }
.aside-nav a:hover span { transform: translateX(3px); }

/* ---------- prose ---------- */
.prose { max-width: 47rem; font-size: 1.0313rem; line-height: 1.78; color: var(--body); }
.prose > * + * { margin-top: 1.05em; }
.prose > h2 { margin-top: 2.4em; }
.prose > h3 { margin-top: 2em; }
.prose h2 {
  scroll-margin-top: calc(var(--header-h) + 24px);
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 2.5vw, 2.15rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.03em;
  color: var(--ink);
  text-wrap: balance;
}
.prose h3 {
  scroll-margin-top: calc(var(--header-h) + 24px);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.015em;
  color: var(--ink);
}
.prose h4 { font-size: 1rem; font-weight: 600; color: var(--ink); }
.prose p { text-wrap: pretty; }
.prose a { color: var(-- white); text-decoration: underline; text-decoration-color: rgba(0, 114, 187, .35); text-underline-offset: 3px; transition: text-decoration-color .2s, color .2s; }
.prose a:hover { color: var(--blue-700); text-decoration-color: currentColor; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { display: grid; gap: .6rem; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 1.35rem; }
.prose ul > li::before { content: ""; position: absolute; left: 0; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.prose ol { counter-reset: list; }
.prose ol > li { position: relative; padding-left: 1.8rem; counter-increment: list; }
.prose ol > li::before { content: counter(list) "."; position: absolute; left: 0; top: 0; font-family: var(--font-mono); font-size: .82em; font-weight: 500; color: var(--blue); }
.prose li > ul, .prose li > ol { margin-top: .6rem; }
.prose table { width: 100%; border-collapse: collapse; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .92rem; line-height: 1.5; overflow: hidden; }
.prose th, .prose td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--soft); color: var(--ink); font-weight: 600; font-size: .82rem; letter-spacing: .02em; }
.prose tr:last-child td { border-bottom: 0; }
.prose blockquote { border-left: 3px solid var(--orange); padding: 6px 0 6px 24px; font-family: var(--font-heading); font-size: 1.12rem; line-height: 1.5; color: var(--ink); }
.prose figure { margin-block: 2rem; }
.prose figure img { width: 100%; border-radius: var(--radius); }
.prose figcaption { margin-top: 10px; font-size: .8rem; color: var(--muted); }
.prose hr { margin-block: 2.5rem; border: 0; border-top: 1px solid var(--line-strong); }

.callout { border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 0 var(--radius) var(--radius) 0; background: var(--soft); padding: 20px 24px; font-size: .95rem; line-height: 1.65; }
.callout > * + * { margin-top: .55em; }
.callout strong { color: var(--ink); }
.callout--warn { border-left-color: var(--orange); background: #fff7f2; }

.keypoints { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, #fff, var(--soft)); padding: clamp(1.25rem, 2.5vw, 1.75rem) clamp(1.25rem, 2.5vw, 1.9rem); }
.keypoints > h2, .keypoints > h3 { margin: 0 0 14px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); }
.keypoints ul { gap: .55rem; font-size: .95rem; line-height: 1.55; }
.keypoints li::before { background: var(--blue); }

/* ---------- service page parts ---------- */
.svc-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); overflow: hidden; }
.svc-facts > div { background: #fff; padding: 16px 20px; }
.svc-facts dt { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.svc-facts dd { margin: 6px 0 0; font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.4; }

.steps-list { display: grid; border-top: 1px solid var(--line-strong); }
.steps-list > li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.steps-list > li::before { counter-increment: step; content: "0" counter(step); font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; color: var(--orange); padding-top: 5px; }
.steps-list h3 { margin: 0 0 6px; font-family: var(--font-heading); font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.steps-list p { margin: 0; font-size: .95rem; line-height: 1.6; color: var(--muted); }
.steps-list { counter-reset: step; }
.prose .steps-list { padding-left: 0; }
.prose .steps-list > li { padding-left: 0; counter-increment: none; }
.prose .steps-list > li::before {
  content: "0" counter(step);
  position: static;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .1em;
  color: var(--orange);
  padding-top: 5px;
}

.svc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.svc-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; transition: transform .35s var(--ease), box-shadow .35s, border-color .35s; }
.svc-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.svc-card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--soft); }
.svc-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.svc-card:hover .svc-card__media img { transform: scale(1.05); }
.svc-card__body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.svc-card__no { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; color: var(--orange); }
.svc-card h3 { margin: 8px 0 8px; font-family: var(--font-heading); font-size: 1.18rem; font-weight: 500; letter-spacing: -.02em; color: var(--ink); }
.svc-card p { font-size: .9rem; line-height: 1.6; color: var(--muted); }
.svc-card .link-arrow { margin-top: auto; padding-top: 18px; font-size: 13px; border: 0; padding-bottom: 0; }
.svc-card .link-arrow span { transition: transform .25s; }
.svc-card:hover .link-arrow span { transform: translateX(4px); }

.related { margin-top: clamp(2.5rem, 5vw, 4rem); padding-top: clamp(1.75rem, 3vw, 2.5rem); border-top: 1px solid var(--line-strong); }
.related > h2 { margin-bottom: 18px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.related__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.related__link { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; transition: border-color .25s, box-shadow .25s; }
.related__link:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); }
.related__link span { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--orange); }
.related__link strong { font-family: var(--font-heading); font-size: 15px; font-weight: 500; line-height: 1.35; color: var(--ink); }

/* ---------- articles ---------- */
.post-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: clamp(2rem, 4vw, 4rem); align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 24px); border-left: 1px solid var(--line-strong); padding-left: 20px; }
.toc h2 { margin-bottom: 14px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.toc ol { display: grid; gap: 10px; font-size: 13px; line-height: 1.4; }
.toc a { color: var(--body); transition: color .2s; }
.toc a:hover { color: var(--blue); }

.article-body { min-width: 0; }
.article-lead { font-family: var(--font-heading); font-size: clamp(1.12rem, 1.5vw, 1.3rem); line-height: 1.55; color: var(--ink); letter-spacing: -.015em; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 12.5px; color: var(--muted); }
.byline strong { color: var(--ink); font-weight: 600; }
.byline .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }

.post-figure { margin: 0 0 clamp(1.75rem, 3vw, 2.5rem); border-radius: var(--radius-lg); overflow: hidden; background: var(--soft); }
.post-figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-figure figcaption { padding: 12px 18px; font-size: 12px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-top: 0; }

.sources { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.sources h2 { margin: 0 0 10px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sources ul { gap: 6px; font-size: .82rem; line-height: 1.5; }
.sources ul > li { padding-left: 0; }
.sources ul > li::before { content: none; }
.sources a { color: var(--muted); }
.sources a:hover { color: var(--blue); }

.author-box { display: flex; gap: 16px; align-items: flex-start; margin-top: 2.5rem; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
.author-box img { width: 54px; height: 54px; flex: 0 0 auto; border-radius: 50%; object-fit: contain; background: #fff; border: 1px solid var(--line); padding: 6px; }
.author-box h2 { margin: 0 0 4px; font-family: var(--font-heading); font-size: 1rem; font-weight: 600; color: var(--ink); }
.author-box p { font-size: .85rem; line-height: 1.55; color: var(--muted); }
.author-box a { color: var(--blue); }

.article-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 2.5rem; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.article-foot a { color: var(--blue); font-weight: 600; }

/* ---------- insights hub ---------- */
.featured { display: grid; grid-template-columns: 1.05fr 1fr; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); }
.featured__media { min-height: 100%; }
.featured__media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; transition: transform .8s var(--ease); }
.featured:hover .featured__media img { transform: scale(1.03); }
.featured__body { display: flex; flex-direction: column; padding: clamp(1.6rem, 3.5vw, 3rem); }
.featured__body h3 { margin: 12px 0 12px; font-family: var(--font-heading); font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 500; line-height: 1.15; letter-spacing: -.03em; color: var(--ink); }
.featured__body p { font-size: .95rem; line-height: 1.65; color: var(--muted); }
.featured__body .link-arrow { margin-top: auto; align-self: flex-start; padding-top: 22px; border: 0; }

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.post-grid .post { display: flex; flex-direction: column; }
.post-grid .post > a { display: flex; flex-direction: column; height: 100%; }

.topic-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.topic-pills li { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 13px; }

/* ---------- legal ---------- */
.legal-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(2rem, 4vw, 4rem); align-items: start; }
.legal-meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.legal .prose { font-size: .97rem; line-height: 1.75; }
.legal .prose h2 { font-size: clamp(1.3rem, 2vw, 1.6rem); margin-top: 2.2em; }
.legal .prose h3 { font-size: 1.02rem; margin-top: 1.7em; }
.legal .prose ul, .legal .prose ol { font-size: .95rem; }
.legal-nav { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 4px; border-top: 1px solid var(--line-strong); padding-top: 16px; }
.legal-nav h2 { margin-bottom: 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.legal-nav a { display: block; padding: 6px 0; font-size: 13px; color: var(--body); }
.legal-nav a:hover { color: var(--blue); }

/* ---------- misc ---------- */
.band { background: var(--soft); border-block: 1px solid var(--line); }
.band__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.band__item { padding-left: 20px; border-left: 2px solid var(--orange); }
.band__item h3 { font-family: var(--font-heading); font-size: 1.02rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.band__item p { font-size: .9rem; line-height: 1.6; color: var(--muted); }
.inline-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 2rem; padding: 20px 24px; border-radius: var(--radius); background: var(--ink); color: rgba(255, 255, 255, .7); }
.inline-cta p { font-size: .95rem; }
.inline-cta strong { color: #fff; font-weight: 500; }

@media (max-width: 1199px) {
  .page-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
  .page-grid, .post-layout, .legal-grid { grid-template-columns: 1fr; }
  .page-aside { position: static; grid-template-columns: 1fr 1fr; align-items: start; }
  .toc { position: static; display: none; }
  .legal-nav { display: none; }
  .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured { grid-template-columns: 1fr; }
  .featured__media img { aspect-ratio: 16 / 9; }
  .band__grid { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 767px) {
  .page-hero__actions .btn { flex: 1 1 auto; }
  .svc-grid, .post-grid, .related__grid, .svc-facts, .page-aside { grid-template-columns: 1fr; }
  .steps-list > li { grid-template-columns: 38px minmax(0, 1fr); gap: 12px; }
  .prose { font-size: 1rem; }
  .prose table { display: block; overflow-x: auto; white-space: nowrap; }
  .author-box { flex-direction: column; }
  .inline-cta { flex-direction: column; align-items: flex-start; }
}
