/* /MalaysiaExploration/Chinese/style.css */

/* Theme-specific variables for Chinese Culture Page */
:root {
    --page-accent-color: #D83A3A;
    --page-accent-color-light: #FADBD8;
    --page-text-color: #34495E;
    --page-bg-main: #FCFBF8;
    --page-card-bg: #FFFFFF;
    --page-card-shadow: 0 6px 20px rgba(0,0,0,0.07);
    --page-card-hover-shadow: 0 10px 30px rgba(0,0,0,0.1);
    --page-heading-font: 'Merriweather', serif;
    --page-body-font: 'Poppins', sans-serif;
    --page-border-radius: 12px;
    --page-border-color: #EAEAEA;
    /* Inherit from ethnic_styles.css or common_navbar.css */
    --me-color-primary: #ffd77b;
    --me-color-secondary: #ffe4a1;
    --me-color-dark: #2c3e50;
    --me-color-light: #fcfaf7;
    --me-color-white: #ffffff;
    --me-color-grey: #555f6d;
    --me-shadow-soft: 0 4px 12px rgba(0,0,0,0.06);
    --me-shadow-medium: 0 6px 20px rgba(0,0,0,0.09);
    --me-border-radius: 12px;
    --cn-actual-height: 79px; /* From common_navbar */
}


/* --- General Page Structure & Typography --- */
body {
    background-color: var(--page-bg-main);
    color: var(--page-text-color);
    font-family: var(--page-body-font);
    line-height: 1.7;
    font-size: 16px;
    margin: 0; /* Ensure no default body margin */
}

.me-page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--cn-actual-height));
}

.me-ethnicity-content {
    flex-grow: 1;
    padding-top: 50px;
}

.me-content-container {
    max-width: 900px; /* Narrower for better focus */
    margin: 0 auto;
    padding: 0 1rem 3rem 1rem;
}

/* Page Title Hero Section */
.me-page-title-hero {
    padding: 2.5rem 1rem 1.5rem 1rem; /* Reduced vertical padding */
    margin: 0 auto 2.5rem auto; /* Centered with bottom margin */
    text-align: center;
    max-width: 700px; /* Constrain title width */
}
.me-main-ethnicity-title {
    font-family: var(--page-heading-font);
    font-size: clamp(2rem, 5.5vw, 3rem); /* Slightly reduced max size */
    color: var(--page-text-color); /* Changed to default dark text for better contrast */
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
    position: relative;
    display: inline-block; /* For ::after positioning */
    padding-bottom: 0.5rem;
}
.me-main-ethnicity-title::after { /* Underline effect for H1 */
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90px; /* Longer underline */
    height: 4px;
    background-color: var(--page-accent-color); /* Use theme accent */
    border-radius: 2px;
}

.me-article-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 0;
    border-bottom: none;
}
.me-section-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    color: var(--me-color-grey);
    max-width: 680px;
    margin: 0.25rem auto 0 auto; /* Reduced top margin */
    line-height: 1.6;
}


/* Article Header */
.me-article-header { /* This now just holds the subtitle */
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 0; /* No border needed if title hero has one */
    border-bottom: none;
}
.me-ethnicity-title {
    font-family: var(--me-font-heading);
    font-size: clamp(2.2rem, 5.5vw, 3.2rem);
    color: var(--page-accent-color);
    margin-bottom: 0.75rem;
    font-weight: 700;
    line-height: 1.25;
}
.me-section-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    color: var(--me-color-grey, #555);
    max-width: 650px;
    margin: 0.5rem auto 0 auto;
}

/* General Section Styling */
.me-section { margin-bottom: 3.5rem; padding: 0; }
.me-section:last-child { margin-bottom: 1rem; }

