/* -----------------------------------------------------------
   1. GLOBAL VARIABLES & THEME
   ----------------------------------------------------------- */
:root {
    /* Brand Colors - Change these to update the whole site */
    --brand-dark: #0f172a;
    /* Matches bg-slate-900 */
    --brand-card: #1e293b;
    /* Matches bg-slate-800 */
    --text-main: #cbd5e1;
    /* Matches text-slate-300 */
    --text-light: #f8fafc;
    /* Matches text-slate-50 */
    --accent: #f59e0b;
    /* Matches text-amber-500 */

    /* Font Families */
    --font-serif: 'Abhaya Libre', serif;
    --font-sans: 'Montserrat', sans-serif;
}

/* Base Body Style */
body {
    background-color: var(--brand-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
}

h1,
h2,
h3,
h4,
h5 {
    font-family: var(--font-serif);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* -----------------------------------------------------------
   2. CUSTOM SCROLLBAR (Chrome/Safari/Edge)
   ----------------------------------------------------------- */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--brand-dark);
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* -----------------------------------------------------------
   3. HERO & FEATURED CAROUSEL STYLES (Moved from index.php)
   ----------------------------------------------------------- */
.featured-carousel {
    padding-bottom: 50px;
}

.featured-carousel .carousel-cell {
    width: 70%;
    height: 400px;
    margin-right: 20px;
    opacity: 0.4;
    transform: scale(0.85);
    transition: all 0.5s ease-in-out;
    border-radius: 1rem;
    border: 1px solid transparent;
    /* Prepares for hover effect */
}

/* Tablet/Desktop sizing */
@media (min-width: 768px) {
    .featured-carousel .carousel-cell {
        width: 30%;
        height: 500px;
    }
}

/* The Active/Center Slide */
.featured-carousel .carousel-cell.is-selected {
    opacity: 1;
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Carousel Dots */
.featured-carousel .flickity-page-dots {
    bottom: -40px;
}

.featured-carousel .flickity-page-dots .dot {
    background: #475569;
    opacity: 0.5;
    width: 10px;
    height: 10px;
    margin: 0 6px;
}

.featured-carousel .flickity-page-dots .dot.is-selected {
    background: #ffffff;
    opacity: 1;
    transform: scale(1.2);
}

/* -----------------------------------------------------------
   4. CATEGORY SWIPER STYLES (Moved from index.php)
   ----------------------------------------------------------- */
.category-swiper {
    width: 100%;
    padding-top: 50px;
    padding-bottom: 50px;
}

.category-swiper .swiper-slide {
    background-position: center;
    background-size: cover;
    width: 300px;
    height: 400px;
}

@media (min-width: 768px) {
    .category-swiper .swiper-slide {
        width: 400px;
        height: 500px;
    }
}

.category-swiper .swiper-slide img {
    display: block;
    width: 100%;
}

/* -----------------------------------------------------------
   4B. MAIN HERO CAROUSEL STYLES
   ----------------------------------------------------------- */
.main-carousel {
    width: 100%;
}

.main-carousel .carousel-cell {
    width: 100%;
    height: 100%;
}

/* Hero Carousel Dots */
.main-carousel .flickity-page-dots {
    bottom: 20px;
}

.main-carousel .flickity-page-dots .dot {
    background: rgba(255, 255, 255, 0.5);
    width: 12px;
    height: 12px;
    margin: 0 8px;
    transition: all 0.3s ease;
}

.main-carousel .flickity-page-dots .dot.is-selected {
    background: #f59e0b;
    transform: scale(1.3);
}

/* 5. HERO TEXT ANIMATION (Editorial Tracking)
   ----------------------------------------------------------- */

/* Default state: visible. If JS/Flickity fails, user sees content. */
.main-carousel .carousel-cell h2,
.main-carousel .carousel-cell p,
.main-carousel .carousel-cell a {
    opacity: 1;
    transform: none;
    transition: opacity 1s ease-out, transform 1s ease-out;
}

/* When Flickity is active, hide non-selected content for animation */
.main-carousel.flickity-enabled .carousel-cell h2,
.main-carousel.flickity-enabled .carousel-cell p,
.main-carousel.flickity-enabled .carousel-cell a {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
}

/* Specific state for first slide on load (Flickity might not have added .is-selected yet) */
.main-carousel.flickity-enabled .carousel-cell:first-child h2,
.main-carousel.flickity-enabled .carousel-cell:first-child p,
.main-carousel.flickity-enabled .carousel-cell:first-child a {
    opacity: 1;
    transform: none;
}

/* Show and animate when selected */
.main-carousel.flickity-enabled .carousel-cell.is-selected h2,
.main-carousel.flickity-enabled .carousel-cell.is-selected p,
.main-carousel.flickity-enabled .carousel-cell.is-selected a {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Sequential delays for smooth editorial look */
.main-carousel.flickity-enabled .carousel-cell.is-selected h2 {
    transition-delay: 0.2s;
}

.main-carousel.flickity-enabled .carousel-cell.is-selected p {
    transition-delay: 0.4s;
}

.main-carousel.flickity-enabled .carousel-cell.is-selected a {
    transition-delay: 0.6s;
}


/* --- 6. HERO CONTENT ANIMATION (Keep keyframe for other uses if any) --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 30px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}


/* --- 7. SITE-WIDE WATERMARK (For Animated Watermark Implementation) --- */
#site-watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-10deg);
    z-index: 10;
    /* UPDATED: Changed from 1 to 10 to ensure it sits above the image but below the hero text (z-20) */
    opacity: 0.03;
    /* Very subtle opacity */
    pointer-events: none;
    /* Allows clicks through the watermark */
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
    animation: sway 15s ease-in-out infinite alternate;
}

/* -----------------------------------------------------------
   8. DYNAMIC HEADER STYLES (Shrinking/Sticky)
   ----------------------------------------------------------- */

/* Keep: Decrease overall header padding/height */
#main-header.header-scrolled #header-nav {
    padding-top: 10px;
    padding-bottom: 10px;
}

/* Keep: Hide and move the profile picture */
#main-header.header-scrolled #profile-pic-container {
    opacity: 0;
    transform: translateX(-50px);
    visibility: hidden;
}

