/*
Theme Name: Lincad
Description: Bespoke theme for Lincad built with ACF Pro
Theme URI: https://www.lincad.co.uk/
Author: Silomedia
Author URI: https://www.silomedia.co.uk/
Version: 1.0
*/

/* ============================
   FONTS (self-hosted, variable)
   ============================ */

/* Mona Sans — body */
@font-face {
    font-family: 'Mona Sans Variable';
    font-style: normal;
    font-display: swap;
    font-weight: 200 900;
    src: url('fonts/mona-sans-latin-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: 'Mona Sans Variable';
    font-style: normal;
    font-display: swap;
    font-weight: 200 900;
    src: url('fonts/mona-sans-latin-ext-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* Hubot Sans — headings / accent. Full variable font: weight (200–900),
   width (75–125) and slant (slnt) axes all available via font-variation-settings. */
@font-face {
    font-family: 'Hubot Sans Variable';
    font-style: normal;
    font-display: swap;
    font-weight: 200 900;
    src: url('fonts/hubot-sans-variable.woff2') format('woff2-variations');
}
/* ============================
   SETTINGS
   ============================ */

:root {
    --primary: #004f70;         /* Lincad primary dark */
    --primary-hover: #00688f;   /* lighter shade of primary for hover */
    --primary-light: #e8f5fa;   /* pale cool tint for subtle backgrounds / mark */
    --accent: #8bd4e7;          /* Lincad primary light — bright accent */
    --secondary: #06283a;       /* cool deep teal-navy for dark sections/footer */

    --text: #14232c;            /* cool dark slate */

    --gray: #5a6b74;            /* cool gray */
    --light-gray: #eef3f5;      /* cool light gray */

    --border-color: #dce4e8;    /* cool border */
    --border-radius: 2px;    /* squared-off for a sharper, angular feel */
    --shadow: 0 4px 6px rgba(0,0,0,0.05);
    --transition: all 0.3s ease;

    font-size: 21px;
    @media(max-width: 1800px) { font-size: 20px; }
    @media(max-width: 1500px) { font-size: 19px; }
    @media(max-width: 1300px) { font-size: 18px; }
    @media(max-width: 1100px) { font-size: 17px; }
}

/* ============================
   RESET
   ============================ */

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Mona Sans Variable', sans-serif;
    font-optical-sizing: auto;
    color: var(--text);
    font-weight: 500;
}

/* overflow-x: clip prevents horizontal overflow from AOS transforms / off-canvas
   elements on small screens (all AOS animations live inside section tags). */
section {
    position: relative;
    z-index: 1;
    background: #fff;
    overflow-x: clip;
}

/* AOS hint — reduce chances of subpixel overflow from transforms and improve GPU compositing */
[data-aos],
.aos-animate {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
    border: 2px solid var(--light-gray);
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--light-gray);
}

/* Text selection color */
::selection {
    background-color: var(--primary);
    color: white;
}

::-moz-selection {
    background-color: var(--primary);
    color: white;
}

/* ============================
   TYPOGRAPHY
   ============================ */

p {
    text-wrap: pretty;
    line-height: 1.6;
    margin-top: 0;
    margin-bottom: 1rem;

    &.lead {
        color: var(--secondary);
        font-weight: 600;
        font-size: 1.1rem;
        line-height: 1.5;
    }

    &:last-child {
        margin-bottom: 0;
    }
}

ul, ol {
    line-height: 1.6;
    margin-top: 0;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    
    &:last-child {
        margin-bottom: 0;
    }
    
    li {
        margin-bottom: 0.5rem;
        padding-left: 0.25rem;
        
        &:last-child {
            margin-bottom: 0;
        }
        
        &::marker {
            color: var(--primary);
            font-weight: 700;
        }
    }
}

ul {
    list-style: disc;
}

ol {
    list-style: decimal;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);

    &:hover {
        color: var(--primary-hover);
        text-decoration: underline;
    }
}

mark {
    background-color: var(--primary-light);
    color: var(--text);
    padding: 0.1em 0.2em;
    border-radius: 2px;
}

/* Global Heading Styles with Fluid Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Hubot Sans Variable', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 1rem;
    text-wrap: pretty;
    color: var(--secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-margin-top: 100px;
    
    &:not(:first-child, h1) {
        margin-top: 2rem;
    }
}

.section-subtitle + h1,
.section-subtitle + h2,
.section-subtitle + h3,
.section-subtitle + h4,
.section-subtitle + h5,
.section-subtitle + h6 {
    margin-top: 0;
}

h1 {
    font-size: clamp(2.5rem, 1.5rem + 3vw, 3.6rem);
    margin-bottom: clamp(1.25rem, 1rem + 1vw, 1.5rem);
    text-wrap: balance;
    font-weight: 700;
    line-height: 1;
}

h2 {
    font-size: clamp(1.7rem, 1.1rem + 2vw, 2.4rem); 
    margin-bottom: clamp(1rem, 0.8rem + 0.7vw, 1.25rem);
}

h3 {
    font-size: clamp(1.2rem, 0.9rem + 1.2vw, 1.6rem); 
    margin-bottom: clamp(0.8rem, 0.7rem + 0.4vw, 1rem);
}

h4 {
    font-size: clamp(1.1rem, 0.85rem + 0.8vw, 1.4rem); 
}

h5 {
    font-size: clamp(1rem, 0.8rem + 0.3vw, 1.2rem); 
    font-weight: 600;
}

h6 {
    font-size: clamp(0.9rem, 0.85rem + 0.1vw, 1rem); 
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Table Styles */
.table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    margin: 2rem 0;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: white;
    font-size: 0.875rem;
}

table thead {
    background: var(--light-gray);
}

table th {
    padding: 0.875rem 1rem !important;
    text-align: left !important;
    font-weight: 600 !important;
    color: var(--secondary) !important;
    border: 1px solid #dce4e8 !important;
    white-space: nowrap !important;
    vertical-align: top !important;
    background: var(--light-gray) !important;
}

table tbody tr {
    transition: background-color 0.2s ease;
}

table tbody tr:nth-child(even) {
    background: #f6f9fb;
}

