/* ===== Global Styles ===== */
:root {
    --primary-color: #8B6F47;
    --accent-color: #FF9500;
    --light-bg: #FDF9F5;
    --dark-text: #333333;
    --light-text: #666666;
    --border-color: #E8E0D5;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    text-align: center;
}

h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

section {
    padding: 80px 0;
    border-bottom: 1px solid var(--border-color);
}

.section-intro {
    text-align: center;
    color: var(--light-text);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

/* ===== Navigation ===== */
.navbar {
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.navbar.sticky {
    position: sticky;
    top: 0;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 84px;
    padding-bottom: 8px;
}

.logo {
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Logo image + title alignment */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 70px;
    width: auto;
    display: block;
}

.site-title {
    font-weight: 700;
    font-size: 1.4rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--light-text);
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.donate-btn {
    background-color: var(--accent-color) !important;
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.donate-btn:hover {
    background-color: #E08500 !important;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--dark-text);
    border-radius: 2px;
    transition: 0.3s ease;
}

/* ===== Hero Section ===== */
.hero {
    background: linear-gradient(135deg, #FDF9F5 0%, #F5EFE7 100%);
    padding: 120px 0 20px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    object-position: center center;
    opacity: 0.45;
    z-index: 0;
    pointer-events: none;
}
.hero-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 50px;
    align-items: start;
    position: relative;
    z-index: 2;
}

.hero-text {
    position: relative;
    overflow: hidden;
    padding: 64px 28px 28px 28px;
    border-radius: 12px;
}

.hero-text > * {
    position: relative;
    z-index: 2;
}

/* Ensure the slider aligns with the top of the Quick Info column */
.slider-container {
    align-self: start;
}

.hero-text h1 {
    font-size: 3rem;
    color: #FFFFFF;
    margin-bottom: 20px;
    line-height: 1.2;
    font-weight: 800;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
}

.hero-text p {
    font-size: 1.2rem;
    color: #FFFFFF;
    margin-bottom: 40px;
    text-align: justify;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.8;
}

.resident-count {
    --border-color: #E8E0D5;
    padding: 30px;
    border-radius: 12px;
}

.resident-count h3 {
    font-size: 2.5rem;
    color: var(--accent-color);
}

.resident-count p {
    color: #ff9500;
    margin-top: 5px;
}

.slider-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 20;
    --border-color: #E8E0D5;
}

.slide-track {
    display: flex;
    width: calc(100% * 16); /* Width of total slides */
    margin: 0;
    animation: scroll 20s linear infinite;
}

.slide {
    flex: 0 0 100%;
    padding: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.slide img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

/* For images that are lower resolution than the display area, avoid upscaling */
.slide img.low-res {
    object-fit: contain;
    border-radius: 8px;
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    max-height: 100%;
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-100% * 8)); }
}

/* Responsive: stack the columns on smaller screens */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .slider-container {
        width: 100%;
        max-width: 100%;
        margin-top: 8px;
        aspect-ratio: 16 / 12;
    }
}

/* ===== About Section ===== */
.about {
    background-color: white;
}

.about-content {
    display: grid;
    grid-template-columns: 1.75fr 1fr;
    gap: 50px;
    margin-bottom: 30px;
    align-items: center;
}

.about-story p {
    color: var(--light-text);
    font-size: 1.05rem;
    line-height: 1.8;
    text-align: justify;
}

.values-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.values .slider-container {
    aspect-ratio: 4 / 5;
    margin-top: 20px;
}

