/*
Theme Name:  GK Kleinmond
Theme URI:   https://www.gkkleinmond.org
Description: Custom theme for Gereformeerde Kerk Kleinmond. Migrated from Wix.
Version:     1.0.0
Author:      GK Kleinmond
Text Domain: gk-kleinmond
*/

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Nunito', Arial, Helvetica, sans-serif;
    font-weight: 300;
    color: #222222;
    background: #ffffff;
    line-height: 1.7;
}

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

a { color: #3a5a8c; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 {
    font-family: 'Caudex', Georgia, serif;
    font-weight: 400;
    line-height: 1.2;
    color: #1a1a1a;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.4rem; }

p { margin-bottom: 1.1em; }
p:last-child { margin-bottom: 0; }

/* ===== LAYOUT ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-content {
    min-height: 60vh;
}

/* ===== HEADER ===== */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e8e8e8;
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-shrink: 0;
}

.site-branding img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.site-title {
    font-family: 'Caudex', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 400;
    color: #1a1a1a;
    line-height: 1.2;
}

.site-title a { color: inherit; }
.site-title a:hover { text-decoration: none; }

/* ===== NAVIGATION ===== */
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 0.2rem;
    align-items: center;
}

.main-nav a {
    display: block;
    padding: 0.4rem 0.75rem;
    font-family: 'Nunito', Arial, sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    color: #333333;
    border-radius: 3px;
    white-space: nowrap;
}

.main-nav a:hover {
    background: #f4f4f4;
    color: #1a1a1a;
    text-decoration: none;
}

/* Dropdown */
.main-nav li { position: relative; }

.main-nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 220px;
    flex-direction: column;
    gap: 0;
    padding: 0.4rem 0;
    z-index: 200;
}

.main-nav li:hover > .sub-menu { display: flex; }

.main-nav .sub-menu a {
    border-radius: 0;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
}

/* ===== HERO ===== */
.hero {
    position: relative;
    height: 480px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #ffffff;
    padding: 1rem 2rem;
    max-width: 700px;
}

.hero-content h1 {
    color: #ffffff;
    font-size: 3rem;
    margin-bottom: 0.6rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 1.15rem;
    opacity: 0.92;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ===== PAGE SECTIONS ===== */
.page-section {
    padding: 3.5rem 0;
}

.page-section--grey {
    background: #f7f7f7;
}

/* ===== CONTENT CARD ===== */
.content-card {
    background: #ffffff;
    border-radius: 6px;
    padding: 2.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
}

/* ===== STANDARD PAGE ===== */
.page-hero {
    background: #3a5a8c;
    padding: 3rem 0;
    text-align: center;
}

.page-hero h1 {
    color: #ffffff;
    margin: 0;
}

.entry-content {
    padding: 3rem 0;
}

.entry-content p,
.entry-content li {
    font-size: 1rem;
    line-height: 1.75;
}

.entry-content h2,
.entry-content h3 {
    margin-top: 1.8em;
}

.entry-content ul,
.entry-content ol {
    margin: 0 0 1.1em 1.4em;
}

/* ===== PREKE (SERMON INDEX) ===== */
.sermon-series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-top: 2rem;
}

.sermon-series-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.sermon-series-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.sermon-series-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.sermon-series-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.sermon-series-card .card-title {
    padding: 0.8rem 1rem;
    font-family: 'Caudex', serif;
    font-size: 1rem;
    font-weight: 400;
    color: #1a1a1a;
}

/* ===== SERMON SERIES PAGE ===== */
.series-hero {
    position: relative;
    height: 320px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.series-hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.series-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.1) 60%);
}

.series-hero-title {
    position: relative;
    z-index: 1;
    padding: 1.5rem 2rem;
    color: #ffffff;
}

.series-hero-title h1 { color: #ffffff; }

.sermon-list {
    padding: 2.5rem 0;
}

.sermon-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eeeeee;
    background: #ffffff;
}