table tbody tr:hover {
    background: var(--light-gray);
}

table tbody td {
    padding: 0.875rem 1rem !important;
    border: 1px solid #dce4e8 !important;
    color: var(--text) !important;
    vertical-align: top !important;
}

@media (max-width: 768px) {
    .table-wrapper {
        overflow-x: auto;
        display: block;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
}

/* =========================
   Search Results Page
   ========================= */

.search-results-page {
    padding: 4rem 0;
    background: var(--light-gray);
    min-height: 70vh;
}

.search-results-header {
    background: white;
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 3rem;
    
    h1 {
        font-size: clamp(2rem, 4vw, 2.5rem);
        margin-bottom: 1rem;
        color: var(--secondary);
    }
    
    .search-query {
        font-size: 1.125rem;
        color: var(--text);
        margin-bottom: 0.5rem;
        
        strong {
            color: var(--primary);
        }
    }
    
    .search-count {
        font-size: 0.9375rem;
        color: var(--gray);
        margin-bottom: 2rem;
    }
}

.search-form-wrapper {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #dce4e8;
    
    .search-form {
        display: flex;
        gap: 0.5rem;
        max-width: 600px;
        
        .search-field {
            flex: 1;
            padding: 0.75rem 1.25rem;
            border: 1px solid #dce4e8;
            border-radius: var(--border-radius);
            font-size: 1rem;
            transition: var(--transition);
            margin: 0;
            
            &:focus {
                outline: none;
                border-color: var(--primary);
                box-shadow: 0 0 0 3px rgba(0, 79, 112, 0.1);
            }
        }
        
        .search-submit {
            padding: 0.625rem 1rem;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: var(--border-radius);
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            
            &:hover {
                background: var(--primary-hover);
            }
            
            svg {
                width: 24px;
                height: 24px;
                fill: white;
            }
        }
    }
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.search-result-item {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid #dce4e8;
    transition: var(--transition);
    
    &:hover {
        box-shadow: 0 6px 12px rgba(0,0,0,0.08);
        transform: translateY(-2px);
    }
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    
    .search-result-type {
        display: inline-block;
        padding: 0.25rem 0.75rem;
        background: var(--primary);
        color: white;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        border-radius: var(--border-radius);
    }
    
    .search-result-date {
        font-size: 0.875rem;
        color: var(--gray);
    }
}

.search-result-title {
    font-size: 1.5rem;
    margin-top: 1.5rem !important;
    margin-bottom: 1rem;
    
    a {
        color: var(--secondary);
        text-decoration: none;
        transition: color 0.2s ease;
        
        &:hover {
            color: var(--primary);
        }
    }
}

.search-result-excerpt {
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.search-result-thumbnail {
    margin-bottom: 1rem;
    
    img {
        width: 100%;
        max-width: 300px;
        height: auto;
        border-radius: var(--border-radius);
    }
}

.search-result-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    
    &:hover {
        gap: 0.75rem;
        
        svg {
            transform: translateX(4px);
        }
    }
    
    svg {
        transition: transform 0.2s ease;
    }
}

.search-no-results-content {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    padding: 3rem;
    margin-bottom: 3rem;
    
    svg {
        color: var(--gray);
        margin-bottom: 1.5rem;
        opacity: 0.5;
        width: 64px;
        height: 64px;
    }
    
    h2 {
        font-size: 2rem;
        color: var(--secondary);
        margin-bottom: 1rem;
    }
    
    p {
        font-size: 1.125rem;
        color: var(--text);
        margin-bottom: 2rem;
    }
}


@media (max-width: 768px) {
    .search-results-header {
        padding: 2rem 1.5rem;
    }
    
    .search-result-item {
        padding: 1.5rem;
    }
    
    .search-form-wrapper .search-form {
        flex-direction: column;
        
        .search-submit {
            width: 100%;
        }
    }
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 48;
}

.tag {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    font-family: 'Hubot Sans Variable', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: var(--border-radius);
    border-left: 3px solid var(--accent); /* sharp angular accent */
    padding: 0.5rem 1.2rem;
}

/* ============================
   ANIMATIONS
   ============================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(30px);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================
   BUTTONS
   ============================ */

a.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    text-align: center;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 3px 0 var(--accent); /* accent ledge = the button's raised edge */
    cursor: pointer;
    position: relative;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.3s ease;
    font-family: 'Hubot Sans Variable', sans-serif;
    line-height: 1.5;

    /* Push the button down into its ledge (3D press) */
    &:hover, &:focus, &:active {
        background-color: var(--primary-hover);
        color: white;
        transform: translateY(3px);
        box-shadow: 0 0 0 var(--accent);
    }

    &.secondary, &.secondary-cta {
        background-color: var(--secondary);

        &:hover, &:focus, &:active {
            background-color: color-mix(in srgb, var(--secondary) 88%, white);
        }
    }

    &.outline {
        background-color: transparent;
        border: 2px solid var(--primary);
        color: var(--primary);

        &:hover, &:focus, &:active {
            background-color: var(--primary);
            color: white;
            box-shadow: 0 0 0 var(--accent);
        }
    }
}

/* ============================
   CONTAINERS
   ============================ */

.container {
    width: 100%;
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 3rem);
    position: relative;
    z-index: 1;
}

/* ============================
   HEADER
   ============================ */

