/* Interior Pages Styles */


/* ── Pinned first-row (above all content) ────────────────────────────── */
.interior-header {
    grid-area: header;
    position: sticky;
    top: 0;
    width: 100%;
    overflow: hidden;
    z-index: 100;
    /* ABOVE the overlay so the × trigger stays clickable */
    pointer-events: none;
    padding-top: 5px;
    padding-left: 5px;
    box-sizing: border-box;
    /* Gradient background so content scrolls underneath gracefully */
    /* Moved to .interior-horizontal-nav::before so it covers both */
    background: transparent;
    /* padding-bottom: 2rem; */
    /* Extend the element slightly so the gradient has room to fade out */

    font-family: Arial, Helvetica, sans-serif;
    color: var(--color-white);
    -webkit-text-stroke: 1px var(--color-light-gray);
    letter-spacing: -0.02em;
}

#interior-top-row {
    width: 100%;
}

/* Homepage link and nav trigger inside the top row must be clickable */
#interior-top-row a,
#nav-trigger {
    pointer-events: auto;
    text-decoration: none;
    color: var(--color-white);
    transition: color 0.25s ease;
}

#interior-top-row a:hover {
    color: var(--color-red);
}

/* ── Nav trigger button (+ / ×) ─────────────────────────────────────── */
#nav-trigger {
    position: absolute;
    right: 1.5rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 11;
    width: 0.8em;
    height: 0.6em;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#nav-trigger span {
    display: block;
    width: 100%;
    height: 0.1em;
    background-color: var(--color-black);
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
    border-radius: 2px;
}

#nav-trigger:hover span {
    background-color: var(--color-red);
}

/* Open state: X shape */
#nav-trigger.is-open span:nth-child(1) {
    transform: translateY(0.25em) rotate(45deg);
}

#nav-trigger.is-open span:nth-child(2) {
    opacity: 0;
}

#nav-trigger.is-open span:nth-child(3) {
    transform: translateY(-0.25em) rotate(-45deg);
}

/* ── Full-screen overlay ─────────────────────────────────────────────── */
#nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 6rem 6vw;
    box-sizing: border-box;
    background-color: rgba(255, 255, 255, 0.95);
    /* near-white, slightly transparent */

    /* Hidden by default */
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4%);
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

#nav-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Menu list inside overlay */
.overlay-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    /* gap is set dynamically by JS */
}

.overlay-navigation li {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.4em;
    row-gap: 0;
    overflow: visible;
    /* allow sub-menu items to be visible */
}

/* Sub-menu: vertical stack below the parent */
.overlay-navigation .sub-menu {
    display: flex;
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    list-style: none;
    margin: 0;
    padding: 0 0 0 3em;
    overflow: hidden;
    max-height: 2000px;
    /* large enough to contain the items */
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.overlay-navigation li.is-collapsed>.sub-menu {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    margin-top: 0;
    margin-bottom: 0;
}

.overlay-navigation .sub-menu li {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    overflow: visible;
}

.overlay-navigation .sub-menu li::before {
    display: none;
}

.overlay-navigation .sub-menu a {
    /* font-size is set dynamically by JS to ~45% of parent */
    color: transparent;
    -webkit-text-stroke: 1px var(--color-black);
    font-weight: 900;
    font-family: Arial, Helvetica, sans-serif;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    line-height: 1;
    text-decoration: none;
    transition: -webkit-text-stroke 0.2s ease, color 0.2s ease;
}

.overlay-navigation .sub-menu a:hover {
    color: var(--color-black);
    -webkit-text-stroke: 0;
}

.overlay-navigation .sub-menu li.current-menu-item a {
    color: var(--color-black);
    -webkit-text-stroke: 0;
}


.overlay-navigation a {
    display: block;
    font-family: Arial, Helvetica, sans-serif;
    /* font-size is set dynamically by JS based on viewport */
    font-size: 5rem;
    /* fallback, overridden immediately */
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px var(--color-black);
    text-decoration: none;
    transition: -webkit-text-stroke 0.2s ease, color 0.2s ease;
}

.overlay-navigation a:hover {
    color: var(--color-black);
    -webkit-text-stroke: 0px;
}

/* Current page item: solid filled */
.overlay-navigation li.current-menu-item>a {
    color: var(--color-black);
    -webkit-text-stroke: 0px;
}

/* Ancestor page item: 50% between white and black */
.overlay-navigation li.current-menu-ancestor>a,
.overlay-navigation li.current-menu-parent>a,
.overlay-navigation li.current-menu-ancestor>.submenu-toggle,
.overlay-navigation li.current-menu-parent>.submenu-toggle {
    color: color-mix(in srgb, var(--color-white) 50%, var(--color-black) 50%);
    -webkit-text-stroke: 0px;
}

.overlay-navigation li.current-menu-ancestor>a:hover,
.overlay-navigation li.current-menu-parent>a:hover,
.overlay-navigation li.current-menu-ancestor>.submenu-toggle:hover,
.overlay-navigation li.current-menu-parent>.submenu-toggle:hover {
    color: var(--color-black);
}

/* Sub-menu toggle button */
.submenu-toggle {
    background: none;
    border: none;
    color: transparent;
    -webkit-text-stroke: 1px var(--color-black);
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 900;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: -webkit-text-stroke 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submenu-toggle:hover {
    color: var(--color-black);
    -webkit-text-stroke: 0px;
}

.submenu-toggle::after {
    content: ">";
    rotate: 90deg;
    color: var(--color-red);
    -webkit-text-stroke: 0px;
    font-size: 0.5em;
    font-family: math;
}

.overlay-navigation li.is-collapsed>.submenu-toggle::after {
    content: "+";
    color: inherit;
    -webkit-text-stroke: inherit;
    font-size: 1em;
}

/* ── Page wrapper ────────────────────────────────────────────────────── */
body:not(.home) {
    min-height: 100vh;
}

/* Prevent layout shift during JS initialization */
body:not(.is-loaded) #page,
body:not(.is-loaded) #interior-top-row {
    opacity: 0;
    transition: opacity 0.4s ease-out;
}

body:not(.is-loaded) .sub-menu {
    transition: none !important;
}

body:not(.home).is-loaded #page,
body:not(.home).is-loaded #interior-top-row {
    opacity: 1;
}

