/* ============================================
   Holy Dormition Website — Main Stylesheet
   Font: Tahoma | Colors: Purple/Gold/Neutral

   TABLE OF CONTENTS:
     1.  Variables (change colors/fonts here)
     2.  Reset & Base
     3.  Typography
     4.  Header & Hamburger Button
     5.  Sidebar Navigation (desktop + mobile)
     6.  Page Layout (two-column)
     7.  Bottom Text Links
     8.  Content Elements (images, blockquotes)
     9.  Footnotes
     10. In-Memoriam Styles
     11. Photo Gallery
     12. Footer
     13. Responsive (mobile breakpoints)
   ============================================ */

/* ==================== 1. VARIABLES ==================== */
:root {
    --primary: #6d4aff;
    --primary-dark: #4a2f9e;
    --accent-gold: #c5a059;
    --text-dark: #2d2d2d;
    --text-light: #666666;
    --bg-page: #f5f5f0;
    --bg-card: #ffffff;
    --bg-sidebar: #fdfbf7;
    --border-light: #e0e0e0;
    --max-width: 1100px;
    --sidebar-width: 200px;
}

/* ==================== 2. RESET & BASE ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: var(--text-dark);
    background-color: var(--bg-page);
    font-size: 16px;
}

/* ==================== 3. TYPOGRAPHY ==================== */
h1 { font-size: 2rem; color: var(--text-dark); margin-bottom: 0.5rem; }
h2 { font-size: 1.5rem; color: var(--primary); margin: 1.5rem 0 0.75rem; }
h3 { font-size: 1.2rem; color: var(--text-dark); margin: 1.25rem 0 0.5rem; }
p  { margin-bottom: 1.25rem; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

blockquote {
    border-left: 4px solid var(--accent-gold);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-light);
    background-color: var(--bg-sidebar);
}

/* ==================== 4. HEADER & HAMBURGER ==================== */
.site-header {
    background-color: var(--bg-card);
    border-bottom: 3px solid var(--accent-gold);
    padding: 1.5rem 1rem;
    text-align: center;
}
.site-header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}
.site-header .subtitle {
    font-style: italic;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Hamburger button (mobile only) */
.hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: var(--primary-dark);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.4rem;
    flex-shrink: 0;
    line-height: 1;
}

/* ==================== 5. TOP NAVBAR WITH DROPDOWNS ====================
   Structure:
   <nav class="topnav" id="topnav">
     <ul class="nav-menu">
       <li class="nav-item">
         <a href="..." class="nav-link">Category Name</a>
         <ul class="dropdown">
           <li><a href="...">Sub-link</a></li>
         </ul>
       </li>
     </ul>
   </nav>

   TO ADD A BUTTON:
   - Add a new <li> inside <ul class="nav-menu">
   - Or add a new <li> inside an existing <ul class="dropdown">
   TO REORDER: drag <li> tags around.
   ============================================================ */

.topnav {
    background-color: var(--primary-dark);
    position: relative;
    z-index: 500;
}

.nav-menu {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
}

.nav-item {
    position: relative;
}

/* Top-level category buttons */
.nav-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #fff !important;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}
.nav-link:hover {
    background-color: var(--primary);
    text-decoration: none;
}

/* ============================================================
   NAVIGATION DROPDOWNS — ALL LEVELS (CONSOLIDATED)
   Replace all previous dropdown CSS with this single block.
   ============================================================ */

