/* Ancient Church — style guide + layout */
:root {
    --red: #8b1538;
    --gold: #c9a227;
    --cream: #f5f0e6;
    --charcoal: #2c1810;
    --wood: #5c4033;
    --white: #ffffff;
    --blue-deep: #1a365d;
}
* { box-sizing: border-box; }
body {
    font-family: 'Roboto', sans-serif;
    background: var(--cream);
    color: var(--charcoal);
    margin: 0;
    line-height: 1.6;
}
.main-content-wrap { min-height: 60vh; }

/* Typography */
h1 {
    font-size: 48px;
    font-family: 'Cormorant Garamond', serif;
    font-weight: bold;
    color: var(--charcoal);
    line-height: 1.2;
    margin: 0 0 0.5em 0;
}
h2 {
    font-size: 38px;
    font-family: 'Cormorant Garamond', serif;
    font-weight: bold;
    color: var(--charcoal);
    line-height: 1.3;
    margin: 0 0 0.5em 0;
}
h3 {
    font-size: 28px;
    font-family: 'Cormorant Garamond', serif;
    font-weight: bold;
    color: var(--charcoal);
    line-height: 1.35;
    margin: 0 0 0.5em 0;
}
h4 {
    font-size: 22px;
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    color: var(--charcoal);
    line-height: 1.4;
    margin: 0 0 0.5em 0;
}
h5 {
    font-size: 18px;
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    color: var(--charcoal);
    line-height: 1.45;
    margin: 0 0 0.5em 0;
}
p {
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    color: var(--charcoal);
    line-height: 1.7;
    margin: 0 0 1em 0;
}
a {
    color: var(--red);
    text-decoration: none;
    font-weight: 500;
}
a:hover {
    color: var(--wood);
    text-decoration: underline;
}
ul, ol {
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    margin: 0 0 1em 0;
    padding-left: 1.5em;
}
li { margin-bottom: 0.5em; line-height: 1.6; }
blockquote {
    font-size: 18px;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: var(--wood);
    border-left: 4px solid var(--gold);
    margin: 1.5em 0;
    padding: 1em 1.5em;
    background: var(--white);
}
strong { font-weight: bold; color: var(--charcoal); }
i, em { font-style: italic; font-family: 'Cormorant Garamond', serif; }

button, .button {
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    color: var(--white);
    background: var(--red);
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    text-decoration: none;
}
button:hover, .button:hover {
    background: var(--wood);
    color: var(--cream);
}

/* Header — fixed, hide on scroll down, show on scroll up */
#main_header_1 { position: relative; z-index: 100; }
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--blue-deep);
    border-bottom: 1px solid rgba(201, 162, 39, 0.3);
    transition: transform 0.25s ease-out;
}
.site-header.header-hidden { transform: translateY(-100%); }
.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--cream);
    font-weight: 600;
}
.brand:hover { color: var(--white); text-decoration: none; }
.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--wood));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--charcoal);
    font-weight: 700;
    font-size: 0.9rem;
}

/* Nav — desktop */
.nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.nav-list > li {
    margin: 0;
    position: relative;
}
.nav-list > li > a {
    color: var(--cream);
    padding: 0.5rem 0.6rem;
    display: block;
}
.nav-list > li > a:hover,
.nav-list > li.active > a,
.nav-list > li.child_active > a {
    color: var(--gold);
    text-decoration: none;
}
.nav-toggle {
    width: 24px;
    height: 24px;
    padding: 0;
    margin-left: 2px;
    border: none;
    background: transparent;
    color: var(--cream);
    cursor: pointer;
    border-radius: 4px;
    vertical-align: middle;
    position: relative;
}
.nav-toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -3px 0 0 -5px;
    border: 5px solid transparent;
    border-top-color: currentColor;
    border-bottom: none;
}
.nav-toggle[aria-expanded="true"]::after {
    border-top: none;
    border-bottom: 5px solid currentColor;
    margin-top: -6px;
}
.nav-sub {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    min-width: 220px;
    background: var(--blue-deep);
    border: 1px solid rgba(201, 162, 39, 0.3);
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
}
.nav-list > li:hover .nav-sub,
.nav-list > li.nav-sub-open .nav-sub {
    display: block;
}
.nav-sub li { margin: 0; }
.nav-sub a {
    color: var(--cream);
    padding: 0.4rem 1rem;
    display: block;
    font-size: 0.95rem;
}
.nav-sub a:hover,
.nav-sub li.active a { color: var(--gold); text-decoration: none; }
.nav-sub .nav-sub {
    left: 100%;
    top: 0;
}
.nav-donate { margin-left: 0.5rem; }

/* Hamburger — mobile */
.hamburger {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--cream);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}
.hamburger::before,
.hamburger::after,
.hamburger span {
    content: '';
    display: block;
    position: absolute;
    left: 12px;
    right: 12px;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s, opacity 0.2s;
}
.hamburger::before { top: 14px; }
.hamburger span { top: 21px; }
.hamburger::after { top: 28px; }
.hamburger[aria-expanded="true"]::before {
    transform: translateY(7px) rotate(45deg);
}
.hamburger[aria-expanded="true"] span {
    opacity: 0;
}
.hamburger[aria-expanded="true"]::after {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 900px) {
    .hamburger { display: block; }
    .nav {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--blue-deep);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 99;
    }
    .nav.nav-open { transform: translateX(0); }
    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .nav-list > li {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .nav-list > li > a { padding: 0.75rem 1rem; }
    .nav-sub {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding-left: 1rem;
        background: rgba(0,0,0,0.15);
    }
    .nav-list > li:hover .nav-sub { display: none; }
    .nav-list > li.nav-sub-open .nav-sub { display: block; }
    .nav-toggle { display: inline-block; }
    .nav-donate { margin: 1rem 0 0; align-self: center; }
}

