/* Typography for the Halvar Theme */

/* Serif font stack prioritizing readability and elegance */
body {
    font-family:
        "Iowan Old Style", "Apple Garamond", Baskerville, "Times New Roman",
        "Droid Serif", Times, "Source Serif Pro", serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family:
        "Iowan Old Style", "Apple Garamond", Baskerville, "Times New Roman",
        "Droid Serif", Times, "Source Serif Pro", serif;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 400;
}

p {
    margin-bottom: 1.2rem;
    line-height: 1.65;
}

.intro p {
    font-size: 1.3rem;
    color: #444;
    line-height: 1.6;
}

.intro .hero-subtitle {
    font-size: 1.5rem;
    color: #666;
    font-style: italic;
    margin-top: 0.5rem;
}

/* Main content links - thick red underline, red text on hover */
main a {
    color: inherit;
    text-decoration: none;
    border-bottom: 3px solid #b10000;
    padding-bottom: 1px;
    transition:
        color 0.2s ease,
        border-color 0.2s ease;
}

main a:hover {
    color: #b10000;
    border-bottom-color: #b10000;
}

/* Navigation links - different styling */
nav a {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    border-bottom: none !important;
    transition: color 0.2s ease;
}

nav a:hover {
    color: #111;
}

/* Special styling for specific link types */
.section-footer a {
    color: #666;
    text-decoration: none;
    border-bottom: 2px solid #b10000;
    padding-bottom: 1px;
    font-weight: 500;
    transition:
        color 0.2s ease,
        border-color 0.2s ease;
}

.section-footer a:hover {
    color: #b10000;
    border-bottom-color: #b10000;
}

/* Newsletter form links should not have thick underlines */
.newsletter a {
    border-bottom: 1px solid #b10000 !important;
}

/* Footer links */
footer a {
    color: #888;
    border-bottom: 1px solid #ccc;
    transition:
        color 0.2s ease,
        border-color 0.2s ease;
}

footer a:hover {
    color: #b10000;
    border-bottom-color: #b10000;
}

/* === Newsletters page tuning (final) ===================================== */

.newsletters-page .nl-wrap {
    max-width: var(--container-max);
    margin: 0 auto;
    padding-inline: var(--space-xl);
}

.newsletters-page h2.nl-section-title {
    font-weight: 600;
    font-size: var(--font-scale-2);
    line-height: var(--lh-heading);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
}

.newsletters-page .intro p {
    text-align: left;
    margin-top: var(--space-xs);
    line-height: 1.35; /* deliberately a bit tighter than global */
}

/* Section spacing and separators */
.newsletters-page .nl-section {
    margin-top: var(--space-lg);
}
.newsletters-page .nl-section + .nl-section {
    border-top: var(--rule);
    padding-top: 0.9rem; /* px-like feel but keep rem rhythm elsewhere */
}

/* Items (no item-level rules now; we want a minimal gap) */
.newsletters-page .nl-list article {
    margin-top: 0.6rem;
}

/* Titles (underline handled globally now, but keep the tighter geometry) */
.newsletters-page a.newsletter-title {
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
    line-height: var(--lh-tight);
    display: inline-block;
}

/* Tight gap from title to blurb */
.newsletters-page a.newsletter-title + p {
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* === Newsletter Page Styles =============================================== */

.newsletter-page-title {
    text-align: center;
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-sm);
}

.newsletter-page-subtitle {
    text-align: center;
    font-size: var(--font-scale--1);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-lg);
}

.page-subtitle {
    font-size: var(--font-scale-1);
    color: #666;
    font-style: italic;
    margin-top: -0.5rem;
    margin-bottom: var(--space-lg);
}

.teaser {
    font-size: var(--font-scale-0);
    color: #555;
    line-height: var(--lh-body);
    margin-top: var(--space-xs);
    margin-bottom: 0;
}

/* === Global Type & Layout ================================================= */

/* Body copy */
main p {
    font-size: var(--font-scale-0);
    line-height: var(--lh-body);
    margin-top: 0; /* tighten stacks by default */
    margin-bottom: var(--space-md);
}

/* Headings: weights + sizes (you can tweak these later) */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600; /* I like this weight */
    line-height: var(--lh-heading);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-sm);
}

h1 {
    font-size: var(--font-scale-4);
}
h2 {
    font-size: var(--font-scale-3);
}
h3 {
    font-size: var(--font-scale-2);
}
h4 {
    font-size: var(--font-scale-1);
}
h5,
h6 {
    font-size: var(--font-scale-0);
}

/* Containers */
.container,
.main-wrap {
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--space-xl);
}

/* Section separators (site-wide, used on newsletters already) */
.section + .section,
.nl-section + .nl-section {
    border-top: var(--rule);
    padding-top: calc(var(--space-lg) - 0.35rem); /* feels tight & tidy */
}

/* DEFAULT link styling site-wide
   Use modern text-decoration where supported; fall back to border-bottom. */
@supports (text-decoration-thickness: 2px) {
    main a {
        border-bottom: none;
        text-decoration: underline;
        text-decoration-color: var(--brand-red);
        text-decoration-thickness: 1.5px;
        text-underline-offset: 2px;
    }
}
@supports not (text-decoration-thickness: 2px) {
    main a {
        padding-bottom: 1px;
        border-bottom: 2px solid var(--brand-red);
        text-decoration: none;
    }
}

/* Tight variants you can opt into where needed */
.lead {
    line-height: var(--lh-body-tight);
}
.small {
    font-size: var(--font-scale--1);
}

/* Utility-ish spacing tokens (optional, pure CSS) */
.mt-0 {
    margin-top: 0 !important;
}
.mb-0 {
    margin-bottom: 0 !important;
}
.mt-xs {
    margin-top: var(--space-xs) !important;
}
.mb-xs {
    margin-bottom: var(--space-xs) !important;
}
.mt-sm {
    margin-top: var(--space-sm) !important;
}
.mb-sm {
    margin-bottom: var(--space-sm) !important;
}
.mt-md {
    margin-top: var(--space-md) !important;
}
.mb-md {
    margin-bottom: var(--space-md) !important;
}
.mt-lg {
    margin-top: var(--space-lg) !important;
}
.mb-lg {
    margin-bottom: var(--space-lg) !important;
}

/* === Essays List Styling ================================================== */
/* Custom styling for the essays section list page */

.essays-list {
    list-style: none;
    padding: 0;
    margin: 3rem 0 0 0;
}

.essay-item {
    margin-bottom: 2rem;
    padding-left: 0;
}

.essay-date {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

.essay-link-wrapper {
    display: block;
    color: inherit;
    text-decoration: none;
    border-bottom: none;
}

.essay-link-wrapper:hover {
    color: var(--brand-red);
}

.essay-link-wrapper:hover .essay-title,
.essay-link-wrapper:hover .essay-subtitle {
    color: var(--brand-red);
}

.essay-title {
    font-size: 2rem;
    font-weight: 500;
    margin: 0 0 0.2rem 0;
    line-height: 1.2;
}

.essay-subtitle {
    display: block;
    font-size: var(--font-scale-0);
    color: #111;
    line-height: 1.55;
    margin: 0;
}