/* --- Dropdown panels (shared base for Level 1 and Level 2) --- */
.dropdown {
    list-style: none;
    position: absolute;
    min-width: 220px;
    background-color: #fff;
    border: 1px solid var(--border-light);
    border-top: 3px solid var(--accent-gold);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    padding: 0;
    margin: 0;
    z-index: 1000;

    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

/* --- Level 1: drops down from top nav bar --- */
.nav-menu > .nav-item > .dropdown {
    top: 100%;
    left: 0;
    transform: translateY(-5px);
}

/* --- Level 2: slides out to the right of parent item --- */
.has-submenu > .dropdown {
    top: 0;
    left: 100%;
    margin-left: 2px;
    transform: translateX(-5px);
}

/* --- Show Level 1 when top nav item is hovered --- */
.nav-menu > .nav-item:hover > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- Show Level 2 when submenu parent is hovered --- */
.has-submenu:hover > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* --- Dropdown link styling (all levels) --- */
.dropdown li a {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text-dark) !important;
    text-decoration: none;
    font-size: 0.88rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s, color 0.15s;
}
.dropdown li:last-child a {
    border-bottom: none;
}
.dropdown li a:hover {
    background-color: #f5f3ff;
    color: var(--primary) !important;
    text-decoration: none;
}

/* --- Category color indicators (left border on hover) --- */
.nav-item.history  > .dropdown li a:hover { border-left: 3px solid #7b5bc4; padding-left: calc(1rem - 3px); }
.nav-item.faith    > .dropdown li a:hover { border-left: 3px solid #937ddb; padding-left: calc(1rem - 3px); }
.nav-item.memorial > .dropdown li a:hover { border-left: 3px solid #6C3BAA; padding-left: calc(1rem - 3px); }
.nav-item.general  > .dropdown li a:hover { border-left: 3px solid #6d4aff; padding-left: calc(1rem - 3px); }
.nav-item.photos   > .dropdown li a:hover { border-left: 3px solid #6d4aff; padding-left: calc(1rem - 3px); }

/* --- Arrow indicator for items with submenus --- */
.has-submenu > a::after {
    content: "›";
    font-size: 1.2rem;
    float: right;
    margin-left: 0.5rem;
    line-height: 1;
}

/* --- Mobile: dropdowns become expanded panels --- */
@media (max-width: 768px) {
    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-left: 4px solid var(--accent-gold);
        background-color: #f9f7fd;
        display: none;
    }
    .nav-item.expanded > .dropdown,
    .has-submenu.expanded > .dropdown {
        display: block;
    }
    .has-submenu > .dropdown {
        margin-left: 1rem;
    }
}

/* ==================== 6. PAGE LAYOUT ==================== */
.page-body {
    max-width: var(--max-width);
    margin: 0 auto;
    background-color: var(--bg-card);
}

.main-content {
    padding: 0;
    min-width: 0;
}

.container {
    padding: 2rem 1.5rem;
}

/* ============================================================
   ARTICLE — Narrower text column for long-form reading
   Wrap article pages: <div class="container"><div class="article"> ... </div></div>
   Only affects desktop; mobile inherits the container width.
   ============================================================ */

.article {
    max-width: 65ch;
    margin: 0 auto;                    /* center within the container */
    font-size: 1.125rem;               /* 18px if root is 16px */
    line-height: 1.65;
}

/* Slightly larger H2 inside articles for visual hierarchy */
.article h2 {
    font-size: 1.75rem;                /* 28px at 16px root */
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* H3 for subsections within articles */
.article h3 {
    font-size: 1.375rem;               /* 22px at 16px root */
    line-height: 1.3;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Comfortable paragraph spacing */
.article p {
    margin-bottom: 1.25rem;
}

/* Images inside articles don't exceed the text column */
.article img {
    max-width: 100%;
    height: auto;
}

/* Blockquotes get a subtle left accent */
.article blockquote {
    margin: 1.5rem 0;
    padding-left: 1.25rem;
    border-left: 4px solid var(--accent);
    font-style: italic;
    color: var(--text-light);
}

/* Lists inherit the same comfortable spacing */
.article ul,
.article ol {
    margin-bottom: 1.25rem;
    padding-left: 1.75rem;
}

.article li {
    margin-bottom: 0.5rem;
}

/* ==================== 6. PAGE LAYOUT continued ==================== */

.breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-light);
    padding: 0.75rem 1.5rem 0;
}
.breadcrumbs a { color: var(--text-light); }
.breadcrumbs span { margin: 0 0.4rem; }

/* ==================== 7. BOTTOM TEXT LINKS ==================== */
.bottom-links {
    border-top: 1px solid var(--border-light);
    padding: 1.25rem 1.5rem;
    text-align: center;
    font-size: 0.88rem;
}
.bottom-links a {
    display: inline-block;
    margin: 0.3rem 0.6rem;
    color: var(--text-light);
}

/* ==================== 8. CONTENT ELEMENTS ==================== */
.article-img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    margin: 1.5rem auto;
}
.img-caption {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 0.25rem;
    margin-bottom: 1.5rem;
}

/* ==================== 9. FOOTNOTES ==================== */
.footnotes {
    border-top: 1px solid var(--border-light);
    margin-top: 2.5rem;
    padding-top: 1rem;
}
.footnotes h3 { font-size: 1rem; color: var(--text-light); }
.footnotes ol {
    font-size: 0.85rem;
    color: var(--text-light);
    padding-left: 1.5rem;
}
.footnotes li { margin-bottom: 0.5rem; }

/* ==================== 10. IN-MEMORIAM STYLES ==================== */
.letter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin: 2rem 0;
}
.letter-btn {
    display: inline-block;
    background-color: var(--primary);
    color: #fff !important;
    padding: 1rem 2rem;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.2s;
}
.letter-btn:hover {
    background-color: var(--primary-dark);
    text-decoration: none;
}

.memorial-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.92rem;
}
.memorial-table th {
    background-color: var(--primary-dark);
    color: #fff;
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
}
.memorial-table td {
    border-bottom: 1px solid var(--border-light);
    padding: 0.5rem 0.75rem;
}
.memorial-table tr:hover { background-color: #f9f7fd; }
.memorial-table a { font-weight: bold; }

.veteran-badge {
    display: inline-block;
    background-color: var(--accent-gold);
    color: #fff;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: bold;
}

.person-profile {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    margin: 1.5rem 0;
}
.person-photo img {
    width: 100%;
    border-radius: 6px;
    border: 1px solid var(--border-light);
}
.person-details dt {
    font-weight: bold;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 0.75rem;
}
.person-details dd {
    margin-left: 0;
    margin-bottom: 0.25rem;
}

/* ============================================================
   MEMORIAL PAGE PHOTO HANDLING
   The memorial-photo-placeholder div takes no visual space
   when empty. Only shows if content is added.
   ============================================================ */

.memorial-photo-placeholder {
    min-width: 280px;
    /* No background, no border, no padding when empty */
}

.memorial-photo-placeholder img {
    max-width: 280px;
    height: auto;
    border-radius: 4px;
    /* Optional subtle shadow for photos when present */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   CEMETERY RECORD BOX
   Individual memorial pages - metadata box at bottom
   ============================================================ */

.cemetery-record-box {
    background-color: #f8f8f8;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.cemetery-record-box h3 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.cemetery-record-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.cemetery-record-table td {
    padding: 0.5rem 0;
}

.cemetery-record-table td:first-child {
    font-weight: bold;
    color: var(--text-light);
    width: 140px;
}

/* ============================================================
   INFO TOOLTIP — Hover bubble for cemetery record table
   ============================================================ */

.info-tooltip {
    position: relative;
    cursor: help;
    display: inline-flex;
    align-items: center;
}

.info-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid var(--accent, #6d4aff);
    color: var(--accent, #6d4aff);
    background: transparent;
    font-size: 0.7rem;
    font-weight: bold;
    font-style: italic;
    text-align: center;
    line-height: 14px;
    flex-shrink: 0;
}

.info-bubble {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    padding: 0.75rem;
    background: #333;
    color: #fff;
    font-size: 0.85rem;
    font-weight: normal;
    font-style: normal;
    line-height: 1.4;
    border-radius: 6px;
    z-index: 1000;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.info-bubble::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
}

.info-tooltip:hover .info-bubble,
.info-tooltip:focus .info-bubble {
    visibility: visible;
    opacity: 1;
}

/* ============================================================
   MEMORIAL GALLERY — Simple vertical photo stack
   ============================================================ */

.memorial-gallery {
    margin: 2rem auto;        /* Top/bottom margin + horizontal auto-centering */
    max-width: 500px;
}

.memorial-gallery-figure {
    margin: 0 0 1.5rem 0;
}

.memorial-gallery-figure:last-child {
    margin-bottom: 0;
}

.memorial-gallery-img {
    display: block;
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 4px;
    margin: 0 auto;
    background-color: #f5f5f5;
}

.memorial-gallery-caption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 0.5rem;
}

/* ==================== 11. PHOTO GALLERY ==================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.gallery-item {
    border: 1px solid var(--border-light);
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.15s;
}
.gallery-item:hover { transform: scale(1.02); }
.gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.gallery-caption {
    padding: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-light);
    text-align: center;
}

/* ===== Parish Committee Table ===== */
.committee-table {
    width: 100%;
    max-width: 480px;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}
.committee-table th {
    background-color: var(--primary-dark);
    color: #fff;
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.88rem;
}
.committee-table td {
    border-bottom: 1px solid var(--border-light);
    padding: 0.5rem 0.75rem;
}
.committee-table tr:hover {
    background-color: #f9f7fd;
}
.committee-table td:first-child {
    font-weight: bold;
}

/* ===== Trustee List (two columns) ===== */
.trustee-list {
    column-count: 2;
    column-gap: 2.5rem;
    list-style: none;
    padding-left: 0;
    margin: 1.5rem 0;
}
.trustee-list li {
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border-light);
    break-inside: avoid;
}

/* On mobile, collapse to a single column */
@media (max-width: 600px) {
    .trustee-list {
        column-count: 1;
    }
    .committee-table {
        max-width: 100%;
    }
}

/* ==================== 12. FOOTER ==================== */
.site-footer {
    background-color: #2d2d2d;
    color: #ccc;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    font-size: 0.88rem;
}
.site-footer a { color: var(--accent-gold); }

/* ==================== 13. RESPONSIVE (MOBILE) ==================== */
@media (max-width: 768px) {

    /* Header: horizontal flex with hamburger */
    .site-header {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        text-align: left;
    }
    .header-text { flex: 1; }
    .hamburger { display: flex; }

    /* Navbar hidden until hamburger tapped */
    .topnav { display: none; }
    .topnav.open { display: block; }

    /* Vertical menu stacking */
    .nav-menu {
        flex-direction: column;
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        padding: 0.7rem 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.15);
        color: #fff !important;
    }

    /* --- Dropdown panels on mobile (both levels) --- */
    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-left: 4px solid var(--accent-gold);
        background-color: #f9f7fd;
        padding: 0;
        display: none;  /* Hidden until parent has .expanded class */
        z-index: 1;
    }

    .nav-item.expanded > .dropdown {
        display: block;
    }

    .has-submenu.expanded > .dropdown {
        display: block;
    }

    /* Nested dropdown indentation */
    .has-submenu > .dropdown {
        margin-left: 1rem;
        border-left: 4px solid #937ddb;
    }

    /* Link styling in mobile dropdowns */
    .dropdown li a {
        padding: 0.7rem 1rem;
        color: var(--text-dark) !important;
        border-bottom: 1px solid #e8e6ed;
    }

    /* Submenu items get further indentation */
    .has-submenu > .dropdown > li > a {
        padding-left: 1.5rem;
    }

}

@media (max-width: 650px) {
    .site-header .subtitle { display: none; }
    .site-header h1 { font-size: 1.05rem; }
}
/* ===============================================
Also, you can update the --max-width variable near the top of styles.css back to the wider value:
    --max-width: 900px;
================================================== */
    