.me-section-heading {
    font-family: var(--page-heading-font);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    color: var(--page-text-color);
    text-align: center;
    margin-bottom: 0.75rem;
    position: relative;
    padding-bottom: 0.75rem;
}
.me-section-heading::after {
    content: ''; position: absolute; bottom: 0; left: 50%;
    transform: translateX(-50%); width: 60px; height: 3px;
    background-color: var(--page-accent-color); border-radius: 1.5px;
}
.me-section-intro {
    text-align: center; font-size: 1rem; color: var(--me-color-grey);
    max-width: 680px; margin: 0.5rem auto 2.5rem auto; line-height: 1.65;
}
/* --- About Population Section --- */
.me-about-population-section {
    background-color: var(--page-card-bg);
    padding: 2rem 2.5rem;
    border-radius: var(--page-border-radius);
    box-shadow: var(--page-card-shadow);
}
.me-prose-content { font-size: 1rem; line-height: 1.8; color: var(--page-text-color); }
.me-prose-content p { margin-bottom: 1.25em; }
.me-prose-content strong { color: var(--page-accent-color); font-weight: 600;}
.me-pull-quote {
    font-family: var(--page-heading-font); font-size: 1.2rem; font-style: italic;
    color: var(--page-text-color); padding: 1.2rem 1.5rem; margin: 1.75rem 0;
    border-left: 4px solid var(--page-accent-color); background-color: var(--page-accent-color-light);
    border-radius: 0 6px 6px 0;
}

/* --- Traditional Clothing Section --- */
.traditional-clothing-section {
    padding: 0; /* Section itself has no padding */
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    margin-top: 1.5rem;
}
.clothing-switcher-container {
    max-width: 420px; /* Max width of a single card */
    margin: 1rem auto 0 auto;
    position: relative;
}
.clothing-display-area {
    position: relative;
    width: 100%;
    height: 520px; /* Adjust to fit content comfortably */
    margin-bottom: 1.5rem;
    border-radius: var(--page-border-radius);
    box-shadow: 0 0 0 1px var(--page-border-color), var(--page-card-shadow); /* Subtle border + shadow */
    overflow: hidden; /* Clip corners of cards */
}
.clothing-card-interactive {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border-radius: var(--page-border-radius);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.98); /* Start slightly smaller */
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out, visibility 0s linear 0.4s;
    z-index: 1;
    background-color: var(--page-card-bg);
}
.clothing-card-interactive.active-clothing-card {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    z-index: 10;
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out, visibility 0s linear 0s;
}

.clothing-image-main {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: center top;
    border-radius: var(--page-border-radius);
    transition: transform 0.4s ease-out, filter 0.3s ease-out;
}
.clothing-card-interactive:hover .clothing-image-main {
    transform: scale(1.02);
    filter: brightness(0.95);
}
.clothing-info-overlay {
    position: relative; z-index: 15;
    background: linear-gradient(to top, rgba(20,20,20,0.9) 0%, rgba(20,20,20,0.8) 40%, transparent 100%);
    color: var(--me-color-white);
    padding: 1.25rem;
    width: 100%; box-sizing: border-box;
    border-radius: 0 0 var(--page-border-radius) var(--page-border-radius);
    margin-top: auto; /* Push to bottom */
}
.clothing-info-overlay h3 {
    font-family: var(--page-heading-font); font-size: 1.5rem; font-weight: 700;
    color: var(--me-color-primary); margin: 0 0 0.5rem 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}
.clothing-info-overlay p, .clothing-info-overlay ul {
    font-size: 0.85rem; line-height: 1.55; margin: 0; color: #e0e0e0;
    list-style: none; padding-left: 0;
}
.clothing-info-overlay ul li { margin-bottom: 0.25em; }


/* Gender Toggle Dots */
.clothing-gender-dots {
    display: flex; justify-content: center; align-items: center;
    gap: 10px; margin-top: 1rem; margin-bottom: 0.5rem;
}
.gender-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background-color: #d0d0d0; /* Inactive dot */
    cursor: pointer; transition: all 0.25s ease;
    border: 2px solid transparent; /* For focus state */
}
.gender-dot:hover { background-color: #b0b0b0; }
.gender-dot.active-dot { /* Class added by JS */
    background-color: var(--page-accent-color);
    transform: scale(1.25);
    box-shadow: 0 0 6px var(--page-accent-color-light);
}
.gender-dot:focus-visible { /* Keyboard focus */
    outline: none;
    border-color: var(--page-accent-color);
}
.clothing-interactive-hint {
    text-align: center; font-size: 0.8rem; color: var(--me-color-grey);
    font-style: italic; margin-top: 0.25rem;
}
.clothes-toggle-radio { display: none; }

/* JS controls display via .style.display */

/* --- Cultural Heritage Section (figure.hover-effect-figure) --- */
.heritage-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-top: 1.5rem;
}
figure.hover-effect-figure {
    font-family: var(--page-heading-font);
    color: var(--me-color-white);
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 10;
    border-radius: var(--page-border-radius);
    box-shadow: var(--page-card-shadow);
    background-color: #222; /* Darker fallback for image */
}
figure.hover-effect-figure img {
    opacity: 1; width: 100%; height: 100%; object-fit: cover;
    transition: opacity 0.4s ease-out, transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}
