/* ============================================
   Kit Memorial Theme — Master Stylesheet
   Clean · Bright · Elegant · Warm
   ============================================ */

/* === CSS Variables === */
:root {
    --kit-gold: #C4A35A;
    --kit-gold-dark: #8B6914;
    --kit-gold-light: #E8D5B7;
    --kit-cream: #FDF8EF;
    --kit-cream-dark: #F5ECD7;
    --kit-bg: #FDFBF7;
    --kit-white: #FFFFFF;
    --kit-text: #444444;
    --kit-text-light: #777777;
    --kit-text-dark: #222222;
    --kit-border: #E8E0D0;
    --kit-shadow: rgba(139, 105, 20, 0.08);
    --kit-font-serif: 'Playfair Display', 'Noto Serif TC', Georgia, 'Times New Roman', serif;
    --kit-font-sans: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --kit-container: 1200px;
    --kit-narrow: 800px;
    --kit-header-height: 72px;
}

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--kit-font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--kit-text);
    background-color: var(--kit-bg);
    overflow-x: hidden;
}

/* Chinese language adjustments */
.kit-lang-zh body,
.kit-lang-zh {
    font-family: 'Noto Serif TC', 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', serif;
}

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

a {
    color: var(--kit-gold-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--kit-gold);
}

/* === Layout === */
.kit-container {
    max-width: var(--kit-container);
    margin: 0 auto;
    padding: 0 24px;
}

.kit-container--narrow {
    max-width: var(--kit-narrow);
}

.kit-section {
    padding: 60px 0;
}

.kit-section:nth-child(even) {
    background-color: var(--kit-cream);
}

/* === Header === */
.kit-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(253, 251, 247, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--kit-border);
    height: var(--kit-header-height);
    transition: all 0.3s ease;
}

.kit-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--kit-header-height);
}

.kit-logo {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    line-height: 1.2;
}

.kit-logo-name {
    font-family: var(--kit-font-serif);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--kit-gold-dark);
}

.kit-logo-chinese {
    font-size: 0.8rem;
    color: var(--kit-gold);
    letter-spacing: 2px;
}

.kit-nav-list {
    display: flex;
    list-style: none;
    gap: 32px;
}

.kit-nav-list a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--kit-text);
    text-decoration: none;
    position: relative;
    padding: 4px 0;
    transition: color 0.3s;
}

.kit-nav-list a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--kit-gold);
    transition: width 0.3s ease;
}

.kit-nav-list a:hover {
    color: var(--kit-gold-dark);
}

.kit-nav-list a:hover::after {
    width: 100%;
}

.kit-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Mobile toggle */
.kit-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.kit-mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--kit-text-dark);
    transition: all 0.3s;
}

/* ============================================
   HERO SECTION — Rotating Image Slider
   MuchLoved-style: full-bleed images with
   overlay text layered on top
   ============================================ */
.kit-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    max-height: 950px;
    overflow: hidden;
    margin-top: var(--kit-header-height);
    background: #1a1a1a;
}

/* Slider container */
.kit-hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Individual slide */
.kit-hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.2s ease-in-out, visibility 1.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kit-hero-slide.active {
    opacity: 1;
    visibility: visible;
}

/* Fallback when no image is set */
.kit-hero-slide:not([style*="background-image"]) {
    background: linear-gradient(135deg, #2c2418 0%, #1a1510 50%, #0d0a06 100%);
}

/* Dark overlay on each slide for text readability */
.kit-slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.30) 40%,
        rgba(0, 0, 0, 0.55) 100%
    );
    z-index: 1;
}

/* Overlay text content — positioned at bottom-center */
.kit-slide-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px 30px;
    max-width: 800px;
    margin-top: auto;
    margin-bottom: 12%;
}

/* Subtitle — "In Loving Memory" */
.kit-slide-subtitle {
    font-family: var(--kit-font-serif);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--kit-gold-light);
    margin-bottom: 12px;
    letter-spacing: 2px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(15px);
    animation: kit-fadeUp 0.8s ease forwards 0.3s;
}

/* Main name heading */
.kit-slide-heading {
    font-family: var(--kit-font-serif);
    font-size: 3.2rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 4px;
    margin-bottom: 8px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(15px);
    animation: kit-fadeUp 0.8s ease forwards 0.5s;
}

/* Chinese name */
.kit-slide-chinese {
    font-family: 'Noto Serif TC', serif;
    font-size: 1.6rem;
    color: var(--kit-gold-light);
    letter-spacing: 6px;
    margin-bottom: 10px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(15px);
    animation: kit-fadeUp 0.8s ease forwards 0.7s;
}

