/* ============================================
   TORANMAL THEME - Complete Redesign
   Matches the Toranmal Tourism Website Look
   ============================================ */

/* ---- Google Font ---- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ---- Variables ---- */
:root {
    --primary: #1a5c52;
    --primary-dark: #0d3d35;
    --accent: #2d9e8e;
    --white: #ffffff;
    --light-bg: #f0f7f6;
    --text-dark: #1a2e2c;
    --text-mid: #4a6360;
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.75);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.07);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(160deg, #e8f5f3 0%, #f0f7fb 40%, #e4eff8 100%);
    background-attachment: fixed;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Hide old header & nav completely */
.header, .main-nav, .leadership-marquee {
    display: none !important;
}

/* ============================================
   TORANMAL STICKY HEADER
   ============================================ */
.toranmal-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px; /* Reduced padding for wider screens */
    height: 65px;
    background: rgba(255, 255, 255, 0.95); /* Increased opacity for better readability */
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

.toranmal-logo {
    display: flex;
    align-items: center;
    gap: 8px; /* Reduced gap */
    text-decoration: none;
    min-width: 120px; /* Reduced min-width */
}

.toranmal-logo img {
    height: 34px; /* Slightly smaller logo */
    width: 34px;
    object-fit: contain;
}

.toranmal-logo span {
    font-size: 1.1rem; /* Slightly smaller text */
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* Desktop Nav */
.toranmal-nav {
    display: flex;
    align-items: center;
    gap: 2px; /* Reduced gap */
    flex: 1;
    justify-content: center;
}

.toranmal-nav .nav-item {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.82rem; /* Reduced font size to fit all 10 links */
    padding: 6px 9px; /* Reduced padding */
    border-radius: 20px;
    transition: all 0.25s ease;
    white-space: nowrap; /* Prevent wrapping */
    cursor: pointer;
    background: transparent;
    border: none;
}

.toranmal-nav .nav-item:hover {
    background: rgba(26, 92, 82, 0.1);
    color: var(--primary);
}

.toranmal-nav .nav-item.active {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* Header Right */
.toranmal-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    justify-content: flex-end;
}

.lang-select {
    padding: 5px 28px 5px 10px;
    border-radius: 20px;
    border: 1.5px solid rgba(26, 92, 82, 0.3);
    background: rgba(255, 255, 255, 0.8);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

@media (max-width: 900px) {
    .toranmal-nav { display: none; }
    .mobile-menu-btn { display: flex !important; }
    .toranmal-header { padding: 0 20px; }
}

/* ============================================
   HOME LANDING PAGE (Toranmal Layout)
   ============================================ */
#home-landing {
    display: block;
}

#inner-page-wrapper {
    display: none;
    padding-top: 65px;
    min-height: calc(100vh - 65px);
}

/* ============================================
   HERO SECTION - Full Bleed
   ============================================ */
.t-hero {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.t-hero-slideshow {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.t-hero-slideshow img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.t-hero-slideshow img.active {
    opacity: 1;
}

.t-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.5) 100%
    );
    z-index: 2;
}

.t-hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: white;
    padding: 0 20px;
    max-width: 800px;
}

.t-hero-content h1 {
    font-size: clamp(2.8rem, 6vw, 5rem);
    font-weight: 800;
    line-height: 1.1;
    text-shadow: 0 4px 20px rgba(0,0,0,0.4);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.t-hero-content p {
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    font-weight: 400;
    opacity: 0.92;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    margin-bottom: 36px;
}

.t-hero-btns {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-t-primary {
    background: var(--primary);
    color: white;
    padding: 14px 36px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(26, 92, 82, 0.4);
    transition: all 0.3s;
    font-family: 'Outfit', sans-serif;
}

.btn-t-secondary {
    background: rgba(255,255,255,0.92);
    color: var(--primary);
    padding: 14px 36px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transition: all 0.3s;
    font-family: 'Outfit', sans-serif;
}

.btn-t-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(26, 92, 82, 0.5); }
.btn-t-secondary:hover { transform: translateY(-3px); background: white; }

/* Slide dots */
.t-hero-dots {
    position: absolute;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    display: flex;
    gap: 8px;
}

.t-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    padding: 0;
}