#topper {
    background: var(--secondary);
    color: white;
    font-size: 0.85rem;
    padding: 0.75rem 0;
    position: relative;
    z-index: 1;

    .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        
        @media (max-width: 767px) {
            flex-direction: column;
            gap: 0.5rem;
        }
    }

    .topper-contact {
        display: flex;
        gap: 1.5rem;
        font-size: 0.8rem;
        
        @media (max-width: 767px) {
            gap: 1rem;
            flex-wrap: wrap;
            justify-content: center;
        }
        
        a {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: white;
            text-decoration: none;
            transition: var(--transition);

            &:hover {
                color: var(--accent);
            }

            .material-symbols-outlined {
                font-size: 1.1rem;
                color: var(--accent);
            }
        }
    }

    .topper-search {
        display: flex;
        align-items: center;

        @media (max-width: 767px) {
            margin-top: 0.25rem;
        }

        form {
            position: relative;
            display: flex;
            align-items: center;
        }

        input[type="search"] {
            width: 220px;
            max-width: 40vw;
            border: 1px solid rgba(255,255,255,0.25);
            border-radius: 999px;
            background: rgba(255,255,255,0.08);
            color: white;
            font-size: 0.8rem;
            padding: 0.5rem 2.2rem 0.35rem 0.9rem;
            line-height: 1.2;
            transition: var(--transition);

            &::placeholder {
                color: rgba(255,255,255,0.6);
            }

            &:focus {
                outline: none;
                border-color: var(--accent);
                background: rgba(255,255,255,0.14);
            }

            &::-webkit-search-cancel-button,
            &::-webkit-search-decoration {
                -webkit-appearance: none;
                appearance: none;
            }
        }

        .search-submit {
            position: absolute;
            right: 0.15rem;
            top: 50%;
            transform: translateY(-50%);
            display: flex;
            align-items: center;
            justify-content: center;
            width: 1.9rem;
            height: 1.9rem;
            padding: 0;
            border: none;
            border-radius: 50%;
            background: none;
            color: rgba(255,255,255,0.75);
            cursor: pointer;
            transition: var(--transition);

            .material-symbols-outlined {
                font-size: 1.1rem;
            }

            &:hover {
                color: var(--accent);
            }
        }
    }

    .topper-actions {
        display: flex;
        align-items: center;
        gap: 1.25rem;
    }

    .topper-social {
        display: flex;
        align-items: center;
        gap: 0.75rem;

        a {
            display: inline-flex;
            color: rgba(255,255,255,0.75);
            transition: var(--transition);

            &:hover {
                color: var(--accent);
            }

            svg {
                width: 1.05rem;
                height: 1.05rem;
                display: block;
                fill: currentColor;
            }
        }
    }
}

/* Hide topper menu at hamburger menu breakpoint (1200px) */
@media (max-width: 1200px) {
    #topper {
        display: none;
    }
}

/* ============================
   MASTHEAD
   ============================ */

/* WordPress admin bar compatibility with sticky header */
.admin-bar #masthead {
    top: 32px; /* Default admin bar height */
    
    @media screen and (max-width: 782px) {
        top: 46px; /* WordPress changes admin bar height on mobile */
    }
    
    @media screen and (max-width: 600px) {
        /* WordPress admin bar becomes fixed on mobile scroll */
        position: absolute;
        left: 0;
        right: 0;
        width: 100%;
        
        &.scrolled {
            position: fixed;
            top: 0;
        }
    }
}

/* Add padding to body when admin bar is present on mobile */
.admin-bar {
    @media screen and (max-width: 600px) {
        /* Add padding to prevent content overlap with absolutely positioned header */
        padding-top: 70px;
        
        /* Reset padding when header becomes fixed */
        &.scrolled-header {
            padding-top: 0;
        }
    }
}