#page {
    width: 100%;
    margin: 0;
    position: relative;
    z-index: 1;
}

.interior-grid-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "header header"
        "sidebar main";
    min-height: 100vh;
    width: 100%;
}

/* ── Main Content Area ───────────────────────────────────────────────── */
.interior-main {
    grid-area: main;
    padding: 6rem 4rem;
}

.entry-title {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.entry-content {
    font-size: 1.25rem;
    line-height: 1.8;
    max-width: 800px;
}

.entry-content p {
    margin-bottom: 1.5rem;
}

/* ── Content Images Reveal Effect ────────────────────────────────────── */
.entry-content img.bw-reveal-img {
    transition: filter 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    transform: scale(0.98);
    cursor: crosshair;
    /* Adds an exploratory feel */
}

.entry-content img.bw-reveal-img.is-revealed {
    transform: scale(1);
    cursor: default;
}

.entry-content h2,
.entry-content h3 {
    margin-top: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

/* ── Interior Layout & Sidebar Nav ─────────────────────────────────────── */
.interior-sidebar {
    grid-area: sidebar;
    background-color: transparent;
    color: var(--color-black);
    padding: 6rem 3rem 2rem 3rem;
    position: sticky;
    top: var(--nav-top, 0);
    height: calc(100vh - var(--nav-top, 0px));
    box-sizing: border-box;
    overflow-y: auto;
    z-index: 10;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-nav li {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.5em;
    width: 100%;
}

.sidebar-nav a {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--color-white);
    -webkit-text-stroke: 1px var(--color-black);
    text-decoration: none;
    transition: color 0.2s ease, -webkit-text-stroke 0.2s ease;
}

.sidebar-nav a:hover {
    color: var(--color-black);
    -webkit-text-stroke: 0px;
}

.sidebar-nav li.current-menu-item>a,
.sidebar-nav li.current-menu-ancestor>a,
.sidebar-nav li.current_page_item>a,
.sidebar-nav li.current_page_ancestor>a {
    color: var(--color-red);
    -webkit-text-stroke: 0px;
}

/* Sub-menu (Accordion) */
.sidebar-nav .sub-menu {
    padding-bottom: 1rem;
    border-bottom: 1px solid;
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    /* padding-left: 1.5rem; */
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    max-height: 1000px;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, margin-top 0.4s ease, margin-bottom 0.4s ease, padding-bottom 0.4s ease, border-color 0.4s ease;
}

.sidebar-nav li.is-collapsed>.sub-menu {
    max-height: 0 !important;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    border-color: transparent;
    pointer-events: none;
}

.sidebar-nav .sub-menu a {
    font-size: 1.75rem;
    color: var(--color-white);
}

.sidebar-nav .sub-menu a:hover {
    color: var(--color-black);
    -webkit-text-stroke: 0px;
}

.sidebar-nav .sub-menu li.current-menu-item>a {
    color: var(--color-red);
    -webkit-text-stroke: 0px;
}

.sidebar-nav .submenu-toggle {
    color: var(--color-white);
    -webkit-text-stroke: 1px var(--color-black);
    font-size: 2rem;
}

.sidebar-nav .submenu-toggle:hover {
    color: var(--color-black);
    -webkit-text-stroke: 0px;
}

.sidebar-nav li.is-collapsed>.submenu-toggle::after {
    content: "+";
    font-size: 1.2rem;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer {
    padding: 2rem 3rem;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: var(--color-charcoal);
}

@media (max-width: 900px) {
    .interior-grid-container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main";
    }

    .interior-sidebar {
        display: none !important;
    }

    .interior-main {
        padding: 4rem 2rem;
    }
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .site-main {
        padding: 2rem 1.5rem;
    }

    .overlay-navigation a {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    #nav-overlay {
        padding: 5rem 1.5rem;
    }
}

/* ── Post Navigation ─────────────────────────────────────────────────── */
.post-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-black);
    font-family: Arial, Helvetica, sans-serif;
    width: 100%;
    max-width: 800px;
    /* Match the entry-content max-width */
}