.t-dot.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

/* ============================================
   SECTION COMMON STYLES
   ============================================ */
.t-section {
    padding: 70px 5% 60px;
    position: relative;
}

.t-section-light {
    background: transparent;
}

.t-section-glass {
    background: rgba(255,255,255,0.35);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.t-section-title {
    text-align: center;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 40px;
    letter-spacing: -0.3px;
    position: relative;
}

.t-section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    margin: 12px auto 0;
}

/* ============================================
   EXPLORE CARDS SECTION
   ============================================ */
.t-explore-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 900px) { .t-explore-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .t-explore-grid { grid-template-columns: 1fr; } }

.t-explore-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 3/4;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: transform 0.4s ease, box-shadow 0.4s;
}

.t-explore-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.15);
}

.t-explore-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.t-explore-card:hover img {
    transform: scale(1.08);
}

.t-explore-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 15px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    color: white;
    font-weight: 700;
    font-size: 1.05rem;
    text-align: center;
}

/* ============================================
   MAP SECTION
   ============================================ */
.t-map-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--glass-border);
    background: white;
}

.t-map-wrapper iframe {
    width: 100%;
    height: 380px;
    display: block;
    border: none;
}

/* ============================================
   EVENTS SECTION
   ============================================ */
.t-events-slider {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0 20px;
    scroll-snap-type: x mandatory;
    max-width: 1200px;
    margin: 0 auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) #e0eded;
}

.t-events-slider::-webkit-scrollbar { height: 5px; }
.t-events-slider::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.t-event-card {
    flex: 0 0 340px;
    scroll-snap-align: start;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-card);
    background: white;
    transition: transform 0.3s;
}

.t-event-card:hover { transform: translateY(-4px); }

.t-event-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.t-event-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 16px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    color: white;
}

.t-event-info h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.t-event-info .t-event-date {
    font-size: 0.82rem;
    opacity: 0.8;
}

.t-event-stars {
    display: flex;
    gap: 3px;
    margin-top: 5px;
}

.t-star { font-size: 0.75rem; color: #ffd700; }

.t-view-more {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 28px auto 0;
    gap: 8px;
    padding: 10px 32px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(26, 92, 82, 0.25);
    border-radius: 30px;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Outfit', sans-serif;
    max-width: 180px;
}

.t-view-more:hover {
    background: white;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

/* ============================================
   PHOTO GALLERY SECTION
   ============================================ */
.t-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .t-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

.t-gallery-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s, box-shadow 0.3s;
}

.t-gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.t-gallery-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.t-gallery-item:nth-child(5),
.t-gallery-item:nth-child(6) {
    height: 200px;
}

.t-gallery-item:nth-child(5) img,
.t-gallery-item:nth-child(6) img {
    height: 200px;
}

/* ============================================
   INNER PAGES (dynamic content area)
   ============================================ */
#inner-page-wrapper .app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 24px 60px;
}

/* Override old styles for inner pages */
.content-area {
    background: transparent !important;
    box-shadow: none !important;
}

/* ============================================
   FOOTER OVERRIDE
   ============================================ */
.footer {
    margin-top: 0;
}

/* ============================================
   SECTION BACKGROUND STRIPES (like Toranmal)
   ============================================ */
.t-section:nth-child(odd) {
    background: transparent;
}

/* Gradient divider between sections */
.t-section + .t-section {
    border-top: 1px solid rgba(26, 92, 82, 0.08);
}

/* ============================================
   GLASSMORPHISM CARDS (carried over)
   ============================================ */
.cream-card, .scheme-detail-box, .contact-card, .emergency-helpline-card {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--shadow-card) !important;
    border-radius: var(--radius-md) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.cream-card:hover, .scheme-detail-box:hover, .contact-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 14px 35px rgba(0,0,0,0.1) !important;
}

/* Inner page section titles */
.section-title {
    color: var(--text-dark) !important;
    font-size: 2rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.3px;
    text-align: center !important;
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
}

.section-title::after {
    background: var(--primary) !important;
    display: block;
    margin: 10px auto 0;
    position: relative !important;
    left: auto !important;
    transform: none !important;
    width: 50px !important;
}