#masthead {
    background: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    transition: box-shadow 0.3s ease, padding 0.3s ease;

    .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }

    .masthead-logo {
        flex: 0 0 auto;
        position: relative;
        z-index: 101;
        
        a {
            display: block;
            
            img {
                height: 2.8rem;
                width: auto;
                display: block;
                margin-top: 0.1rem;
                transition: height 0.3s ease;
                
                @media (max-width: 767px) {
                    height: 2.2rem;
                }
            }
        }
    }

    .masthead-menu {
        display: flex;
        margin: 0;
        padding: 0;
        list-style: none;
        gap: 0.5rem;
        font-family: 'Hubot Sans Variable', sans-serif;
        
        @media (max-width: 1200px) {
            display: none;
        }
        
        > li {
            position: relative;
            margin-bottom: 0;
            padding-left: 0;
            
            &::marker {
                content: none;
            }
            
            > a {
                display: block;
                padding: 1rem 0.7rem;
                color: var(--secondary);
                text-decoration: none;
                font-size: 0.85rem;
                font-weight: 500;
                transition: var(--transition);
                white-space: nowrap;
                
                &:hover, &:focus {
                    color: var(--primary);
                }
            }
            
            &.menu-item-has-children > a {
                padding-right: 1.8rem;
                position: relative;
                
                &::after {
                    content: "keyboard_arrow_down";
                    font-family: 'Material Symbols Outlined';
                    position: absolute;
                    right: 0.45rem;
                    top: 52%;
                    transform: translateY(-50%);
                    font-size: 1.1rem;
                    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
                    transition: var(--transition);
                    color: var(--accent);
                }
                
                &:hover::after {
                    opacity: 0.8;
                }
            }
            
            > ul.sub-menu {
                position: absolute;
                top: 100%;
                left: 0;
                background: white;
                border: 1px solid var(--border-color);
                border-top: 2px solid var(--accent);
                border-radius: 2px;
                margin: 0;
                padding: 0.5rem 0;
                min-width: 260px;
                box-shadow: 0 12px 28px rgba(6, 40, 58, 0.16);
                opacity: 0;
                visibility: hidden;
                transform: translateY(10px);
                transition: var(--transition);
                z-index: 100;
                list-style: none;
                
                li {
                    margin-bottom: 0;
                    padding-left: 0;
                    
                    &::marker {
                        content: none;
                    }
                }
                
                > li {
                    list-style: none;
                    position: relative;
                    
                    > a {
                        display: block;
                        padding: 0.5rem 1rem;
                        color: var(--secondary);
                        text-decoration: none;
                        white-space: nowrap;
                        font-size: 0.85rem;
                        transition: var(--transition);

                        &:hover, &:focus {
                            color: var(--primary);
                            background-color: var(--light-gray);
                        }
                    }

                    &.menu-item-has-children > a {
                        padding-right: 2rem;
                        position: relative;
                        
                        &::after {
                            content: "chevron_right";
                            font-family: 'Material Symbols Outlined';
                            position: absolute;
                            right: 0.7rem;
                            top: 50%;
                            transform: translateY(-50%);
                            font-size: 1rem;
                            font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
                            transition: var(--transition);
                            color: var(--accent);
                        }
                        
                        &:hover::after {
                            transform: translateY(-50%) translateX(2px);
                            opacity: 0.8;
                        }
                    }
                    
                    > ul.sub-menu {
                        position: absolute;
                        top: 0;
                        left: 100%;
                        background: white;
                        border: 1px solid var(--border-color);
                        border-top: 2px solid var(--accent);
                        border-radius: 2px;
                        margin: 0;
                        padding: 0.5rem 0;
                        min-width: 260px;
                        box-shadow: 0 12px 28px rgba(6, 40, 58, 0.16);
                        opacity: 0;
                        visibility: hidden;
                        transform: translateX(10px);
                        transition: var(--transition);
                        list-style: none;
                        
                        li {
                            margin-bottom: 0;
                            padding-left: 0;
                            
                            &::marker {
                                content: none;
                            }
                        }
                        
                        > li {
                            list-style: none;
                            
                            > a {
                                display: block;
                                padding: 0.5rem 1rem;
                                color: var(--secondary);
                                text-decoration: none;
                                white-space: nowrap;
                                font-size: 0.85rem;
                                transition: var(--transition);
                                
                                &:hover, &:focus {
                                    color: var(--primary);
                                    background-color: var(--light-gray);
                                }
                            }
                        }
                    }
                    
                    &:hover > ul.sub-menu,
                    &:focus-within > ul.sub-menu {
                        opacity: 1;
                        visibility: visible;
                        transform: translateX(0);
                    }
                }
            }
            
            &:hover > ul.sub-menu,
            &:focus-within > ul.sub-menu {
                opacity: 1;
                visibility: visible;
                transform: translateY(0);
            }
        }
        
        .current-menu-item > a {
            color: var(--primary); /* Only highlight current page */
        }
        
        .current-menu-parent > a {
            color: var(--secondary); /* Reset parent to default color */
        }
    }

    .masthead-nav {
        transition: opacity 0.3s ease, visibility 0.3s ease;
        opacity: 1;
        visibility: visible;
        position: relative;
        flex: 1;
        display: flex;
        justify-content: center;
    }

    .masthead-cta {
        display: flex;
        align-items: center;
        gap: 1rem;
        position: relative;
        z-index: 101; /* Same as logo */
        
        /* Hide the CTA button on small screens */
        @media (max-width: 500px) {
            .button {
                display: none;
            }
        }
    }
    
    /* Add subtle shadow when scrolled and make it more compact */
    &.scrolled {
        padding: 0.75rem 0;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        
        .masthead-logo img {
            height: 2.4rem;
            
            @media (max-width: 767px) {
                height: 1.9rem;
            }
        }
        
        .masthead-menu > li > a {
            padding-top: 0.8rem;
            padding-bottom: 0.8rem;
        }
    }

    /* Hamburger Icon */
    .hamburger-menu {
        display: none;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        cursor: pointer;
        z-index: 200;
        margin-left: 1rem;
        position: relative;
        
        @media (max-width: 1200px) {
            display: flex;
        }
        
        span {
            display: block;
            height: 2px;
            width: 100%;
            background-color: var(--secondary);
            border-radius: 2px;
            transition: all 0.3s ease;
            transform-origin: left;
        }
        
        &.active {
            span:first-child {
                transform: rotate(45deg);
            }
            
            span:nth-child(2) {
                opacity: 0;
                transform: scaleX(0);
            }
            
            span:last-child {
                transform: rotate(-45deg);
            }
        }
    }
    
    /* For devices under 1200px */
    @media (max-width: 1200px) {
        .masthead-cta {
            margin-left: auto;
        }
    }
}

/* ============================
   MOBILE MENU OVERLAY
   ============================ */

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(6, 40, 58, 0.7); /* semi-transparent secondary */
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px); /* For Safari support */
    cursor: pointer; /* Indicate it's clickable */
    
    &.active {
        opacity: 1;
        visibility: visible;
    }
}

/* ============================
   MOBILE MENU
   ============================ */

.mobile-menu-container {
    position: fixed;
    top: 0;
    right: -350px;
    width: 320px;
    max-width: 90%;
    height: 100%;
    background-color: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 160;
    transition: right 0.4s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    
    &.active {
        right: 0;
    }
    
    .mobile-menu-inner {
        flex: 1;
        overflow-y: auto;
        padding: 1rem 0;
        
        /* Mobile menu */
        .mobile-menu {
            list-style: none;
            margin: 0;
            padding: 0 1.5rem;
            font-family: 'Hubot Sans Variable', sans-serif;

            li {
                position: relative;
            }
            
            /* Basic link styling */
            a {
                display: block;
                padding: 0.75rem 0;
                color: var(--secondary);
                text-decoration: none;
                font-weight: 500;
                border-bottom: 1px solid var(--border-color);
            }
            
            /* Only current item gets highlight */
            .current-menu-item > a {
                color: var(--primary);
                font-weight: 600;
            }
            
            /* Simple toggle button */
            .toggle-button {
                position: absolute;
                right: 0;
                top: 10px;
                width: 30px;
                height: 30px;
                background: transparent;
                border: none;
                cursor: pointer;
                z-index: 2;
                
                &:before, &:after {
                    content: '';
                    display: block;
                    background-color: var(--primary);
                    position: absolute;
                }
                
                /* Horizontal line */
                &:before {
                    width: 16px;
                    height: 2px;
                    top: 14px;
                    left: 7px;
                }
                
                /* Vertical line (for plus sign) */
                &:after {
                    width: 2px;
                    height: 16px;
                    top: 7px;
                    left: 14px;
                    transition: transform 0.2s ease;
                }
                
                /* When submenu is open, hide vertical bar (minus sign) */
                &.active:after {
                    transform: rotate(90deg);
                    opacity: 0;
                }
            }
            
            /* Simple submenu styling */
            .sub-menu {
                display: none; /* Hidden by default */
                list-style: none;
                margin: 0;
                padding: 0 0 0 1rem; /* Simple indentation */
                border-left: 2px solid var(--primary); /* Colored border */
                
                /* Override any WordPress behavior */
                &.shown-by-default {
                    display: none !important;
                }
                
                /* Last item in submenu shouldn't have a border */
                > li:last-child > a {
                    border-bottom: none;
                }
            }
            
            /* Only show submenu when explicitly toggled */
            .menu-item.open > .sub-menu {
                display: block;
            }
        }
    }
    
    .mobile-menu-top {
        padding: 1.2rem 1.5rem;
        border-bottom: 1px solid var(--border-color);
        background-color: var(--light-gray);
        
        /* Mobile search */
        .mobile-search-form {
            position: relative;
            
            form {
                display: flex;
                align-items: center;
            }
            
            input[type="search"] {
                width: 100%;
                padding: 0.7rem 3rem 0.7rem 1rem;
                border: 2px solid var(--border-color);
                border-radius: 50px;
                font-size: 0.9rem;
                transition: var(--transition);
                background-color: white;
                
                &:focus {
                    outline: none;
                    border-color: var(--primary);
                    box-shadow: 0 0 0 3px rgba(0, 79, 112, 0.1);
                }
                
                &::placeholder {
                    color: var(--gray);
                    opacity: 0.7;
                }
            }
            
            button {
                position: absolute;
                right: 0.5rem;
                top: 50%;
                transform: translateY(-50%);
                background: none;
                border: none;
                cursor: pointer;
                padding: 0.5rem;
                color: var(--primary);
                display: flex;
                align-items: center;
                justify-content: center;
                transition: var(--transition);
                
                .material-symbols-outlined {
                    font-size: 1.2rem;
                }
                
                &:hover {
                    color: var(--primary-hover);
                }
            }
        }
    }
    
    .mobile-menu-bottom {
        padding: 1.5rem;
        border-top: 1px solid var(--border-color);
        
        .mobile-cta {
            text-align: center;
            
            .button {
                display: inline-block;
                width: 100%;
            }
        }
    }
    
    /* Mobile Menu Search - Keep this visible */
    .mobile-search-form {
        display: block !important;
    }
}

