/*
Theme Name: Sidebar Collapse Theme
Theme URI: https://example.com
Description: A modern WordPress theme with collapsible sidebar navigation, light/dark mode, and download functionality
Version: 1.0
Author: Your Name
Author URI: https://example.com
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sidebar-theme
*/

/* CSS Variables for Theme Colors */
:root {
    --bg-primary: #3a3a3a;   /* body + sidebar */
    --bg-secondary: #4a4a4a; /* buttons, hovers */
    --bg-content: #e0e0e0;   /* content card */
    --accent: #c49a3d;       /* brand gold — active menu item */
    --text-primary: #e0e0e0;
    --text-heading: #f0f0f0;
    --text-link: #fff;
    --text-meta: #aaa;
    --text-placeholder: #666;
    --icon-color: #2a2a2a;
    --border-color: rgba(255,255,255,0.1);
    --shadow-color: rgba(0,0,0,0.3);
    --menu-item-color: #ecf0f1;
    --menu-icon-color: #ecf0f1;
    --transition-logo-color: #fff;
    --transition-logo-opacity: 0.5;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--brand-font, 'Epilogue'), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 60px;
    background: var(--bg-primary);
    transition: width 0.3s ease, background-color 0.3s ease;
    overflow: hidden;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow-color);
    display: flex;
    flex-direction: column;
}

.sidebar:hover {
    width: 280px;
}

/* Arrow indicator */
.sidebar::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 23px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #fff;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar:hover::after {
    opacity: 0;
}

.sidebar-header {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: width 0.3s ease, height 0.3s ease;
}

.sidebar:hover .sidebar-header {
    width: 280px;
    height: 280px;
}

.logo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-placeholder svg {
    width: 100%;
    height: 100%;
}

.custom-logo-link {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.logo-placeholder img,
.custom-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-menu {
    list-style: none;
    padding: 30px 0;
}

.sidebar-menu li {
    margin: 0 0 8px 0;
}

.sidebar-menu > li > a .menu-text {
    font-weight: 700;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    color: var(--menu-item-color);
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.sidebar-menu a:hover {
    color: #ffffff;
}

.menu-text {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar:hover .menu-text {
    opacity: 1;
}

/* Sidebar Footer Logo */
.sidebar-footer {
    width: 60px;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--border-color);
    transition: width 0.3s ease, height 0.3s ease;
    padding: 20px 10px;       /* collapsed: 20px above and below the monogram */
    margin-top: auto;
}

.sidebar:hover .sidebar-footer {
    width: 280px;
    height: 280px;
    padding: 30px 20px;
}

.sidebar-footer-logo {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.3s ease, height 0.3s ease;
}

.sidebar:hover .sidebar-footer-logo {
    width: 30px;
    height: 30px;
}

.sidebar-footer-logo svg {
    width: 100%;
    height: 100%;
}

.sidebar-footer-contact {
    display: none;
    text-align: center;
    margin-top: 20px;
}

.sidebar:hover .sidebar-footer-contact {
    display: block;
}

.sidebar-footer-contact a {
    display: block;
    color: var(--text-placeholder);
    text-decoration: none;
    font-size: 0.765rem;
    line-height: 1.6;
    margin: 4px 0;
}

.sidebar-footer-contact a:hover {
    color: var(--text-placeholder);
}

/* Menu Icons */
.menu-icon {
    width: 24px;
    height: 24px;
    opacity: 1;
    transition: opacity 0.3s ease;
    flex-shrink: 0;
}

.sidebar:hover .menu-icon {
    opacity: 0;
    width: 0;
}

.menu-icon svg {
    width: 100%;
    height: 100%;
    stroke: var(--menu-icon-color);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Active menu item */
.sidebar-menu .menu-item.active > a {
    opacity: 1;
}

/* Submenu styles */
/* Collapsed until you are inside that section — animated open */
.sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    /* max-height must sit close to the real height, or the reveal races past it */
    transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.5s ease;
}

.sidebar:hover .menu-item.active > .sub-menu {
    max-height: var(--sub-h, 400px);
    opacity: 1;
}

.sub-menu li {
    margin: 0;
}

/* Hide icons in submenu */
.sub-menu .menu-icon {
    display: none;
}

/* Same white as the main entries — anything clickable reads the same */
.sub-menu a {
    padding: 7px 20px 7px 24px;
    font-size: 0.9rem;
    opacity: 1;
}

.sub-menu .menu-text { font-weight: 600; }

.sub-menu a:hover {
    opacity: 1;
}

.sub-menu .menu-item.active a {
    opacity: 1;
}

.menu-item-has-children > a .menu-text::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--menu-item-color);
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar:hover .menu-item-has-children > a .menu-text::after {
    opacity: 1;
}

/* Main Content */
.main-content {
    margin-left: 60px;
    padding: 20px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.content-wrapper {
    position: relative;
    z-index: 2;               /* stays above the page-change swash */
    --card-pad: 40px;         /* full-bleed elements cancel this out */
    max-width: calc(100% - 100px);
    margin: 0 auto;
    background: var(--bg-content);
    padding: var(--card-pad);
    border-radius: 16px;
    box-shadow: 0 2px 10px var(--shadow-color);
    color: var(--text-primary);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 20px;
    line-height: 1.05;
    color: var(--text-heading);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 15px;
}

a {
    color: var(--text-link);
}

a:hover {
    color: #ddd;
}

.entry-meta {
    color: var(--text-meta);
}

article {
    /* No border below content */
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin: 40px 0;
}

.image-placeholder {
    background: #3a3a3a;
    aspect-ratio: 1/1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-placeholder);
    font-size: 0.9rem;
}

.image-caption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-meta);
    text-align: center;
}