figure.hover-effect-figure figcaption {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; text-align: left; overflow: hidden;
    background: linear-gradient(to top, rgba(0,0,0,0.0) 20%, rgba(0,0,0,0.0) 50%, rgba(0,0,0,0.0) 100%); /* Initially less dark overlay */
    transition: background 0.4s ease-out;
}
figure.hover-effect-figure:hover figcaption { /* Darken overlay on hover for text legibility */
    background: linear-gradient(to top, rgba(10,10,10,0.88) 0%, rgba(10,10,10,0.75) 50%, rgba(10,10,10,0.3) 100%);
}

figure.hover-effect-figure .heritage-title-column,
figure.hover-effect-figure .heritage-desc-column {
    width: 50%; height: 100%; padding: 2rem;
    display: flex; flex-direction: column; justify-content: center;
    position: relative;
}
figure.hover-effect-figure .heritage-title-column { align-items: center; text-align: center; }

figure.hover-effect-figure figcaption::before { /* Dividing line */
    position: absolute; top: 50%; left: 50%; width: 0px; height: 80%;
    transform: translate(-50%, -50%); content: ''; opacity: 0;
    background-color: rgba(255,255,255,0.25); /* More subtle line */
    transition: all 0.3s ease-in-out 0.3s; /* Faster line appearance */
}
figure.hover-effect-figure h3, figure.hover-effect-figure p {
    margin: 0; opacity: 0;
    transition: opacity 0.35s ease-out, transform 0.35s ease-out;
}
figure.hover-effect-figure h3 {
    font-size: clamp(1.4rem, 3.5vw, 1.9rem);
    font-weight: 700; text-transform: uppercase; color: var(--me-color-primary);
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
    transform: translateX(-25px);
}
.heritage-local-name { font-size: 0.7em; font-weight: normal; display: block; opacity: 0.8; margin-top: 0.25em; color: var(--me-color-secondary); }

figure.hover-effect-figure p {
    font-family: var(--page-body-font);
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    line-height: 1.6; color: var(--me-color-light); /* Lighter text for dark bg */
    background: transparent; /* No separate background for p, rely on figcaption's */
    border-radius: 0; padding: 0; /* No padding needed if figcaption > div handles it */
    transform: translateX(25px);
    max-height: 80%; overflow-y: auto;
}
figure.hover-effect-figure p strong { color: var(--me-color-secondary); }

figure.hover-effect-figure:hover img { opacity: 0.4; transform: scale(1.0); } /* Less zoom, more dim */
figure.hover-effect-figure:hover figcaption::before { width: 1px; opacity: 1; }
figure.hover-effect-figure:hover h3, figure.hover-effect-figure:hover p { opacity: 1; transform: translateX(0); }
figure.hover-effect-figure:hover h3 { transition-delay: 0.15s; }
figure.hover-effect-figure:hover p { transition-delay: 0.2s; }


/* --- Cuisine Section --- */
.me-cuisine-section { padding-top: 1rem; }
.cuisine-showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); /* Slightly smaller cards */
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.me-cuisine-card-link {
    display: block; text-decoration: none; color: inherit;
    border-radius: var(--me-border-radius);
    overflow: hidden;
    background-color: var(--page-card-bg);
    box-shadow: var(--page-card-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    height: 100%;
    display: flex; /* To make .me-cuisine-card fill it */
    flex-direction: column;
}
.me-cuisine-card-link:hover {
    transform: translateY(-5px);
    box-shadow: var(--page-card-hover-shadow);
}
.me-cuisine-card { /* Will be child of <a> */
    display: flex; flex-direction: column; height: 100%;
    text-align: left; /* Align text left within card */
}
.cuisine-image {
    width: 100%; height: 170px; /* Slightly reduced height */
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}
.me-cuisine-card-link:hover .cuisine-image { transform: scale(1.06); }
.cuisine-info {
    padding: 1rem; /* Uniform padding */
    flex-grow: 1; display: flex; flex-direction: column;
}
.cuisine-name {
    font-family: var(--page-body-font); font-weight: 600;
    font-size: 1.05rem; color: var(--page-text-color);
    margin-bottom: 0.3rem;
}
.cuisine-description {
    font-size: 0.85rem;
    color: var(--me-color-grey);
    line-height: 1.55;
    flex-grow: 1;
    margin-bottom: 0.75rem; /* Space before potential "View Recipe" link */
}
.me-cuisine-cta-container { text-align: center; margin-top: 3rem; }
.btn-cuisine-all {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background-color: var(--page-accent-color); color: var(--me-color-white);
    padding: 0.85rem 2rem; border-radius: 30px; font-weight: 600;
    text-decoration: none; transition: all 0.25s ease;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12); font-size: 1rem;
}
.btn-cuisine-all:hover {
    background-color: color-mix(in srgb, var(--page-accent-color) 85%, black);
    transform: translateY(-2px); box-shadow: 0 5px 12px rgba(0,0,0,0.15);
}