/* Lock body when mobile menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

/* ============================
   UTILITIES
   ============================ */

.overlay-darken {
    background-color: #041d29;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.7;
    z-index: 0;
    mix-blend-mode: darken;
}

.light-bg {
    background-color: var(--light-gray);
}

/* ============================
   FOOTER
   ============================ */

#site-footer {
    background: white;
    padding: 0;
    z-index: 1;
    position: relative;
    
    .footer-top {
        padding: 2.5rem 0 2rem;
        border-bottom: 1px solid var(--border-color);
        position: relative;
        overflow: hidden;
        
        &::before {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            width: 60%;
            background-image: url('/wp-content/uploads/2025/11/fM5v680A.jpg');
            background-size: cover;
            background-position: right center;
            background-repeat: no-repeat;
            opacity: 0.15;
            filter: grayscale(100%);
            mask-image: linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0) 100%);
            -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0) 100%);
            pointer-events: none;
            z-index: 0;
        }
        
        .container {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            flex-wrap: wrap;
            gap: 2.5rem;
            position: relative;
            z-index: 1;
        }
    }
    
    .footer-info {
        flex: 1;
        max-width: 700px;
    }
    
    /* Horizontal layout for logo and text */
    .footer-logo-text {
        display: flex;
        align-items: flex-start;
        gap: 1.5rem;
        flex-wrap: wrap;
    }
    
    .footer-logo {
        margin-bottom: 0;
        
        img {
            height: 2.75rem;
            width: auto;
        }
    }
    
    .footer-text {
        color: var(--gray);
        font-size: 0.95rem;
        line-height: 1.5;
        margin-top: 0rem;
        flex: 1;
        min-width: 250px;
        border-left: solid 1px var(--border-color);
        padding-left: 1.5rem;
        
        @media (max-width: 767px) {
            border-left: none;
            padding-left: 0;
            min-width: 100%;
        }
    }
    
    /* Footer Logos Bar */
    .footer-logos-bar {
        padding: 2rem 0;
        border-bottom: 1px solid var(--border-color);
        background: white;
        
        /* Remove container padding on mobile for full-width carousel */
        @media (max-width: 999px) {
            padding: 2.5rem 0; /* Increased padding */
            
            .container {
                padding-left: 0;
                padding-right: 0;
                max-width: 100%;
            }
        }
        
        .accreditation-logos {
            /* Swiper container */
            width: 100%;
            
            .swiper-wrapper {
                display: flex;
                flex-wrap: wrap;
                gap: 2rem;
                align-items: center;
                justify-content: space-between;
                
                /* Desktop overrides to reset Swiper styles */
                @media (min-width: 1000px) {
                    transform: none !important;
                    width: 100% !important;
                    box-sizing: border-box;
                }

                /* Mobile Carousel overrides */
                @media (max-width: 999px) {
                    flex-wrap: nowrap;
                    gap: 0; /* Swiper handles gap */
                    justify-content: flex-start;
                }
            }
        }
        
        .logo-item {
            display: block;
            transition: var(--transition);
            
            /* Desktop overrides to reset Swiper styles */
            @media (min-width: 1000px) {
                width: auto !important;
                height: auto !important;
                margin-right: 0 !important;
            }
            
            @media (max-width: 999px) {
                width: auto;
                flex: 0 0 auto;
            }
            
            img {
                display: block;
                max-height: 2.5rem;
                width: auto;
                max-width: 140px;
                object-fit: contain;
            }
            
            &:hover {
                opacity: 0.8;
            }
        }
    }
    
    /* Footer Middle Section */
    .footer-middle {
        padding: 2.5rem 0;
    }
    
    /* Footer columns */
    .footer-columns {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 2.5rem;
    }
    
    .footer-column h3 {
        font-size: 1.1rem;
        margin-bottom: 1.25rem;
        position: relative;
        color: var(--secondary);
    }
    
    /* Contact details */
    .footer-contact-details {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        
        a {
            display: flex;
            align-items: center;
            gap: 0.875rem;
            color: var(--text);
            text-decoration: none;
            transition: var(--transition);
            font-size: 0.9rem;
            padding: 0.25rem 0;
            
            &:hover {
                color: var(--primary);
                
                .contact-icon {
                    background-color: var(--primary-hover);
                    transform: translateY(-2px);
                    box-shadow: 0 4px 8px rgba(0, 79, 112, 0.2);
                }
            }
        }
    }
    
    .contact-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: var(--primary);
        color: white;
        width: 2.2rem;
        height: 2.2rem;
        border-radius: var(--border-radius);
        transition: var(--transition);
        
        .material-symbols-outlined {
            font-size: 1.1rem;
            color: white;
        }
    }
    
    /* Footer links */
    .footer-links {
        list-style: none;
        padding: 0;
        margin: 0;
        
        li {
            margin-bottom: 0.75rem;
        }
        
        a {
            color: var(--text);
            text-decoration: none;
            font-size: 0.9rem;
            transition: var(--transition);
            position: relative;
            padding-left: 1.2rem;
            display: block;
            
            &::before {
                content: "chevron_right";
                font-family: 'Material Symbols Outlined';
                position: absolute;
                left: 0;
                top: 50%;
                transform: translateY(-50%);
                transition: var(--transition);
                color: var(--primary);
                font-size: 0.9rem;
                font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
            }
            
            &:hover {
                color: var(--primary);
                text-decoration: none;
                padding-left: 1.4rem;
                
                &::before {
                    left: 0.2rem;
                }
            }
        }
    }
    
    /* Footer Bottom */
    .footer-bottom {
        background-color: var(--secondary);
        padding: 1.25rem 0;
        color: white;
        
        .container {
            display: block;
        }
        
        .footer-bottom-inner {
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            align-items: center;
            justify-content: space-between;
            gap: 2rem;
        }
        
        .copyright {
            font-size: 0.72rem;
            color: rgba(255,255,255,0.7);
            letter-spacing: 0.02em;

            a {
                color: rgba(255,255,255,0.8);
                text-decoration: none;
                transition: var(--transition);

                &:hover {
                    color: var(--accent);
                }
            }

            .site-credit {
                a {
                    color: rgba(255,255,255,0.4);

                    &:hover {
                        color: var(--accent);
                    }
                }
            }
        }
        
        .footer-legal-links {
            .legal-links {
                display: flex;
                align-items: center;
                gap: 0.4rem;
                list-style: none;
                margin: 0;
                padding: 0;
                
                li {
                    margin: 0;
                    padding: 0;
                    display: flex;
                    align-items: center;
                    
                    &:not(:last-child)::after {
                        content: "·";
                        color: rgba(255,255,255,0.4);
                        margin-left: 0.4rem;
                        font-weight: 700;
                    }
                    
                    a {
                        font-size: 0.72rem;
                        color: rgba(255,255,255,0.7);
                        text-decoration: none;
                        transition: var(--transition);
                        padding: 0.25rem 0;

                        &:hover {
                            color: var(--accent);
                        }
                    }
                }
            }
        }
    }

    @media (max-width: 767px) {
        .footer-bottom {
            padding: 1.5rem 0;
            
            .footer-bottom-inner {
                flex-direction: column-reverse;
                text-align: center;
                gap: 1rem;
            }
            
            .footer-legal-links .legal-links {
                justify-content: center;
                flex-wrap: wrap;
                gap: 0.25rem 0.4rem;
            }
        }
    }
    
    /* Footer responsive */
    @media (max-width: 991px) {
        .footer-top .container {
            flex-direction: column;
        }
        
        .footer-info {
            max-width: 100%;
        }
        
        .accreditation-logos {
            justify-content: flex-start;
            /* margin-top: 1.5rem; */
        }
        
        /* 2-column layout for medium screens */
        .footer-columns {
            grid-template-columns: repeat(2, 1fr);
            gap: 2.5rem 3rem;
        }
    }
    
    @media (max-width: 767px) {
        /* Single column for small screens */
        .footer-columns {
            grid-template-columns: 1fr;
            gap: 2.25rem;
        }
        
        .footer-logo-text {
            flex-direction: column;
            gap: 1.5rem;
        }
        
        /* More compact spacing on mobile */
        .footer-middle {
            padding: 2.5rem 0;
        }
        
        .footer-column h3 {
            margin-bottom: 1rem;
        }
    }
}

