﻿/* ============================================================
   KITCHEN LAB MALTA — home.css   (homepage only)
   ============================================================ */

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 55% 45%;
    position: relative;
    overflow: hidden;
}

.hero-left {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 var(--gutter) 100px;
    position: relative;
    z-index: 2;
    background-color: var(--hero-left-bg, transparent);
}

[data-theme="light"] .hero-left {
    background: var(--hero-left-bg, #1A0E05);
}

.hero-eyebrow {
    font-size: 10.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-red);
    margin-bottom: 36px;
    display: flex;
    align-items: center;
    gap: 14px;
}

    .hero-eyebrow::before {
        content: '';
        display: block;
        width: 36px;
        height: 1px;
        background: var(--c-red);
    }

.hero-headline {
    font-family: var(--f-serif);
    font-size: clamp(72px,7.5vw,116px);
    font-weight: 300;
    letter-spacing: -0.025em;
    margin-bottom: 52px;
}

.hero-headline .accent {
    color: var(--c-red);
    font-style: italic;
}

.hero-sub {
    font-size: 14px;
    color: var(--c-muted-light);
    max-width: 380px;
    line-height: 1.85;
    margin-bottom: 52px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 36px;
}

.hero-right {
    position: relative;
    overflow: hidden;
}

.hero-img {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--c-bg) 0%, var(--c-hero-grad-r) 35%, transparent 58%), linear-gradient(to bottom, var(--c-hero-grad-b) 0%, transparent 40%, var(--c-bg) 100%), var(--hero-img-url, url('../images/hero.png')) center/cover no-repeat;
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 44px;
    right: var(--gutter);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--c-muted);
    font-size: 9.5px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    z-index: 3;
}

/* ── Editorial Split ───────────────────────────────────────── */
.section {
    padding: 130px var(--gutter);
}

.editorial {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 96px;
    align-items: center;
}

.ed-img-wrap {
    position: relative;
    height: 640px;
    overflow: hidden;
}

    .ed-img-wrap img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        filter: brightness(0.85);
    }

.ed-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--c-bg) 0%, transparent 50%);
}
/* Keep editorial image unaffected by light mode */
[data-theme="light"] .ed-img-overlay {
    background: linear-gradient(135deg, rgba(26,14,5,0.3) 0%, transparent 50%);
}

[data-theme="light"] .ed-img-wrap img {
    filter: brightness(0.85); /* same as dark mode — no washout */
    pointer-events: none;
}

.ed-text .sec-h2 {
    margin-bottom: 36px;
}

.ed-text p {
    margin-bottom: 20px;
}

    .ed-text p:last-of-type {
        margin-bottom: 40px;
    }

/* ── Category Grid ─────────────────────────────────────────── */
.cat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 48px;
}
/* ── Category Carousel ──────────────────────────────────────── */
.cat-carousel-wrap {
    position: relative;
}

.cat-carousel-wrap {
    position: relative;
}

/* Swiper's root needs to clip its slide track to its own box — without
   this, the full un-clipped row of slides renders at its total combined
   width instead of being cropped down to what should be visible, which
   is what was causing the carousel to visually stretch past the screen
   edge (worse on mobile, where slidesPerView:1.25 already means more of
   the track sits outside the intended viewing window). */
.swiperCategories {
    overflow: hidden;
    width: 100%;
}

.cat-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 3px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    cursor: grab;
}

    .cat-carousel::-webkit-scrollbar {
        display: none;
    }

    .cat-carousel.dragging {
        cursor: grabbing;
        scroll-behavior: auto;
    }

.cat-card {
    scroll-snap-align: start;
    flex: 0 0 calc(25% - 3px);
    position: relative;
    height: 500px;
    overflow: hidden;
    display: block;
    text-decoration: none;
}

.cat-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.8s cubic-bezier(0.25,0.46,0.45,0.94);
}

.cat-card:hover .cat-bg {
    transform: scale(1.07);
}

