/* /MalaysiaExploration/ethnic_styles.css */
/* Shared styles for the Malaysia Exploration section (overview and sub-pages) */
:root {
    /* ... your existing ME :root variables ... */
    --navbar-height: var(--cn-actual-height, 79px);
    --navbar-height-mobile: var(--cn-actual-height-mobile, 60px);
    --me-font-heading: 'Merriweather', serif;
    --me-font-body: 'Poppins', sans-serif;
    --me-color-primary: #ffd77b;
    --me-color-secondary: #ffe4a1;
    --me-color-accent: #ff8c00;
    --me-color-dark: #2c3e50;
    --me-color-text-body: #34495e;
    --me-color-light: #fdfcf9; /* Slightly warmer page background */
    --me-color-white: #ffffff;
    --me-color-grey: #707B81; /* Refined grey */
    --me-shadow-soft: 0 4px 12px rgba(0,0,0,0.05);
    --me-shadow-medium: 0 7px 22px rgba(0,0,0,0.08);
    --me-shadow-strong: 0 10px 30px rgba(0,0,0,0.1);
    --me-border-radius: 14px; /* Softer, slightly larger radius */
    --me-border-radius-small: 8px;
    --me-transition-speed: 0.3s;
    --me-transition-cubic: cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Theme colors for cards - Adjusted for better readability with white text */
    --theme-malay-primary: #005944;  /* Darker Green */
    --theme-malay-secondary: #00796B; /* Teal Green */
    --theme-chinese-primary: #B71C1C; /* Deeper Red */
    --theme-chinese-secondary: #E64A19; /* Deep Orange-Red */
    --theme-indian-primary: #FF8F00; /* Amber/Deep Saffron */
    --theme-indian-secondary: #FFB300; /* Bright Gold/Yellow-Orange */

    /* Sub-Navigation */
    --me-sub-nav-bg: var(--me-color-dark);
    --me-sub-nav-text: var(--me-color-light);
    --me-sub-nav-text-hover: var(--me-color-primary);
    --me-sub-nav-active-bg: var(--me-color-primary);
    --me-sub-nav-active-text: var(--me-color-dark);
    --me-sub-nav-height: 50px;
    --me-sub-nav-height-mobile: 44px;

    /* Tooltip */
    --me-tooltip-bg: #263238; /* Darker, slightly blueish grey */
    --me-tooltip-text: #ECEFF1; /* Off-white for tooltip text */
    --me-card-hover-scale: 1.025; /* Refined hover scale */
}

/* --- Base Styles --- */
body {
    margin: 0;
    font-family: var(--me-font-body);
    background-color: var(--me-color-light);
    color: var(--me-color-text-body);
    line-height: 1.7; /* Consistent line height */
    overflow-x: hidden;
    /* padding-top for common-header is handled by common_navbar.css directly on body */
}

*, *::before, *::after {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: var(--me-color-accent); /* Default link color */
    transition: color var(--me-transition-speed) ease;
}
a:hover {
    color: color-mix(in srgb, var(--me-color-accent) 80%, black); /* Darken accent on hover */
}

/* --- Main Wrapper for Ethnic Pages --- */
.me-main-content-area, /* For ethnic_page.html */
.me-page-wrapper {        /* For sub-pages like Chinese.html */
    display: flex;
    flex-direction: column;
    /* Account for main navbar AND sub-navbar if sticky */
    min-height: calc(100vh - var(--navbar-height) - var(--me-sub-nav-height));
    padding-top: var(--me-sub-nav-height); /* Space for the sticky sub-navigation */
}

@media (max-width: 768px) {
    .me-main-content-area,
    .me-page-wrapper {
        min-height: calc(100vh - var(--navbar-height-mobile) - var(--me-sub-nav-height-mobile));
        padding-top: var(--me-sub-nav-height-mobile);
    }
}


/* --- Sub-Navigation (Common for all MalaysiaExploration pages) --- */
.me-sub-navigation {
    background-color: var(--me-sub-nav-bg);
    padding: 0 1.5rem; /* Let container handle max-width */
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: var(--navbar-height); /* Stick below the main common navbar */
    z-index: 999;
    overflow-x: auto;
    white-space: nowrap;
    height: var(--me-sub-nav-height);
    display: flex;
    align-items: center;
}
.me-sub-navigation::-webkit-scrollbar { height: 3px; }
.me-sub-navigation::-webkit-scrollbar-thumb { background: var(--me-color-primary); border-radius: 2px; }
.me-sub-navigation::-webkit-scrollbar-track { background: rgba(255,255,255,0.1); }

.me-sub-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 0.5rem; /* Slightly reduced gap between links */
    width: 100%;
}