/* ============================
   CARD COMPONENT
   ============================ */

.card {
    background: white;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    will-change: transform, box-shadow;
    height: 100%;
    display: flex;
    flex-direction: column;
    
    &:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 24px rgba(0,0,0,0.1);
        
        .card-image img {
            transform: scale(1.08);
        }
    }
    
    .card-image {
        width: 100%;
        position: relative;
        overflow: hidden;
        
        /* Default aspect ratio - can be overridden */
        aspect-ratio: 16 / 9;
        
        &.square {
            aspect-ratio: 1 / 1;
        }
        
        &.landscape {
            aspect-ratio: 4 / 3;
        }
        
        &.portrait {
            aspect-ratio: 3 / 4;
        }
        
        &.widescreen {
            aspect-ratio: 16 / 9;
        }
        
        img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s ease;
            will-change: transform;
        }
        
        a {
            display: block;
            width: 100%;
            height: 100%;
        }
    }
    
    .card-content {
        padding: 1.5rem;
        position: relative;
        display: flex;
        flex-direction: column;
        flex-grow: 1;
        
        h3 {
            font-size: 1.2rem;
            margin: 0.5rem 0 0.75rem;
            line-height: 1.3;
            
            a {
                color: var(--secondary);
                text-decoration: none;
                transition: color 0.2s ease;
                
                &:hover {
                    color: var(--primary);
                }
            }
        }
        
        .card-meta {
            color: var(--gray);
            font-size: 0.85rem;
            font-weight: 600;
            margin: 0;
            line-height: 1.3;
            display: inline-block;
        }
        
        .card-text {
            color: var(--text);
            margin-bottom: 1rem;
            font-size: 0.9rem;
            line-height: 1.5;
        }
        
        .card-link {
            margin-top: auto;
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--primary);
            text-decoration: none;
            
            &:hover {
                text-decoration: underline;
            }
        }
    }
}

/* ============================
   PAGINATION
   ============================ */