.cat-darken {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--c-hero-dark) 0%, var(--c-cat-mid) 55%, var(--c-hero-light) 100%);
    transition: background 0.5s ease;
}

.cat-card:hover .cat-darken {
    background: linear-gradient(to top, var(--c-cat-dark) 0%, var(--c-hero-mid) 55%, var(--c-cat-mid) 100%);
}
/* Force dark overlays on image cards regardless of theme */
[data-theme="light"] .cat-darken {
    background: linear-gradient(to top, rgba(26,14,5,0.97) 0%, rgba(26,14,5,0.3) 55%, rgba(26,14,5,0.1) 100%);
}

[data-theme="light"] .cat-card:hover .cat-darken {
    background: linear-gradient(to top, rgba(26,14,5,1) 0%, rgba(26,14,5,0.6) 55%, rgba(26,14,5,0.25) 100%);
}
/* Keep category text white on image cards in light mode */
[data-theme="light"] .cat-name {
    color: #fff;
}

[data-theme="light"] .cat-tag {
    color: var(--c-red);
}

[data-theme="light"] .cat-sub {
    color: rgba(255,255,255,0.6);
}

[data-theme="light"] .cat-corner {
    color: rgba(255,255,255,0.6);
    border-color: rgba(255,255,255,0.2);
}

[data-theme="light"] .cat-line {
    background: rgba(255,255,255,0.25);
}

.cat-corner {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    opacity: 0;
    transform: translate(6px,-6px);
    transition: all 0.4s ease;
    z-index: 2;
}

.cat-card:hover .cat-corner {
    opacity: 1;
    transform: translate(0,0);
}

.cat-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px;
    z-index: 2;
}

.cat-tag {
    font-size: 9.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--c-red);
    margin-bottom: 10px;
}

.cat-line {
    width: 0;
    height: 1px;
    background: var(--c-red);
    margin-bottom: 16px;
    transition: width 0.4s ease;
}

.cat-card:hover .cat-line {
    width: 32px;
}

.cat-name {
    font-family: var(--f-serif);
    font-size: 30px;
    font-weight: 300;
    margin-bottom: 12px;
    color: var(--c-text);
}

.cat-sub {
    font-size: 12px;
    color: var(--c-text-faint);
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.4s ease;
}

.cat-card:hover .cat-sub {
    opacity: 1;
    transform: translateY(0);
}

/* ── Brands Section ────────────────────────────────────────── */
.brands-section {
    background: var(--c-brown-mid);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.brands-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 64px;
}

.brands-grid {
    display: grid;
    grid-template-columns: repeat(6,1fr);
    border: 1px solid var(--border);
}

.brand-cell {
    padding: 36px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s ease;
    cursor: default;
    text-align: center;
}

    .brand-cell:nth-child(6n) {
        border-right: none;
    }

    .brand-cell:nth-child(n+7) {
        border-bottom: none;
    }

.brand-name {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--c-muted);
    transition: color 0.3s;
}

.brand-type {
    font-size: 9.5px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--c-muted);
    opacity: 0;
    transition: opacity 0.3s;
    margin-top: 2px;
}

.brand-cell:hover {
    background: rgba(232,57,28,0.04);
}

    .brand-cell:hover .brand-name {
        color: var(--c-text);
    }

    .brand-cell:hover .brand-type {
        opacity: 1;
    }

/* ── Formula / Why Partner ─────────────────────────────────── */
.formula-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 120px;
    align-items: flex-start;
}

.formula-sticky {
    position: sticky;
    top: 130px;
}

    .formula-sticky .sec-h2 {
        margin-top: 24px;
    }

.formula-list {
    display: flex;
    flex-direction: column;
}

.formula-row {
    padding: 52px 0;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 32px;
    align-items: flex-start;
}

    .formula-row:first-child {
        border-top: 1px solid var(--border);
    }

