/* --- Custom Font --- */
@font-face {
    font-family: "Untitled Sans Light";
    src: local("Untitled Sans Light"), local("UntitledSans-Light");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

html body,
html body * {
    font-family: "Untitled Sans Light", sans-serif !important;
    font-weight: 300 !important;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* FIX: Hide the default theme page title on the homepage only */
.home .entry-title,
.home .page-title,
.home .post-title {
    display: none !important;
}

/* Homepage: raise hero content slightly (template-safe) */
.brutalist-homepage .homepage-content {
    position: relative;
    top: -20px;
}

/* --- Global Width Constraint --- */
.single-narrow-wrapper {
    max-width: 800px !important;
    margin: 0 auto !important;
    padding: 0 2rem !important;
    display: block !important;
    width: 100%;
}

/* --- Archive / Blog Page --- */
.brutalist-archive {
    padding-top: 0;
    /* Header handles spacing */
}

.archive-hero {
    margin-bottom: 3rem;
}

.archive-title {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.archive-description {
    width: 100% !important;
    /* Forces full 800px width */
    max-width: 100% !important;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #444;
}

/* --- Series Groups (3-part posts) --- */
.series-group+.series-group {
    margin-top: 2.5rem;
}

.series-title {
    font-size: 1.5rem;
    margin: 0.5rem 0 0.75rem 0;
}

/* 3-Post Grid within 800px */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    /* Tighter gap to fit 3 posts elegantly */
    width: 100%;
}

.post-card {
    background: #fff;
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e5e5;
    /* Restored 1px border */
    height: 100%;
}

.card-image img {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid #e5e5e5;
}

.card-content {
    padding: 0.75rem !important;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.card-title a {
    text-decoration: none;
    color: #000;
}

.card-meta {
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 0.75rem;
}

.card-excerpt {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #666;
}

/* --- Single Post --- */
.brutalist-single-page {
    padding-top: 2.5rem;
    padding-bottom: 7rem;
}

.single .single-narrow-wrapper {
    padding-top: 0.5rem;
}

.single-featured-image {
    margin-bottom: 3.5rem;
}

.single-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.single-hero {
    margin-bottom: 3.5rem;
    padding: 0;
    background: transparent;
    border: 0;
    text-align: left;
}

.single .entry-title {
    font-size: clamp(2.2rem, 5.4vw, 3.5rem);
    line-height: 1.08;
    margin-bottom: 1.2rem;
    text-wrap: balance;
}

.single .entry-meta {
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-top: 1px solid #111;
    display: inline-block;
    padding-top: 0.95rem;
    color: #404040;
}

.single .entry-content hr {
    margin-left: 0;
    margin-right: auto;
    border: 0;
    border-top: 1px solid #000;
    margin-top: 2.5rem;
}

.single .entry-content {
    font-size: 1.12rem;
    line-height: 1.82;
    color: #1f1f1f;
}

.single .entry-content>*+* {
    margin-top: 1.5rem;
}

.single .entry-content p {
    margin: 0;
}

.single .entry-content p+p {
    margin-top: 2.2rem;
}

.single .entry-content h2,
.single .entry-content h3,
.single .entry-content h4 {
    margin-top: 3rem;
    line-height: 1.3;
}

.single .entry-content ul,
.single .entry-content ol {
    padding-left: 1.2rem;
}

.single .entry-content li+li {
    margin-top: 0.5rem;
}

.single .entry-content a {
    color: #111;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.single .post-footer-nav {
    margin-top: 6rem;
    padding-top: 1.75rem;
    border-top: 1px solid #e2e2e2;
}

.single .post-navigation {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 2.5rem;
    align-items: start;
}

.single .post-navigation>div {
    min-width: 0;
}

.single .post-navigation .nav-previous {
    text-align: left;
}

.single .post-navigation .nav-next {
    text-align: left;
}

.single .post-navigation a {
    color: #000 !important;
    text-decoration: none;
    line-height: 1.45;
}

.hr {
    margin-bottom: -15px !important;
    color: #505050 !important;
}

.single .post-navigation .nav-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #000;
}

/* Responsive */
@media (max-width: 768px) {

    /* Homepage: avoid vertical centering + large template padding on mobile */
    .brutalist-homepage {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        justify-content: flex-start !important;
    }

    .brutalist-homepage .homepage-content {
        margin-top: 0 !important;
        padding-top: 15px !important;
        padding-left: 5px !important;
    }

    /* FIX: Ensure front-page content aligns with header on mobile */
    body.front-page .brutalist-homepage .homepage-content .single-narrow-wrapper {
        max-width: 800px !important;
        margin: 0 auto !important;
        padding-left: 2rem !important;
        padding-right: 2rem !important;
        width: 100%;
    }

    /* FIX: Prevent parent theme from shifting the section itself */
    body.front-page .brutalist-homepage .homepage-content {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100%;
    }

    /* FIX: Prevent any front-page text indent/offset from shifting alignment */
    body.front-page .hero-text-block,
    body.front-page .hero-text-block p,
    body.front-page .hero-text-block .lead-text {
        margin-left: 0 !important;
        padding-left: 0 !important;
        text-indent: 0 !important;
    }

    /* FIX: Front page mobile vertical alignment + full viewport height */
    body.front-page {
        min-height: 100svh;
        display: flex;
        flex-direction: column;
    }

    body.front-page .brutalist-homepage {
        flex: 1 0 auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        /* FIX: Neutralize any parent-theme horizontal offsets on mobile */
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100%;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .post-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .archive-title {
        font-size: 2.5rem;
    }

    .series-title {
        font-size: 1.15rem;
    }

    .single-hero {
        padding: 0;
        margin-bottom: 2.75rem;
    }

    /* Single post title: scale down smoothly on mobile */
    .single .entry-title {
        font-size: clamp(1.9rem, 8.5vw, 2.6rem);
    }

    .single .entry-content {
        font-size: 1rem;
        line-height: 1.78;
    }

    .single .entry-content p+p {
        margin-top: 1.9rem;
    }

    .single .post-footer-nav {
        margin-top: 4.5rem;
    }

    .single .post-navigation {
        column-gap: 1.5rem;
    }

    /* Footer: mobile should be a single sharp line (no cities) with minimal bottom space */
    .archive-footer-flair {
        padding-bottom: 25px !important;
    }

    .archive-footer-flair .lk-footer-row {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 0.75rem !important;
        white-space: nowrap;
        font-size: 0.75rem !important;
    }

    /* Hide the cities line on mobile */
    .archive-footer-flair .lk-footer-cities {
        display: none !important;
    }

    /* Keep the year visible on mobile */
    .archive-footer-flair .footer-year {
        display: inline !important;
    }

    /* Avoid stacking extra padding under the footer on single posts */
    .brutalist-single-page {
        padding-bottom: 0 !important;
    }
}