.me-sub-nav-link {
    color: var(--me-sub-nav-text);
    padding: 0.6rem 1.1rem; /* Balanced padding */
    border-radius: var(--me-border-radius-small);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
    opacity: 0.85;
    border-bottom: 3px solid transparent; /* For active state underline */
}
.me-sub-nav-link:hover {
    opacity: 1;
    color: var(--me-sub-nav-text-hover);
    background-color: rgba(255,255,255,0.05);
}
.me-sub-nav-link.active-sub-link { /* JS adds this class */
    color: var(--me-sub-nav-active-text);
    background-color: var(--me-sub-nav-active-bg);
    font-weight: 600;
    opacity: 1;
    border-bottom-color: var(--me-color-accent); /* Underline for active sub-link */
}

@media (max-width: 768px) {
    .me-sub-navigation {
        top: var(--navbar-height-mobile);
        height: var(--me-sub-nav-height-mobile);
        padding: 0 1rem;
    }
    .me-sub-nav-container {
        justify-content: flex-start; /* Allow horizontal scroll */
    }
    .me-sub-nav-link {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
    }
}

/* --- Hero Section for ethnic_page.html --- */
.me-hero-new {
    background: url('KLCC_backdrop.png') no-repeat center center/cover;
    /* image-rendering: crisp-edges; -- avoid, can look pixelated */
    background-position: center 35%; /* Adjusted for KLCC towers */
    color: var(--me-color-white);
    padding: clamp(4rem, 15vh, 8rem) 1.5rem; /* Responsive padding */
    text-align: center;
    position: relative;
    min-height: 45vh; /* Slightly less than 50vh for balance */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 -1.5rem; /* Extend to edges if parent .me-main-content-area has padding */
}
.me-hero-overlay-new {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.7) 0%, rgba(255, 215, 123, 0.5) 100%);
    z-index: 1;
}

.me-hero-content-new {
    position: relative;
    z-index: 2;
    max-width: 750px;
}

.me-hero-content-new h2 {
    font-family: var(--me-font-heading);
    font-size: clamp(2.2rem, 6vw, 3.5rem); /* Adjusted */
    font-weight: 700; margin-bottom: 1.25rem;
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
    line-height: 1.25;
    /* animation: real-pop-up 0.6s 0.2s ease-out forwards; -- Animation applied by JS .is-visible */
}
.me-hero-content-new p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    max-width: 650px; margin: 0 auto; opacity: 0.95;
    line-height: 1.7;
    /* animation: real-pop-up 0.6s 0.4s ease-out forwards; -- Animation applied by JS .is-visible */
}

/* Keyframes for pop-up (already defined, ensure no conflicts) */
@keyframes real-pop-up { /* ... */ }


/* --- Culture Showcase Section (on ethnic_page.html) --- */
.me-culture-showcase-new {
    padding: 4.5rem 1.5rem 5.5rem 1.5rem; /* Increased padding */
    background-color: var(--me-color-white);
}
.me-section-title-new {
    padding-top: 15px; /* Space for the title */
    text-align: center; margin-bottom: 4rem;
}
.me-section-title-new span { /* "Choose Your Path" */
    display: block; font-size: 0.9rem; font-weight: 500;
    color: var(--me-color-accent); text-transform: uppercase;
    letter-spacing: 1px; margin-bottom: 0.5rem; /* More space */
}
.me-section-title-new h3 { /* "Explore Our Diverse Heritage" */
    font-family: var(--me-font-heading); font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 700; color: var(--me-color-dark); margin: 0;
}

.me-culture-grid-new {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); /* Min card width */
    gap: 2.5rem; /* Slightly more gap */
    max-width: 1150px; /* Slightly wider container */
    margin: 0 auto;
}

.me-culture-card-new {
    color: var(--me-color-white);
    border-radius: var(--me-border-radius);
    box-shadow: var(--me-shadow-medium);
    overflow: hidden;
    transition: transform 0.35s var(--me-transition-cubic), 
                box-shadow 0.35s var(--me-transition-cubic);
    position: relative;
    min-height: 430px; /* Ensure consistent height, adjust as needed */
    display: flex;
    flex-direction: column;
    text-decoration: none;
}
.me-culture-card-new:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--me-shadow-strong);
}