.pagination {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    
    ul {
        display: flex;
        list-style: none;
        padding: 0;
        margin: 0;
        gap: 0.3rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    li {
        margin: 0;
        
        > a, > span {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 2.5rem;
            height: 2.5rem;
            border-radius: 2px;
            background-color: white;
            color: var(--text);
            font-weight: 500;
            font-size: 0.9rem;
            text-decoration: none;
            transition: all 0.3s ease;
            border: 1px solid var(--border-color);
            position: relative;
            
            &:hover {
                background-color: var(--light-gray);
                color: var(--primary);
                border-color: var(--primary);
            }
            
            &.current {
                background-color: var(--primary);
                color: white;
                border-color: var(--primary);
                font-weight: 700;
                position: relative;
                z-index: 2;
                
                &:hover {
                    background-color: var(--primary-hover);
                    color: white;
                }
            }
        }
        
        .material-symbols-outlined {
            font-size: 1rem;
            line-height: 1;
            height: 1rem;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            top: 1px;
        }

        .prev .material-symbols-outlined {
            margin-left: 0.25rem;
        }
        
        &.dots {
            span {
                border: none;
                background: transparent;
            }
        }
    }
    
    @media (max-width: 767px) {
        margin-top: 2rem;
        
        li {
            a, span {
                width: 2.2rem;
                height: 2.2rem;
            }
        }
    }
}

/* ============================
   HOME HERO SECTION
   ============================ */

.home-hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    color: white;
    border-bottom: 4px solid var(--primary);
}

.hero-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-slideshow {
    position: absolute;
    inset: 0;
}

.hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(6, 40, 58, 0.6) 0%, rgba(6, 40, 58, 0.4) 50%, rgba(6, 40, 58, 0.32) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 5;
    width: 100%;
    padding: 6rem 0;
    pointer-events: none;
    
    /* Allow pointer events only on interactive elements */
    a, button, input, select, textarea {
        pointer-events: auto;
    }
}

.hero-content-inner {
    max-width: 840px;
    text-align: left;
    /* Flat, boxy panel keeps text readable over high-impact imagery */
    background: rgba(6, 40, 58, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--accent);
    padding: 2.25rem 2.5rem;
    animation: fadeInUp 1s ease-out;
}

/* Drop the trailing margin of the last element so the panel isn't bottom-heavy
   (e.g. the subtitle's margin when there are no CTA buttons) */
.hero-content-inner > *:last-child {
    margin-bottom: 0;
}

.hero-content-inner .section-title.tag {
    margin-bottom: 1.5rem;
    pointer-events: none;
}

.hero-title {
    font-size: clamp(2.3rem, 1.45rem + 3.2vw, 3.8rem);
    font-weight: 680;
    line-height: 1.05;
    letter-spacing: -0.035em;
    color: white;
    margin-bottom: 1.25rem;
    pointer-events: none;
}

/* Typing effect within the hero title — inherits the title's font so it matches,
   just recoloured. inline-block + JS-set min-width (longest word) prevents reflow. */
.hero-typed {
    display: inline-block;
    color: var(--accent);
    font-variation-settings: 'slnt' -6; /* real Hubot Sans slant axis (0 = upright, more negative = more slant) */
    white-space: nowrap;
}

.hero-typed::after {
    content: '_';
    margin-left: 0.02em;
    animation: hero-caret 1.1s steps(1) infinite;
}

@keyframes hero-caret {
    50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-typed::after { animation: none; }
}

.hero-subtitle {
    font-size: clamp(1rem, 0.9rem + 0.4vw, 1.2rem);
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1.5rem;
    line-height: 1.5;
    font-weight: 400;
    max-width: 750px;
    pointer-events: none;
}

.hero-cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
}

.hero-cta-buttons .button {
    /* Inherit base button styles and just override what's needed */
    padding: 0.8rem 1.8rem;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    min-width: 160px;
}

/* Video CTA Button - with play icon */
.button.video-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.button.video-cta .play-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    opacity: 0.7;
    margin-left: -0.5rem;
}

/* ============================
   HERO MARKETS BAND
   ============================ */

.hero-markets {
    position: relative;
    z-index: 6; /* lets the tab overlap the hero above */
    background: var(--secondary);
    color: white;
    padding-bottom: 3.25rem;
}

/* Techy tab, contained bottom-left, poking up onto the hero.
   left matches the container padding so it aligns with the grid content. */
.hero-markets-tab {
    position: absolute;
    left: clamp(1rem, 4vw, 3rem);
    bottom: 100%;
    display: inline-block;
    background: var(--secondary);
    color: #fff;
    font-family: 'Hubot Sans Variable', sans-serif;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 0.7rem 1.4rem;
    border-top: 3px solid var(--accent);
}

.hero-markets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding-top: 3.25rem;
}

.market-item {
    display: block;
    padding: 0 2rem;
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.market-item:first-child { padding-left: 0; }
.market-item:last-child { padding-right: 0; }
.market-item + .market-item { border-left: 1px solid rgba(255, 255, 255, 0.14); }

.market-icon {
    display: block;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 1.25rem;
    background-color: var(--accent);
    -webkit-mask: var(--market-icon) center / contain no-repeat;
    mask: var(--market-icon) center / contain no-repeat;
    transition: var(--transition);
}

.market-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 0.6rem;
}

.market-desc {
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.72);
    margin: 0;
}