/* --- Reveal on Scroll Animations --- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.65s ease-out, transform 0.65s ease-out;
}
.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays - apply these classes to individual elements if desired */
.delay-100.is-visible { transition-delay: 0.1s; }
.delay-200.is-visible { transition-delay: 0.2s; }
.delay-300.is-visible { transition-delay: 0.3s; }


/* Responsive Adjustments */
@media (max-width: 991px) { /* Tablet */
    .me-content-container { padding: 0 1rem 2rem 1rem; }
    .clothing-switcher-container { max-width: 380px; } /* Smaller card on tablet */
    .clothing-display-area { height: 500px; }
}

@media (max-width: 768) { /* Mobile */
    .me-section-heading { font-size: clamp(1.5rem, 5vw, 1.9rem); }
    .me-section-intro { font-size: 0.95rem; }
    .clothing-display-area { height: 460px; }
    .clothing-info-overlay h3 { font-size: 1.4rem; }
    .clothing-info-overlay p, .clothing-info-overlay ul { font-size: 0.8rem; }

    .clothing-selector-container .selector {
        grid-template-columns: 1fr; /* Stack on mobile */
        gap: 1.5rem;
    }
    .me-clothing-card { /* Applies to both women-card and men-card */
        max-width: 100%;
        /* transform: translateX(0) scale(1); Overlap/swing not used on mobile */
        /* opacity: 1; Show both initially, JS will handle which is 'active' */
        margin: 0 0 1rem 0 !important; /* Reset margins from desktop swing */
        position: relative; /* Take space in flow */
        opacity: 1; transform: scale(1); /* Ensure they are visible */
    }
    /* On mobile, we hide the non-selected card via JS adding a simple 'hidden' class */
    .me-clothing-card:not(.active-clothing-card) {
        display: none;
    }
    .me-clothing-card.active-clothing-card {
        display: flex; /* Ensure active one is visible */
        opacity: 1;
        transform: scale(1);
    }

    .clothing-toggle-buttons {
        flex-direction: column; /* Stack buttons */
        align-items: center;
        gap: 0.75rem;
    }
    .me-clothing-pick-btn {
        width: 100%;
        max-width: 280px;
    }

    .about-content-grid { grid-template-columns: 1fr; }
    .about-image-placeholder { display: none; } /* Hide image on tablet if text is primary */
}

@media (max-width: 768px) { /* Mobile */
    .me-section-heading { font-size: clamp(1.5rem, 5vw, 1.9rem); }
    .me-section-intro { font-size: 0.95rem; }

    figure.hover-effect-figure { aspect-ratio: 4/5; }
    figure.hover-effect-figure figcaption { flex-direction: column; }
    figure.hover-effect-figure figcaption > div { width: 100%; height: 50%; padding: 1rem; }
    figure.hover-effect-figure figcaption::before { top: 50%; left: 10%; width: 80%; height: 0px; transform: translate(0, -50%); }
    figure.hover-effect-figure:hover figcaption::before { height: 1.5px; }
    figure.hover-effect-figure h3 { transform: translateY(-15px); font-size: clamp(1.1rem, 3.5vw, 1.4rem); }
    figure.hover-effect-figure p { transform: translateY(15px); font-size: 0.8rem; padding: 0.75rem; }

    .cuisine-showcase-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 1rem;}
    .cuisine-image { height: 160px; }
    .cuisine-name { font-size: 1rem; }
    .cuisine-description { font-size: 0.75rem; }
}