.me-card-bg-new {
    position: absolute; inset: 0; z-index: 1;
    transition: opacity 0.5s ease-out, transform 0.4s ease-out;
    border-radius: var(--me-border-radius);
}
/* Themed Backgrounds */
/* Ensure these themed backgrounds provide enough contrast for white text */
.malay-theme-bg { background-image: linear-gradient(140deg, var(--theme-malay-secondary, #00796B), var(--theme-malay-primary, #004D40)); }
.chinese-theme-bg { background-image: linear-gradient(140deg, var(--theme-chinese-secondary, #F5B041), var(--theme-chinese-primary, #B71C1C)); }
.indian-theme-bg { background-image: linear-gradient(140deg, var(--theme-indian-secondary, #FFC300), var(--theme-indian-primary, #FF8F00)); }

.me-culture-card-new:hover .me-card-bg-new {
    transform: scale(1.03);
    opacity: 0.9;
}

.me-card-content-new {
    padding: 1.5rem; /* Unified padding */
    position: relative; z-index: 2; margin-top: auto;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 10%, rgba(0,0,0,0.6) 60%, transparent 100%); /* Darker gradient from bottom */
    border-radius: 0 0 var(--me-border-radius) var(--me-border-radius);
    display: flex; flex-direction: column; flex-grow: 1;
    min-height: 220px; /* Ensure enough space for text content */
}

.me-card-header-icon {
    margin-bottom: 0.75rem;
    align-self: flex-start; /* Align icon to the start */
}
.me-card-icon-new {
    font-size: 2.6rem;
    color: var(--me-color-white);
    opacity: 0.8;
    /* Transition for icon properties, including the new ones */
    transition: transform 0.35s var(--me-transition-cubic), 
                opacity 0.35s var(--me-transition-cubic),
                text-shadow 0.35s var(--me-transition-cubic), /* For potential glow */
                color 0.35s var(--me-transition-cubic);      /* For color change */
}
.me-culture-card-new:hover .me-card-icon-new {
    transform: scale(1.2) rotate(-8deg) translateY(-3px); /* More dynamic: larger, slight tilt, lift */
    opacity: 1;
    color: var(--me-color-white); /* Change icon color to JomKL primary yellow */
    text-shadow: 0 0 12px rgba(255, 215, 123, 0.7), /* Outer glow (JomKL Yellow) */
                 0 0 20px rgba(255, 215, 123, 0.5); /* Wider, softer glow */
}

.me-card-content-new h4 { /* Malay Heritage, Chinese Heritage, etc. */
    font-family: var(--me-font-heading);
    font-size: 1.6rem; /* Slightly smaller to accommodate more text */
    font-weight: 700; margin-bottom: 0.75rem; color: var(--me-color-white);
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Text Wrapper and Description Toggle on Hover */
.me-card-text-wrapper {
    position: relative; /* For absolute positioning of descriptions */
    flex-grow: 1;
    min-height: 80px; /* Approximate height for 3-4 lines of text */
    margin-bottom: 1.25rem;
}

.me-card-description,
.me-card-icon-explanation {
    font-size: 0.88rem; /* Consistent small text size */
    line-height: 1.6;
    color: rgba(255,255,255,0.85);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.me-card-description.initial-desc {
    opacity: 1;
    transform: translateY(0);
}
.me-card-icon-explanation.hover-desc {
    opacity: 0;
    transform: translateY(15px); /* Start slightly below */
    pointer-events: none; /* Hidden initially */
}

.me-culture-card-new:hover .me-card-description.initial-desc {
    opacity: 0;
    transform: translateY(-15px); /* Move up and fade out */
    pointer-events: none;
}
.me-culture-card-new:hover .me-card-icon-explanation.hover-desc {
    opacity: 1;
    transform: translateY(0); /* Slide in from bottom */
    pointer-events: auto;
    transition-delay: 0.1s; /* Slight delay for icon explanation to appear */
}
.me-card-icon-explanation strong {
    color: var(--me-color-primary); /* Highlight keywords in explanation */
    font-weight: 600;
}


.me-card-cta-new { /* "Explore X Culture" button */
    font-weight: 600; color: var(--me-color-primary);
    background-color: rgba(255,255,255,0.1); /* More subtle button */
    padding: 0.7rem 1.3rem; border-radius: 25px;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.5rem; transition: all var(--me-transition-speed) ease;
    font-size: 0.9rem; margin-top: auto; align-self: flex-start;
    border: 1px solid rgba(255,255,255,0.2);
}
.me-card-cta-new:hover {
    background-color: var(--me-color-primary);
    color: var(--me-color-dark);
    border-color: var(--me-color-primary);
}


/* Scroll reveal animations for ethnic_page.html */
.me-hero-content-new, .me-section-title-new, .me-culture-card-new.reveal-on-scroll {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.65s var(--me-transition-cubic), transform 0.65s var(--me-transition-cubic);
}
.me-hero-content-new.is-visible, .me-section-title-new.is-visible, .me-culture-card-new.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.me-culture-grid-new .me-culture-card-new.reveal-on-scroll:nth-child(1).is-visible { transition-delay: 0.1s; }
.me-culture-grid-new .me-culture-card-new.reveal-on-scroll:nth-child(2).is-visible { transition-delay: 0.2s; }
.me-culture-grid-new .me-culture-card-new.reveal-on-scroll:nth-child(3).is-visible { transition-delay: 0.3s; }

/* Responsive Adjustments for ethnic_page.html */
@media (max-width: 992px) {
    .me-culture-card-new { min-height: 390px; }
    .me-card-content-new h4 { font-size: 1.5rem; }
}
@media (max-width: 768px) {
    .me-hero-new { min-height: auto; padding: clamp(3rem, 12vh, 5rem) 1rem; }
    .me-card-content-new p.me-card-description { font-size: 0.85rem; }
    .me-culture-card-new { min-height: auto; }
    .me-card-content-new {
        min-height: 200px; /* Adjust if text gets cut off */
    }
    .me-card-text-wrapper {
        min-height: 70px;
    }
    .me-card-description, .me-card-icon-explanation {
        font-size: 0.82rem;
    }
}