/* Gallery container for About section */
.gallery-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.gallery-photo {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.gallery-photo img,
.gallery-photo video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.gallery-controls button {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 1rem;
}

.gallery-controls button:hover {
    background: #e08500;
}

.gallery-counter {
    color: var(--dark-text);
    font-weight: 700;
}

.value-card {
    background-color: var(--light-bg);
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.value-card h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.value-card p {
    color: var(--light-text);
}

.team h3 {
    text-align: center;
    margin-bottom: 40px;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.team-member {
    background-color: var(--light-bg);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.team-member:hover {
    transform: translateY(-5px);
}

.member-avatar {
    font-size: 3rem;
    margin-bottom: 15px;
}

.team-member h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.team-member p {
    color: var(--accent-color);
    font-weight: 600;
}

/* ===== Mission Section ===== */
.mission {
    background-color: #FFFBF7;
}

.mission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.mission-card {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.mission-card:hover {
    transform: translateY(-8px);
}

.mission-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.mission-card h3 {
    margin-bottom: 15px;
}

.mission-card p {
    color: var(--light-text);
}

/* ===== Programs Section ===== */
.programs {
    background-color: white;
}

.programs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-top: 40px;
}

.program-card {
    background: linear-gradient(135deg, #FDF9F5 0%, #F5EFE7 100%);
    padding: 30px;
    border-radius: 8px;
    border-top: 4px solid var(--accent-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.program-card:hover {
    transform: translateY(-5px);
}

.program-card h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.program-card p {
    color: var(--light-text);
}

/* ===== Donate Section ===== */
.donate {
    background: linear-gradient(135deg, #FFE8CC 0%, #FDF9F5 100%);
}

.donate-content {
    display: grid;
    justify-content: center;
    gap: 50px;
    margin-bottom: 60px;
}

.donation-amounts h3 {
    margin-bottom: 25px;
}

.amount-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.impact-info h3 {
    margin-bottom: 25px;
    text-align: center;
}

.impact-details {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.impact-details p {
    margin-bottom: 12px;
    color: var(--dark-text);
}

.tax-note {
    background-color: #E8F5E9;
    padding: 15px;
    border-radius: 6px;
    color: #2E7D32;
    font-size: 0.95rem;
    margin-top: 20px;
}

.qr-section {
    text-align: center;
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    margin-top: 40px;
}

.qr-section h3 {
    margin-bottom: 30px;
}

.qr-code {
    width: 250px;
    height: 250px;
    margin: 0 auto;
    background-color: #f0f0f0;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light-text);
    font-size: 0.9rem;
}

.qr{
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ===== Events Section ===== */
.events {
    background-color: white;
}

.events-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin: 0 auto;
    margin-top: 30px;
    max-width: 760px;
}

.event-card {
    background: linear-gradient(135deg, #FDF9F5 0%, #F5EFE7 100%);
    padding: 16px;
    border-radius: 8px;
    border-top: 4px solid var(--accent-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
}

.event-card .slider-container {
    width: 100%;
    height: 180px;
    max-height: 180px;
    background-color: #F5EFE7;
    overflow: hidden;
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    padding: 0;
    margin: 0;
}

.event-card .slider-container .slide-track {
    display: flex;
    width: calc(100% * 16 + 8px * 15);
    gap: 8px;
    margin: 0;
}

.event-card .slider-container,
.event-card .slider-container .slide-track,
.event-card .slider-container .slide {
    height: 100%;
}

.event-card .slide {
    flex: 0 0 calc(100% - 8px);
    min-width: calc(100% - 8px);
    height: 100%;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.event-card .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

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

.event-card h3 {
    margin-bottom: 8px;
    font-size: 1.16rem;
    color: var(--primary-color);
}

.event-card p {
    color: var(--light-text);
    margin-top: 0;
}

.event-photo {
    width: 100%;
    aspect-ratio: 16 / 9; /* enforce 16:9 frame */
    max-height: 420px; /* prevent excessively tall frames on very wide screens */
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    display: block;
    color: var(--light-text);
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    padding: 0; /* remove inner padding so images fill frame evenly */
    cursor: pointer;
}

/* Sliding items inside event photo */
.event-photo {
    position: relative;
}

.event-photo .slide-item {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: transform 500ms ease;
}

.event-photo .slide-item img,
.event-photo .slide-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slide-in-right { transform: translateX(100%); }
.slide-in-right.active { transform: translateX(0); }
.slide-out-left { transform: translateX(0); }
.slide-out-left.active { transform: translateX(-100%); }

.slide-in-left { transform: translateX(-100%); }
.slide-in-left.active { transform: translateX(0); }
.slide-out-right { transform: translateX(0); }
.slide-out-right.active { transform: translateX(100%); }

.event-photo img,
.event-photo video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.event-photo video {
    border-radius: 12px;
}

.event-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.event-controls button {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 1rem;
}

.event-controls button:hover {
    background: #e08500;
}

.event-counter {
    color: var(--dark-text);
    font-weight: 700;
    display: none; /* hide numeric counter on event cards */
}

/* ===== Contact Section ===== */
.contact {
    background-color: white;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-top: 40px;
}

.contact-info h3 {
    margin-bottom: 25px;
}

.info-item {
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--light-bg);
    border-radius: 6px;
}

.info-item p {
    color: var(--dark-text);
    line-height: 1.6;
}

.contact-form h3 {
    margin-bottom: 12px;
    color: var(--primary-color);
}

.form-intro {
    color: var(--light-text);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.contact-form-container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.contact-form-container iframe {
    border-radius: 6px;
    border: none;
}

.social-links {
    background-color: var(--light-bg) !important;
}

.social-icons {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.1);
    background-color: var(--primary-color);
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #E08500;
}

/* ===== Footer ===== */
.footer {
    background-color: var(--primary-color);
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    /* Navbar */
    .navbar-container {
        height: auto;
        min-height: 60px;
        padding: 8px 0;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .logo {
        gap: 8px;
        min-width: 0;
        flex: 1;
        overflow: hidden;
    }

    .logo-img {
        height: 40px;
        flex-shrink: 0;
    }

    .site-title {
        font-size: 0.82rem;
        line-height: 1.25;
        white-space: normal;
        word-break: break-word;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        flex-direction: column;
        background-color: white;
        padding: 20px;
        gap: 15px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        z-index: 99;
    }

    .nav-links.active {
        display: flex;
    }

    .menu-toggle {
        display: flex;
        flex-shrink: 0;
    }

    /* Hero */
    .hero {
        padding: 70px 0 20px;
    }

    h2 {
        font-size: 2rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    /* About */
    .about-content {
        grid-template-columns: 1fr;
    }

    /* Programs */
    .programs-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    /* Events */
    .events-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        max-width: 100%;
    }

    .event-card .slider-container {
        aspect-ratio: 16 / 9;
    }

    /* Donate */
    .donate-content {
        grid-template-columns: 1fr;
    }

    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
    }

    .amount-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    section {
        padding: 50px 0;
    }
}

@media (max-width: 480px) {
    .logo-img {
        height: 34px;
    }

    .site-title {
        font-size: 0.72rem;
    }

    .hero-text h1 {
        font-size: 1.5rem;
    }

    .amount-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    h2 {
        font-size: 1.5rem;
    }

    .programs-grid {
        gap: 18px;
    }

    .events-grid {
        gap: 20px;
    }
}