.f-num {
    font-family: var(--f-serif);
    font-size: 52px;
    font-weight: 300;
    color: var(--c-text-ghost);
    line-height: 1;
    transition: color 0.4s ease;
}

.formula-row:hover .f-num {
    color: var(--c-red);
}

.f-text h3 {
    font-family: var(--f-sans);
    font-size: 17px;
    font-weight: 500;
    margin-bottom: 14px;
    margin-top: 10px;
}

.f-text p {
    font-size: 13.5px;
    line-height: 1.85;
}

/* ============================================================
   RESPONSIVE — home page
   ============================================================ */

/* ── Hero ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 60% 40%;
    }

    .hero-headline {
        font-size: clamp(56px, 6vw, 88px);
    }
}

@media (max-width: 767px) {
    .hero {
        grid-template-columns: 1fr;
        min-height: 100svh;
        position: relative;
    }

    .hero-right {
        position: absolute;
        inset: 0;
        z-index: 0;
    }

    .hero-img {
        background: linear-gradient(to bottom, rgba(26,14,5,0.72) 0%, rgba(26,14,5,0.45) 40%, rgba(26,14,5,0.85) 100%), var(--hero-img-url, url('../images/hero.png')) center/cover no-repeat;
    }

    .hero-left {
        position: relative;
        z-index: 2;
        padding: 0 var(--gutter) 72px;
        padding-top: calc(72px + 48px);
        justify-content: flex-end;
        min-height: 100svh;
        background-color: transparent;
    }

    [data-theme="light"] .hero-left {
    background: transparent;
}

    .hero-headline {
        font-size: clamp(52px, 12vw, 80px);
        margin-bottom: 28px;
    }

    .hero-sub {
        font-size: 14px;
        margin-bottom: 36px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

        .hero-actions .btn {
            width: 100%;
            justify-content: center;
        }

    .hero-scroll-indicator {
        display: none;
    }

    .hero-eyebrow {
        margin-bottom: 24px;
    }
}

/* ── Editorial split ───────────────────────────────────────── */
.sec-h2 .accent {
    color: var(--c-red);
    font-style: italic;
}

@media (max-width: 900px) {
    .editorial {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .ed-img-wrap {
        height: 420px;
    }
}

@media (max-width: 767px) {
    .section {
        padding: 72px var(--gutter);
    }

    .ed-img-wrap {
        height: 280px;
    }
}

/* ── Category grid ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .cat-card {
        flex: 0 0 calc(45% - 2px);
        height: 380px;
    }
}

@media (max-width: 600px) {
    .cat-card {
        flex: 0 0 80%;
        height: 320px;
    }

    .cat-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 28px;
    }
}

/* ── Brands grid ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .brands-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .brand-cell:nth-child(6n) {
        border-right: 1px solid var(--border);
    }

    .brand-cell:nth-child(n+7) {
        border-bottom: 1px solid var(--border);
    }

    .brand-cell:nth-child(4n) {
        border-right: none;
    }

    .brand-cell:nth-child(n+9) {
        border-bottom: none;
    }
}

@media (max-width: 600px) {
    .brands-section {
        padding: 60px var(--gutter);
    }

    .brands-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 40px;
    }

    .brands-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .brand-cell {
        padding: 24px 12px;
    }

        .brand-cell:nth-child(4n) {
            border-right: 1px solid var(--border);
        }

        .brand-cell:nth-child(3n) {
            border-right: none;
        }
}

/* ── Formula / Why Partner ─────────────────────────────────── */
@media (max-width: 900px) {
    .formula-wrap {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .formula-sticky {
        position: static;
    }
}

@media (max-width: 767px) {
    .formula-row {
        grid-template-columns: 48px 1fr;
        gap: 20px;
        padding: 36px 0;
    }

    .f-num {
        font-size: 36px;
    }
}

/* ============================================================
   FIX 4 — Mobile brands grid: restore missing borders on last row
   ============================================================ */
@media (max-width: 600px) {
    .brands-grid {
        border: 1px solid var(--border);
    }

    .brand-cell {
        border-right: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }
        /* Reset all nth-child overrides and use simple 3-column rule */
        .brand-cell:nth-child(3n) {
            border-right: none;
        }

        .brand-cell:nth-child(4n) {
            border-right: 1px solid var(--border);
        }

        .brand-cell:nth-child(n+7) {
            border-bottom: 1px solid var(--border);
        }
        /* Last 3 items — remove bottom border */
        .brand-cell:nth-last-child(-n+3) {
            border-bottom: none;
        }
}

/* ── Category Carousel arrows ──────────────────────────────── */
.cat-arrows {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
    pointer-events: none;
}

.cat-arrows {
    top: -52px;
    right: 0;
    transform: none;
}

.cat-arrow {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--c-bg);
    color: var(--c-text-muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    pointer-events: all;
}

    .cat-arrow:hover {
        border-color: var(--border-mid);
        color: var(--c-text);
    }

    .cat-arrow:disabled {
        opacity: 0.25;
        cursor: default;
    }

/* ── Carousel progress dots (mobile) ───────────────────────── */
.cat-dots {
    display: none;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}

@media (max-width:767px) {
    .cat-dots {
        display: flex;
    }

    .cat-arrows {
        display: none;
    }
}

.cat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-text-dimmer);
    transition: background 0.3s, width 0.3s;
    border: none;
    cursor: pointer;
    padding: 0;
}

    .cat-dot.active {
        background: var(--c-red);
        width: 18px;
        border-radius: 3px;
    }