/* Page Navigation */
.page-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.nav-previous,
.nav-next {
    display: flex;
    flex-direction: column;
    max-width: 45%;
}

.nav-previous {
    text-align: left;
}

.nav-next {
    text-align: right;
}

.nav-label {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 5px;
}

.nav-title {
    font-size: 1rem;
    color: var(--text-link);
    text-decoration: none;
}

.nav-title:hover {
    color: #ddd;
}

/* Responsive */
/* Desktop: sidebar permanently expanded — no hover-collapse */
@media (min-width: 769px) {
    .sidebar { width: 280px; }
    .sidebar-header { width: 280px; height: 280px; }
    .menu-text { opacity: 1; }
    .menu-icon { opacity: 0; width: 0; }
    .menu-item.active > .sub-menu { max-height: var(--sub-h, 400px); opacity: 1; }
    .menu-item-has-children > a .menu-text::after { opacity: 1; }
    /* Footer idle: logomark only, compact; only hovering the footer itself reveals contact */
    .sidebar-footer,
    .sidebar:hover .sidebar-footer { width: 280px; height: 82px; padding: 20px; transition: height 0.3s ease; }
    .sidebar-footer-logo,
    .sidebar:hover .sidebar-footer-logo { width: 30px; height: 30px; }
    .sidebar-footer-contact,
    .sidebar:hover .sidebar-footer-contact { display: none; }
    .sidebar .sidebar-footer:hover { height: 230px; }
    .sidebar .sidebar-footer:hover .sidebar-footer-contact { display: block; }
    .sidebar::after { opacity: 0; }            /* hide the "hover to expand" arrow */
    .sidebar { transition: none; }             /* no width animation, nothing to animate */
    .main-content { margin-left: 280px; }      /* content clears the wider sidebar */
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        width: 100%;
        height: 60px;
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        overflow: visible;
        background: var(--bg-primary);
        z-index: 2000;
    }
    
    .sidebar.menu-open {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        height: 100vh;
        width: 100vw;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Show header logo, hide footer by default */
    .sidebar-header {
        display: none;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: auto;
        padding: 20px 0 0;
        border-bottom: none;
        flex-shrink: 0;
    }

    .sidebar.menu-open .sidebar-header {
        display: flex;
    }

    .sidebar-footer {
        display: none;
        position: relative;
        width: 100%;
        height: auto;
        padding: 15px 10px 20px;
        margin-top: auto;
        flex-shrink: 0;
    }

    .sidebar.menu-open .sidebar-footer {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .sidebar-footer-logo,
    .sidebar.menu-open .sidebar-footer-logo {
        width: 40px;
        height: 40px;
    }

    .sidebar-footer-contact {
        display: block;
        margin-top: 10px;
    }

    .logo-placeholder,
    .sidebar.menu-open .logo-placeholder {
        width: 110px;
        height: 110px;
    }

    /* Show only arrow, hide icons */
    .menu-icon {
        display: none;
    }

    /* Arrow positioned for top bar - always visible */
    .sidebar::after {
        left: auto;
        right: 20px;
        top: 26px;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-top: 8px solid #fff;
        border-bottom: 0;
        transform: none;
        opacity: 1;
    }

    .sidebar.menu-open::after {
        transform: rotate(180deg);
        opacity: 0;
    }

    /* Menu hidden by default */
    .sidebar nav {
        display: none;
        flex: none;
        padding: 10px 0;
    }

    .sidebar.menu-open nav {
        display: block;
        margin: 0;
        width: 100%;
    }

    .sidebar-menu {
        padding: 0;
        background: transparent;
        text-align: center;
    }

    .sidebar-menu > li {
        margin: 0 0 4px 0;
    }

    .sidebar-menu a {
        padding: 9px 16px;
        justify-content: center;
        background: transparent;
        font-size: 1rem;
    }

    .sidebar-menu a:hover {
        background: transparent;
        padding-left: 16px;
    }

    .sidebar-menu .menu-text {
        opacity: 1;
    }

    /* Open menu: three centered zones — logo top, menu middle, contact bottom */
    .sidebar.menu-open {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        padding: 10px 0;
    }

    .sidebar.menu-open .sidebar-header {
        width: 100%;
        justify-content: center;
        align-items: center;
        margin: 0;
    }

    .sidebar.menu-open .sidebar-footer {
        width: 100%;
        justify-content: center;
        align-items: center;
        text-align: center;
        margin: 0;
    }

    /* Single column grid on mobile */
    .image-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        margin-left: 0;
        margin-top: 60px;
        padding: 10px !important;
    }
    
    .content-wrapper {
        --card-pad: 15px;
        padding: 15px !important;
        max-width: 100% !important;
    }
    
    article {
        padding: 0 !important;
    }
    
    .entry-content {
        padding: 0 !important;
    }
    
    h1, h2, h3, h4, h5, h6, p {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}


/* Download All Button */
/* Same pill as the per-format buttons, left aligned under its heading */
.download-all-btn {
    display: inline-block;
    margin: 0 0 12px;
    padding: 6px 16px;
    font-family: inherit;
    line-height: 1.6;         /* keeps <button> and <a> the same height */
    vertical-align: top;
    background: transparent;
    color: var(--text-meta);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-all-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--text-meta);
}

