/*
 * Akhut Insights — feature-post design system.
 * An artifact-grade long-form layout for flagship analysis pieces, loaded only
 * on posts using template-feature.php. Everything is namespaced under
 * .ak-feature so it never touches the rest of the site and the theme's base
 * element styles never bleed in. Brand tokens mirror style.css (Fraunces / DM
 * Sans / ivory / gold), with IBM Plex Mono added as the utility/label face.
 *
 * Components: masthead (stamp + display headline + deck), stat-strip (.parcels),
 * railed sections (.rail labels), drop-cap lede, schematic figure (.plan),
 * pull-quote (.quote), numbered sequence (.sequence), compare grid (.compare),
 * coda. Authors compose these in post_content; see the design-system reference
 * in the blog workflows.
 */

.ak-feature {
  --paper:      #fefcfb;
  --card:       #ffffff;
  --tint:       #f7f3ea;
  --ink:        #23201a;
  --ink-2:      #4d4838;
  --muted:      #6b6455;
  --faint:      #a39a87;
  --rule:       #e7e0d1;
  --rule-soft:  #efe9dc;
  --gold:       #96721d;
  --gold-deep:  #7a5c15;
  --gold-tint:  rgba(150, 114, 29, 0.12);
  --road:       #b7ae9b;
  --road-line:  #fefcfb;

  --measure: 66ch;
  --rail: 140px;
  --gutter: 40px;

  --f-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --f-body:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --f-mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  max-width: calc(var(--rail) + var(--gutter) + var(--measure));
  margin: 0 auto;
  padding: 0 28px 40px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.ak-feature * { box-sizing: border-box; }

/* ---------- masthead ---------- */
.ak-feature .masthead { display: grid; gap: 22px; padding: 40px 0 0; }
.ak-feature .stamp {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 14px;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.ak-feature .stamp b { font-weight: 500; color: var(--gold); }
.ak-feature .stamp .div { width: 1px; height: 11px; background: var(--rule); display: inline-block; transform: translateY(1px); }

.ak-feature h1 {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(2.7rem, 7.2vw, 4.5rem); line-height: 0.98;
  letter-spacing: -0.02em; text-wrap: balance; margin: 0; color: var(--ink);
}
.ak-feature h1 .nb { white-space: nowrap; }
.ak-feature h1 .num { color: var(--gold); font-variant-numeric: tabular-nums; font-style: italic; }

.ak-feature .deck {
  font-family: var(--f-display); font-weight: 400; font-style: italic;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem); line-height: 1.42; color: var(--ink-2);
  max-width: 40ch; text-wrap: balance; margin: 0;
}
.ak-feature .masthead-rule { height: 3px; background: var(--ink); margin-top: 6px; }

/* ---------- stat strip ---------- */
.ak-feature .parcels { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--rule); margin: 0 0 20px; }
.ak-feature .parcel { padding: 20px 18px 22px 0; display: grid; gap: 3px; align-content: start; }
.ak-feature .parcel + .parcel { border-left: 1px solid var(--rule-soft); padding-left: 18px; }
.ak-feature .parcel .fig {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(1.6rem, 4.4vw, 2.15rem); letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--ink);
}
.ak-feature .parcel .unit { font-size: 0.6em; font-weight: 500; color: var(--muted); letter-spacing: 0; font-style: italic; }
.ak-feature .parcel .lbl { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.11em; text-transform: uppercase; color: var(--muted); line-height: 1.6; }
.ak-feature .parcel.is-subject .fig { color: var(--gold); }
.ak-feature .parcel.is-subject .unit { color: var(--gold); opacity: 0.8; }

/* ---------- railed sections ---------- */
.ak-feature .lede { font-size: 1.19rem; line-height: 1.62; color: var(--ink); }
.ak-feature .lede::first-letter {
  font-family: var(--f-display); font-weight: 700; font-size: 3.2em; float: left;
  line-height: 0.8; margin: 0.05em 0.1em 0 0; color: var(--gold);
}

.ak-feature section {
  display: grid; grid-template-columns: var(--rail) minmax(0, var(--measure));
  column-gap: var(--gutter); padding-top: 52px;
}
.ak-feature section > .rail { grid-column: 1; }
.ak-feature section > *:not(.rail) { grid-column: 2; }

.ak-feature .rail {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); padding-top: 0.72em; position: relative;
}
.ak-feature .rail::before { content: ""; position: absolute; left: 0; top: 0; width: 26px; height: 2px; background: var(--gold); }
.ak-feature .rail span { display: block; padding-top: 12px; }

