/* ==========================================================================
   BLOCK266 — Global Stylesheet
   ========================================================================== */

/* ------------------------------------------------------------------
   CSS CUSTOM PROPERTIES (Design Tokens)
   Match these in Elementor > Site Settings > Global Colors & Fonts
------------------------------------------------------------------ */
:root {
    --b266-bg:           #DDDDDD;
    --b266-black:        #000000;
    --b266-white:        #FFFFFF;
    --b266-font-display: 'Turnaround', sans-serif;
    --b266-font-body:    'Mulish', sans-serif;
    --b266-transition:   0.45s cubic-bezier(0.77, 0, 0.175, 1);
}

/* ------------------------------------------------------------------
   BASE RESET
------------------------------------------------------------------ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background-color: var(--b266-bg);
}

body {
    background-color: var(--b266-bg);
    font-family: var(--b266-font-body);
    color: var(--b266-black);
    overflow-x: hidden;
}

/* Prevent scroll when modal/lightbox is open */
body.b266-locked {
    overflow: hidden;
}

/* ------------------------------------------------------------------
   HEADER
   Build the header in Elementor Theme Builder.
   Add class "b266-header" to the header section.
   Then these styles will apply automatically.
------------------------------------------------------------------ */
.b266-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    background-color: var(--b266-bg);
}

/* INFO button (left) */
.b266-info-btn {
    font-family: var(--b266-font-body);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.05em;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--b266-black);
    padding: 0;
    text-transform: uppercase;
    transition: opacity 0.2s ease;
}
.b266-info-btn:hover {
    opacity: 0.6;
}

/* Logo (centre) */
.b266-logo {
    font-family: var(--b266-font-display);
    font-size: 28px;
    font-weight: normal;
    color: var(--b266-black);
    text-decoration: none;
    letter-spacing: 0.02em;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* Social links (right) */
.b266-socials {
    display: flex;
    gap: 32px;
}
.b266-socials a {
    font-family: var(--b266-font-body);
    font-weight: 700;
    font-size: 14px;
    color: var(--b266-black);
    text-decoration: none;
    transition: opacity 0.2s ease;
}
.b266-socials a:hover {
    opacity: 0.6;
}

/* ------------------------------------------------------------------
   INFO MODAL (full-screen, slides from top)
------------------------------------------------------------------ */
.b266-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--b266-black);
    z-index: 1000;

    /* Hidden state: slid up above viewport */
    transform: translateY(-100%);
    transition: transform var(--b266-transition);
    pointer-events: none;
}

/* Visible state (JS adds .is-open) */
.b266-modal.is-open {
    transform: translateY(0);
    pointer-events: all;
}

/* Modal inner — replicates the Figma layout exactly */
.b266-modal-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    padding: 20px 40px 60px;
}

/* Close button — replaces INFO in top-left */
.b266-modal-close {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    align-self: center;
    font-family: var(--b266-font-body);
    font-weight: 700;
    font-size: 18px;
    color: var(--b266-white);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.2s ease;
    line-height: 1;
}
.b266-modal-close:hover {
    opacity: 0.6;
}

/* Logo centred in header row */
.b266-modal-logo {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
    align-self: center;
    font-family: var(--b266-font-display);
    font-size: 28px;
    color: var(--b266-white);
    text-decoration: none;
}

/* Primary nav links — large, left column */
.b266-modal-nav {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
    padding-top: 48px;
}
.b266-modal-nav a {
    font-family: var(--b266-font-display);
    font-size: clamp(52px, 8vw, 88px);
    color: var(--b266-white);
    text-decoration: none;
    line-height: 1;
    transition: opacity 0.2s ease;
}
.b266-modal-nav a:hover {
    opacity: 0.5;
}

/* Socials — right column, vertically stacked */
.b266-modal-socials {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
    gap: 20px;
    padding-top: 60px;
}
.b266-modal-socials a {
    font-family: var(--b266-font-body);
    font-weight: 700;
    font-size: 16px;
    color: var(--b266-white);
    text-decoration: none;
    transition: opacity 0.2s ease;
}
.b266-modal-socials a:hover {
    opacity: 0.6;
}

/* ------------------------------------------------------------------
   VIMEO LIGHTBOX
------------------------------------------------------------------ */
.b266-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;

    /* Hidden state */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.b266-lightbox.is-open {
    opacity: 1;
    pointer-events: all;
}

.b266-lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    font-size: 24px;
    color: var(--b266-white);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    transition: opacity 0.2s ease;
    z-index: 10;
}
.b266-lightbox-close:hover {
    opacity: 0.6;
}

.b266-lightbox-inner {
    width: 90vw;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
    position: relative;
}

.b266-lightbox-inner iframe {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* ------------------------------------------------------------------
   PROJECT THUMBNAILS (homepage + projects page)
   Add class "b266-thumb" to each clickable thumbnail section in Elementor.
------------------------------------------------------------------ */
.b266-thumb {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.b266-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.b266-thumb:hover::after {
    background: rgba(0, 0, 0, 0.15);
}

/* ------------------------------------------------------------------
   TV GRAIN FOOTER
   The video element fills the footer strip.
------------------------------------------------------------------ */
.b266-grain-footer {
    width: 100%;
    height: 80px;
    overflow: hidden;
    display: block;
    line-height: 0;
    position: relative;
}

.b266-grain-footer video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ------------------------------------------------------------------
   CONTACT PAGE — Blinking portfolio GIF effect
   Add class "b266-blink-reel" to the image section in Elementor.
   JS handles the cycling. CSS handles the fade.
------------------------------------------------------------------ */
.b266-blink-reel {
    position: relative;
    overflow: hidden;
}

.b266-blink-reel img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.08s ease;
}

.b266-blink-reel img.is-active {
    opacity: 1;
}

/* ------------------------------------------------------------------
   UTILITY — Page content padding (accounts for fixed header)
------------------------------------------------------------------ */
.elementor-section-wrap,
.elementor-page > .elementor-section {
    padding-top: 80px;
}

/* ------------------------------------------------------------------
   RESPONSIVE
------------------------------------------------------------------ */
@media (max-width: 768px) {
    .b266-header {
        padding: 16px 24px;
    }

    .b266-modal-inner {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        padding: 16px 24px 40px;
    }

    .b266-modal-logo {
        grid-column: 1;
    }

    .b266-modal-nav {
        grid-column: 1;
        grid-row: 2;
        padding-top: 40px;
    }

    .b266-modal-nav a {
        font-size: clamp(40px, 12vw, 64px);
    }

    .b266-modal-socials {
        grid-column: 1;
        grid-row: 3;
        align-items: flex-start;
        flex-direction: row;
        gap: 24px;
        padding-top: 32px;
    }

    .b266-lightbox-inner {
        width: 95vw;
    }

    .b266-grain-footer {
        height: 60px;
    }
}