/* Individual Download Button */
.download-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 16px;
    background: transparent;
    color: var(--text-meta);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--text-meta);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    transition: all 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.wp-block-image img,
.image-placeholder {
    cursor: pointer;
    transition: opacity 0.2s ease;
}


/* Force all images in content to be square */
.entry-content img,
.wp-block-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    display: block;
    padding: 10%;
    box-sizing: border-box;
}

.wp-block-image {
    margin-bottom: 20px;
}

/* Image captions in Gutenberg */
.wp-block-image figcaption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-meta);
    text-align: center;
}

/* Transition Logo */
/* Page-change swash. One 1.7s keyframe animation, played by adding .show —
   js/main.js removes the class on animationend, so the state can't get stuck. */
.transition-logo {
    position: fixed;
    top: 50%;
    left: 50%;
    /* wider than the viewport: the artwork runs off both edges */
    width: 160vw;
    aspect-ratio: 524.63 / 314.45;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

.transition-logo.show {
    animation: swash 1.7s ease-out both;
}

.transition-logo img {
    display: block;
    width: 100%;
    height: 100%;
}

@keyframes swash {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) translate(-4vw, 2vw);
    }
    35%, 65% {
        opacity: var(--transition-logo-opacity);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translate(4vw, -2vw);
    }
}

@media (prefers-reduced-motion: reduce) {
    .transition-logo.show {
        animation: swash-still 1.7s ease-out both;
    }

    @keyframes swash-still {
        0%, 100% { opacity: 0; }
        25%, 75% { opacity: var(--transition-logo-opacity); }
    }
}

/* Content wrapper transition state */
.content-wrapper.transitioning {
    background: transparent;
    box-shadow: none;
}

/* Page fade animations */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile menu open state */
@media (max-width: 768px) {
    .sidebar.menu-open {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        height: 100vh;
        width: 100vw;
        overflow-y: auto;
    }
    
    .sidebar.menu-open .sidebar-header {
        opacity: 1;
        pointer-events: auto;
    }
    
    .sidebar.menu-open .sidebar-footer {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .sidebar.menu-open nav {
        display: block;
    }
}

/* ===== Brand asset figures ===== */
/* Transparent PNGs sit directly on the card, no tile background */
.wp-block-image.tile-light img,
.wp-block-image.tile-dark img {
    padding: 12%;
    width: 100%;
}

/* Row of per-format download buttons under an asset */
.download-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
}

.download-row .download-btn {
    margin-top: 0;
}

/* Active menu item — darker grey */
.sidebar-menu .menu-item.active > a > .menu-text {
    color: #9a9a9a;
}

/* Light content card — dark text inside */
.content-wrapper {
    color: #3a3a3a;
}

.content-wrapper h1, .content-wrapper h2, .content-wrapper h3,
.content-wrapper h4, .content-wrapper h5, .content-wrapper h6 {
    color: #3d3d3d;
    font-weight: 700;
    margin-top: 40px;
}