/* Dates */
.kit-slide-dates {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 22px;
    letter-spacing: 1px;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(15px);
    animation: kit-fadeUp 0.8s ease forwards 0.9s;
}

/* CTA button on slides */
.kit-slide-cta {
    margin-top: 8px;
    opacity: 0;
    transform: translateY(15px);
    animation: kit-fadeUp 0.8s ease forwards 1.1s;
}

.kit-btn--hero {
    display: inline-block;
    padding: 14px 36px;
    font-family: var(--kit-font-serif);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: #FFFFFF;
    background: var(--kit-gold);
    border: 2px solid var(--kit-gold);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    text-shadow: none;
}

.kit-btn--hero:hover {
    background: transparent;
    color: #FFFFFF;
    border-color: #FFFFFF;
}

/* Fade-up animation for overlay text */
@keyframes kit-fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Re-trigger animation on slide change */
.kit-hero-slide:not(.active) .kit-slide-subtitle,
.kit-hero-slide:not(.active) .kit-slide-heading,
.kit-hero-slide:not(.active) .kit-slide-chinese,
.kit-hero-slide:not(.active) .kit-slide-dates,
.kit-hero-slide:not(.active) .kit-slide-cta {
    opacity: 0;
    transform: translateY(15px);
    animation: none;
}

/* Slide indicators (dots) */
.kit-hero-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 12px;
}

.kit-hero-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.kit-hero-dot:hover {
    border-color: #FFFFFF;
    background: rgba(255, 255, 255, 0.3);
}

.kit-hero-dot.active {
    background: var(--kit-gold);
    border-color: var(--kit-gold);
}

/* Navigation arrows */
.kit-hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(0, 0, 0, 0.25);
    color: #FFFFFF;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kit-hero-arrow:hover {
    background: rgba(0, 0, 0, 0.5);
}

.kit-hero-arrow--prev {
    left: 20px;
}

.kit-hero-arrow--next {
    right: 20px;
}

/* === Intro Section === */
.kit-intro-section {
    text-align: center;
    background: var(--kit-white);
}

.kit-intro-name {
    font-family: var(--kit-font-serif);
    font-size: 2.2rem;
    color: var(--kit-gold-dark);
    margin-bottom: 8px;
}

.kit-intro-chinese {
    display: block;
    font-size: 1.3rem;
    color: var(--kit-gold);
    margin-top: 5px;
    letter-spacing: 3px;
}

.kit-intro-dates {
    font-size: 1rem;
    color: var(--kit-text-light);
    margin-bottom: 25px;
}

.kit-intro-message {
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--kit-text);
    margin-bottom: 30px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.kit-intro-ctas {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* === Biography === */
.kit-bio-content {
    font-size: 1.05rem;
    line-height: 2;
    color: var(--kit-text);
}

.kit-bio-content p {
    margin-bottom: 1.5em;
}

/* === Page Headers === */
.kit-page-header {
    background: linear-gradient(135deg, var(--kit-cream), var(--kit-cream-dark));
    padding: 80px 0 50px;
    text-align: center;
    margin-top: var(--kit-header-height);
}

.kit-page-title {
    font-family: var(--kit-font-serif);
    font-size: 2.5rem;
    color: var(--kit-gold-dark);
    margin-bottom: 10px;
}

.kit-page-subtitle {
    font-size: 1.1rem;
    color: var(--kit-text-light);
}

/* === Memorial Page Hero === */
.kit-memorial-hero {
    position: relative;
    height: 50vh;
    min-height: 350px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: var(--kit-header-height);
    background-color: var(--kit-cream);
}

.kit-memorial-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(253, 248, 239, 0.7);
}

.kit-memorial-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.kit-memorial-hero-content h1 {
    font-family: var(--kit-font-serif);
    font-size: 3rem;
    color: var(--kit-gold-dark);
    margin-bottom: 8px;
}

.kit-memorial-hero-zh {
    font-family: 'Noto Serif TC', serif;
    font-size: 1.5rem;
    color: var(--kit-gold);
    letter-spacing: 4px;
    margin-bottom: 10px;
}

.kit-memorial-hero-dates {
    font-size: 1.1rem;
    color: var(--kit-text-light);
}

/* === Article Content === */
.kit-article-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.kit-article-content h2 {
    font-family: var(--kit-font-serif);
    color: var(--kit-gold-dark);
    margin: 30px 0 15px;
}