a.market-item:hover .market-title { color: var(--accent); }
a.market-item:hover .market-icon { background-color: #fff; }

@media (max-width: 900px) {
    .hero-markets-grid {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 2.5rem;
    }
    .market-item { padding: 0 1.75rem; }
    .market-item + .market-item { border-left: 1px solid rgba(255, 255, 255, 0.14); }
    .market-item:nth-child(odd) { border-left: none; padding-left: 0; }
    .market-item:nth-child(even) { padding-right: 0; }
}

@media (max-width: 560px) {
    .hero-markets-grid { grid-template-columns: 1fr; }
    .market-item,
    .market-item:nth-child(odd),
    .market-item:nth-child(even) {
        padding: 1.75rem 0 0;
        border-left: none;
    }
    .market-item + .market-item { border-top: 1px solid rgba(255, 255, 255, 0.14); }
    .market-item:first-child { padding-top: 0; }
    .hero-markets-tab { font-size: 0.72rem; padding: 0.6rem 1.1rem; }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .home-hero {
        min-height: 60vh;
    }
    
    .hero-content {
        padding: 4rem 0 5rem 0;
    }
    
    .hero-content-inner {
        padding: 1.75rem 1.5rem;
        text-align: center;
    }
    
    .hero-title {
        margin-bottom: 0.8rem;
    }
    
    .hero-subtitle {
        margin-bottom: 1.5rem;
    }
    
    .hero-cta-buttons {
        justify-content: center;
        gap: 0.8rem;
    }
    
    .hero-cta-buttons .button {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .home-hero .hero-play-button {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .home-hero {
        min-height: 50vh;
    }
    
    .home-hero .hero-play-button {
        width: 70px;
        height: 70px;
    }
    
    .home-hero .hero-play-button .play-icon {
        width: 28px;
        height: 28px;
    }
    
    .home-hero .hero-play-button .circular-text {
        width: 100px;
        height: 100px;
    }
    
    .hero-content {
        padding: 3rem 0 4rem 0;
    }
    
    .hero-overlay {
        background: linear-gradient(to right, rgba(6, 40, 58, 0.55) 0%, rgba(6, 40, 58, 0.35) 100%);
    }
}

/* Short screens - based on viewport HEIGHT */
@media (max-height: 700px) {
    .hero-content {
        padding: 6rem 0 7rem 0;
    }
}

@media (max-height: 600px) {
    .hero-content {
        padding: 8rem 0 9rem 0;
    }
}

@media (max-height: 500px) {
    .hero-content {
        padding: 10rem 0 11rem 0;
    }
}

/* Ensure video plays on mobile devices */
@media (hover: none) and (pointer: coarse) {
    .hero-video {
        /* Ensure video covers properly on mobile */
        min-width: 100%;
        min-height: 100%;
    }
}

/* ============================
   404 ERROR PAGE
   ============================ */

.error-404-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(135deg, var(--secondary) 0%, #123241 100%);
    color: white;
    overflow: hidden;
    padding: 4rem 0;
    
    @media (max-width: 767px) {
        min-height: 70vh;
        padding: 3rem 0;
    }
    
    
    .container {
        position: relative;
        z-index: 1;
    }
    
    .error-404-content {
        text-align: center;
        max-width: 700px;
        margin: 0 auto;
    }
    
    .error-404-number {
        font-size: clamp(6rem, 10vw, 12rem);
        font-weight: 900;
        line-height: 1;
        margin-bottom: 1rem;
        background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.6) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        text-fill-color: transparent;
        letter-spacing: -0.02em;
    }
    
    h1 {
        font-size: clamp(2rem, 4vw, 3rem);
        margin: 0 0 1.5rem;
        color: white;
        font-weight: 800;
    }
    
    p {
        font-size: clamp(1rem, 2vw, 1.2rem);
        margin: 0 0 2.5rem;
        color: rgba(255, 255, 255, 0.85);
        line-height: 1.6;
        text-wrap: balance;
    }
    
    .button {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        font-size: 1rem;
        padding: 1rem 2rem;
        
        &:hover {
            transform: translateY(-2px);
        }
    }
}

/* =========================
   Download Shortcode Styles
   ========================= */

.download-shortcode {
    margin: 1rem 0;
}

.download-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: white;
    border: 1px solid #dce4e8;
    border-left: 4px solid var(--secondary);
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: all 0.3s ease;
    
    &:hover {
        border-left-color: var(--primary);
        box-shadow: var(--shadow);
        transform: translateX(4px);
        text-decoration: none;
        
        .download-icon {
            background: var(--primary);
        }
        
        .download-name {
            color: var(--primary);
            text-decoration: none;
        }
        
        .download-arrow {
            transform: translateX(4px);
        }
    }
}

.download-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--secondary);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    
    svg {
        color: white;
    }
}

.download-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.download-name {
    font-weight: 600;
    color: var(--secondary);
    transition: color 0.2s ease;
    line-height: 1.3;
}

.download-meta {
    font-size: 0.875rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.download-separator {
    opacity: 0.5;
}

.download-arrow {
    flex-shrink: 0;
    color: var(--secondary);
    opacity: 0.5;
    transition: transform 0.2s ease;
}

/* =========================
   YouTube Shortcode Styles
   ========================= */

.youtube-shortcode {
    margin: 1rem 0;
}

.youtube-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem 1rem 1rem;
    background: white;
    border: 1px solid #dce4e8;
    border-left: 4px solid #ff0000;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: all 0.3s ease;
    
    &:hover {
        border-left-color: var(--primary);
        box-shadow: var(--shadow);
        transform: translateX(4px);
        text-decoration: none;
        
        .youtube-thumbnail {
            .youtube-play-button {
                transform: translate(-50%, -50%) scale(1.1);
            }
        }
        
        .youtube-title {
            color: var(--primary);
            text-decoration: none;
        }
        
        .youtube-arrow {
            transform: translateX(4px);
        }
    }
}

.youtube-thumbnail {
    flex-shrink: 0;
    width: 120px;
    height: 68px;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    background: #000;
    
    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .youtube-play-button {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        transition: transform 0.2s ease;
        
        svg {
            display: block;
            width: 40px;
            height: auto;
        }
    }
}

.youtube-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.youtube-title {
    font-weight: 600;
    color: var(--secondary);
    transition: color 0.2s ease;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.youtube-meta {
    font-size: 0.875rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.youtube-source {
    color: #ff0000;
    font-weight: 500;
}

.youtube-separator {
    opacity: 0.5;
}

.youtube-channel {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.youtube-arrow {
    flex-shrink: 0;
    color: var(--secondary);
    opacity: 0.5;
    transition: transform 0.2s ease;
}

/* Responsive adjustments */
@media (max-width: 700px) {
    .youtube-channel,
    .youtube-separator {
        display: none;
    }
}

@media (max-width: 480px) {
    .youtube-link {
        flex-wrap: wrap;
        padding: 1rem;
    }
    
    .youtube-thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    
    .youtube-content {
        width: 100%;
    }
    
    .youtube-arrow {
        display: none;
    }
}