/*
Theme Name: District Frame
Theme URI: https://districtframe.com
Author: DistrictFrame Studio
Description: Editorial production-studio WordPress theme. Cream and near-black surfaces, serif display type, restrained motion.
Version: 3.0
*/

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
    /* Surfaces */
    --df-bg-light:   #f1eee7;
    --df-bg-dark:    #0e0e0e;
    --df-bg-card:    #161616;

    /* Text */
    --df-ink:         #171717;
    --df-ink-muted:   #6e6a62;
    --df-paper:       #f1eee7;
    --df-paper-muted: #9b9890;

    /* Lines */
    --df-hairline:      rgba(23, 23, 23, 0.14);
    --df-hairline-dark: rgba(241, 238, 231, 0.16);

    /* Type */
    --df-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
    --df-sans:  'Segoe UI', system-ui, -apple-system, sans-serif;

    /* Motion */
    --df-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
    --df-reveal-dur: 0.7s;

    /* Layout */
    --df-nav-h: 72px;
    --df-gutter: clamp(20px, 4vw, 48px);

    /* Legacy aliases - old per-template CSS reads these until every
       template is rebuilt. Mapped onto the new palette so interim
       pages stay legible, then removable. */
    --df-brand:        #9b9890;
    --df-brand-dim:    rgba(155, 152, 144, 0.6);
    --df-brand-faint:  rgba(155, 152, 144, 0.08);
    --df-bg-deep:      #0e0e0e;
    --df-bg-section:   #121212;
    --df-bg-surface:   #161616;
    --df-bg-nav:       rgba(14, 14, 14, 0.9);
    --df-bg-nav-solid: rgba(14, 14, 14, 0.97);
    --df-text:         #f1eee7;
    --df-text-muted:   #9b9890;
    --df-text-light:   #c9c6be;
    --df-border:       rgba(241, 238, 231, 0.12);
    --df-glass:        rgba(22, 22, 22, 0.4);
    --df-glass-strong: rgba(10, 10, 10, 0.6);
    --df-line:         rgba(241, 238, 231, 0.14);
    --df-red-line:     rgba(241, 238, 231, 0.2);
    --df-red-glow:     none;
    --df-card-shadow:  0 24px 74px rgba(0, 0, 0, 0.34);
    --df-radius:       0px;
    --df-font:         var(--df-sans);
    --color-brand:        var(--df-brand);
    --color-dark-bg:      var(--df-bg-deep);
    --color-dark-surface: var(--df-bg-surface);
    --color-text-primary: var(--df-text);
    --color-text-muted:   var(--df-text-muted);
}

/* ============================================================
   2. BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html {
    overflow-x: hidden;
    overflow-y: scroll;
}
body {
    margin: 0;
    background: var(--df-bg-light);
    color: var(--df-ink);
    font-family: var(--df-sans);
    font-size: 16px;
    line-height: 1.7;
    overflow-x: clip;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

h1, h2, h3 {
    font-family: var(--df-serif);
    font-optical-sizing: auto;
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.01em;
    margin: 0;
}

/* Global reduced-motion reset intentionally DISABLED 2026-07-05 (owner: play
   animations for everyone; many users have OS reduced-motion enabled without
   knowing it, which was silently suppressing the site's animations). Restore
   to respect the setting again:
   @media (prefers-reduced-motion: reduce) {
       *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
       html { scroll-behavior: auto; }
   } */

/* ============================================================
   3. TYPE UTILITIES
   ============================================================ */