.content-wrapper h1 { font-size: 3rem; margin-top: 0; letter-spacing: -0.06em; }
.content-wrapper h2 { font-size: 2.2rem; letter-spacing: -0.04em; }

/* Roomier paragraphs */
.content-wrapper p,
.content-wrapper ul {
    margin-bottom: 28px;
}

.content-wrapper a {
    color: #2e2e2e;
}

.content-wrapper .wp-block-image figcaption,
.content-wrapper .image-caption {
    color: #777;
}

.content-wrapper .download-btn,
.content-wrapper .download-all-btn {
    color: #555;
    border-color: rgba(0, 0, 0, 0.25);
}

.content-wrapper .download-all-btn:hover,
.content-wrapper .download-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #2e2e2e;
    border-color: rgba(0, 0, 0, 0.4);
}

/* ===== Asset + sample split =====
   Reusable page layout: the asset on the left with its download row, a cropped
   square sample photo on the right with its label set over the image.

   <section class="asset-group">
     <button class="download-all-btn">Download all …</button>
     <div class="split">
       <figure class="wp-block-image asset-square no-lightbox">
         <img …><div class="download-row">…</div>
       </figure>
       <figure class="wp-block-image sample-photo">
         <img … style="object-position: 55% 35%;">
         <figcaption class="sample-label">Sample</figcaption>
       </figure>
     </div>
   </section>

   Both columns are square, so they stand exactly the same height; the pair
   stacks to one column once a column would drop below 340px.
   Add `no-lightbox` to any figure that should not open the lightbox.        */
.entry-content .split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 40px;
    align-items: start;
    margin: 12px 0 40px;
}

.entry-content .split .wp-block-image { margin-bottom: 0; }
.entry-content .split .download-row { margin-top: 5px; }
.entry-content .no-lightbox img { cursor: default; }

.entry-content .asset-square img {
    aspect-ratio: 1 / 1;
    padding: 6%;
}

/* A column of samples running alongside the main column, independent of it */
.entry-content .sample-stack {
    display: grid;
    gap: 40px;
    align-content: start;
}

.entry-content .sample-photo { position: relative; }

/* The last column of samples runs out to the card edge, cancelling its padding */
.entry-content .split > .sample-photo:last-child,
.entry-content .split > .sample-stack:last-child {
    margin-right: calc(-1 * var(--card-pad, 40px));
}

.entry-content .sample-photo img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    padding: 0;
    border-radius: 16px 0 0 16px;
    display: block;
}

.entry-content .sample-photo .sample-label {
    position: absolute;
    left: 24px;
    top: 18px;
    margin: 0;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

/* ===== Language switch =====
   Tiny text, top right, sitting on the dark ground beside the content card.   */
.lang-switch {
    position: fixed;
    top: 14px;
    right: 20px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    color: #6f6f6f;
}

.lang-switch button {
    background: none;
    border: 0;
    padding: 2px;
    font: inherit;
    letter-spacing: inherit;
    color: #8a8a8a;
    cursor: pointer;
    transition: color 0.2s ease;
}

.lang-switch button:hover { color: #fff; }

/* Only the language you can switch to is shown */
.lang-switch button.active,
.lang-switch span { display: none; }

@media (max-width: 768px) {
    /* sits in the mobile menu bar, top left */
    .lang-switch {
        top: 20px;
        left: 20px;
        right: auto;
        z-index: 2001;
    }
}

/* ===== Front page =====
   js/main.js puts .is-home on <body> before the transition starts, so none of
   this arrives late. No content card, and the swash is frozen where the
   page-change animation leaves it.                                          */
body.is-home .content-wrapper {
    background: transparent;
    box-shadow: none;
    color: var(--text-primary);
}

body.is-home .content-wrapper h1,
body.is-home .content-wrapper h2,
body.is-home .content-wrapper h3 { color: var(--text-heading); }

body.is-home .content-wrapper .kicker { color: #b8b8b8; }
body.is-home .content-wrapper a { color: var(--text-link); }

body.is-home .transition-logo {
    animation: none !important;
    opacity: 0.1;
    transform: translate(-50%, -50%) translate(4vw, -2vw);
}

/* ===== Prev / next footer ===== */
.content-wrapper .page-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 64px;
}

.content-wrapper .page-nav-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1 1 260px;
    padding: 18px 24px;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 16px;
    text-decoration: none;
    color: #8a8a8a;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.content-wrapper .page-nav-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.5);
    color: #5a5a5a;
}

.content-wrapper .page-nav-btn.next {
    justify-content: flex-end;
    text-align: right;
    margin-left: auto;
}

.content-wrapper .page-nav-arrow {
    font-size: 1.7rem;
    line-height: 1;
}

.content-wrapper .page-nav-label {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
}

/* Kicker line above page title */
.content-wrapper .kicker {
    font-weight: 300;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: #6a6a6a;
    margin-bottom: 12px;
}

/* Full-card image — the image IS the content card, text overlaid */
.entry-content .full-card {
    margin: 0;
    position: relative;
}

.entry-content .full-card img {
    width: 100%;
    display: block;
    aspect-ratio: auto;
    border-radius: 16px;
}

.entry-content .full-card-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 60px 40px 30px;
    border-radius: 0 0 8px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
}