.ak-feature h2 {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(1.5rem, 3.1vw, 1.95rem); line-height: 1.16;
  letter-spacing: -0.012em; text-wrap: balance; margin: 0 0 8px; color: var(--ink);
}
.ak-feature p { margin: 0 0 1.15em; }
.ak-feature section p:last-child { margin-bottom: 0; }
.ak-feature section > ul { margin: 0 0 1.15em; padding-left: 1.1em; }
.ak-feature section > ul li { margin: 0 0 0.6em; line-height: 1.55; }
.ak-feature section > ul li::marker { color: var(--gold); }
.ak-feature em { font-style: italic; }
.ak-feature a { color: var(--gold-deep); text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---------- figures ---------- */
.ak-feature figure { margin: 34px 0 4px; }
.ak-feature figcaption {
  font-family: var(--f-mono); font-size: 11px; line-height: 1.6; letter-spacing: 0.02em;
  color: var(--muted); padding-top: 12px; border-top: 1px solid var(--rule-soft); margin-top: 14px;
}
.ak-feature .plan { background: var(--tint); border: 1px solid var(--rule); padding: 14px; overflow-x: auto; }
.ak-feature .plan svg { display: block; width: 100%; height: auto; min-width: 480px; }
.ak-feature .svg-label { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.ak-feature .svg-figure { font-family: var(--f-display); font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.ak-feature .svg-note { font-family: var(--f-display); font-style: italic; font-size: 13px; }
.ak-feature .svg-road { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.14em; }

/* ---------- data table ---------- */
.ak-feature .tw { overflow-x: auto; margin: 28px 0 4px; }
.ak-feature .data-table { width: 100%; border-collapse: collapse; font-family: var(--f-body); font-size: 0.95rem; min-width: 440px; }
.ak-feature .data-table th { text-align: left; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 0 14px 10px 0; border-bottom: 2px solid var(--ink); }
.ak-feature .data-table td { padding: 12px 14px 12px 0; border-bottom: 1px solid var(--rule-soft); vertical-align: top; line-height: 1.5; color: var(--ink-2); }
.ak-feature .data-table td:first-child { font-family: var(--f-mono); font-size: 0.8rem; color: var(--gold-deep); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ak-feature .data-table td:nth-child(2) { white-space: nowrap; color: var(--ink); font-variant-numeric: tabular-nums; }
.ak-feature .data-table tr:last-child td { border-bottom: 0; }

/* ---------- media figures (official renders, maps) ---------- */
.ak-feature figure img { width: 100%; height: auto; display: block; border: 1px solid var(--rule); }
.ak-feature figure iframe { width: 100%; display: block; border: 1px solid var(--rule); }

/* ---------- pull quote ---------- */
.ak-feature .quote {
  margin: 38px 0 8px; padding: 26px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule);
  display: grid; grid-template-columns: 42px 1fr; gap: 4px;
}
.ak-feature .quote .mark { font-family: var(--f-display); font-weight: 700; font-size: 46px; line-height: 0.7; color: var(--gold); }
.ak-feature .quote p {
  font-family: var(--f-display); font-weight: 400; font-style: italic;
  font-size: clamp(1.3rem, 2.9vw, 1.6rem); line-height: 1.34; letter-spacing: -0.008em; margin: 0; text-wrap: balance;
}

/* ---------- numbered sequence ---------- */
.ak-feature .sequence { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin: 32px 0 4px; }
.ak-feature .step { background: var(--card); padding: 16px 18px; display: grid; grid-template-columns: 34px 1fr; align-items: baseline; gap: 8px; }
.ak-feature .step .n { font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; color: var(--gold); font-variant-numeric: tabular-nums; }
.ak-feature .step .t { font-family: var(--f-body); font-size: 0.98rem; font-weight: 600; line-height: 1.45; color: var(--ink); }
.ak-feature .step .t small { display: block; font-family: var(--f-body); font-weight: 400; font-size: 0.9rem; line-height: 1.55; color: var(--muted); padding-top: 3px; }

/* ---------- compare grid (good / bad, this / that) ---------- */
.ak-feature .compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.ak-feature .col { background: var(--card); padding: 18px 18px 20px; display: grid; gap: 10px; align-content: start; }
.ak-feature .col h3 { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase; font-weight: 500; margin: 0; color: var(--muted); }
.ak-feature .col ul { list-style: none; display: grid; gap: 6px; margin: 0; padding: 0; font-family: var(--f-body); font-size: 1.04rem; line-height: 1.3; font-weight: 500; }
.ak-feature .col.good { background: var(--gold-tint); }
.ak-feature .col.good h3 { color: var(--gold-deep); }
.ak-feature .col.good ul li::before { content: ""; display: inline-block; width: 7px; height: 7px; background: var(--gold); margin-right: 9px; transform: translateY(-1px); }
.ak-feature .col.bad ul li::before { content: ""; display: inline-block; width: 7px; height: 7px; border: 1.5px solid var(--road); margin-right: 9px; transform: translateY(-1px); }
.ak-feature .col.bad ul { color: var(--muted); }

/* ---------- coda + colophon ---------- */
.ak-feature .coda { padding-top: 48px; }
.ak-feature .coda .rail::before { display: none; }
.ak-feature .coda p {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(1.4rem, 3.2vw, 1.85rem); line-height: 1.24; letter-spacing: -0.015em; text-wrap: balance; margin: 0; color: var(--ink);
}
.ak-feature .coda .end { display: inline-block; width: 12px; height: 12px; background: var(--gold); margin-left: 10px; }

.ak-feature .colophon {
  margin-top: 56px; padding-top: 16px; border-top: 1px solid var(--rule);
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between;
}

/* ---------- disclaimer (brand/compliance, appended by the template) ---------- */
.ak-feature .ak-feature-disclaimer {
  margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--rule);
  font-family: var(--f-body); font-size: 13px; line-height: 1.62; color: var(--faint);
}

@media (max-width: 880px) {
  .ak-feature { font-size: 17px; }
  .ak-feature section { grid-template-columns: minmax(0, 1fr); row-gap: 14px; padding-top: 44px; }
  .ak-feature section > .rail, .ak-feature section > *:not(.rail) { grid-column: 1; }
  .ak-feature .rail { padding-top: 0; }
  .ak-feature .rail::before { position: static; display: block; margin-bottom: 10px; }
  .ak-feature .rail span { padding-top: 0; }
  .ak-feature .compare { grid-template-columns: 1fr; }
  .ak-feature .parcels { grid-template-columns: 1fr; }
  .ak-feature .parcel + .parcel { border-left: 0; border-top: 1px solid var(--rule-soft); padding-left: 0; }
  .ak-feature .parcel { padding-right: 0; }
}
