/* Contentmacro — editorial type, generous whitespace, image-led. */
/* Design review: Felix "Aux" Ng. Brief: thick rules, asymmetric grid, small caps + oldstyle
   figures everywhere Iowan supports them, square the corners, kill the cute purple drop cap. */

:root[data-site="contentmacro"] {
    --cm-bg: #fbfaf6;
    --cm-fg: #1a1a1a;
    --cm-muted: #6b7280;
    --cm-accent: #7c3aed;
    --cm-accent-soft: #ede9fe;
    --cm-border: #e5e7eb;
    --cm-rule: #1a1a1a;
    --cm-serif: "Iowan Old Style", "Charter", Georgia, "Times New Roman", serif;
    --cm-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}

html[data-site="contentmacro"], body { background: var(--cm-bg); color: var(--cm-fg); }
body {
    font-family: var(--cm-sans);
    line-height: 1.65;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    /* Aux: real small caps + oldstyle figures, where the font supports them. */
    font-feature-settings: "kern", "liga", "calt", "onum";
}

h1, h2, h3, .cm-deck, .cm-article-body p:first-of-type { font-family: var(--cm-serif); }
h1 {
    font-size: clamp(2.25rem, 4.5vw, 3.5rem); line-height: 1.05;
    margin: 0 0 1rem; letter-spacing: -.015em;
}
h1 em { color: var(--cm-accent); font-style: italic; font-weight: 500; }
h2 { font-size: 1.5rem; margin: 0 0 .65rem; letter-spacing: -.005em; }
h3 { font-family: var(--cm-sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--cm-muted); }

/* Aux's signature move: the rubric. Tracked small-caps line above H1. */
.cm-rubric {
    font-family: var(--cm-sans);
    font-size: .75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .14em;
    color: var(--cm-accent);
    margin: 0 0 1rem;
    display: flex; align-items: center; gap: .75rem;
}
.cm-rubric::after {
    content: ""; flex: 1; height: 1px; background: var(--cm-rule);
    /* The rubric pulls a hairline across the column — pure Bloomberg Businessweek. */
}

.cm-container { max-width: 760px; margin: 0 auto; padding: 0 1.5rem; }
.cm-container--wide { max-width: 1080px; }

/* Header — Aux: 2 px rule, not 1. This is a magazine. */
.cm-header { padding: 1.25rem 0; border-bottom: 2px solid var(--cm-rule); }
.cm-header .cm-container { display: flex; justify-content: space-between; align-items: baseline; }
.cm-brand {
    font-family: var(--cm-serif); font-size: 1.5rem;
    color: var(--cm-fg); text-decoration: none; letter-spacing: -.015em;
    font-weight: 600;
}
.cm-nav { font-family: var(--cm-sans); }
.cm-nav a {
    color: var(--cm-muted); text-decoration: none; margin-left: 1.5rem;
    font-size: .85rem; text-transform: uppercase; letter-spacing: .08em;
    transition: color .12s ease;
}
.cm-nav a:hover { color: var(--cm-fg); }
.cm-nav a:focus-visible { outline: 2px solid var(--cm-accent); outline-offset: 4px; }

/* Main */
.cm-main { padding: 4rem 0; }
.cm-hero { margin-bottom: 5rem; }
.cm-lede {
    color: var(--cm-muted); font-size: 1.2rem; line-height: 1.55;
    max-width: 56ch; margin: 0 0 1.5rem;
    font-feature-settings: "onum";
}

