/* --- [Design System] --- */
:root {
    --primary-navy: #0a2342;
    --secondary-navy: #15325b;
    --accent-gold: #c5a47e;
    --warm-white: #f9f9f7;
    --pure-white: #ffffff;
    --text-dark: #333333;
    --text-gray: #666666;
    --border-light: #e0e0e0;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans KR', sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--warm-white);
    color: var(--text-dark);
    line-height: 1.6;
    word-break: keep-all;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed);
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 100px 0;
}

/* --- [Header] --- */
header {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    flex-shrink: 0;
}

.logo a {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    gap: 40px;
    flex-wrap: nowrap;
}

.nav-link {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-dark);
    position: relative;
    padding: 5px 0;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent-gold);
    transition: width var(--transition-speed) ease-in-out;
    border-radius: 2px;
}

.nav-link:hover {
    color: var(--secondary-navy);
}

.nav-link:hover::after {
    width: 100%;
}



/* --- [Mobile Optimization & Layout Fixes] --- */
img {
    max-width: 100%;
    height: auto;
}

/* Fix Leaflet Tile Issues caused by global img rule */
.leaflet-pane img,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
    max-width: none !important;
    height: auto !important;
}

.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    scroll-margin-top: 80px;
    /* Offset for fixed header */
}



/* --- [Hero Section] --- */
.hero {
    height: 90vh;
    width: 100%;
    background: linear-gradient(rgba(10, 35, 66, 0.4), rgba(10, 35, 66, 0.6)), url('../images/전경.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--pure-white);
    margin-top: 80px;
}

.hero-content {
    width: 100%;
    padding: 0 20px;
    animation: fadeIn 1.2s ease-out;
}

.hero-title {
    font-size: 4.8rem;
    font-weight: 700;
    margin-bottom: 30px;
    line-height: 1.2;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    color: white;
}

.hero-subtitle {
    font-size: 1.6rem;
    font-weight: 400;
    /* Regular weight */
    margin-bottom: 50px;
    opacity: 0.95;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
    line-height: 1.5;
    color: white;
}

.hero-btn {
    display: inline-block;
    padding: 15px 35px;
    background-color: transparent;
    border: 2px solid white;
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all var(--transition-speed);
    pointer-events: auto;
}

.hero-btn:hover {
    background-color: var(--accent-gold);
    color: var(--primary-navy);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- [General Section Styles] --- */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--primary-navy);
    font-weight: 700;
    display: inline-block;
    border-bottom: 3px solid var(--accent-gold);
    padding-bottom: 7px;
    margin-bottom: 20px;
}

.section-header p {
    color: var(--text-gray);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.section-divider {
    display: none;
}

/* --- [Greeting Grid] --- */
.greeting-grid {
    display: flex;
    gap: 50px;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* --- [Cards] --- */
/* --- [Cards] --- */
.about-card {
    background: var(--pure-white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform var(--transition-speed);
}

.staff-card {
    background: var(--pure-white);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.staff-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.05);
}

.officer-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.officer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08) !important;
}

.name-badge {
    display: inline-block;
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 20px;
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid #eee;
}

.name-badge:hover {
    background: var(--primary-navy);
    color: white;
    transform: scale(1.05);
}

/* Enhanced Education Card Styles */
.edu-card {
    background: var(--pure-white);
    padding: 40px;
    /* Increased padding */
    border-radius: 16px;
    /* More rounded corners */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    /* Softer, larger shadow */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy transition */
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.edu-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.edu-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--secondary-navy);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.edu-card:hover::before {
    opacity: 1;
}

.edu-card h3 {
    font-size: 1.8rem !important;
    /* Larger Heading */
    font-weight: 800 !important;
    margin-bottom: 15px !important;
}

.edu-card p {
    font-size: 1.15rem !important;
    /* Larger text */
    line-height: 1.6;
}

.edu-card .edu-info {
    font-size: 1.05rem !important;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 3px solid #ddd;
}