.sermon-item:hover { background: #f9f9f9; }

.sermon-meta {
    flex: 1;
}

.sermon-title {
    font-family: 'Caudex', serif;
    font-size: 1rem;
    font-weight: 400;
    color: #1a1a1a;
    margin-bottom: 0.2rem;
}

.sermon-details {
    font-size: 0.82rem;
    color: #777777;
}

.sermon-audio {
    width: 260px;
    flex-shrink: 0;
}

.sermon-audio audio {
    width: 100%;
    height: 36px;
}

.sermon-download {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: #3a5a8c;
    text-decoration: none;
}
.sermon-download:hover {
    text-decoration: underline;
}

/* ===== FOOTER ===== */
.site-footer {
    background: #1e2a3a;
    color: #cccccc;
    padding: 2.5rem 0;
    margin-top: 4rem;
    font-size: 0.9rem;
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-col h3 {
    font-family: 'Caudex', serif;
    font-size: 1rem;
    color: #ffffff;
    margin-bottom: 0.8rem;
}

.footer-col a { color: #aabbcc; }
.footer-col a:hover { color: #ffffff; }

.footer-bottom {
    margin-top: 2rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 0.8rem;
    color: #888;
}

/* ===== PAGE HERO WITH IMAGE ===== */
.page-hero--image {
    background-size: cover;
    background-position: center;
    position: relative;
    padding: 5rem 0;
}

.page-hero-overlay {
    display: none;
}

.page-hero--image .page-hero-overlay {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}

.page-hero--image .container {
    position: relative;
    z-index: 1;
}

/* ===== MAP SECTION ===== */
.map-contact {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    align-items: start;
}

.map-info {
    padding: 1rem 0;
}

.map-info p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .map-contact {
        grid-template-columns: 1fr;
    }
}

/* ===== BUTTON LINKS ===== */
.wp-button {
    display: inline-block;
    background: #3a5a8c;
    color: #ffffff;
    font-family: 'Nunito', Arial, sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.75rem 1.8rem;
    border-radius: 4px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(58,90,140,0.25);
    transition: background 0.2s, box-shadow 0.2s;
}

.wp-button:hover {
    background: #2d4870;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(58,90,140,0.35);
}

/* ===== NARROW TEXT COLUMN ===== */
.container--text {
    max-width: 740px;
}

/* ===== CONFESSION LINK TILES ===== */
.confession-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.2rem 0 2rem;
}

.confession-link {
    display: inline-block;
    padding: 0.7rem 1.3rem;
    background: #f0f4f9;
    border: 1px solid #c8d8ec;
    border-radius: 4px;
    color: #3a5a8c;
    font-family: 'Caudex', serif;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.confession-link:hover {
    background: #3a5a8c;
    border-color: #3a5a8c;
    color: #ffffff;
    text-decoration: none;
}

/* ===== CONFESSION DOCUMENT FORMATTING ===== */
.hk-subtitle {
    font-size: 0.95rem;
    color: #666;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hk-part {
    margin-top: 2.5rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #e0e8f0;
    color: #3a5a8c;
}

.hk-sondag {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #555;
}

.hk-question {
    margin-top: 0.8rem;
    margin-bottom: 0.2rem;
}

.hk-question strong {
    color: #1a1a1a;
}

.hk-answer {
    margin-top: 0;
    margin-bottom: 1.2rem;
    padding-left: 1rem;
    border-left: 3px solid #e0e8f0;
    color: #333;
}

/* ===== ANNOUNCEMENT BAR ===== */
.announcement-bar {
    background: #4a7c3f;
    color: #ffffff;
    text-align: center;
    font-size: 0.875rem;
    font-family: 'Nunito', Arial, sans-serif;
    padding: 0.5rem 1rem;
    letter-spacing: 0.01em;
}

/* ===== HAMBURGER BUTTON (hidden on desktop) ===== */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.menu-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: #333333;
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}

/* X state when open */
.menu-toggle.is-active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.menu-toggle.is-active span:nth-child(2) { opacity: 0; }
.menu-toggle.is-active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ===== SUB-MENU TOGGLE BUTTON (hidden on desktop) ===== */
.sub-menu-toggle { display: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }

    .hero { height: 340px; }
    .hero-content h1 { font-size: 2rem; }

    /* Header: hide logo, let title wrap to two lines */
    .site-branding img,
    .site-branding .custom-logo-link { display: none !important; }

    .site-branding {
        flex-shrink: 1;
        min-width: 0;
    }

    .site-title {
        font-size: 1rem;
        white-space: normal;
        line-height: 1.3;
    }

    /* Show hamburger, hide inline nav */
    .menu-toggle { display: flex; }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff;
        border-top: 1px solid #e8e8e8;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        z-index: 150;
    }

    .main-nav.is-open { display: block; }

    /* Make header relative so mobile nav positions correctly */
    .site-header { position: sticky; top: 0; }
    .site-header .container { position: relative; }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 0;
    }

    .main-nav li { border-bottom: 1px solid #f0f0f0; }
    .main-nav li:last-child { border-bottom: none; }

    /* Items with children: relative so chevron can be absolutely placed */
    .main-nav .menu-item-has-children {
        position: relative;
        display: block;
    }

    .main-nav .menu-item-has-children > a {
        display: block;
        padding: 0.75rem 3rem; /* extra padding both sides so text stays centred */
        font-size: 1rem;
        text-align: center;
    }

    /* Chevron: absolute top-right, same height as the link row */
    .main-nav .menu-item-has-children > .sub-menu-toggle {
        position: absolute;
        top: 0;
        right: 0;
        width: 48px;
        height: 48px;
    }

    .main-nav a {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        text-align: center;
    }

    /* Chevron toggle button */
    .sub-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        flex-shrink: 0;
    }

    .sub-menu-toggle svg { transition: transform 0.2s ease; }
    .menu-item-has-children.sub-is-open > .sub-menu-toggle svg { transform: rotate(180deg); }

    /* Sub-menus: hidden by default, shown when sub-is-open */
    .main-nav .sub-menu {
        display: none;
        position: static;
        box-shadow: none;
        border: none;
        padding: 0;
        min-width: 0;
        background: #ffffff;
        width: 100%;
    }

    .main-nav .menu-item-has-children.sub-is-open > .sub-menu {
        display: block;
    }

    .main-nav .sub-menu a {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        text-align: center;
    }

    .sermon-audio { width: 100%; }
    .sermon-item { flex-direction: column; align-items: flex-start; }
}

