/*
Theme Name: TG Editorial Portfolio
Theme URI: https://example.com/
Author: OpenAI for Travis Gagnon
Description: Minimal editorial photography theme with a restrained commercial-photo navigation system and an image-first masonry portfolio. Built as original WordPress code inspired by the visual direction of the supplied reference sites.
Version: 1.8.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tg-editorial-portfolio
*/

:root {
    --tgp-bg: #ffffff;
    --tgp-fg: #111111;
    --tgp-muted: #6b6b6b;
    --tgp-line: #dedede;
    --tgp-accent: #111111;
    --tgp-content: 1500px;
    --tgp-text: 760px;
    --tgp-gutter: clamp(18px, 3vw, 48px);
    --tgp-header-h: 92px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--tgp-bg);
    color: var(--tgp-fg);
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
body.nav-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--tgp-accent); }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea, select { font: inherit; }

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

.site-header {
    position: relative;
    z-index: 100;
    width: 100%;
    background: rgba(255,255,255,.94);
    border-bottom: 1px solid transparent;
}
.site-header.is-sticky {
    position: sticky;
    top: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.site-header.is-scrolled { border-bottom-color: var(--tgp-line); }
.header-inner {
    min-height: var(--tgp-header-h);
    max-width: var(--tgp-content);
    margin: 0 auto;
    padding: 0 var(--tgp-gutter);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(14px, 1.8vw, 26px);
}
.site-branding {
    flex: 0 0 auto;
    transition: opacity .18s ease, transform .18s ease;
}
.custom-logo-link { display: inline-flex; align-items: center; }
.custom-logo { max-height: 48px; width: auto; }
.site-title {
    margin: 0;
    font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
    font-size: clamp(21px, 2vw, 29px);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1;
}

.menu-toggle {
    position: relative;
    z-index: 103;
    display: block;
    flex: 0 0 30px;
    width: 30px;
    height: 34px;
    padding: 6px 0;
    border: 0;
    background: transparent;
    color: #9a9a9a;
    cursor: pointer;
}
.menu-toggle-line {
    position: absolute;
    left: 0;
    display: block;
    width: 25px;
    height: 1px;
    background: currentColor;
    transform-origin: center;
    transition: top .2s ease, transform .2s ease, opacity .15s ease;
}
.menu-toggle-line:nth-child(1) { top: 9px; }
.menu-toggle-line:nth-child(2) { top: 16px; }
.menu-toggle-line:nth-child(3) { top: 23px; }
.nav-open .menu-toggle-line:nth-child(1) { top: 16px; transform: rotate(45deg); }
.nav-open .menu-toggle-line:nth-child(2) { opacity: 0; }
.nav-open .menu-toggle-line:nth-child(3) { top: 16px; transform: rotate(-45deg); }

.primary-navigation {
    min-width: 0;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    white-space: nowrap;
    transform: translateX(-8px);
    transition: max-width .32s ease, opacity .18s ease, transform .25s ease;
}
.nav-open .primary-navigation {
    max-width: min(1000px, calc(100vw - 110px));
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}
.nav-open .site-branding {
    display: none;
}
.primary-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: clamp(15px, 1.8vw, 30px);
}
.primary-navigation li { position: relative; }
.primary-navigation a {
    display: inline-block;
    padding: 7px 0;
    color: #111;
    font-family: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
    font-size: clamp(16px, 1.65vw, 23px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.02em;
}
.primary-navigation a:hover,
.primary-navigation .current-menu-item > a,
.primary-navigation .current-menu-ancestor > a {
    color: var(--tgp-muted);
}

.site-main { min-height: 60vh; }
.content-shell {
    width: min(var(--tgp-content), 100%);
    margin: 0 auto;
    padding: clamp(56px, 8vw, 120px) var(--tgp-gutter);
}
.narrow-shell { max-width: calc(var(--tgp-text) + (var(--tgp-gutter) * 2)); }

.entry-header,
.portfolio-intro {
    max-width: var(--tgp-text);
    margin-bottom: clamp(40px, 6vw, 86px);
}
.eyebrow,
.entry-kicker {
    margin: 0 0 16px;
    color: var(--tgp-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
}
h1, h2, h3, h4 { line-height: 1.1; font-weight: 450; }
.entry-title,
.portfolio-title {
    margin: 0;
    font-size: clamp(42px, 6.2vw, 92px);
    letter-spacing: -.035em;
}
.portfolio-description,
.entry-summary {
    margin-top: 24px;
    max-width: 700px;
    font-size: clamp(17px, 1.5vw, 21px);
    line-height: 1.55;
}
.entry-content { max-width: var(--tgp-text); }
.entry-content > *:first-child { margin-top: 0; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content h2 { margin-top: 2.2em; font-size: clamp(30px, 4vw, 50px); }
.entry-content h3 { margin-top: 2em; font-size: clamp(24px, 3vw, 34px); }

/* Portfolio gallery: natural image ratios, image-first and lightly spaced. */
.tgp-gallery {
    width: 100%;
    columns: var(--tgp-columns, 2);
    column-gap: clamp(8px, 1.2vw, 18px);
}
.tgp-gallery-item {
    position: relative;
    break-inside: avoid;
    margin: 0 0 clamp(8px, 1.2vw, 18px);
    overflow: hidden;
    background: #f1f1f1;
}
.tgp-gallery-link { display: block; cursor: zoom-in; }
.tgp-gallery img {
    width: 100%;
    height: auto;
    transition: transform .35s ease, opacity .35s ease;
}
.tgp-gallery-link:hover img { transform: scale(1.008); opacity: .94; }
.tgp-gallery-caption {
    margin: 7px 2px 0;
    color: var(--tgp-muted);
    font-size: 11px;
    line-height: 1.4;
}

.portfolio-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: clamp(26px, 4vw, 70px) clamp(14px, 2vw, 30px);
}
.portfolio-card-image { aspect-ratio: 4 / 3; overflow: hidden; background:#efefef; }
.portfolio-card-image img { width:100%; height:100%; object-fit:cover; transition: transform .35s ease; }
.portfolio-card:hover img { transform: scale(1.015); }
.portfolio-card-title { margin: 15px 0 0; font-size: 18px; font-weight: 450; }
.portfolio-card-excerpt { margin: 7px 0 0; color: var(--tgp-muted); font-size: 13px; }

/* Fullscreen lightbox */
.tgp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10,10,10,.96);
    color: white;
}
.tgp-lightbox.is-open { display: flex; }
.tgp-lightbox-stage {
    width: min(94vw, 1800px);
    height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tgp-lightbox-image { max-width: 100%; max-height: 92vh; width:auto; height:auto; object-fit:contain; }
.tgp-lightbox-close,
.tgp-lightbox-prev,
.tgp-lightbox-next {
    position: absolute;
    border: 0;
    background: rgba(0,0,0,.22);
    color: #fff;
    cursor: pointer;
    line-height: 1;
}
.tgp-lightbox-close { top: 20px; right: 24px; width:44px; height:44px; font-size:29px; }
.tgp-lightbox-prev,
.tgp-lightbox-next { top:50%; transform:translateY(-50%); width:50px; height:70px; font-size:34px; }
.tgp-lightbox-prev { left: 12px; }
.tgp-lightbox-next { right: 12px; }
.tgp-lightbox-counter { position:absolute; left:24px; bottom:18px; font-size:11px; letter-spacing:.14em; }

.site-footer {
    margin-top: clamp(60px, 9vw, 140px);
    border-top: 1px solid var(--tgp-line);
}
.footer-inner {
    max-width: var(--tgp-content);
    margin: 0 auto;
    padding: 38px var(--tgp-gutter) 46px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 28px;
    color: var(--tgp-muted);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.footer-navigation ul { list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:18px; }
.footer-navigation a:hover { color:var(--tgp-fg); }

.pagination { margin-top: 60px; display:flex; gap:10px; }
.pagination .page-numbers { border:1px solid var(--tgp-line); padding:8px 12px; font-size:12px; }
.pagination .current { background:var(--tgp-fg); color:#fff; border-color:var(--tgp-fg); }

/* Homepage: introduction first, then an uninterrupted selected portfolio. */
.home-shell { padding-top: clamp(44px, 6vw, 92px); }
.home-intro { margin-bottom: clamp(48px, 7vw, 105px); }
.home-intro-content { max-width: 980px; }
.home-intro-content > p:first-child {
    margin-top: 0;
    font-size: clamp(25px, 3.1vw, 48px);
    line-height: 1.2;
    letter-spacing: -.025em;
}
.home-portfolio { scroll-margin-top: calc(var(--tgp-header-h) + 18px); }
.tgp-embedded-portfolio { width: 100%; }
.tgp-embedded-portfolio-header {
    max-width: var(--tgp-text);
    margin-bottom: clamp(32px, 5vw, 64px);
}
.tgp-embedded-portfolio-title {
    margin: 0;
    font-size: clamp(32px, 4vw, 58px);
    letter-spacing: -.03em;
}
.tgp-embedded-portfolio-intro { margin-top: 20px; }

@media (max-width: 900px) {
    :root { --tgp-header-h: 74px; }
    .custom-logo { max-height: 42px; }
    .primary-navigation a { font-size: 17px; }
    .primary-navigation ul { gap: 16px; }
    .tgp-gallery { --tgp-columns: 2; }
}

@media (max-width: 680px) {
    .home .site-header.is-past-hero .header-inner { min-height: 48px; }
    .site-header { background: rgba(255,255,255,.98); }
    .header-inner { gap: 14px; }
    .custom-logo { max-height: 38px; }
    .site-title { font-size: 21px; }
    .nav-open .site-branding { display: none; }
    .primary-navigation {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        max-width: none;
        padding: 0 var(--tgp-gutter);
        background: rgba(255,255,255,.98);
        border-bottom: 1px solid var(--tgp-line);
        opacity: 0;
        visibility: hidden;
        overflow: visible;
        pointer-events: none;
        transform: translateY(-5px);
        transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    }
    .nav-open .primary-navigation {
        max-width: none;
        padding-top: 8px;
        padding-bottom: 18px;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }
    .primary-navigation ul {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 18px;
    }
    .primary-navigation a { font-size: 18px; padding: 7px 0; }
    .content-shell { padding-top: 42px; }
    .home-shell { padding-top: 36px; }
    .home-intro { margin-bottom: 46px; }
    .home-intro-content > p:first-child { font-size: clamp(24px, 7vw, 34px); }
    .entry-title, .portfolio-title { font-size: clamp(38px, 13vw, 62px); }
    .tgp-gallery { --tgp-columns: 1 !important; column-gap: 0; }
    .tgp-gallery-item { margin-bottom: 10px; }
    .portfolio-list { grid-template-columns: 1fr; }
    .footer-inner { display: block; }
    .footer-navigation { margin-top: 18px; }
    .tgp-lightbox-prev, .tgp-lightbox-next { width: 42px; height: 60px; }
}

/* --------------------------------------------------------------------------
   Homepage hero treatment (v1.6)
   Full-viewport translucent veil + white copy. Header/menu floats over image.
   -------------------------------------------------------------------------- */
.home .site-main { min-height: 0; }

/* The homepage header must be visually absent while it overlays the hero. */
.home .site-header,
.home .site-header.is-sticky,
.home .site-header:not(.is-past-hero),
.home .site-header:not(.is-past-hero) .header-inner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    box-shadow: none !important;
    filter: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}
.home .site-header .header-inner {
    max-width: none;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    filter: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

/* Text title rather than custom logo, like the supplied minimal reference. */
.home .site-title,
.home .site-title a,
.home .menu-toggle,
.home .primary-navigation a {
    color: #fff !important;
    text-shadow: 0 1px 7px rgba(0,0,0,.32);
}
.home .site-title {
    font-size: clamp(20px, 2vw, 28px);
    font-weight: 700;
}
.home .menu-toggle-line { background: currentColor; }

/* After the hero, restore a compact white header and black controls. */
.home .site-header.is-past-hero {
    background: rgba(255,255,255,.96) !important;
    border-bottom: 1px solid rgba(0,0,0,.08) !important;
}
.home .site-header.is-past-hero .header-inner {
    min-height: 52px;
}
.home .site-header.is-past-hero .site-title,
.home .site-header.is-past-hero .site-title a,
.home .site-header.is-past-hero .menu-toggle,
.home .site-header.is-past-hero .primary-navigation a {
    color: #111 !important;
    text-shadow: none;
}

.home-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    min-height: 620px;
    overflow: hidden;
    background: #111;
}
.home-hero-media,
.home-hero-shade {
    position: absolute;
    inset: 0;
}
.home-hero-media img,
.home-hero-image {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center center;
}
/* No separate blur/white panel. Keep only a very subtle photographic vignette. */
.home-hero-shade {
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.02) 30%, rgba(0,0,0,.08));
}

/* This is the ONE overlay. It covers the entire browser viewport and fades
   away with the copy as soon as the visitor scrolls. */
.home-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    color: #fff;
    background: rgba(0,0,0,.40);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    filter: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    opacity: 1;
    transform: translate3d(0,0,0);
    will-change: opacity, transform;
    pointer-events: auto;
}
.home-hero-copy-wrap {
    width: min(680px, 47vw);
    margin: 0;
    padding: calc(var(--tgp-header-h) + clamp(34px, 5vh, 70px)) 0 40px clamp(34px, 7vw, 120px);
    color: #fff;
}
.home-hero-copy,
.home-hero-copy * {
    color: #fff !important;
}
.home-hero-copy {
    max-width: 620px;
    font-size: clamp(17px, 1.45vw, 23px);
    line-height: 1.48;
    letter-spacing: -.012em;
}
.home-hero-copy > *:first-child { margin-top: 0; }
.home-hero-copy > *:last-child { margin-bottom: 0; }
.home-hero-copy p { margin: 0 0 1.25em; }
.home-hero-copy h1,
.home-hero-copy h2,
.home-hero-copy h3 {
    margin: 0 0 .75em;
    line-height: 1.08;
    letter-spacing: -.03em;
}
.home-hero-copy h1 { font-size: clamp(34px, 4.2vw, 68px); }
.home-hero-copy h2 { font-size: clamp(30px, 3.4vw, 54px); }
.home-hero-copy h3 { font-size: clamp(20px, 2vw, 30px); }
.home-hero-copy a {
    color: #fff !important;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .18em;
}