/* ── Cat card reveal in carousel ───────────────────────────── */
.cat-carousel .cat-card {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

    .cat-carousel .cat-card.visible {
        opacity: 1;
        transform: translateY(0);
    }

/* Force hero image to stay dark/cinematic in light mode */
[data-theme="light"] .hero-img {
    background: linear-gradient(to right, #1A0E05 0%, rgba(26,14,5,0.35) 35%, transparent 58%), linear-gradient(to bottom, rgba(26,14,5,0.25) 0%, transparent 40%, #1A0E05 100%), var(--hero-img-url, url('../images/hero.png')) center/cover no-repeat !important;
}
/* Keep hero text white in light mode */
/* ── Hero: always dark/cinematic regardless of theme ────────── */

    [data-theme="light"] .hero-headline .accent {
        color: var(--c-red) !important;
    }

[data-theme="light"] .hero-sub {
    color: rgba(255,255,255,0.7) !important;
}

[data-theme="light"] .hero-eyebrow {
    color: var(--c-red) !important;
}

    [data-theme="light"] .hero-eyebrow::before {
        background: var(--c-red) !important;
    }

/* Force mobile hero to stay dark in light mode */
@media (max-width: 767px) {
    [data-theme="light"] .hero-img {
        background: linear-gradient(to bottom, rgba(26,14,5,0.72) 0%, rgba(26,14,5,0.45) 40%, rgba(26,14,5,0.85) 100%), var(--hero-img-url, url('../images/hero.png')) center/cover no-repeat !important;
    }

}

/* ── Hero CTA buttons — always light text on dark hero regardless of theme ── */
[data-theme="light"] .hero-actions .btn-outline {
    color: #fff;
    border-color: rgba(255,255,255,0.35);
}

    [data-theme="light"] .hero-actions .btn-outline:hover {
        border-color: #fff;
        color: #fff;
    }

[data-theme="light"] .hero-actions .btn-ghost {
    color: rgba(255,255,255,0.55);
}

    [data-theme="light"] .hero-actions .btn-ghost:hover {
        color: #fff;
    }

    [data-theme="light"] .hero-actions .btn-ghost::after {
        color: rgba(255,255,255,0.55);
    }

[data-theme="light"] .hero-scroll-indicator {
    color: rgba(255,255,255,0.35);
}

    [data-theme="light"] .hero-scroll-indicator .scroll-line {
        background: rgba(255,255,255,0.2);
    }
