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

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #f8f6f0;
    color: #1e2b2f;
    line-height: 1.5;
    padding: 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

/* header & mobile menu */
.parish-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0 1.5rem 0;
    border-bottom: 2px solid #d9c9b0;
    margin-bottom: 2rem;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: #3d2c1b;
}
.logo i {
    color: #b68b5c;
    margin-right: 6px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    color: #3d2c1b;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    order: -1;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem 2rem;
    font-weight: 500;
}
.nav-links a {
    text-decoration: none;
    color: #2c3e3f;
    font-size: 1.1rem;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: 0.2s;
    white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
    border-bottom-color: #b68b5c;
    color: #1f2a2b;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 999;
}
.mobile-menu-overlay.open {
    display: block;
}
.mobile-menu {
    position: fixed;
    top: 0; left: -280px;
    width: 270px;
    height: 100%;
    background: #f5efe7;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    padding: 2rem 1.5rem;
    transition: left 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    border-right: 2px solid #d9c9b0;
}
.mobile-menu.open {
    left: 0;
}
.mobile-menu .close-menu {
    background: none;
    border: none;
    font-size: 2rem;
    color: #3d2c1b;
    float: right;
    cursor: pointer;
}
.mobile-menu a {
    display: block;
    padding: 0.8rem 0;
    font-size: 1.2rem;
    color: #2c3e3f;
    text-decoration: none;
    border-bottom: 1px solid #ddd0bd;
}
.mobile-menu a.active {
    color: #8b6f4c;
    font-weight: 600;
}

.page {
    display: block;
}
.page.hidden {
    display: none;
}

/* hero carousel */
.hero-carousel {
    background: #e7dfd2;
    border-radius: 32px;
    overflow: hidden;
    margin-bottom: 2.5rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
    position: relative;
}

.carousel-track {
    display: flex;
    aspect-ratio: 16 / 7;
    min-height: 200px;
    max-height: 480px;
    transition: transform 0.35s ease;
    will-change: transform;
}

.carousel-slide {
    flex: 0 0 100%;
    background: #c8bcab;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #3d2c1b;
    background-size: cover;
    background-position: center;
    background-color: #d6cdbc;
    position: relative;
}
.carousel-slide img,
.carousel-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    border: none;
    font-size: 2rem;
    padding: 0.4rem 1rem;
    cursor: pointer;
    border-radius: 40px;
    color: #1e2b2f;
    backdrop-filter: blur(4px);
    transition: 0.2s;
    z-index: 10;
}
.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}
.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0.8rem 0 1.2rem 0;
}
.carousel-indicators span {
    width: 12px;
    height: 12px;
    border-radius: 20px;
    background: #c0b3a0;
    cursor: pointer;
    transition: 0.2s;
}
.carousel-indicators span.active {
    background: #7f6a4e;
    width: 28px;
}

/* card grid */
.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin: 2rem 0 1.2rem 0;
    color: #2e3f3a;
    border-left: 8px solid #b68b5c;
    padding-left: 1rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.8rem;
}

.card {
    background: white;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,0.04);
    transition: 0.2s;
    border: 1px solid #ede6db;
    cursor: pointer;
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 28px rgba(0,0,0,0.06);
}

.card-media {
    background: #dbd1c1;
    aspect-ratio: 16 / 10;
    position: relative;
    overflow: hidden;
}
.card-media .mini-carousel {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.25s ease;
}
.card-media .mini-carousel .slide {
    flex: 0 0 100%;
    background-size: cover;
    background-position: center;
    background-color: #cbbfad;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2f3e38;
}
.card-media .mini-carousel .slide img,
.card-media .mini-carousel .slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-media .mini-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.7);
    border: none;
    font-size: 1.2rem;
    padding: 0.2rem 0.6rem;
    border-radius: 30px;
    cursor: pointer;
    backdrop-filter: blur(2px);
    z-index: 5;
}
.card-media .mini-btn.prev { left: 6px; }
.card-media .mini-btn.next { right: 6px; }

.card-body {
    padding: 1.2rem 1.2rem 1.5rem 1.2rem;
}
.card-body h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #1f2e2b;
}
.card-body .date {
    font-size: 0.85rem;
    color: #6e6253;
    margin-bottom: 0.4rem;
}
.card-body p {
    color: #33413e;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: #6f6254;
    background: #f0ebe3;
    border-radius: 40px;
}

/* detail view */
.post-detail-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.55);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}
.post-detail-overlay.open {
    display: flex;
}
.post-detail-card {
    background: #fcf9f4;
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    border-radius: 40px;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    padding: 1.8rem 1.8rem 2.2rem;
    position: relative;
    margin: 0 1rem;
}
.post-detail-card .close-detail {
    position: sticky;
    top: 0;
    float: right;
    background: rgba(255,255,255,0.8);
    border: none;
    font-size: 2rem;
    padding: 0 0.8rem;
    border-radius: 40px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    z-index: 10;
    margin-top: -0.5rem;
}
.post-detail-card .detail-carousel {
    width: 100%;
    aspect-ratio: 16/9;
    background: #d6cdbc;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    margin: 0.5rem 0 1.2rem 0;
}
.detail-carousel .detail-track {
    display: flex;
    height: 100%;
    transition: transform 0.3s ease;
}
.detail-track .detail-slide {
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #d0c4b2;
    cursor: pointer;
}
.detail-track .detail-slide img,
.detail-track .detail-slide video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #1e1e1e;
}
.detail-carousel .detail-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.7);
    border: none;
    font-size: 1.8rem;
    padding: 0.2rem 0.8rem;
    border-radius: 40px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    z-index: 8;
}
.detail-carousel .detail-btn.prev { left: 8px; }
.detail-carousel .detail-btn.next { right: 8px; }

.detail-title {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 0.5rem;
}
.detail-meta {
    color: #6e6253;
    margin: 0.2rem 0 0.8rem;
}
.detail-description {
    font-size: 1.1rem;
    color: #1e2b2f;
    white-space: pre-wrap;
}

/* image viewer */
.image-viewer {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 1rem;
}
.image-viewer.open {
    display: flex;
}
.image-viewer img {
    max-width: 95%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    transition: transform 0.1s ease;
    cursor: grab;
}
.image-viewer .viewer-close {
    position: absolute;
    top: 20px; right: 30px;
    font-size: 2.8rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.8;
}
.image-viewer .viewer-controls {
    margin-top: 1rem;
    display: flex;
    gap: 1.5rem;
}
.image-viewer .viewer-controls button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.8rem;
    padding: 0.4rem 1.2rem;
    border-radius: 40px;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.parish-footer {
    margin-top: 3rem;
    text-align: center;
    padding: 1.5rem 0 0.5rem 0;
    border-top: 1px solid #dacfc0;
    color: #4d4236;
    font-size: 0.95rem;
}

@media (max-width: 640px) {
    .parish-header {
        flex-direction: row;
        align-items: center;
    }
    .menu-toggle {
        display: block;
    }
    .nav-links {
        display: none;
    }
    .carousel-track {
        aspect-ratio: 16 / 9;
        max-height: 300px;
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
    .post-detail-card {
        padding: 1.2rem;
        margin: 0;
        border-radius: 24px;
        max-height: 95vh;
    }
    .detail-title {
        font-size: 1.6rem;
    }
}

@media (min-width: 641px) {
    .menu-toggle {
        display: none;
    }
    .mobile-menu-overlay,
    .mobile-menu {
        display: none !important;
    }
}