/**
 * Manon Theme Styles
 * Minimalist portfolio theme inspired by Reko Rennie
 */

/* ==========================================================================
   Font Face - HK Grotesk
   ========================================================================== */

@font-face {
    font-family: 'HK Grotesk';
    src: url('../fonts/HKGrotesk-Light.woff2') format('woff2'),
         url('../fonts/HKGrotesk-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'HK Grotesk';
    src: url('../fonts/HKGrotesk-Regular.woff2') format('woff2'),
         url('../fonts/HKGrotesk-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'HK Grotesk';
    src: url('../fonts/HKGrotesk-Medium.woff2') format('woff2'),
         url('../fonts/HKGrotesk-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'HK Grotesk';
    src: url('../fonts/HKGrotesk-SemiBold.woff2') format('woff2'),
         url('../fonts/HKGrotesk-SemiBold.woff') format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'HK Grotesk';
    src: url('../fonts/HKGrotesk-Bold.woff2') format('woff2'),
         url('../fonts/HKGrotesk-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
    /* Colors */
    --color-black: #000;
    --color-white: #fff;
    --color-gray-100: #f5f5f5;
    --color-gray-200: #e5e5e5;
    --color-gray-300: #d4d4d4;
    --color-gray-500: #737373;
    --color-gray-700: #404040;
    --color-gray-900: #171717;

    /* Typography */
    --font-heading: 'HK Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'HK Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Sizes */
    --header-height: 80px;
    --sidebar-width: 200px;
    --container-padding: 40px;
    --grid-gap: 20px;
    --container-max-width: 1440px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-black);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.1;
    margin: 0 0 1rem;
}

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

p {
    margin: 0 0 1rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

a:hover {
    opacity: 0.7;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

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

.skip-link:focus {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: auto;
    height: auto;
    padding: 1rem;
    background: var(--color-black);
    color: var(--color-white);
    clip: auto;
}

/* ==========================================================================
   Site Structure
   ========================================================================== */

.site {
    min-height: 100vh;
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

.site-content {
    flex: 1;
}

/* Has sidebar nav (internal pages) */
.has-sidebar-nav .site-content {
    margin-left: var(--sidebar-width);
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--container-max-width);
    z-index: 100;
    height: var(--header-height);
    background: var(--color-white);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--container-padding);
}

/* Site branding / Logo */
.site-branding {
    z-index: 101;
}

.site-branding a {
    display: block;
}

.site-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.custom-logo-link img {
    height: 40px;
    width: auto;
}

/* Diamond icon */
.diamond-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    z-index: 101;
}

.diamond-icon svg {
    width: 24px;
    height: 24px;
}

/* Menu toggle (mobile) */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    gap: 5px;
    z-index: 101;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-black);
    transition: transform var(--transition-base), opacity var(--transition-base);
}

.menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   Navigation (Sidebar)
   ========================================================================== */

.main-navigation {
    position: fixed;
    top: var(--header-height);
    left: max(0px, calc((100vw - var(--container-max-width)) / 2));
    bottom: 0;
    width: var(--sidebar-width);
    padding: var(--container-padding);
    background: var(--color-white);
    overflow-y: auto;
    z-index: 90;
}

.nav-inner {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Primary menu */
#primary-menu {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#primary-menu a {
    display: block;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#primary-menu .current-menu-item a,
#primary-menu .current_page_item a {
    opacity: 0.5;
}

/* Year filters */
.year-filters {
    padding-top: 1rem;
    border-top: 1px solid var(--color-gray-200);
}

.filter-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

.year-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.year-filter {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--color-gray-500);
    text-align: left;
    transition: color var(--transition-fast);
}

.year-filter:hover,
.year-filter.active {
    color: var(--color-black);
}

/* ==========================================================================
   Front Page (Hero Video)
   ========================================================================== */

.front-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}

body.home {
    overflow: hidden;
}

body.home .site {
    max-width: none;
}

body.home .site-header {
    background: transparent;
}

body.home .site-title,
body.home .diamond-icon {
    color: var(--color-white);
}

.hero-video-container {
    position: fixed;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    overflow: hidden;
    background: var(--color-black);
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Cover any aspect ratio - take the larger dimension */
    width: max(100vw, calc(100vh * 16 / 9));
    height: max(100vh, calc(100vw * 9 / 16));
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* YouTube specific - scale up to hide any black bars from the player */
.youtube-wrapper {
    transform: translate(-50%, -50%) scale(1.5);
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
}

.hero-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-white);
}

/* Fullscreen clickable link */
.hero-fullscreen-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    cursor: pointer;
}

/* Hero info (title overlay) */
.hero-info {
    position: absolute;
    bottom: var(--container-padding);
    left: var(--container-padding);
    z-index: 10;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-white);
}

.hero-link:hover .hero-title {
    opacity: 0.7;
}

/* Enter site arrow */
.enter-site {
    position: absolute;
    bottom: var(--container-padding);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    color: var(--color-white);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* ==========================================================================
   Work Archive (Grid)
   ========================================================================== */

.archive-work {
    padding: calc(var(--header-height) + var(--container-padding)) var(--container-padding) var(--container-padding);
}

/* Work grid */
.work-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.work-item {
    opacity: 1;
    transition: opacity var(--transition-base);
}

.work-item.hidden {
    display: none;
}

.work-link {
    display: block;
}

.work-thumbnail {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--color-gray-100);
}

.work-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.work-link:hover .work-thumbnail img {
    transform: scale(1.05);
}

