/* tanso.news — airy minimalist magazine */

:root {
    --white: #ffffff;
    --text: #111827;
    --accent: #059669;
    --light: #f9fafb;
    --border: #e5e7eb;
    --muted: #6b7280;

    --font-display: "Newsreader", Georgia, "Times New Roman", serif;
    --font-body: "Newsreader", Georgia, "Times New Roman", serif;
    --font-meta: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --container: 1100px;
    --gutter: 2rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--white);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.0625rem;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

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

ul,
ol {
    list-style: none;
}

sub {
    font-size: 0.65em;
    line-height: 0;
    vertical-align: baseline;
    position: relative;
    bottom: -0.25em;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ---------------- Reading progress bar ---------------- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--accent);
    z-index: 1000;
    transition: width 80ms linear;
    will-change: width;
}

@media (prefers-reduced-motion: reduce) {
    .reading-progress {
        display: none;
    }
    html {
        scroll-behavior: auto;
    }
}

/* ---------------- Masthead ---------------- */
.masthead {
    border-bottom: 1px solid var(--border);
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
}

.masthead-inner {
    padding-top: 1.25rem;
    padding-bottom: 0;
}

.masthead-top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding-bottom: 1.25rem;
}

.masthead-date,
.masthead-edition {
    font-family: var(--font-meta);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.masthead-edition {
    text-align: right;
}

.masthead-logo {
    display: inline-flex;
    align-items: baseline;
    gap: 0.55rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: -0.01em;
    color: var(--text);
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background: var(--accent);
    color: var(--white);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1;
    transform: translateY(2px);
}

.logo-word {
    font-feature-settings: "ss01" on;
}

.logo-dot {
    color: var(--accent);
}

.masthead-nav {
    border-top: 1px solid var(--border);
}

.masthead-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 1.75rem;
    justify-content: center;
    padding: 0.85rem 0;
}

.masthead-nav a {
    font-family: var(--font-meta);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    padding: 0.25rem 0;
    border-bottom: 1px solid transparent;
    transition: border-color 200ms ease, color 200ms ease;
}

.masthead-nav a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ---------------- Featured (Magazine Hero) ---------------- */
.featured {
    padding: 3rem 0;
    border-bottom: 2px solid var(--text);
}

.featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.featured-media {
    aspect-ratio: 4 / 5;
    background: var(--light);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.featured-media-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
}

.media-rule {
    width: 3rem;
    height: 2px;
    background: var(--accent);
}

.media-mark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(5rem, 10vw, 8rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
    color: var(--text);
    align-self: flex-start;
}

.media-mark sub {
    font-size: 0.5em;
    color: var(--accent);
}

.media-meta {
    font-family: var(--font-meta);
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.media-meta strong {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text);
    text-transform: none;
    letter-spacing: -0.01em;
}

.featured-text .badge {
    margin-bottom: 1.25rem;
    display: inline-block;
}

.featured-headline {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 1.25rem;
}

.featured-deck {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.2rem;
    line-height: 1.65;
    color: var(--text);
    margin-bottom: 1.5rem;
    max-width: 38ch;
}

.read-link {
    display: inline-block;
    margin-top: 1rem;
    font-family: var(--font-meta);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    border-bottom: 1px solid var(--accent);
    padding-bottom: 0.2rem;
    transition: opacity 200ms ease;
}

.read-link:hover {
    opacity: 0.7;
}

/* ---------------- Badges ---------------- */
.badge {
    display: inline-block;
    color: var(--accent);
    font-family: var(--font-meta);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ---------------- Bylines ---------------- */
.byline {
    color: var(--muted);
    font-family: var(--font-meta);
    font-size: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.byline-author {
    color: var(--text);
    font-weight: 600;
}

.byline-sep {
    opacity: 0.6;
}

/* ---------------- Layout: main + sidebar ---------------- */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 3.5rem;
    padding: 3rem 0 4rem;
}

.layout-main {
    min-width: 0;
}

/* ---------------- Sections ---------------- */
.section {
    padding: 2rem 0 2.5rem;
}

.section + .section {
    border-top: 1px solid var(--border);
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--text);
}

.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    color: var(--text);
}

.section-link {
    font-family: var(--font-meta);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    transition: opacity 200ms ease;
}

.section-link:hover {
    opacity: 0.7;
}