/* --- [Worship Info] --- */
.info-section {
    background-color: var(--primary-navy);
    color: var(--pure-white);
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.service-list li {
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
}

.service-list li:last-child {
    border-bottom: none;
}

.service-time {
    color: var(--accent-gold);
    font-weight: 500;
}

/* --- [Footer] --- */
footer {
    background-color: #05162b;
    color: rgba(255, 255, 255, 0.6);
    padding: 60px 0 30px;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    font-size: 1.5rem;
    color: var(--pure-white);
    font-weight: 700;
    margin-bottom: 20px;
    display: inline-block;
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

/* --- [Video Item Hover] --- */
.video-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        height: auto;
        padding: 20px 0;
        gap: 20px;
    }

    .nav-menu {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .greeting-grid,
    .info-grid,
    .video-grid,
    .board-grid,
    .people-grid {
        /* Added people-grid for safety */
        flex-direction: column;
        grid-template-columns: 1fr !important;
    }
}

/* --- [Modal Styles] --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal-container {
    background: white;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.open .modal-container {
    transform: translateY(0);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-navy);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-list li {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #eee;
}

.page-btn {
    border: 1px solid #ddd;
    background: white;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
}

.page-btn.active {
    background: var(--primary-navy);
    color: white;
    border-color: var(--primary-navy);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- [Responsive Board Section] --- */
.responsive-board-container {
    display: grid;
    grid-template-columns: 400px 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.responsive-board-header {
    text-align: left;
    margin-bottom: 0;
    position: sticky;
    top: 120px;
    height: fit-content;
}

.responsive-board-grid {
    display: contents;
}

/* Fix for long text breaking layout */
.board-column li,
.board-column h4,
.board-column p {
    word-break: break-all;
    overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
    .responsive-board-container {
        grid-template-columns: 200px 1fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .responsive-board-container {
        display: flex;
        flex-direction: column;
    }

    .responsive-board-header {
        position: static;
        width: 100%;
        margin-bottom: 30px;
    }
}


/* --- [Board Section] --- */
#board .container {
    max-width: 1400px;
    /* Wider container for board */
}

/* --- [Background Image Theme] --- */
/* Common overlay settings for consistency */
/* Opacity reduced to 0.85 to make the background image more visible */
.bg-tint-white {
    background: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85)), url('../images/배경사진.png');
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
}

.bg-tint-gray {
    background: linear-gradient(rgba(248, 249, 250, 0.85), rgba(248, 249, 250, 0.85)), url('../images/배경사진.png');
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
}

.bg-tint-navy {
    background: linear-gradient(rgba(10, 35, 66, 0.88), rgba(10, 35, 66, 0.92)), url('../images/배경사진.png');
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
    color: white;
}

.bg-tint-blue-gray {
    background: linear-gradient(rgba(240, 244, 248, 0.85), rgba(240, 244, 248, 0.85)), url('../images/배경사진.png');
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
}

.bg-tint-warm {
    background: linear-gradient(rgba(253, 250, 246, 0.85), rgba(253, 250, 246, 0.85)), url('../images/배경사진.png');
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
}

/* --- [Hero Slider CSS from index.html] --- */
#hero .slider-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#hero .slide {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
}

#hero .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#hero .prev,
#hero .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: 100;
    text-decoration: none;
}

#hero .next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

#hero .prev:hover,
#hero .next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

#hero .dots-container {
    text-align: center;
    position: absolute;
    bottom: 30px;
    width: 100%;
    z-index: 100;
}

#hero .dot {
    cursor: pointer;
    height: 12px;
    width: 12px;
    margin: 0 6px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
}

#hero .dot.active,
#hero .dot:hover {
    background-color: #fff;
    transform: scale(1.2);
}

.fade {
    animation-name: fade;
    animation-duration: 1.5s;
}

@keyframes fade {
    from {
        opacity: .4
    }

    to {
        opacity: 1
    }
}

/* --- [Greeting Section Image Fix] --- */
.image-content img {
    width: 100%;
    max-width: 500px;
    /* Limit maximum width */
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    object-fit: cover;
}

/* Scroll to Top Button */
/* Scroll to Top Button */
#scrollTopBtn {
    position: fixed;
    bottom: 30px;
    /* Moved to bottom */
    right: 30px;
    z-index: 9999;
    border: none;
    outline: none;
    background-color: var(--accent-gold);
    color: white;
    cursor: pointer;
    padding: 10px 5px;
    /* Adjust padding */
    border-radius: 30px;
    /* Rounded pill vertical */
    width: 60px;
    height: 60px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    /* Stack vertically */
    justify-content: center;
    align-items: center;
    gap: 3px;
}