.no-thumbnail {
    width: 100%;
    height: 100%;
    background: var(--color-gray-200);
}

/* ==========================================================================
   Single Work (Project Detail) - Two Column Layout
   ========================================================================== */

.single-work {
    padding: calc(var(--header-height) + var(--container-padding)) var(--container-padding) var(--container-padding);
}

/* Two column grid layout */
.work-project {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 60px;
    align-items: start;
    min-height: calc(100vh - var(--header-height) - var(--container-padding) * 2);
}

/* Left column: text content */
.work-content {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: calc(var(--header-height) + var(--container-padding));
}

.single-work .work-header {
    margin-bottom: 2rem;
}

.single-work .work-title {
    font-size: 1.5rem;
    margin: 0;
}

.single-work .work-year {
    display: block;
    font-size: 0.875rem;
    color: var(--color-gray-500);
    margin-top: 0.5rem;
}

.work-description {
    margin-bottom: 1.5rem;
}

.work-description p:last-child {
    margin-bottom: 0;
}

.work-caption {
    font-size: 0.875rem;
    color: var(--color-gray-500);
    margin-bottom: 2rem;
}

/* Work navigation - bottom of left column */
.work-navigation {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--color-gray-200);
}

.work-navigation a {
    display: block;
}

.work-navigation .nav-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.work-navigation .nav-title {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Right column: gallery */
.work-gallery {
    position: relative;
}

/* Gallery navigation - top of gallery */
.gallery-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.gallery-counter {
    font-size: 0.875rem;
    color: var(--color-gray-500);
}

.gallery-next {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    transition: opacity var(--transition-fast);
}

.gallery-next:hover {
    opacity: 0.7;
}

.gallery-container {
    position: relative;
}

.gallery-item {
    display: none;
    margin: 0;
}

.gallery-item.active {
    display: block;
}

.gallery-item img {
    width: 100%;
    height: auto;
    max-height: calc(100vh - var(--header-height) - var(--container-padding) * 2 - 50px);
    object-fit: contain;
}

.gallery-item figcaption {
    font-size: 0.875rem;
    color: var(--color-gray-500);
    margin-top: 1rem;
}

/* ==========================================================================
   Pages (About, CV, Contact)
   ========================================================================== */

.page-default,
.page-about,
.page-cv,
.page-contact {
    padding: calc(var(--header-height) + var(--container-padding)) var(--container-padding) var(--container-padding);
    max-width: 800px;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.25rem;
}

/* About page */
.about-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.about-image img {
    max-width: 300px;
}

.about-text p:last-child {
    margin-bottom: 0;
}

/* CV page */
.cv-intro {
    margin-bottom: 2rem;
}

.cv-table {
    width: 100%;
    border-collapse: collapse;
}

.cv-entry td {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-gray-200);
    vertical-align: top;
}

.cv-year {
    width: 80px;
    font-weight: 500;
    color: var(--color-gray-500);
}

.cv-title {
    padding-left: 1rem;
    padding-right: 1rem;
}

.cv-location {
    color: var(--color-gray-500);
    text-align: right;
}

.acf-notice {
    font-size: 0.875rem;
    color: var(--color-gray-500);
    font-style: italic;
}

/* Contact page */
.contact-content a {
    text-decoration: underline;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    padding: var(--container-padding);
    text-align: center;
}

.has-sidebar-nav .site-footer {
    margin-left: var(--sidebar-width);
}

.copyright {
    font-size: 0.75rem;
    color: var(--color-gray-500);
    margin: 0;
}

/* Hide footer on front page */
body.home .site-footer {
    display: none;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination,
.nav-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    font-size: 0.875rem;
}

.page-numbers.current {
    font-weight: 700;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 180px;
        --container-padding: 30px;
    }

    .work-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
        --container-padding: 20px;
        --grid-gap: 15px;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.25rem; }

    /* Show mobile menu toggle */
    .menu-toggle {
        display: flex;
    }

    /* Hide diamond on mobile */
    .diamond-icon {
        display: none;
    }

    /* Sidebar becomes overlay */
    .main-navigation {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        padding-top: calc(var(--header-height) + var(--container-padding));
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        z-index: 95;
    }

    .main-navigation.active {
        transform: translateX(0);
    }

    .has-sidebar-nav .site-content,
    .has-sidebar-nav .site-footer {
        margin-left: 0;
    }

    /* Work grid 2 columns */
    .work-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Single work - stack columns on mobile */
    .work-project {
        display: flex;
        flex-direction: column-reverse;
        gap: 2rem;
    }

    .work-content {
        position: static;
    }

    .single-work .work-title {
        font-size: 1.25rem;
    }

    .gallery-item img {
        max-height: 50vh;
    }

    .work-navigation {
        margin-top: 2rem;
    }

    /* CV table responsive */
    .cv-table,
    .cv-table tbody,
    .cv-table tr,
    .cv-table td {
        display: block;
    }

    .cv-entry {
        padding: 1rem 0;
        border-bottom: 1px solid var(--color-gray-200);
    }

    .cv-entry td {
        padding: 0;
        border: none;
    }

    .cv-year {
        width: auto;
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }

    .cv-title {
        padding: 0;
        font-weight: 500;
    }

    .cv-location {
        text-align: left;
        font-size: 0.875rem;
        margin-top: 0.25rem;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .work-grid {
        grid-template-columns: 1fr;
    }

    .hero-info {
        left: var(--container-padding);
        right: var(--container-padding);
    }

    .hero-title {
        font-size: 1rem;
    }
}