.df-display {
    font-size: clamp(44px, 7vw, 92px);
    line-height: 1.04;
}
.df-title {
    font-size: clamp(30px, 4.5vw, 54px);
}
.df-label {
    font-family: var(--df-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.df-lede {
    font-size: 17px;
    line-height: 1.75;
    color: var(--df-ink-muted);
}
.df-dark .df-lede { color: var(--df-paper-muted); }

/* ============================================================
   4. SURFACES + LAYOUT UTILITIES
   ============================================================ */
.df-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 var(--df-gutter);
}
.df-dark {
    background: var(--df-bg-dark);
    color: var(--df-paper);
}
.df-hairline-top    { border-top: 1px solid var(--df-hairline); }
.df-hairline-bottom { border-bottom: 1px solid var(--df-hairline); }
.df-dark .df-hairline-top    { border-top-color: var(--df-hairline-dark); }
.df-dark .df-hairline-bottom { border-bottom-color: var(--df-hairline-dark); }

/* ============================================================
   5. BUTTONS + LINKS
   ============================================================ */
.df-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 36px;
    background: var(--df-ink);
    color: var(--df-paper) !important;
    font-family: var(--df-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    border: 1px solid var(--df-ink);
    border-radius: 0;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
    text-decoration: none;
}
/* Hover keeps the same polarity (filled, readable) so the label can
   never vanish against a mismatched surface behind the button. */
.df-btn:hover {
    background: #3a3833;
    border-color: #3a3833;
    color: var(--df-paper) !important;
}
.df-btn--ghost {
    background: transparent;
    color: var(--df-ink) !important;
}
.df-btn--ghost:hover {
    background: var(--df-ink);
    border-color: var(--df-ink);
    color: var(--df-paper) !important;
}
.df-dark .df-btn,
.df-btn--inverse {
    background: var(--df-paper);
    color: var(--df-ink) !important;
    border-color: var(--df-paper);
}
.df-dark .df-btn:hover,
.df-btn--inverse:hover {
    background: #d8d4c9;
    border-color: #d8d4c9;
    color: var(--df-ink) !important;
}

/* Arrow text link: "VIEW ALL PROJECTS ->" */
.df-link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--df-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: inherit;
    padding: 4px 0;
    border-bottom: 1px solid currentColor;
    transition: opacity 0.25s ease;
}
.df-link-arrow .df-arrow {
    display: inline-block;
    transition: transform 0.3s var(--df-ease);
}
.df-link-arrow:hover .df-arrow,
.df-link-arrow:focus-visible .df-arrow {
    transform: translateX(4px);
}
.df-link-arrow--back .df-arrow {
    transform: none;
}
.df-link-arrow--back:hover .df-arrow,
.df-link-arrow--back:focus-visible .df-arrow {
    transform: translateX(-4px);
}

/* ============================================================
   6. ICONS + VIDEO TOGGLE STATES
   ============================================================ */
.df-icon {
    display: block;
    width: 1em;
    height: 1em;
    color: currentColor;
    flex: 0 0 auto;
    pointer-events: none;
}
.df-icon-pause { display: none; }

.df-video-play,
.df-project-play {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    padding: 0;
    line-height: 0;
    text-decoration: none;
}
.df-video-play > span,
.df-project-play > span {
    display: grid;
    grid-area: 1 / 1;
    place-items: center;
    width: 100%;
    height: 100%;
    line-height: 0;
}
.df-video-play .df-icon-play,
.df-project-play .df-icon-play { display: grid; }
.df-video-play .df-icon-pause,
.df-project-play .df-icon-pause { display: none; }
.is-playing .df-video-play .df-icon-play,
.is-playing > .df-project-play .df-icon-play,
.is-playing .df-project-play .df-icon-play { display: none; }
.is-playing .df-video-play .df-icon-pause,
.is-playing > .df-project-play .df-icon-pause,
.is-playing .df-project-play .df-icon-pause { display: grid; }
.df-video-play .df-icon-play,
.df-project-play .df-icon-play { transform: translateX(1px); }

/* ============================================================
   7. NAV
   ============================================================ */
.df-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: transparent;
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border-bottom: 1px solid transparent;
}
.df-nav-inner {
    max-width: 1400px;
    height: var(--df-nav-h);
    margin: 0 auto;
    padding: 0 var(--df-gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.df-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--df-sans);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.1;
}
/* Scope to nav so the rule catches the logo no matter how WP wraps it */
.df-nav .df-logo,
.df-nav .custom-logo-link {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    max-height: 52px;
}
.df-nav img,
.df-nav .custom-logo,
.df-nav .custom-logo-link img,
.df-logo img {
    max-height: 40px !important;
    max-width: 170px !important;
    height: auto !important;
    width: auto !important;
    object-fit: contain;
}
.df-logo-text { line-height: 1.1; }