.post-navigation a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 900;
    text-transform: uppercase;
    color: transparent;
    -webkit-text-stroke: 1px var(--color-black);
    transition: color 0.2s ease, -webkit-text-stroke 0.2s ease;
    max-width: 100%;
    white-space: nowrap;
}

.post-navigation a:hover {
    color: var(--color-black);
    -webkit-text-stroke: 0px;
}

.post-navigation .nav-arrow {
    font-size: 1.5rem;
    color: var(--color-red);
    -webkit-text-stroke: 0px;
    /* Keep the arrow solid red */
    flex-shrink: 0;
}

.post-navigation .nav-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

.post-navigation .nav-next,
.post-navigation .nav-previous {
    flex: 1;
    min-width: 0;
    /* Enable flex-child text truncation */
}

.post-navigation .nav-previous {
    text-align: right;
    justify-content: flex-end;
    display: flex;
}

.post-navigation .nav-next {
    text-align: left;
    justify-content: flex-start;
    display: flex;
}

/* ── Archive Page ────────────────────────────────────────────────────── */
.archive-posts-list {
    margin-top: 3rem;
}

.archive-post-item {
    margin-bottom: 3.5rem;
}

.archive-post-date {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-charcoal);
    display: block;
    margin-bottom: 0.25rem;
}

.archive-post-title {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.archive-post-title a {
    text-decoration: none;
    /* color: transparent; */
    -webkit-text-stroke: 0px;
    transition: color 0.2s ease, -webkit-text-stroke 0.2s ease;
}

.archive-post-title a:hover {
    color: var(--color-black);
    -webkit-text-stroke: 1px var(--color-black);
}

.archive-post-excerpt {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--color-charcoal);
    max-width: 800px;
}

/* Pagination */
.archive-pagination {
    margin-top: 4rem;
    display: flex;
    gap: 0.5rem;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 900;
    font-size: 1.25rem;
}

.archive-pagination a,
.archive-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    /* border: 1px solid var(--color-black); */
    text-decoration: none;
    color: transparent;
    -webkit-text-stroke: 0.5px var(--color-black);
    transition: all 0.2s ease;
}

.archive-pagination a:hover,
.archive-pagination .current {
    color: var(--color-black);
    -webkit-text-stroke: 0px;
    background-color: transparent;
    border-bottom: 1px solid var(--color-black);
}

.archive-pagination .prev,
.archive-pagination .next {
    background-color: transparent;
    border: none !important;
    width: auto;
    padding: 0 1rem;
    white-space: nowrap;
}

.archive-pagination .prev:hover,
.archive-pagination .next:hover {
    border: none !important;
    border-bottom: none !important;
}

.excerpt-read-more {
    text-decoration: none;
    color: var(--color-red);
    font-weight: 900;
    font-size: 1.25rem;
    transition: color 0.2s ease;
    display: inline-block;
}

.excerpt-read-more:hover {
    color: var(--color-black);
}

/* Override Archive menu item active color in the sidebar nav */
.sidebar-nav li.menu-item-archive.current-menu-item > a {
    color: var(--color-black);
    -webkit-text-stroke: 0px;
}