.kit-article-content p {
    margin-bottom: 1.2em;
}

/* === Footer === */
.kit-footer {
    background: var(--kit-cream-dark);
    padding: 50px 0 30px;
    text-align: center;
    border-top: 1px solid var(--kit-border);
}

.kit-footer-memorial {
    margin-bottom: 20px;
}

.kit-footer-name {
    font-family: var(--kit-font-serif);
    font-size: 1.3rem;
    color: var(--kit-gold-dark);
    margin-bottom: 5px;
}

.kit-footer-dates {
    font-size: 0.9rem;
    color: var(--kit-text-light);
}

.kit-footer-quote {
    font-family: var(--kit-font-serif);
    font-style: italic;
    font-size: 1rem;
    color: var(--kit-gold);
    margin-bottom: 25px;
    padding: 0 20px;
}

.kit-footer-bottom {
    font-size: 0.8rem;
    color: var(--kit-text-light);
    padding-top: 20px;
    border-top: 1px solid var(--kit-border);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .kit-nav-list { gap: 20px; }

    .kit-slide-heading {
        font-size: 2.6rem;
    }
}

@media (max-width: 768px) {
    :root {
        --kit-header-height: 60px;
    }

    .kit-mobile-toggle {
        display: flex;
    }

    .kit-nav {
        position: fixed;
        top: var(--kit-header-height);
        left: 0;
        right: 0;
        background: rgba(253, 251, 247, 0.98);
        backdrop-filter: blur(10px);
        padding: 20px;
        border-bottom: 1px solid var(--kit-border);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
    }

    .kit-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .kit-nav-list {
        flex-direction: column;
        gap: 0;
    }

    .kit-nav-list a {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid var(--kit-border);
        font-size: 1rem;
    }

    /* Hero responsive */
    .kit-hero {
        min-height: 500px;
        max-height: 700px;
    }

    .kit-slide-heading {
        font-size: 2.2rem;
        letter-spacing: 2px;
    }

    .kit-slide-chinese {
        font-size: 1.3rem;
        letter-spacing: 4px;
    }

    .kit-slide-subtitle {
        font-size: 1rem;
    }

    .kit-slide-content {
        padding: 30px 20px;
        margin-bottom: 15%;
    }

    .kit-hero-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.6rem;
    }

    .kit-hero-arrow--prev {
        left: 10px;
    }

    .kit-hero-arrow--next {
        right: 10px;
    }

    .kit-section {
        padding: 40px 0;
    }

    .kit-page-header {
        padding: 60px 0 35px;
    }

    .kit-page-title {
        font-size: 2rem;
    }

    .kit-intro-name {
        font-size: 1.8rem;
    }

    .kit-memorial-hero-content h1 {
        font-size: 2.2rem;
    }

    .kit-footer {
        padding: 35px 0 20px;
    }
}

@media (max-width: 480px) {
    .kit-hero {
        min-height: 450px;
        max-height: 600px;
    }

    .kit-slide-heading {
        font-size: 1.7rem;
        letter-spacing: 1px;
    }

    .kit-slide-chinese {
        font-size: 1.1rem;
        letter-spacing: 3px;
    }

    .kit-slide-subtitle {
        font-size: 0.9rem;
    }

    .kit-slide-dates {
        font-size: 0.9rem;
    }

    .kit-slide-content {
        padding: 20px 15px;
        margin-bottom: 18%;
    }

    .kit-btn--hero {
        padding: 12px 28px;
        font-size: 0.9rem;
    }

    .kit-hero-arrow {
        width: 36px;
        height: 36px;
        font-size: 1.4rem;
    }

    .kit-hero-arrow--prev {
        left: 8px;
    }

    .kit-hero-arrow--next {
        right: 8px;
    }

    .kit-hero-indicators {
        bottom: 20px;
    }

    .kit-hero-dot {
        width: 10px;
        height: 10px;
    }

    .kit-intro-ctas {
        flex-direction: column;
        align-items: center;
    }
}

/* === Print Styles === */
@media print {
    .kit-header,
    .kit-footer,
    .kit-form-wrapper,
    .kit-hero-indicators,
    .kit-hero-arrow,
    .kit-lang-switcher,
    .kit-mobile-toggle {
        display: none !important;
    }

    .kit-hero {
        height: auto;
        min-height: auto;
        margin-top: 0;
    }

    .kit-section {
        padding: 20px 0;
    }
}