#scrollTopBtn i {
    font-size: 1.2rem;
}

#scrollTopBtn span {
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

#scrollTopBtn:hover {
    background-color: var(--primary-navy);
    transform: translateY(-5px) scale(1.1);
    /* Slight lift */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* --- [Mobile Responsive Styles] --- */
.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--primary-navy);
    cursor: pointer;
    padding: 10px;
}

@media (max-width: 992px) {
    .header-inner {
        padding: 0 20px;
    }

    .nav-menu {
        gap: 20px;
    }

    .nav-link {
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {

    /* --- [Navigation] --- */
    .header-inner {
        padding: 0 15px;
        height: 60px;
        /* Reduced header height */
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center;
        width: 100%;
        gap: 0;
    }

    /* Remove nav from flex flow so logo and toggle are at edges */
    .header-inner nav {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: visible;
        opacity: 1;
        pointer-events: none;
        /* Let clicks pass through */
    }

    .header-inner nav .nav-menu {
        pointer-events: auto;
        /* Re-enable pointer events for the menu itself */
    }

    .mobile-menu-toggle {
        display: block !important;
        font-size: 1.5rem;
        color: var(--primary-navy);
        z-index: 1001;
        /* Above everything */
    }

    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        height: auto;
        max-height: 80vh;
        /* Prevent overflowing screen if too many items */
        background: rgba(255, 255, 255, 0.98);

        display: flex !important;
        flex-direction: column !important;
        align-items: center;
        padding: 30px 0;
        gap: 20px;

        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);

        /* Animation: Slide Down Reveal */
        transform: none;
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path 0.4s cubic-bezier(0.4, 0, 0.2, 1);

        z-index: 999;
        overflow-y: auto;
    }

    .nav-menu.active {
        transform: none;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    /* --- [Hero Section Fix] --- */
    #hero {
        height: 100vh !important;
        min-height: auto;
        margin-top: 60px !important;
    }

    #hero .slide {
        height: 100% !important;
    }

    #hero .slide img {
        height: 100% !important;
        object-fit: cover !important;
    }

    .hero-content h1 {
        /* Targeting the H1 directly */
        font-size: clamp(1.8rem, 6vw, 3rem) !important;
        line-height: 1.3 !important;
        margin-bottom: 20px !important;
        padding: 0 10px;
        word-break: keep-all;
    }

    .hero-content p {
        /* Targeting the P directly */
        font-size: clamp(0.9rem, 3.5vw, 1.3rem) !important;
        margin-bottom: 30px !important;
        line-height: 1.6 !important;
        padding: 0 10px;
        word-break: keep-all;
    }

    .hero-content a {
        /* Button */
        padding: 12px 30px !important;
        font-size: 1rem !important;
        margin-top: 10px;
    }

    /* --- [Layout & Padding] --- */
    .container {
        padding: 0 20px;
    }

    .section {
        padding: 60px 0 !important;
    }

    .section-header h2 {
        font-size: 1.8rem !important;
    }

    /* --- [Greeting Section] --- */
    .greeting-grid {
        flex-direction: column-reverse;
        /* Image on top */
        gap: 30px;
    }

    /* --- [People / Staff Grid Fix] --- */
    /* Target the inline style grid of People section */
    div[style*="display: flex; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr))"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 40px !important;
    }

    /* Staff Card */
    .staff-card {
        flex-direction: column !important;
        /* Stack icon/text */
        text-align: center;
        padding: 20px !important;
    }

    .staff-card>div:first-child {
        margin-bottom: 10px;
    }

    /* --- [Gallery Fix] --- */
    /* Force Swiper Slide to be responsive */
    .swiper-slide {
        width: 85vw !important;
        /* Override fixed 600px */
        height: 300px !important;
        /* Adjust height */
    }

    .gallery-title {
        font-size: 1.2rem !important;
    }

    /* --- [Sermon Grid & Video] --- */
    #main-sermon-title {
        font-size: 1.3rem !important;
    }

    .sermon-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* --- [Table & Lists] --- */
    .modal-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .modal-list li span:last-child {
        align-self: flex-end;
        color: #999;
        font-size: 0.9rem;
    }

    /* --- [Footer] --- */
    footer .container {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .footer-section {
        width: 100%;
    }

    /* --- [Specific Section Grid Fixes] --- */

    /* 1. About - History & Vision Grid */
    #about>.container>div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    /* 2. About - Philosophy Grid (3 cols -> 1 col) */
    .philosophy>div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* 3. Education Grid */
    #education>.container>div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    /* 4. People Grid */
    #people>.container>div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }

    /* 5. Worship Section Fixes */
    #worship .container>div[style*="padding: 50px"] {
        padding: 25px !important;
        /* Reduce padding */
    }

    .service-list {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .service-list li {
        flex-direction: row !important;
        /* Keep row but allow wrapping if needed */
        flex-wrap: wrap;
        gap: 10px;
    }

    .service-list li>span {
        font-size: 1.1rem !important;
    }

    /* Global Container Overflow Fix */
    body,
    html {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }
}