/* Active nav item underline */
.toranmal-nav .nav-item.active {
    position: relative;
}

/* ============================================
   SIDEBAR / MOBILE MENU
   ============================================ */
.sidebar-menu {
    position: fixed;
    top: 0;
    left: -320px;
    width: 290px;
    height: 100vh;
    background: white;
    z-index: 10001;
    transition: left 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    overflow-y: auto;
}

.sidebar-menu.open {
    left: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: #f8faf9;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 10000;
}

/* ============================================
   GALLERY IMAGES FIX  
   ============================================ */
.t-gallery-grid {
    min-height: 320px;
}

.t-gallery-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

/* Make the tall-span items fill properly */
.t-gallery-item[style*="grid-row: span 2"] img {
    height: 332px !important;
}

/* ============================================
   INNER PAGE — PADDING-TOP FIX
   ============================================ */
#inner-page-wrapper {
    padding-top: 65px;
}

#inner-page-wrapper .app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 24px 60px;
    box-sizing: border-box;
    overflow-x: hidden;
    width: 100%;
}

/* Remove old sidebar reference that may conflict */
.main-nav { display: none !important; }

/* Home landing fills screen (no extra padding) */
#home-landing {
    padding-top: 65px; /* below sticky header */
}

#home-landing .t-hero {
    margin-top: -65px; /* hero goes under header */
    height: 100vh;
}

/* ============================================
   MOBILE FIXES - Language Dropdown & Headings
   ============================================ */

/* Ensure lang-select wrapper custom arrow shows correctly on all screens */
.lang-select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.lang-select-wrapper .lang-chevron {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-52%);
    font-size: 0.95rem;
    color: var(--primary);
    pointer-events: none;
    line-height: 1;
}

/* Mobile (<=768px) language select fix */
@media (max-width: 768px) {
    .lang-select {
        padding: 5px 24px 5px 8px !important;
        font-size: 0.74rem !important;
        appearance: none !important;
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        max-width: 90px;
    }
    .lang-select-wrapper .lang-chevron {
        right: 7px;
        font-size: 0.85rem;
    }

    /* Inner page content — reduce padding on mobile */
    #inner-page-wrapper .app-container {
        padding: 20px 14px 40px !important;
    }

    /* CRITICAL: prevent table from stretching parent section/heading */
    #inner-page-wrapper section,
    #dynamic-content-area section {
        overflow-x: hidden;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Scheme detail box — clip overflow, allow table to scroll inside */
    .scheme-detail-box {
        overflow-x: hidden !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Table container scrolls independently */
    .revenue-table-container {
        overflow-x: auto !important;
        max-width: 100% !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Section titles — properly sized and contained */
    .section-title {
        font-size: clamp(1.1rem, 5vw, 1.5rem) !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Cream card / scheme boxes — ensure no overflow */
    .cream-card, .contact-card, .emergency-helpline-card {
        padding: 16px 14px !important;
        overflow-x: hidden;
    }

    /* Content area inner page: allow full width */
    #dynamic-content-area {
        width: 100%;
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    .lang-select {
        padding: 4px 22px 4px 7px !important;
        font-size: 0.70rem !important;
        max-width: 80px;
    }
    .lang-select-wrapper .lang-chevron {
        right: 6px;
        font-size: 0.8rem;
    }

    /* Inner page section titles on small mobile */
    .section-title {
        font-size: 1.25rem !important;
        line-height: 1.3 !important;
        margin-bottom: 16px !important;
        padding-bottom: 10px !important;
    }

    /* Ensure heading text doesn't get clipped */
    #inner-page-wrapper h1,
    #inner-page-wrapper h2,
    #inner-page-wrapper h3,
    #inner-page-wrapper h4 {
        overflow-wrap: break-word;
        word-break: break-word;
        max-width: 100%;
    }
}

@media (max-width: 400px) {
    .lang-select {
        padding: 4px 20px 4px 6px !important;
        font-size: 0.68rem !important;
        max-width: 72px;
    }

    /* Inner page compact padding */
    #inner-page-wrapper .app-container {
        padding: 16px 10px 30px !important;
    }
}
