/* Gardner Field Notes — public styles. Minimal, single-column (leerob-inspired). */

:root {
    --bg:     #ffffff;
    --text:   #111111;
    --muted:  #6b7280;
    --faint:  #e5e7eb;
    --rule:   #d1d5db;
    --accent: #15803d;
    --maxw:   640px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

/* ---------- Header (pinned to the very top; never scrolls away) ---------- */
header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg);
    padding-top: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--faint);
    margin-bottom: 2.75rem;
}
.site-name {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    line-height: 1.1;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid var(--rule);
    margin-bottom: 0.7rem;
}
.brand {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}
.brand:hover { color: var(--text); }
.today {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--muted);
    white-space: nowrap;
}
.tagline { color: var(--muted); font-size: 1rem; }
nav { margin-top: 1.25rem; display: flex; gap: 1.25rem; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
nav a:hover, nav a.active { color: var(--text); }

/* ---------- Home section cards ---------- */
.home-card {
    border: 1px solid #c9ced6;
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
}
.home-card > .featured,
.home-card > .section { margin-bottom: 0; }
/* Make the "Popular Posts" / "All Posts" headings stand out more. */
.home-card .section-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.06em;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--faint);
    margin-bottom: 1rem;
}

/* ---------- Featured ---------- */
.featured { margin-bottom: 3.5rem; }
.eyebrow {
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--accent); font-weight: 600; margin-bottom: 0.6rem;
}
.featured-title {
    display: inline-block; font-size: 1.85rem; font-weight: 700;
    letter-spacing: -0.02em; line-height: 1.25; color: var(--text);
    text-decoration: none; margin-bottom: 0.5rem;
}
.featured-title:hover { color: var(--accent); }
.featured .meta {
    color: var(--muted); font-size: 0.85rem; margin-bottom: 0.9rem;
    font-variant-numeric: tabular-nums;
}
.featured .excerpt { color: #374151; margin-bottom: 0.9rem; }
.featured .more {
    color: var(--accent); text-decoration: none; font-weight: 500; font-size: 0.95rem;
}
.featured .more:hover { text-decoration: underline; }

/* Expanded full article (revealed in place) */
.full-post { display: none; }
.full-post p { color: #374151; }
.full-post p + p { margin-top: 1rem; }
.full-post h2, .full-post h3 { margin: 1.5rem 0 0.5rem; line-height: 1.3; }
.full-post ul, .full-post ol { margin: 0.75rem 0 0.75rem 1.4rem; }
.full-post img { max-width: 100%; height: auto; border-radius: 8px; margin: 1.2rem 0; }
figure.post-figure { margin: 1.6rem 0; }
figure.post-figure svg, figure.post-figure img {
    display: block; width: 100%; height: auto;
    border: 1px solid var(--faint); border-radius: 8px; background: #fff;
}
figure.post-figure figcaption {
    font-size: 0.8rem; color: var(--muted); margin-top: 0.5rem; text-align: center;
}
.collapse {
    display: inline-block; margin-top: 1.5rem; color: var(--muted);
    text-decoration: none; font-size: 0.9rem; font-weight: 500;
}
.collapse:hover { color: var(--text); }

/* ---------- Section + lists ---------- */
.section { margin-bottom: 3.5rem; }
.section-label {
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--muted); font-weight: 600; margin-bottom: 1.25rem;
}
.notes { list-style: none; }
.note {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 1.5rem; padding: 0.7rem 0; border-bottom: 1px solid var(--faint);
}
.note:last-child { border-bottom: none; }
.note a { color: var(--text); text-decoration: none; font-weight: 500; }
.note a:hover { color: var(--accent); }
.note .date {
    color: var(--muted); font-size: 0.85rem;
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
.all-notes {
    display: inline-block; color: var(--accent); text-decoration: none;
    font-weight: 500; font-size: 0.95rem;
}
.all-notes:hover { text-decoration: underline; }

/* ---------- Topic chips ---------- */
.topics { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.topic-chip {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent);
    border: 1px solid #abefc6;
    background: #ecfdf3;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.6;
}
/* Plain display chips (spans) have no action. Only buttons/links react. */
button.topic-chip {
    cursor: pointer;
    font-family: inherit;
    -webkit-appearance: none;   /* iOS Safari ignores custom background on native buttons without this */
    appearance: none;
}
/* Only lighten on hover when NOT active — otherwise iOS "sticky hover" after a
   tap overrides the active chip's dark-green background (white text on light green). */
button.topic-chip:not(.active):hover { background: #d1fae5; }
.topic-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Display-only chips (non-clickable spans) — no fill, so they're clearly
   distinct from the filled, clickable filter chips. */
span.topic-chip { background: transparent; }

/* Filter bar inside the expanded All Posts list */
.topic-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.25rem; }

/* Rich post list (Popular) — title, date, chips stacked */
.post-list { list-style: none; }
.post-list > li { padding: 0.85rem 0; border-bottom: 1px solid var(--faint); }
.post-list > li:last-child { border-bottom: none; }
.post-list .p-title { color: var(--text); text-decoration: none; font-weight: 500; }
.post-list .p-title:hover { color: var(--accent); }
.post-list .p-date { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; margin: 0.1rem 0 0.45rem; }

/* ---------- Single post page ---------- */
.post-body { }
.post-back { display:inline-block; margin-bottom: 1.5rem; color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.post-back:hover { color: var(--text); }
.post-title { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 0.5rem; }
.post-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 2rem; }
.post-id { margin-left: 2.5rem; color: #9ca3af; }  /* gap + slightly lighter than the date */
.post-content p { margin-bottom: 1rem; color: #374151; }
.post-content h2, .post-content h3 { margin: 1.75rem 0 0.6rem; line-height: 1.3; }
.post-content ul, .post-content ol { margin: 0.75rem 0 0.75rem 1.4rem; }
.post-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 1.2rem 0; }

/* ---------- Simple content pages (about/contact) ---------- */
.page-content p { margin-bottom: 1rem; color: #374151; }
.page-content h2 { margin: 1.75rem 0 0.6rem; }

/* ---------- Footer ---------- */
footer {
    margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--faint);
    color: var(--muted); font-size: 0.85rem;
}

@media (max-width: 520px) {
    .note { flex-direction: column; gap: 0.2rem; }
}