/* --- static copy additions --- */
.sermon-spotify{display:inline-block;padding:.4rem .9rem;border:1px dashed currentColor;border-radius:999px;font-size:.9rem;opacity:.4;cursor:default}
a.sermon-spotify{opacity:1;cursor:pointer;text-decoration:none;font-weight:600;border:1px solid #1db954;background:#1db954;color:#000}
a.sermon-spotify::before{content:"\25B6\FE0E";margin-right:.45em;font-size:.8em}
a.sermon-spotify:hover,a.sermon-spotify:focus-visible{background:#1ed760;border-color:#1ed760;color:#000}
.sermon-item{flex-wrap:wrap}
.sermon-audio{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center}
.sermon-play{font:inherit;font-size:.9rem;font-weight:600;padding:.4rem .9rem;border-radius:999px;border:1px solid currentColor;background:transparent;color:inherit;cursor:pointer}
.sermon-play::before{content:"\25B6\FE0E";margin-right:.45em;font-size:.8em}
.sermon-play:hover,.sermon-play:focus-visible{background:#f2f2f2}
.sermon-player{flex-basis:100%;margin-top:.75rem}
.sermon-player iframe{border:0;border-radius:12px;display:block}
.sermon-note{font-size:.85rem;opacity:.75;margin:.5rem 0 1rem}
.recent-list,.recent-more{margin-top:1.5rem}
.card-noimage{aspect-ratio:3/2;background:#3a5a8c}
.series-hero:not(:has(img)){min-height:12rem;background:#3a5a8c}