/* Main content — sections */
.section_block { padding: 2.5rem 0; }
.section_wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}
.hero_section {
    position: relative;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, var(--blue-deep) 0%, var(--charcoal) 100%);
    color: var(--cream);
}
.hero_section .section_wrap { position: relative; z-index: 1; }
.hero_section h1 { color: var(--cream); margin-bottom: 0.25em; }
.hero_bg {
    position: absolute;
    inset: 0;
    background: url('/images/hero-bg.jpg') center/cover no-repeat;
    opacity: 0.35;
}
.hero_tagline {
    font-size: 1.25rem;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    margin: 0;
    opacity: 0.95;
}
.intro_section { background: var(--white); }
.cards_section { background: var(--cream); }
.card_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(44, 24, 16, 0.08);
    border: 1px solid rgba(92, 64, 51, 0.1);
}
.card a {
    display: block;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
}
.card a:hover { text-decoration: none; color: var(--charcoal); }
.card a:hover .button { background: var(--wood); color: var(--cream); }
.card_image {
    height: 160px;
    background: linear-gradient(135deg, var(--blue-deep), var(--charcoal));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cream);
    font-size: 0.9rem;
}
.card h3 { margin: 0 0 0.5em; font-size: 1.35rem; }
.card p { margin: 0 0 1em; font-size: 0.95rem; }
.cta_section {
    background: var(--charcoal);
    color: var(--cream);
    text-align: center;
}
.cta_section h2 { color: var(--cream); }
.cta_section p { color: rgba(245, 240, 230, 0.95); }
.cta_section a { color: var(--gold); }
.half_image_section { display: flex; flex-wrap: wrap; gap: 2rem; align-items: center; }
.half_image_section .half_content { flex: 1 1 300px; }
.half_image_section .half_image {
    flex: 1 1 300px;
    min-height: 240px;
    background: linear-gradient(135deg, var(--wood), var(--charcoal));
    border-radius: 8px;
}
.text_section { background: var(--cream); }
.sitemap-list { list-style: none; padding-left: 0; }
.sitemap-list li { margin: 0.5em 0; }

/* Spacer for fixed header */
body { padding-top: 56px; }

/* Footer */
.site-footer {
    border-top: 1px solid rgba(92, 64, 51, 0.2);
    background: var(--charcoal);
    padding: 1.5rem 1.25rem;
    color: var(--cream);
    font-size: 0.9rem;
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.footer-inner a { color: var(--gold); }
.footer-inner a:hover { color: var(--cream); text-decoration: underline; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }

#chatbot-root { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 50; }
.chatbot-bubble {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid rgba(248,250,252,.5);
    background: linear-gradient(135deg, var(--gold), var(--wood));
    color: var(--charcoal);
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.chatbot-panel {
    position: absolute;
    right: 0;
    bottom: 60px;
    width: 320px;
    max-width: 90vw;
    border-radius: 10px;
    border: 1px solid rgba(92,64,51,.3);
    background: var(--cream);
    box-shadow: 0 10px 40px rgba(0,0,0,.2);
    overflow: hidden;
}
.chatbot-panel-head { padding: 0.6rem 0.9rem; border-bottom: 1px solid rgba(92,64,51,.2); font-weight: 600; color: var(--charcoal); }
.chatbot-panel-body { padding: 0.9rem; }
.chatbot-panel-body textarea {
    width: 100%;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(92,64,51,.3);
    background: var(--white);
    color: var(--charcoal);
    font-size: 0.9rem;
    resize: vertical;
    box-sizing: border-box;
}
.chatbot-panel-body select {
    width: 100%;
    padding: 0.4rem;
    margin: 0.5rem 0;
    background: var(--white);
    color: var(--charcoal);
    border: 1px solid rgba(92,64,51,.3);
    border-radius: 6px;
}
.chatbot-panel-body #chatbot-submit { margin-top: 0.5rem; padding: 0.5rem 1rem; background: var(--red); color: var(--white); border: none; border-radius: 4px; cursor: pointer; }
#chatbot-status { margin-top: 0.5rem; font-size: 0.85rem; color: var(--wood); }
#chatbot-refresh-wrap { margin-top: 0.75rem; }
#chatbot-refresh-btn { background: var(--wood); color: var(--cream); border: none; padding: 0.5rem 1rem; border-radius: 4px; cursor: pointer; }
.chatbot-drop-zone.chatbot-drop-zone-active { outline: 2px dashed var(--gold); outline-offset: 4px; border-radius: 8px; background: rgba(201,162,39,.1); }
.chatbot-uploaded-urls { margin-top: 0.5rem; font-size: 0.8rem; color: var(--wood); display: none; }
.chatbot-uploaded-urls code { background: rgba(92,64,51,.15); padding: 0.15rem 0.35rem; border-radius: 4px; margin-right: 0.25rem; }