/* MODIFIED: Hide the large logo image completely (image height was 128px) */
#main-header.header-scrolled #large-logo-img {
    height: 0px;
    width: 0px;
    opacity: 0;
    margin-bottom: 0;
    /* Remove previous mb-2 */
    margin-right: 0;
}

/* UPDATED: Increased size of the small logo as requested (100px x 200px) */
#main-header.header-scrolled #small-logo-img {
    display: block;
    /* Override Tailwind's hidden class */
    height: 100px;
    /* INCREASED HEIGHT */
    width: 200px;
    /* INCREASED WIDTH */
    opacity: 1;
    margin-right: 5px;
    /* Added margin for separation from text */
}

/* The logo text (#logo-text) maintains its original size (text-3xl) on desktop. */

/* Remove bottom margin from logo block parent on scroll */
#main-header.header-scrolled #logo-block {
    margin-bottom: 0;
}

/* --- MOBILE SPECIFIC OVERRIDES (Max-width: 767px) --- */

@media (max-width: 767px) {

    /* MODIFIED: Reduce font size of logo text on mobile (pre-scroll) to 8px (0.5rem) */
    #logo-text {
        font-size: 1rem;
        /* Equivalent to 8px */
        line-height: 1.2;
    }

    /* 1. Restore mobile pre-scroll stacking (Image above Text, defined by flex-direction: column) */
    #logo-block a.group {
        flex-direction: column;
    }

    /* MODIFIED: HIDE logo text COMPLETELY on scroll (Mobile Only) */
    #main-header.header-scrolled #logo-text {
        opacity: 0;
        height: 0px;
        /* Collapse the element */
        font-size: 0;
        margin: 0;
        padding: 0;
        visibility: hidden;
    }

    /* 3. Revert logo text/logo to row layout for shrinking header, centering the remaining small logo. */
    #main-header.header-scrolled #logo-block a.group {
        flex-direction: row;
        justify-content: center;
        align-items: center;
    }
}