/* WordPress blocks can carry their own white backgrounds/padding. Inside the
   hero those presentation styles are deliberately neutralized. */
.home-hero-copy .has-background,
.home-hero-copy .wp-block-group,
.home-hero-copy .wp-block-columns,
.home-hero-copy .wp-block-column,
.home-hero-copy .wp-block-cover,
.home-hero-copy .wp-block-media-text,
.home-hero-copy [style*="background"],
.home-hero-copy [class*="has-background"] {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}
.home-hero-copy .wp-block-group,
.home-hero-copy .wp-block-columns,
.home-hero-copy .wp-block-column,
.home-hero-copy .wp-block-media-text {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.home-hero-kicker {
    margin: 0 0 12px;
    color: #fff;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .2em;
    text-transform: uppercase;
}
.home-hero-title {
    margin: 0;
    color: #fff;
    font-size: clamp(42px, 7vw, 104px);
    letter-spacing: -.045em;
}
.home-scroll-cue {
    position: relative;
    z-index: 6;
    width: 40px;
    height: 40px;
    margin-top: 22px;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(0,0,0,.20);
    border: 1px solid rgba(255,255,255,.65);
    border-radius: 999px;
    font-size: 18px;
    transition: background .2s ease, transform .2s ease;
}
.home-scroll-cue:hover {
    color: #fff;
    background: rgba(0,0,0,.40);
    transform: translateY(2px);
}

/* Make the opened navigation unambiguous and independent of the page copy. */
.home.nav-open .primary-navigation {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    overflow: visible;
}
.home:not(.is-past-hero) .primary-navigation,
.home .site-header:not(.is-past-hero) .primary-navigation {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

.home-portfolio-full {
    width: 100%;
    padding: clamp(8px, 1vw, 16px) var(--tgp-gutter) 0;
    scroll-margin-top: var(--tgp-header-h);
}
.home-portfolio-full .tgp-gallery {
    max-width: var(--tgp-content);
    margin: 0 auto;
}
.home-shell-no-hero { padding-top: calc(var(--tgp-header-h) + 50px); }

@media (max-width: 680px) {
    .home-hero { min-height: 560px; }
    .home-hero-overlay {
        inset: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,.44);
    }
    .home-hero-copy-wrap {
        width: 100%;
        max-width: 560px;
        padding: calc(var(--tgp-header-h) + 34px) 24px 34px;
    }
    .home-hero-copy {
        font-size: clamp(17px, 4.7vw, 22px);
    }
    .home .primary-navigation {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 10px var(--tgp-gutter) 18px;
        background: rgba(0,0,0,.72) !important;
        border: 0 !important;
    }
    .home .site-header.is-past-hero .primary-navigation {
        background: rgba(255,255,255,.98) !important;
    }
    .home .primary-navigation ul {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 18px;
    }
    .home .primary-navigation a { color: #fff !important; }
    .home .site-header.is-past-hero .primary-navigation a { color: #111 !important; }
    .home .site-header.is-past-hero .header-inner { min-height: 48px; }
    .home-scroll-cue { right: auto; bottom: auto; }
    .home-portfolio-full { padding-left: 0; padding-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .home-hero-overlay { will-change: auto; }
}

/* --------------------------------------------------------------------------
   Portfolio detail pages (v1.7)
   Every individual portfolio uses the same full-screen hero language as home.
   -------------------------------------------------------------------------- */
.single-tgp_portfolio .site-main { min-height: 0; }

.single-tgp_portfolio .site-header,
.single-tgp_portfolio .site-header.is-sticky,
.single-tgp_portfolio .site-header:not(.is-past-hero),
.single-tgp_portfolio .site-header:not(.is-past-hero) .header-inner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    box-shadow: none !important;
    filter: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}
.single-tgp_portfolio .site-header .header-inner {
    max-width: none;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    filter: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}
.single-tgp_portfolio .site-title,
.single-tgp_portfolio .site-title a,
.single-tgp_portfolio .menu-toggle,
.single-tgp_portfolio .primary-navigation a {
    color: #fff !important;
    text-shadow: 0 1px 7px rgba(0,0,0,.32);
}
.single-tgp_portfolio .site-title {
    font-size: clamp(20px, 2vw, 28px);
    font-weight: 700;
}
.single-tgp_portfolio .menu-toggle-line { background: currentColor; }

.single-tgp_portfolio .site-header.is-past-hero {
    background: rgba(255,255,255,.96) !important;
    border-bottom: 1px solid rgba(0,0,0,.08) !important;
}
.single-tgp_portfolio .site-header.is-past-hero .header-inner { min-height: 52px; }
.single-tgp_portfolio .site-header.is-past-hero .site-title,
.single-tgp_portfolio .site-header.is-past-hero .site-title a,
.single-tgp_portfolio .site-header.is-past-hero .menu-toggle,
.single-tgp_portfolio .site-header.is-past-hero .primary-navigation a {
    color: #111 !important;
    text-shadow: none;
}

.single-tgp_portfolio.nav-open .primary-navigation {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    overflow: visible;
}
.single-tgp_portfolio:not(.is-past-hero) .primary-navigation,
.single-tgp_portfolio .site-header:not(.is-past-hero) .primary-navigation {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

.portfolio-page-gallery {
    width: 100%;
    padding: clamp(8px, 1vw, 16px) var(--tgp-gutter) 0;
    scroll-margin-top: var(--tgp-header-h);
}
.portfolio-page-gallery .tgp-gallery {
    max-width: var(--tgp-content);
    margin: 0 auto;
}
.portfolio-hero-copy > h1:first-child {
    margin-top: 0;
}

@media (max-width: 680px) {
    .single-tgp_portfolio .primary-navigation {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 10px var(--tgp-gutter) 18px;
        background: rgba(0,0,0,.72) !important;
        border: 0 !important;
    }
    .single-tgp_portfolio .site-header.is-past-hero .primary-navigation {
        background: rgba(255,255,255,.98) !important;
    }
    .single-tgp_portfolio .primary-navigation ul {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 18px;
    }
    .single-tgp_portfolio .primary-navigation a { color: #fff !important; }
    .single-tgp_portfolio .site-header.is-past-hero .primary-navigation a { color: #111 !important; }
    .single-tgp_portfolio .site-header.is-past-hero .header-inner { min-height: 48px; }
    .portfolio-page-gallery { padding-left: 0; padding-right: 0; }
}


/* --------------------------------------------------------------------------
   Primary navigation dropdowns (v1.8)
   WordPress child menu items appear beneath their parent on desktop hover
   or keyboard focus. A separate toggle makes them usable on touch screens
   while retaining the parent's normal archive link.
   -------------------------------------------------------------------------- */
.nav-open .primary-navigation { overflow: visible; }
.primary-navigation .sub-menu {
    display: none;
    position: absolute;
    z-index: 150;
    top: 100%;
    left: 0;
    min-width: 170px;
    max-width: min(320px, calc(100vw - 36px));
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 6px 0;
    white-space: normal;
    background: rgba(255,255,255,.98);
    box-shadow: 0 10px 24px rgba(0,0,0,.12);
}
.primary-navigation .sub-menu li { width: 100%; }
.primary-navigation .sub-menu a {
    display: block;
    padding: 9px 15px;
    font-size: clamp(14px, 1.15vw, 17px);
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: 0;
    white-space: normal;
}
/* Over a photographic hero, keep the light-weight, unboxed look illustrated
   by the existing menu design. The compact post-hero header stays white. */
.home .site-header:not(.is-past-hero) .primary-navigation .sub-menu,
.single-tgp_portfolio .site-header:not(.is-past-hero) .primary-navigation .sub-menu {
    min-width: 165px;
    padding: 4px 0 8px;
    background: transparent;
    box-shadow: none;
}
.home .site-header:not(.is-past-hero) .primary-navigation .sub-menu a,
.single-tgp_portfolio .site-header:not(.is-past-hero) .primary-navigation .sub-menu a {
    padding: 5px 0;
}

@media (min-width: 681px) {
    .nav-open .primary-navigation .menu-item-has-children:hover > .sub-menu,
    .nav-open .primary-navigation .menu-item-has-children:focus-within > .sub-menu,
    .nav-open .primary-navigation .menu-item-has-children.is-submenu-open > .sub-menu {
        display: flex;
    }
}

/* JavaScript adds a separate toggle for each menu item with child links.
   It is hidden on pointer-based desktops where hover and focus suffice. */
.primary-navigation .submenu-toggle {
    display: none;
    padding: 6px 8px;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    vertical-align: middle;
}
.primary-navigation .submenu-toggle .submenu-chevron {
    display: inline-block;
    transition: transform .2s ease;
}
.primary-navigation .is-submenu-open > .submenu-toggle .submenu-chevron {
    transform: rotate(180deg);
}
@media (hover: none) and (min-width: 681px) {
    .primary-navigation .submenu-toggle { display: inline-flex; }
    .home .site-header:not(.is-past-hero) .primary-navigation .submenu-toggle,
    .single-tgp_portfolio .site-header:not(.is-past-hero) .primary-navigation .submenu-toggle {
        color: #fff;
    }
    .primary-navigation .menu-item-has-children.is-submenu-open > .sub-menu { display: flex; }
}

@media (max-width: 680px) {
    .primary-navigation > ul,
    .home .primary-navigation > ul,
    .single-tgp_portfolio .primary-navigation > ul {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 0;
    }
    .primary-navigation > ul > li {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
    }
    .primary-navigation .submenu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: 10px;
    }
    .home .primary-navigation .submenu-toggle,
    .single-tgp_portfolio .primary-navigation .submenu-toggle {
        color: #fff;
    }
    .home .site-header.is-past-hero .primary-navigation .submenu-toggle,
    .single-tgp_portfolio .site-header.is-past-hero .primary-navigation .submenu-toggle {
        color: #111;
    }
    .primary-navigation .sub-menu,
    .home .site-header:not(.is-past-hero) .primary-navigation .sub-menu,
    .single-tgp_portfolio .site-header:not(.is-past-hero) .primary-navigation .sub-menu {
        position: static;
        width: 100%;
        max-width: none;
        min-width: 0;
        flex-basis: 100%;
        margin: 0;
        padding: 0 0 10px 18px;
        background: transparent;
        box-shadow: none;
    }
    .primary-navigation .sub-menu a,
    .home .site-header:not(.is-past-hero) .primary-navigation .sub-menu a,
    .single-tgp_portfolio .site-header:not(.is-past-hero) .primary-navigation .sub-menu a {
        padding: 7px 0;
        font-size: 16px;
        font-weight: 400;
    }
    .home .primary-navigation .sub-menu,
    .single-tgp_portfolio .primary-navigation .sub-menu {
        display: none;
    }
    .primary-navigation .menu-item-has-children.is-submenu-open > .sub-menu,
    .home .primary-navigation .menu-item-has-children.is-submenu-open > .sub-menu,
    .single-tgp_portfolio .primary-navigation .menu-item-has-children.is-submenu-open > .sub-menu {
        display: flex;
    }
    /* Long menus remain scrollable instead of spilling below the screen. */
    .nav-open .primary-navigation,
    .home.nav-open .primary-navigation,
    .single-tgp_portfolio.nav-open .primary-navigation {
        max-height: calc(100svh - 60px);
        overflow-x: hidden;
        overflow-y: auto;
    }
}