/* --- [Responsive Grid System] --- */
.grid-container {
    display: grid;
    width: 100%;
}

.two-col-grid {
    grid-template-columns: 1fr 1fr;
    /* Explicit 2 columns for PC */
    gap: 30px;
}

.three-col-grid {
    grid-template-columns: 1fr 1fr 1fr;
    /* Explicit 3 columns for PC */
    gap: 20px;
}

.edu-grid {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.people-side-grid {
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: stretch;
}

.people-side-grid>div {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.people-side-grid>div>div {
    flex-grow: 1;
    justify-content: space-between;
}

/* Worship Section Wrapper */
.worship-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 50px;
    border-radius: 24px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.service-list-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* --- [Mobile Overrides for Grids] --- */
@media (max-width: 768px) {

    .grid-container,
    .two-col-grid,
    .three-col-grid,
    .edu-grid,
    .people-side-grid,
    .service-list-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    .worship-wrapper {
        padding: 25px !important;
    }

    /* Ensure no overflow */
    .container {
        padding: 0 20px;
        width: 100%;
        overflow-x: hidden;
    }
}

/* --- [New Mobile Optimization 2026-01-18] --- */


/* --- [Advanced Mobile Optimization] --- */
@media screen and (max-width: 768px) {

    /* 1. Typography Scaling */
    html {
        font-size: 15px;
    }

    body {
        font-size: 1rem;
        line-height: 1.6;
    }

    .hero-title {
        font-size: 2.2rem !important;
    }

    .section-header h2 {
        font-size: 1.8rem !important;
    }

    .section-header p {
        font-size: 1rem !important;
    }

    h1,
    h2,
    h3 {
        line-height: 1.3 !important;
        word-break: keep-all;
    }

    /* 2. Force Vertical Layout for Grids */
    .grid-container,
    .two-col-grid,
    .three-col-grid,
    .edu-grid,
    .people-side-grid,
    .greeting-grid,
    .info-grid,
    .board-grid,
    .responsive-board-container,
    .footer-content,
    .worship-wrapper,
    .service-list-grid {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 30px !important;
        margin-bottom: 20px;
    }

    /* 3. Specialized Layouts */
    .greeting-grid {
        flex-direction: column-reverse !important;
    }

    /* 4. Item Frequency & Sizing */
    .about-card,
    .staff-card,
    .officer-card,
    .edu-card,
    .board-column,
    .footer-section,
    .image-content,
    .text-content {
        width: 100% !important;
        margin: 0 !important;
        padding: 20px !important;
    }

    /* 5. Container Adjustments */
    .section {
        padding: 30px 0 !important;
        min-height: auto !important;
        /* Don't force full screen height */
        justify-content: flex-start !important;
        /* Align to top */
        scroll-margin-top: 70px !important;
        /* Clear header + little gap */
    }

    .container {
        padding: 0 20px !important;
    }

    .worship-wrapper {
        padding: 25px !important;
    }

    /* 6. Navigation Stack */
    .nav-menu {
        flex-direction: column;
        gap: 20px;
    }

    /* 7. Worship & Location Mobile Optimization (New) */
    #worship-location .worship-wrapper {
        padding: 25px !important;
    }

    #worship-location .worship-wrapper h3 {
        font-size: 1.5rem !important;
        /* Scale down from 1.8rem */
        margin-bottom: 25px !important;
    }

    #worship-location .service-list li {
        padding: 15px 0 !important;
    }

    /* Worship Name */
    #worship-location .service-list li>div>span {
        font-size: 1.15rem !important;
        /* Scale down from 1.35rem */
    }

    /* Worship Time */
    #worship-location .service-list li>span {
        font-size: 1.25rem !important;
        /* Scale down from 1.5rem */
    }

    #worship-location .location-column>div {
        padding: 25px !important;
        /* Ensure compact padding */
    }

    #map {
        min-height: 300px !important;
        /* Reduce map height for mobile */
    }
}