/* Buttons — squared per Aux. Editorial buttons aren't rounded. */
.cm-btn {
    display: inline-block; padding: .8rem 1.4rem;
    border-radius: 0;
    text-decoration: none; font-weight: 600;
    font-family: var(--cm-sans); font-size: .9rem;
    text-transform: uppercase; letter-spacing: .06em;
    border: 2px solid transparent;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.cm-btn-primary { background: var(--cm-fg); color: var(--cm-bg); border-color: var(--cm-fg); }
.cm-btn-primary:hover { background: var(--cm-accent); border-color: var(--cm-accent); }
.cm-btn-ghost { color: var(--cm-fg); border-color: var(--cm-fg); }
.cm-btn-ghost:hover { background: var(--cm-fg); color: var(--cm-bg); }
.cm-btn:focus-visible { outline: 2px solid var(--cm-accent); outline-offset: 3px; }

/* Pillars — Aux: 12-col asymmetric grid, alternating spans. */
.cm-pillars {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: 2.5rem; row-gap: 3rem;
    border-top: 2px solid var(--cm-rule);
    padding-top: 3rem;
}
.cm-pillars > article { color: var(--cm-fg); }
.cm-pillars > article:nth-child(3n+1) { grid-column: 1 / span 7; }
.cm-pillars > article:nth-child(3n+2) { grid-column: 8 / span 5; }
.cm-pillars > article:nth-child(3n+3) { grid-column: 1 / span 12; }
.cm-pillars p { color: var(--cm-muted); margin: .25rem 0 0; }
@media (max-width: 720px) {
    .cm-pillars > article,
    .cm-pillars > article:nth-child(3n+1),
    .cm-pillars > article:nth-child(3n+2),
    .cm-pillars > article:nth-child(3n+3) {
        grid-column: 1 / -1;
    }
}

/* Article — the part that has to look like print. */
.cm-article { max-width: 64ch; margin: 0 auto; }
.cm-hero-figure { margin: 0 0 2rem; }
.cm-hero-figure img {
    width: 100%; height: auto;
    border-radius: 0;
    /* No corner softening on editorial images, ever. */
}
.cm-article-header { margin-bottom: 2rem; }
.cm-article-date {
    display: block; color: var(--cm-muted);
    font-family: var(--cm-sans); font-size: .8rem;
    text-transform: uppercase; letter-spacing: .1em;
    font-feature-settings: "tnum";
    margin-bottom: 1rem;
}
.cm-deck {
    color: var(--cm-muted); font-size: 1.35rem; line-height: 1.4;
    margin: 1.25rem 0 2rem; font-style: italic;
}

/* Drop cap — Aux: black, big, blocky. Not purple-cute. */
.cm-article-body p:first-of-type::first-letter {
    float: left;
    font-family: var(--cm-serif);
    font-size: 4.5rem; line-height: .85;
    padding: .25rem .5rem 0 0;
    color: var(--cm-fg); font-weight: 700;
}
.cm-article-body p { margin: 0 0 1.25rem; }
.cm-article-body blockquote {
    border-left: 3px solid var(--cm-fg);
    padding: .25rem 0 .25rem 1.5rem;
    margin: 2rem 0;
    font-family: var(--cm-serif); font-style: italic;
    font-size: 1.2rem; line-height: 1.4;
    color: var(--cm-fg);
    background: transparent;
}
.cm-article-body code {
    background: #f3f4f6; padding: .12rem .35rem; border-radius: 0;
    font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9em;
}
.cm-article-body pre {
    background: #f3f4f6; padding: 1rem; border-radius: 0;
    border-left: 3px solid var(--cm-accent);
    overflow-x: auto; font-size: .9rem; line-height: 1.5;
}
.cm-article-body a {
    color: var(--cm-fg); text-decoration: underline;
    text-decoration-color: var(--cm-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}
.cm-article-body a:hover { color: var(--cm-accent); }

.cm-article-footer { margin-top: 3rem; padding-top: 2rem; border-top: 2px solid var(--cm-rule); }
.cm-article-footer a {
    color: var(--cm-fg); text-decoration: none;
    font-family: var(--cm-sans); font-size: .85rem;
    text-transform: uppercase; letter-spacing: .08em;
}
.cm-article-footer a:hover { color: var(--cm-accent); }

/* Selection — quiet but on-brand. */
::selection { background: var(--cm-fg); color: var(--cm-bg); }

/* Footer */
.cm-footer { padding: 3rem 0; border-top: 2px solid var(--cm-rule); margin-top: 5rem; color: var(--cm-muted); }
.cm-footer-meta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-top: 1rem; }
.cm-footer a, .cm-footer .parent-wordmark {
    color: var(--cm-muted); text-decoration: none;
    font-family: var(--cm-sans); font-size: .8rem;
    text-transform: uppercase; letter-spacing: .08em;
}
.cm-footer a:hover, .cm-footer .parent-wordmark:hover { color: var(--cm-accent); }

/* Skip-to-content (Aux didn't ask, but Mira would have killed me). */
.skip-to-content {
    position: absolute; left: -9999px;
    background: var(--cm-fg); color: var(--cm-bg);
    padding: .5rem 1rem; font-weight: 600;
    font-family: var(--cm-sans); font-size: .85rem;
    text-transform: uppercase; letter-spacing: .08em;
    z-index: 1000;
}
.skip-to-content:focus { left: 1rem; top: 1rem; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
