/* Color palette and shared page defaults */
:root {
    color-scheme: light;
    --cream: #f7efdf;
    --paper: #fffaf0;
    --brown: #34251d;
    --muted-brown: #68564a;
    --coral: #a83e32;
    --coral-light: #edc2ae;
    --rule: #d9c8b3;
    --content-width: 700px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--cream);
    color: var(--brown);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.7;
}

/* Headings and links */
h1,
h2,
h3,
.site-title {
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.2;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    font-size: clamp(2.2rem, 8vw, 3.5rem);
    letter-spacing: -0.035em;
}

h2 {
    font-size: clamp(1.7rem, 5vw, 2.25rem);
}

h3 {
    font-size: 1.55rem;
}

a {
    color: var(--coral);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

a:hover {
    color: var(--brown);
}

a:focus-visible {
    border-radius: 2px;
    outline: 3px solid var(--coral);
    outline-offset: 4px;
}

/* Skip link for keyboard and assistive-technology users */
.skip-link {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1;
    padding: 0.5rem 0.75rem;
    transform: translateY(-180%);
    background: var(--brown);
    color: var(--paper);
}

.skip-link:focus {
    transform: translateY(0);
    color: var(--paper);
}

/* Shared header and navigation */
.site-header {
    border-bottom: 1px solid var(--rule);
    background: var(--paper);
}

.site-header__inner {
    display: flex;
    width: min(100% - 2.5rem, var(--content-width));
    min-height: 150px;
    margin: 0 auto;
    padding: 1.5rem 0 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.site-title {
    color: var(--brown);
    font-size: 1.85rem;
    font-weight: 700;
    text-decoration: none;
}

.site-title:hover {
    color: var(--coral);
}

.site-tagline {
    margin: 0.35rem 0 1rem;
    color: var(--muted-brown);
    font-size: 0.9rem;
}

.site-nav {
    display: flex;
    gap: 1.25rem;
}

.site-nav a {
    padding: 0.2rem 0;
    font-weight: 700;
    text-decoration: none;
}

.site-nav a[aria-current="page"] {
    border-bottom: 2px solid var(--coral);
    color: var(--brown);
}

/* Main content width and intro */
.content {
    width: min(100% - 2.5rem, var(--content-width));
    min-height: 60vh;
    margin: 0 auto;
    padding: clamp(2.5rem, 8vw, 5rem) 0;
}

.intro {
    margin-bottom: 4rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--rule);
}

.intro h1 {
    max-width: 16ch;
    margin-bottom: 1rem;
}

.intro > p:last-child {
    max-width: 62ch;
    margin-bottom: 0;
    color: var(--muted-brown);
    font-size: 1.08rem;
}

.eyebrow {
    margin-bottom: 0.75rem;
    color: var(--coral);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.section-heading {
    margin-bottom: 1.5rem;
}

.section-heading h2 {
    margin-bottom: 0;
}

/* Home page post preview cards */
.post-list {
    display: grid;
    gap: 1rem;
}

.post-card {
    padding: 1.5rem;
    border: 1px solid var(--rule);
    border-left: 5px solid var(--coral);
    border-radius: 4px;
    background: var(--paper);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.post-card:hover,
.post-card:focus-within {
    transform: translateY(-3px);
    border-color: var(--coral-light);
    box-shadow: 0 8px 18px rgb(52 37 29 / 10%);
}

.post-card__meta {
    margin-bottom: 0.4rem;
    color: var(--muted-brown);
    font-size: 0.85rem;
}

.post-card h3 {
    margin-bottom: 0.6rem;
}

.post-card h3 a {
    color: var(--brown);
    text-decoration: none;
}

.post-card h3 a:hover {
    color: var(--coral);
}

.post-card > p:not(.post-card__meta) {
    margin-bottom: 0.9rem;
    color: var(--muted-brown);
}

.read-more,
.text-link {
    font-weight: 750;
}

.read-more span,
.text-link span {
    display: inline-block;
    transition: transform 160ms ease;
}

.read-more:hover span,
.text-link:hover span {
    transform: translateX(3px);
}

/* Article and About page content */
.post-header {
    margin-bottom: 2.25rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--rule);
}

.post-header h1 {
    margin-bottom: 0.8rem;
}

.post-deck {
    max-width: 58ch;
    margin-bottom: 0;
    color: var(--muted-brown);
    font-size: 1.15rem;
}

.post-body p {
    margin-bottom: 1.35rem;
}

.post-back {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
}

.about-page h1 {
    margin-bottom: 1.5rem;
}

.about-page p {
    max-width: 62ch;
}

.placeholder-note {
    padding: 1.25rem;
    border-left: 5px solid var(--coral);
    background: var(--paper);
}

.about-page .text-link {
    display: inline-block;
    margin-top: 1rem;
}

/* Shared footer */
.site-footer {
    display: flex;
    width: min(100% - 2.5rem, var(--content-width));
    margin: 0 auto;
    padding: 1.5rem 0 2rem;
    border-top: 1px solid var(--rule);
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    color: var(--muted-brown);
    font-size: 0.9rem;
}

.site-footer p {
    margin: 0;
}

/* Respect visitors who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}

/* Small-screen layout adjustments */
@media (max-width: 480px) {
    .site-header__inner,
    .content,
    .site-footer {
        width: min(100% - 2rem, var(--content-width));
    }

    .site-header__inner {
        min-height: 0;
    }

    .post-card {
        padding: 1.2rem;
    }

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}