/* --- [Worship Section Grid Specifics] --- */
.worship-grid-container {
    grid-template-columns: 0.95fr 1fr;
    align-items: stretch;
    gap: 50px;
}

/* --- [Intermediate Laptop Breakpoint (max-width: 1280px)] --- */
@media (max-width: 1280px) {
    .container {
        max-width: 1000px;
        /* Constrain width slightly to prevent edge hitting */
    }

    .hero-title {
        font-size: 3.5rem;
        /* Scale down from 4.8rem */
    }

    .hero-subtitle {
        font-size: 1.3rem;
    }

    .worship-grid-container {
        gap: 30px;
        grid-template-columns: 1fr 1fr;
        /* Switch to equal cols */
    }

    .two-col-grid,
    .three-col-grid {
        gap: 20px;
        /* Reduce gaps */
    }
}

/* --- [Tablet / Small Laptop Breakpoint (max-width: 1024px)] --- */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 3rem;
    }

    .three-col-grid {
        grid-template-columns: 1fr 1fr;
        /* 3 cols -> 2 cols */
    }

    /* Hide specific elements if needed or adjust padding */
    .section {
        padding: 60px 0;
    }
}

/* --- [Mobile Breakpoint (max-width: 768px)] --- */
/* (Refining existing mobile styles) */
@media (max-width: 768px) {
    .worship-grid-container {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }
}

/* --- [Worship Schedule Card] --- */
.worship-schedule-card {
    background: #fdfbf7;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: #333;
    font-family: 'Noto Sans KR', sans-serif;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.worship-title {
    text-align: center;
    color: #0f3e6d;
    font-size: 2.2rem;
    margin-bottom: 25px;
    font-weight: 800;
    letter-spacing: -1px;
    text-shadow: none;
}

.worship-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.worship-group.sunday {
    flex: 2;
}

.worship-group.weekday {
    flex: 1;
}

.worship-header {
    background: #205ea6;
    color: white;
    padding: 12px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.worship-header i {
    font-size: 1.1rem;
}

.worship-list {
    background: #f9f9f9;
    padding: 25px 20px;
    border-radius: 0 0 10px 10px;
    border: 1px solid #ddd;
    border-top: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.worship-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    justify-content: space-between;
}

.worship-item:last-child {
    margin-bottom: 0;
}

.worship-name {
    font-weight: 700;
    font-size: 1.15rem;
    color: #000;
    flex-shrink: 0;
}

.worship-line {
    flex-grow: 1;
    border-bottom: 1px solid #bbb;
    margin: 0 10px;
    position: relative;
    top: -5px;
}

.worship-time {
    font-weight: 800;
    font-size: 1.2rem;
    color: #000;
    flex-shrink: 0;
}

.worship-time i {
    color: #bfa376;
    margin-right: 5px;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .worship-schedule-card {
        padding: 20px;
    }

    .worship-title {
        font-size: 1.8rem;
    }

    .worship-header {
        font-size: 1.2rem;
    }

    .worship-name,
    .worship-time {
        font-size: 1rem;
    }
}

/* --- [People Section Grid] --- */
.people-grid-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 1025px) {
    .people-grid-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        align-items: start;
    }
}

/* --- [Drawing Animation] --- */
.drawing-container {
    position: relative;
    width: 100%;
    max-height: 500px;
    background: #fff;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
}