.entry-content .full-card-text h1,
.entry-content .full-card-text p {
    color: #fff;
    margin: 0;
}

.entry-content .full-card-text p {
    opacity: 0.85;
}

@media (max-width: 768px) {
    .entry-content .full-card-text {
        padding: 40px 15px 15px;
    }
}

/* ===== Touch: neutralise sticky :hover =====
   Safari applies :hover after a tap and keeps it, so the desktop hover states
   would override the mobile bar. These come last, so they win.              */
@media (max-width: 768px) {
    .sidebar:hover { width: 100%; }

    .sidebar:hover .sidebar-header {
        width: 100%;
        height: auto;
        padding: 20px 0 0;
    }

    .sidebar:hover .sidebar-footer {
        width: 100%;
        height: auto;
        padding: 15px 10px 20px;
    }

    .sidebar:hover .menu-icon { display: none; }
    .sidebar:hover .menu-text { opacity: 1; }
    .sidebar:hover::after { opacity: 1; }
    .sidebar.menu-open:hover::after { opacity: 0; }

    /* Submenus follow the open menu on touch, not hover */
    .sidebar:hover .menu-item.active > .sub-menu { max-height: 0; opacity: 0; }
    .sidebar.menu-open .menu-item.active > .sub-menu {
        max-height: var(--sub-h, 400px);
        opacity: 1;
    }
}

/* ===== Phone: keep everything inside the card ===== */
@media (max-width: 768px) {
    /* grids declare min column widths wider than the screen — collapse them all */
    .entry-content .asset-grid,
    .entry-content .rule-grid,
    .entry-content .alt-grid,
    .entry-content .photo-grid,
    .entry-content .split {
        grid-template-columns: 1fr !important;
        column-count: 1;
    }

    /* nothing bleeds off the card edge on a narrow screen */
    .entry-content .split > .sample-photo:last-child,
    .entry-content .split > .sample-stack:last-child { margin-right: 0; }
    .entry-content .sample-photo img { border-radius: 8px; }

    /* open menu: logo bigger and higher, list closer, footer reachable */
    .sidebar.menu-open { justify-content: flex-start; padding: 4px 0 20px; }
    .sidebar.menu-open .sidebar-header { padding: 6px 0 0; }
    .logo-placeholder,
    .sidebar.menu-open .logo-placeholder { width: 126px; height: 126px; }
    .sidebar.menu-open nav { margin-top: 4px; }
    .sidebar.menu-open .sidebar-footer { margin-top: 16px; padding: 10px 10px 16px; }

    /* a tapped parent shows its children */
    .sidebar.menu-open .menu-item.open > .sub-menu {
        max-height: var(--sub-h, 400px);
        opacity: 1;
    }
    .sub-menu a { padding: 8px 16px; }
}

/* ===== Lightbox navigation ===== */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s ease;
}

.lightbox-nav:hover { background: rgba(0, 0, 0, 0.75); }
.lightbox-nav.prev { left: 18px; }
.lightbox-nav.next { right: 18px; }

@media (max-width: 768px) {
    /* thumb-reachable, out of the way of the image */
    .lightbox-nav { top: auto; bottom: 24px; transform: none; width: 46px; height: 46px; }
    .lightbox-nav.prev { left: 24px; }
    .lightbox-nav.next { right: 24px; }

    /* main entries read as headings, sub items clearly secondary */
    .sidebar-menu > .menu-item > a .menu-text {
        font-size: 1.25rem;
        font-weight: 700;
        letter-spacing: -0.01em;
    }
    .sub-menu .menu-text {
        font-size: 0.92rem;
        font-weight: 400;
    }
}

/* Lightbox caption — number and where the file came from */
.lightbox-caption {
    margin-top: 14px;
    text-align: center;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.85);
}

.lightbox-caption:empty { display: none; }
.lightbox-caption strong { margin-right: 8px; }
.lightbox-caption .when { opacity: 0.65; }