/* ---------------- News Grid (3 columns) ---------------- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.story {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.story-media {
    aspect-ratio: 4 / 3;
    background: var(--light);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.story-media::before,
.story-media::after {
    content: "";
    position: absolute;
    background: var(--border);
}

.story-media::before {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        135deg,
        var(--light) 0,
        var(--light) 10px,
        #f1f3f5 10px,
        #f1f3f5 11px
    );
}

.story-media::after {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
    box-shadow: 0 0 0 6px var(--white);
}

.media-tag {
    position: absolute;
    bottom: 0.6rem;
    left: 0.6rem;
    font-family: var(--font-meta);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    background: var(--white);
    padding: 0.15rem 0.45rem;
    border: 1px solid var(--border);
    z-index: 2;
}

.story-headline {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1.22;
    letter-spacing: -0.01em;
    color: var(--text);
}

.story-headline a {
    background-image: linear-gradient(var(--accent), var(--accent));
    background-size: 0 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 250ms ease;
}

.story-headline a:hover {
    background-size: 100% 1px;
}

.story-excerpt {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
}

/* ---------------- Opinion list (no images) ---------------- */
.opinion-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.opinion-item {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.5rem;
    background: var(--light);
    border-left: 2px solid var(--accent);
}

.opinion-item .story-headline {
    font-style: italic;
    font-size: 1.2rem;
    font-weight: 600;
}

/* ---------------- Sidebar ---------------- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    align-self: start;
    position: sticky;
    top: 7.5rem;
    padding-top: 2rem;
}

.sidebar-block {
    border-top: 2px solid var(--text);
    padding-top: 1rem;
}

.sidebar-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.topic-list a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text);
    transition: color 200ms ease;
}

.topic-list a:hover {
    color: var(--accent);
}

.topic-count {
    font-family: var(--font-meta);
    font-size: 0.75rem;
    color: var(--muted);
}

.most-read-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.most-read-list li {
    display: grid;
    grid-template-columns: 2.25rem 1fr;
    gap: 0.75rem;
    align-items: start;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.most-read-list li:last-child {
    border-bottom: none;
}

.rank {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--accent);
    line-height: 1;
}

.most-read-headline {
    display: block;
    margin-top: 0.35rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.35;
    color: var(--text);
    transition: color 200ms ease;
}

.most-read-headline:hover {
    color: var(--accent);
}

/* ---------------- Newsletter ---------------- */
.newsletter {
    background: var(--light);
    padding: 1.5rem 1.25rem;
    border-top: 2px solid var(--accent);
    margin: 0 -0.5rem;
}

.newsletter .sidebar-title {
    color: var(--accent);
}

.newsletter-deck {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 1rem;
}

.newsletter-label {
    font-family: var(--font-meta);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    display: block;
    margin-bottom: 0.4rem;
}

.newsletter-row {
    display: flex;
    gap: 0;
    border: 1px solid var(--text);
    background: var(--white);
}

.newsletter-row input {
    flex: 1;
    border: 0;
    padding: 0.6rem 0.7rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text);
    background: transparent;
    outline: none;
    min-width: 0;
}

.newsletter-row button {
    border: 0;
    background: var(--text);
    color: var(--white);
    padding: 0.6rem 0.9rem;
    font-family: var(--font-meta);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background-color 200ms ease;
}

.newsletter-row button:hover {
    background: var(--accent);
}

.newsletter-note {
    font-family: var(--font-meta);
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.newsletter-note.is-success {
    color: var(--accent);
}

.newsletter-note.is-error {
    color: #b91c1c;
}

/* ---------------- Carbon Clock ---------------- */
.carbon-clock {
    border-top: 2px solid var(--accent);
}

.clock-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-meta);
}

.clock-row:last-of-type {
    border-bottom: none;
}

.clock-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.clock-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    letter-spacing: -0.01em;
}

.clock-note {
    font-family: var(--font-meta);
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 0.75rem;
    line-height: 1.5;
}

/* ---------------- Footer ---------------- */
.footer {
    background: var(--light);
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

.footer-inner {
    padding-top: 3rem;
    padding-bottom: 2rem;
    display: grid;
    grid-template-columns: 1.4fr 2fr;
    gap: 3rem;
}

.footer-brand .masthead-logo,
.footer-brand .logo-word {
    font-size: 1.4rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
}

.footer-brand .logo-mark {
    width: 1.6rem;
    height: 1.6rem;
    font-size: 1rem;
}

.footer-tagline {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--muted);
    max-width: 36ch;
    margin-top: 0.5rem;
}

.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-cols h3 {
    font-family: var(--font-meta);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    margin-bottom: 0.85rem;
}

.footer-cols ul {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.footer-cols a {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--muted);
    transition: color 200ms ease;
}

.footer-cols a:hover {
    color: var(--accent);
}

.footer-meta {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    font-family: var(--font-meta);
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 960px) {
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .featured-media {
        aspect-ratio: 16 / 10;
    }

    .layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .sidebar {
        position: static;
        padding-top: 0;
    }

    .news-grid,
    .opinion-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .masthead-top {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 0.5rem;
    }

    .masthead-edition {
        text-align: center;
    }

    .masthead-nav ul {
        gap: 1rem;
        justify-content: flex-start;
        overflow-x: auto;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .news-grid,
    .opinion-list {
        grid-template-columns: 1fr;
    }

    .footer-cols {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-meta {
        flex-direction: column;
        gap: 0.4rem;
    }

    .featured {
        padding: 2rem 0;
    }
}