.df-nav-links {
    display: flex;
    gap: 34px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.df-nav-links li { margin: 0; }
.df-nav-links a {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    position: relative;
    padding: 6px 0;
    transition: opacity 0.25s ease;
    cursor: pointer;
}
.df-nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 1px;
    background: currentColor;
    transition: width 0.3s var(--df-ease);
}
.df-nav-links a:hover::after,
.df-nav-links .current-menu-item > a::after,
.df-nav-links .current_page_item > a::after,
.df-nav-links .current-menu-ancestor > a::after { width: 100%; }

/* Surface variants - set per template via body class */
body.df-nav-on-light .df-nav { color: var(--df-ink); }
/* The client logo file is white-on-transparent (from the old dark
   site). Invert it on light surfaces; never edit the logo file. */
body.df-nav-on-light .df-nav .custom-logo,
body.df-nav-on-light .df-nav .df-logo img {
    filter: invert(1) contrast(1.05);
}
body.df-nav-on-light .df-nav.scrolled {
    background: rgba(241, 238, 231, 0.94);
    border-bottom-color: var(--df-hairline);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
body.df-nav-on-dark .df-nav { color: var(--df-paper); }
body.df-nav-on-dark .df-nav.scrolled {
    background: rgba(14, 14, 14, 0.92);
    border-bottom-color: var(--df-hairline-dark);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Hamburger */
.df-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: inherit;
}
.df-hamburger span {
    display: block;
    width: 24px; height: 1px;
    background: currentColor;
    margin: 6px 0;
    transition: all 0.3s;
}

/* Mobile drawer - hidden by default, no matter what */
.df-mobile-menu,
#mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    width: 80%;
    max-width: 340px;
    height: 100vh;
    background: var(--df-bg-dark);
    color: var(--df-paper);
    z-index: 200;
    transform: translateX(110%);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s var(--df-ease), opacity 0.3s, visibility 0s linear 0.4s;
    padding: 88px 36px 36px;
    border-left: 1px solid var(--df-hairline-dark);
}
.df-mobile-menu.is-open,
#mobile-menu.is-open {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: transform 0.4s var(--df-ease), opacity 0.3s, visibility 0s;
}
.df-mobile-close {
    position: absolute;
    top: 20px; right: 24px;
    background: none;
    border: none;
    color: var(--df-paper);
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}
.df-mobile-links {
    list-style: none;
    padding: 0; margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.df-mobile-links li {
    border-bottom: 1px solid var(--df-hairline-dark);
}
.df-mobile-links a {
    display: block;
    padding: 16px 0;
    color: var(--df-paper);
    font-family: var(--df-serif);
    font-size: 26px;
    line-height: 1.2;
}
.df-mobile-links a:hover { color: var(--df-paper-muted); }

@media (max-width: 1040px) {
    .df-nav-links { gap: 22px; }
}
@media (max-width: 900px) {
    .df-nav-links { display: none; }
    .df-hamburger { display: block; }
}
/* The drawer is a mobile-only construct (hamburger only shows <=900px). Hard
   off on desktop so a stray .is-open - e.g. opened in a narrow window that is
   then widened - can never paint over the page. JS also closes it on resize. */
@media (min-width: 901px) {
    .df-mobile-menu,
    #mobile-menu { display: none !important; }
}

/* ============================================================
   8. MAIN + SHARED PAGE HERO
   ============================================================ */
.df-main {
    min-height: 100vh;
}

/* Light editorial page hero (About / Services / Contact / Portfolio) */
.df-page-hero {
    padding: calc(var(--df-nav-h) + clamp(56px, 9vw, 120px)) 0 clamp(40px, 6vw, 80px);
}
.df-page-kicker {
    display: block;
    margin: 0 0 22px;
    color: var(--df-ink-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.df-page-hero h1 {
    font-size: clamp(44px, 7vw, 92px);
    line-height: 1.04;
    max-width: 14em;
    text-wrap: balance;
}
.df-page-hero p {
    max-width: 540px;
    margin: 28px 0 0;
    color: var(--df-ink-muted);
    font-size: 16px;
    line-height: 1.75;
}

/* Hero with a media column (df_hero 'media_img' arg) */
.df-page-hero-grid {
    display: grid;
    grid-template-columns: minmax(300px, 6fr) 5fr;
    gap: clamp(36px, 6vw, 96px);
    align-items: center;
}
.df-page-hero-media {
    line-height: 0;
}
.df-page-hero-media img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: 50% 22%;
}
/* Click-to-enlarge hero image (opt-in via df_hero() media_lightbox). */
.df-page-hero-photo {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    line-height: 0;
    overflow: hidden;
    cursor: zoom-in;
    -webkit-appearance: none;
    appearance: none;
}
.df-page-hero-photo img {
    transition: transform 0.6s var(--df-ease);
}
.df-page-hero-photo:hover img,
.df-page-hero-photo:focus-visible img {
    transform: scale(1.03);
}
@media (prefers-reduced-motion: reduce) {
    .df-page-hero-photo img { transition: none; }
    .df-page-hero-photo:hover img,
    .df-page-hero-photo:focus-visible img { transform: none; }
}
@media (max-width: 860px) {
    .df-page-hero-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* ============================================================
   9. FOOTER
   ============================================================ */
.df-footer {
    background: var(--df-bg-dark);
    color: var(--df-paper-muted);
    border-top: 1px solid var(--df-hairline-dark);
    padding: clamp(36px, 5vw, 56px) 0;
    font-size: 12px;
}
.df-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--df-gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.df-footer-nav { order: 2; }
.df-footer-links,
.df-footer-social {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 28px;
}
.df-footer-links a,
.df-footer-social a {
    color: var(--df-paper-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    transition: color 0.25s ease;
}
.df-footer-links a:hover,
.df-footer-social a:hover { color: var(--df-paper); }
.df-copyright {
    order: 1;
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.df-footer-location {
    order: 3;
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
@media (max-width: 700px) {
    .df-footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
    }
    .df-footer-nav { order: 0; }
}

/* ============================================================
   10. ADMIN FRONT-END HELPERS
   ============================================================ */
body.admin-bar .df-nav { top: 32px; }

.df-admin-shortcuts {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 100000;
    display: flex;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--df-hairline-dark);
    background: rgba(14, 14, 14, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.df-admin-shortcuts a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(241, 238, 231, 0.25);
    color: var(--df-paper);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
}
.df-admin-shortcuts a:hover,
.df-admin-shortcuts a:focus-visible {
    background: var(--df-paper);
    color: var(--df-ink);
    border-color: var(--df-paper);
}
@media (max-width: 782px) {
    body.admin-bar .df-nav { top: 46px; }
    .df-admin-shortcuts {
        right: 10px;
        bottom: 10px;
        max-width: calc(100vw - 20px);
        flex-wrap: wrap;
    }
}

/* ============================================================
   11. SECTION TITLE (shared helper markup)
   ============================================================ */
.df-section-title { margin-bottom: 48px; }
.df-section-title h2 {
    font-size: clamp(30px, 4.5vw, 54px);
    margin: 0;
}
.df-section-title .df-divider { display: none; }
.df-section-title p {
    color: var(--df-ink-muted);
    font-size: 16px;
    max-width: 560px;
    margin: 18px 0 0;
    line-height: 1.75;
}
.df-dark .df-section-title p { color: var(--df-paper-muted); }

/* ============================================================
   12. LEGACY CLASSES (old body copy fallback)
   ============================================================ */
.hero, .page-header {
    padding: 120px 20px 60px !important;
    text-align: center;
}

/* ============================================================
   13. KEYBOARD FOCUS RINGS
   ============================================================ */
.df-hamburger:focus-visible,
.df-mobile-close:focus-visible,
.df-mobile-links a:focus-visible,
.df-nav-links a:focus-visible,
.df-btn:focus-visible,
.df-link-arrow:focus-visible,
.df-pf-filter-btn:focus-visible,
.df-video-play:focus-visible,
.df-project-play:focus-visible,
.df-video-fullscreen:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}
