/* =========================================================
   Darklife — Cave Surveys & Biology, South Africa
   Stylesheet v4 | Traditional, clean, white-background
   ========================================================= */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #2b2b2b;
    background: #fff;
}

/* --- Links --- */
a { color: #1a5276; text-decoration: none; }
a:hover { color: #0e3460; text-decoration: underline; }
a:visited { color: #5c4a8a; }

/* --- Typography --- */
h1, h2, h3, h4, h5 {
    font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;
    font-weight: 600;
    line-height: 1.25;
    color: #1a2e1a;
}
h1 { font-size: 1.9rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.4rem; margin-top: 2rem; margin-bottom: 0.6rem;
     border-bottom: 1px solid #d4d4d4; padding-bottom: 0.25rem; }
h3 { font-size: 1.15rem; margin-top: 1.5rem; margin-bottom: 0.4rem; }
h4 { font-size: 1rem; margin-top: 1.2rem; margin-bottom: 0.3rem; color: #2a4a2a; }
p  { margin-bottom: 1rem; }
ul, ol { margin: 0.5rem 0 1rem 1.5rem; }
li { margin-bottom: 0.3rem; }
hr { border: none; border-top: 1px solid #ddd; margin: 2rem 0; }
pre {
    background: #f4f4f4; border: 1px solid #ddd;
    padding: 0.8rem 1rem; font-size: 0.85rem;
    overflow-x: auto; border-radius: 3px; margin-bottom: 1rem;
}
blockquote {
    border-left: 4px solid #4a7a4a;
    background: #f2f7f2;
    margin: 1rem 0 1.2rem 0;
    padding: 0.7rem 1.2rem;
    color: #3a3a3a;
    font-style: italic;
    border-radius: 0 3px 3px 0;
}
blockquote p { margin-bottom: 0.5rem; }
blockquote p:last-child { margin-bottom: 0; }

/* --- Site layout --- */
#site-wrapper { min-height: 100vh; display: flex; flex-direction: column; }

/* =========================================================
   HEADER
   ========================================================= */
#site-header { background: #1e3a1e; color: #fff; }
#header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1.5rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
#site-logo {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.9rem; font-weight: 700;
    color: #fff; text-decoration: none; letter-spacing: -0.5px; flex-shrink: 0;
}
#site-logo:hover { color: #c8e6c8; text-decoration: none; }
#site-logo:visited { color: #fff; }
#site-tagline { font-style: italic; font-size: 0.88rem; color: #a8c8a8; }

/* =========================================================
   NAVIGATION BAR — horizontal with cascading dropdowns
   ========================================================= */
#site-nav {
    background: #2a4a2a;
    border-bottom: 3px solid #4a7a4a;
    position: relative;
    z-index: 100;
}

#nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: stretch;
}

/* Top-level list */
#nav-links {
    display: flex;
    align-items: stretch;
    flex: 1;
    list-style: none;
    margin: 0; padding: 0;
}

#nav-links > li {
    position: relative;
    display: flex;
    align-items: stretch;
}

#nav-links > li > a,
#nav-links > li > span.nav-parent {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.65rem 1rem;
    color: #e8f5e8;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.875rem; font-weight: 500;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -3px;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s;
    user-select: none;
}
#nav-links > li > a:hover,
#nav-links > li > span.nav-parent:hover,
#nav-links > li:hover > a,
#nav-links > li:hover > span.nav-parent {
    background: #3a5e3a; color: #fff; text-decoration: none;
}
#nav-links > li > a.active,
#nav-links > li > a[aria-current="page"] {
    border-bottom-color: #8fbc8f; color: #fff; background: #355035;
}
#nav-links > li > a:visited { color: #e8f5e8; }
#nav-links > li > a.private-link { color: #b8d4b8; font-style: italic; }
.nav-caret { font-size: 0.62rem; opacity: 0.65; }

/* ---- DROPDOWN PANEL (level 1) ---- */
.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    background: #1e3a1e;
    border: 1px solid #3a5e3a;
    border-top: none;
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
    list-style: none;
    margin: 0; padding: 0.3rem 0;
    z-index: 200;
}

#nav-links > li:hover > .nav-dropdown,
#nav-links > li:focus-within > .nav-dropdown {
    display: block;
}

.nav-dropdown > li { position: relative; }

.nav-dropdown > li > a,
.nav-dropdown > li > span.nav-sub-parent {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.42rem 1.1rem;
    color: #c8e6c8;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.84rem;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    gap: 6px;
    transition: background 0.1s;
}
.nav-dropdown > li > a:hover,
.nav-dropdown > li > span.nav-sub-parent:hover,
.nav-dropdown > li:hover > a,
.nav-dropdown > li:hover > span.nav-sub-parent {
    background: #2e5230; color: #fff; text-decoration: none;
}
.nav-dropdown > li > a:visited { color: #c8e6c8; }
/* Province labels use span.nav-sub-parent wrapping an <a> — must match nav colour */
.nav-dropdown > li > span.nav-sub-parent > a {
    color: #c8e6c8; text-decoration: none; padding: 0; background: none;
}
.nav-dropdown > li > span.nav-sub-parent > a:visited { color: #c8e6c8; }
.nav-dropdown > li:hover > span.nav-sub-parent > a,
.nav-dropdown > li > span.nav-sub-parent:hover > a { color: #fff; }
.nav-dropdown .divider { border-top: 1px solid #2a4a2a; margin: 0.3rem 0; }

/* ---- SUBDROPDOWN (level 2) ---- */
.nav-subdropdown {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    min-width: 220px;
    background: #1e3a1e;
    border: 1px solid #3a5e3a;
    box-shadow: 4px 4px 16px rgba(0,0,0,0.4);
    list-style: none;
    margin: 0; padding: 0.3rem 0;
    z-index: 300;
}

.nav-dropdown > li:hover > .nav-subdropdown,
.nav-dropdown > li:focus-within > .nav-subdropdown {
    display: block;
}

.nav-subdropdown a {
    display: block;
    padding: 0.42rem 1.1rem;
    color: #c8e6c8;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.83rem;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.1s;
}
.nav-subdropdown a:hover { background: #2e5230; color: #fff; text-decoration: none; }
.nav-subdropdown a:visited { color: #c8e6c8; }

/* --- Google Search in nav bar --- */
.nav-search {
    display: flex;
    align-items: center;
    padding: 0.35rem 0 0.35rem 1rem;
    margin-left: auto;
    gap: 0;
    flex-shrink: 0;
}
.nav-search input[type="text"] {
    padding: 0.28rem 0.6rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.82rem;
    border: 1px solid #6a9a6a;
    border-right: none;
    border-radius: 3px 0 0 3px;
    background: #f8fff8;
    color: #222;
    width: 175px;
    outline: none;
}
.nav-search input[type="text"]:focus {
    border-color: #8fbc8f; background: #fff;
    box-shadow: 0 0 0 2px rgba(143,188,143,0.3);
}
.nav-search input[type="text"]::placeholder { color: #999; }
.nav-search button {
    padding: 0.28rem 0.65rem;
    background: #4a7a4a; color: #fff;
    border: 1px solid #6a9a6a;
    border-radius: 0 3px 3px 0;
    cursor: pointer; font-size: 0.82rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    transition: background 0.15s; white-space: nowrap;
}
.nav-search button:hover { background: #5a8a5a; }

/* Mobile toggle */
#nav-toggle {
    display: none;
    width: 100%;
    background: none; border: none;
    color: #e8f5e8;
    font-size: 0.9rem;
    font-family: 'Helvetica Neue', Arial, sans-serif; font-weight: 500;
    cursor: pointer;
    padding: 0.65rem 1.5rem;
    text-align: left;
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */
#main-content {
    flex: 1;
    max-width: 1100px; width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

.content-with-sidebar { display: flex; gap: 2.5rem; align-items: flex-start; }
.content-main { flex: 1; min-width: 0; }
.content-main img { max-width: 100%; height: auto; display: block; }
.content-sidebar { width: 240px; flex-shrink: 0; }

.sidebar-box {
    background: #f5f8f5; border: 1px solid #c8d8c8;
    border-radius: 3px; padding: 1rem 1.2rem; margin-bottom: 1.5rem;
}
.sidebar-box h4 {
    font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: #3a5a3a; margin: 0 0 0.6rem;
    border-bottom: 1px solid #c8d8c8; padding-bottom: 0.35rem;
}
.sidebar-box ul { list-style: none; margin: 0; padding: 0; }
.sidebar-box ul li { margin-bottom: 0.2rem; }
.sidebar-box ul li a { font-size: 0.9rem; font-family: 'Helvetica Neue', Arial, sans-serif; }
.sidebar-box p { font-size: 0.88rem; margin: 0; }

.page-title-area { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 2px solid #2a4a2a; }
.page-title-area h1 { color: #1e3a1e; }
.page-title-area .subtitle { font-style: italic; color: #666; font-size: 0.95rem; margin: 0.3rem 0 0; }

.breadcrumb {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.82rem; color: #888; margin-bottom: 1.2rem;
}
.breadcrumb a { color: #888; }
.breadcrumb a:hover { color: #555; }
.breadcrumb span { margin: 0 0.3rem; }

.home-intro {
    background: linear-gradient(135deg, #1e3a1e 0%, #2a5030 100%);
    color: #fff; padding: 3rem 2rem;
    margin: -2rem -1.5rem 2.5rem; text-align: center;
}
.home-intro h1 { color: #fff; font-size: 2.2rem; margin-bottom: 0.6rem; }
.home-intro .intro-lead { font-style: italic; font-size: 1.05rem; color: #c8e6c8; max-width: 700px; margin: 0 auto; }

.notice-box {
    border-left: 4px solid #2a4a2a; background: #f0f6f0;
    padding: 0.9rem 1.2rem; margin: 1.5rem 0; font-size: 0.95rem;
}
.notice-box.conservation { border-left-color: #4a7a2a; background: #f0f6ec; }
.notice-box.safety       { border-left-color: #8a4a1a; background: #fdf4ee; }
.notice-box.members      { border-left-color: #1a4a7a; background: #eef4fd; }
.notice-box strong { display: block; margin-bottom: 0.3rem; font-family: 'Helvetica Neue', Arial, sans-serif; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin: 2rem 0; }
.feature-card { border: 1px solid #c8d8c8; border-radius: 3px; padding: 1.3rem; background: #fafcfa; }
.feature-card h3 { font-size: 1rem; margin-top: 0; color: #1e3a1e; }
.feature-card p  { font-size: 0.9rem; color: #555; margin-bottom: 0.8rem; }
.feature-card a.card-link { font-size: 0.85rem; font-family: 'Helvetica Neue', Arial, sans-serif; font-weight: 600; color: #2a5a2a; }

.province-card { border: 1px solid #c8d8c8; border-radius: 3px; padding: 1.2rem 1.4rem; margin-bottom: 1.2rem; background: #fafcfa; }
.province-card h3 { margin-top: 0; color: #1e3a1e; font-size: 1.1rem; }
.province-card p  { font-size: 0.9rem; color: #555; margin-bottom: 0.6rem; }
.province-card .browse-link { font-family: 'Helvetica Neue', Arial, sans-serif; font-weight: 600; font-size: 0.88rem; color: #2a5a2a; }

/* Cave table */
.cave-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 1rem 0 2rem; }
.cave-table th {
    background: #2a4a2a; color: #fff; text-align: left;
    padding: 0.5rem 0.8rem;
    font-family: 'Helvetica Neue', Arial, sans-serif; font-weight: 500;
    font-size: 0.79rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.cave-table td { padding: 0.45rem 0.8rem; border-bottom: 1px solid #e8e8e8; vertical-align: top; }
.cave-table tr:hover td { background: #f5f8f5; }
.cave-table tr:nth-child(even) td { background: #fbfcfb; }
.cave-table tr:nth-child(even):hover td { background: #f2f5f2; }
.cave-table td a { font-family: 'Helvetica Neue', Arial, sans-serif; }
.col-name   { width: 30%; }
.col-length { width: 9%; text-align: right; white-space: nowrap; }
.col-grade  { width: 8%; text-align: center; }
.col-date   { width: 12%; white-space: nowrap; }
.col-assets { width: 41%; }

.badge {
    display: inline-block; padding: 0.1em 0.45em;
    font-size: 0.72rem; font-family: 'Helvetica Neue', Arial, sans-serif;
    border-radius: 2px; margin-right: 0.2rem; white-space: nowrap;
}
.badge-survey { background: #e8f0e8; color: #2a4a2a; border: 1px solid #c0d4c0; }
.badge-photo  { background: #fff4e0; color: #7a4a00; border: 1px solid #e0c880; }
.badge-desc   { background: #e8f0fa; color: #1a3a6a; border: 1px solid #b8cce8; }

.cave-meta-table {
    font-size: 0.88rem; border-collapse: collapse;
    margin-bottom: 1.5rem; width: 100%; max-width: 480px;
}
.cave-meta-table th, .cave-meta-table td {
    padding: 0.3rem 0.6rem; border: 1px solid #dde8dd; text-align: left; vertical-align: top;
}
.cave-meta-table th {
    background: #f0f6f0; font-family: 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600; width: 140px; color: #2a4a2a;
}

.photo-gallery { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1rem 0; }
.photo-gallery a { display: block; }
.photo-gallery img { width: 180px; height: 130px; object-fit: cover; border: 1px solid #c8d8c8; border-radius: 2px; display: block; }
.photo-gallery img:hover { border-color: #2a4a2a; }

/* Members / login */
.members-section {
    background: #f0f4f8; border: 1px solid #b8cce8;
    border-radius: 3px; padding: 1.2rem 1.4rem; margin-bottom: 1.5rem;
}
.members-section h3 { color: #1a3a6a; margin-top: 0; }
.login-box {
    max-width: 380px;
    background: #f8faff; border: 1px solid #b8cce8;
    border-radius: 4px; padding: 2rem 2rem 1.5rem; margin: 2rem auto;
}
.login-box h2 { font-size: 1.2rem; color: #1a3a6a; border: none; margin-top: 0; }
#login-error {
    background: #fdecea; border: 1px solid #e0a0a0; color: #8a2020;
    padding: 0.55rem 0.9rem; border-radius: 3px;
    font-size: 0.88rem; font-family: 'Helvetica Neue', Arial, sans-serif;
    margin-bottom: 1rem; display: none;
}

/* Contact form */
.contact-form { max-width: 560px; }
.form-group { margin-bottom: 1.2rem; }
.form-group label {
    display: block; font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.88rem; font-weight: 600; margin-bottom: 0.3rem; color: #333;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%; padding: 0.5rem 0.7rem; border: 1px solid #bbb;
    border-radius: 3px; font-family: Georgia, serif; font-size: 0.95rem; color: #333; background: #fff;
}
.form-group textarea { min-height: 110px; resize: vertical; }
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { outline: none; border-color: #2a4a2a; box-shadow: 0 0 0 2px rgba(42,74,42,0.12); }

.btn { display: inline-block; padding: 0.55rem 1.4rem; font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 0.9rem; font-weight: 600; border: none; border-radius: 3px; cursor: pointer; text-decoration: none; }
.btn-primary { background: #2a4a2a; color: #fff; }
.btn-primary:hover { background: #1e3a1e; color: #fff; text-decoration: none; }
.btn-sm { padding: 0.35rem 0.9rem; font-size: 0.82rem; }

/* Photo album link button and gallery back-link — badge style */
.btn-album,
.gallery-back a {
    display: inline-block;
    padding: 0.1em 0.45em;
    border: 1px solid #c0d4c0;
    border-radius: 2px;
    color: #2a4a2a;
    background: #e8f0e8;
    text-decoration: none;
    font-size: 0.72rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.btn-album:hover,
.gallery-back a:hover {
    background: #d4e8d4;
    border-color: #8fbc8f;
    color: #1a3a1a;
    text-decoration: none;
}

/* Search / Google CSE */
.search-intro { color: #555; font-size: 0.95rem; margin-bottom: 1.5rem; }
.gcse-search { margin-top: 1rem; }

/* =========================================================
   PHOTO GALLERY & LIGHTBOX
   ========================================================= */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin: 1.2rem 0 2rem;
}
.gallery-thumb {
    display: block;
    overflow: hidden;
    border: 1px solid #c8d8c8;
    border-radius: 3px;
    cursor: pointer;
    background: #f0f4f0;
    aspect-ratio: 4/3;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.gallery-thumb:hover { border-color: #2a4a2a; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.gallery-thumb img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform 0.2s;
}
.gallery-thumb:hover img { transform: scale(1.04); }
.gallery-caption {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.72rem; color: #666;
    padding: 4px 6px 5px;
    background: #f8faf8;
    border-top: 1px solid #e0e8e0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Photo album teaser strip on cave description pages */
.album-teaser {
    display: flex;
    gap: 8px;
    margin: 0.8rem 0 1rem;
    flex-wrap: wrap;
}
.album-teaser-thumb {
    display: block;
    width: calc(25% - 6px);
    min-width: 80px;
    aspect-ratio: 4/3;
    overflow: hidden;
    border: 1px solid #c8d8c8;
    border-radius: 3px;
    flex-shrink: 0;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.album-teaser-thumb:hover {
    border-color: #2a4a2a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.album-teaser-thumb img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform 0.2s;
}
.album-teaser-thumb:hover img { transform: scale(1.05); }

/* Prev / Next cave navigation buttons */
.cave-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0 0.6rem;
    padding-top: 1.2rem;
    border-top: 1px solid #d8e8d8;
}
.cave-nav-btn {
    display: inline-block;
    padding: 0.1em 0.45em;
    border: 1px solid #c0d4c0;
    border-radius: 2px;
    color: #2a4a2a;
    background: #e8f0e8;
    text-decoration: none;
    font-size: 0.72rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.cave-nav-btn:hover {
    background: #d4e8d4;
    border-color: #8fbc8f;
    color: #1a3a1a;
}
.cave-nav-prev { text-align: left; }
.cave-nav-next { text-align: right; margin-left: auto; }
.back-link {
    margin-top: 0.5rem;
}
.back-link a {
    display: inline-block;
    padding: 0.1em 0.45em;
    border: 1px solid #c0d4c0;
    border-radius: 2px;
    color: #2a4a2a;
    background: #e8f0e8;
    text-decoration: none;
    font-size: 0.72rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.back-link a:hover {
    background: #d4e8d4;
    border-color: #8fbc8f;
    color: #1a3a1a;
}

/* Survey PDF preview images */
.survey-image-wrap {
    margin: 1.5rem 0 2rem;
    text-align: center;
}
.survey-image-wrap a {
    display: block;
    text-decoration: none;
}
.survey-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 1px solid #a0b8a0;
    border-radius: 3px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.18);
    transition: box-shadow 0.15s, border-color 0.15s;
    display: block;
}
.survey-image-wrap a:hover .survey-image {
    border-color: #2a4a2a;
    box-shadow: 0 4px 20px rgba(0,0,0,0.28);
}
.survey-image-caption {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.82rem;
    color: #666;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Copyright overlay on thumbnails */
.gallery-thumb { position: relative; }
.gallery-copyright-overlay {
    position: absolute; bottom: 24px; left: 0; right: 0;
    background: rgba(0,0,0,0.55);
    color: #e8e8e8;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.62rem;
    text-align: center;
    padding: 2px 4px;
    pointer-events: none;
    letter-spacing: 0.2px;
}
.gallery-copyright-note {
    font-size: 0.78rem;
    color: #666;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    margin-bottom: 0.5rem;
    font-style: italic;
}

/* Lightbox overlay */
#dl-lightbox {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
#dl-lightbox.open { display: flex; }
#dl-lb-img {
    max-width: 92vw;
    max-height: 82vh;
    object-fit: contain;
    border: 2px solid #4a7a4a;
    border-radius: 3px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.7);
}
#dl-lb-caption {
    color: #c8e6c8;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.85rem;
    margin-top: 10px;
    max-width: 80vw;
    text-align: center;
}
.lb-caption-text {
    display: inline;
}
.lb-copyright {
    display: block;
    font-size: 0.72rem;
    color: #90a890;
    margin-top: 4px;
    font-style: italic;
    letter-spacing: 0.2px;
}
#dl-lb-close {
    position: fixed; top: 16px; right: 22px;
    color: #fff; font-size: 2rem; line-height: 1;
    cursor: pointer; background: none; border: none;
    opacity: 0.8; z-index: 10000;
}
#dl-lb-close:hover { opacity: 1; }
#dl-lb-prev, #dl-lb-next {
    position: fixed; top: 50%; transform: translateY(-50%);
    color: #fff; font-size: 2.2rem; line-height: 1;
    cursor: pointer; background: rgba(0,0,0,0.35);
    border: none; padding: 0.5rem 0.9rem; border-radius: 3px;
    opacity: 0.8; z-index: 10000;
    transition: background 0.15s, opacity 0.15s;
}
#dl-lb-prev { left: 12px; }
#dl-lb-next { right: 12px; }
#dl-lb-prev:hover, #dl-lb-next:hover { background: rgba(42,74,42,0.7); opacity: 1; }
#dl-lb-counter {
    position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
    color: #a8c8a8; font-size: 0.8rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

/* =========================================================
   FOOTER
   ========================================================= */
#site-footer {
    background: #1e3a1e; color: #a8c8a8;
    font-family: 'Helvetica Neue', Arial, sans-serif; font-size: 0.82rem; padding: 1.5rem;
}
#footer-inner {
    max-width: 1100px; margin: 0 auto;
    display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between;
}
.footer-col h5 { color: #c8e6c8; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col ul li { margin-bottom: 0.2rem; }
.footer-col a { color: #a8c8a8; }
.footer-col a:hover { color: #e8f5e8; text-decoration: underline; }
.footer-col a:visited { color: #a8c8a8; }
.footer-bottom {
    max-width: 1100px; margin: 1rem auto 0;
    padding-top: 1rem; border-top: 1px solid #2a4a2a;
    color: #6a8a6a; font-size: 0.78rem;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .content-with-sidebar { flex-direction: column; }
    .content-sidebar { width: 100%; }
    .nav-search input[type="text"] { width: 130px; }
    #nav-links > li > a,
    #nav-links > li > span.nav-parent { padding: 0.65rem 0.75rem; font-size: 0.82rem; }
}

@media (max-width: 680px) {
    body { font-size: 0.95rem; }
    #header-inner { flex-direction: column; align-items: flex-start; gap: 0.2rem; padding: 0.8rem 1rem; }
    #site-logo { font-size: 1.55rem; }

    #nav-toggle { display: block; }
    #nav-inner { flex-direction: column; padding: 0; }
    #nav-links { display: none; flex-direction: column; }
    #nav-links.open { display: flex; }

    #nav-links > li { flex-direction: column; align-items: stretch; }
    #nav-links > li > a,
    #nav-links > li > span.nav-parent {
        padding: 0.6rem 1.2rem; border-bottom: none;
        border-left: 3px solid transparent; margin-bottom: 0;
        justify-content: space-between;
    }
    #nav-links > li > a.active,
    #nav-links > li > a[aria-current="page"] { border-left-color: #8fbc8f; border-bottom: none; }

    .nav-dropdown {
        position: static; box-shadow: none; border: none;
        background: #162e16; display: none; padding: 0;
    }
    .nav-dropdown.mobile-open { display: block; }
    .nav-dropdown > li > a,
    .nav-dropdown > li > span.nav-sub-parent { padding: 0.5rem 1.2rem 0.5rem 2rem; }

    .nav-subdropdown {
        position: static; box-shadow: none; border: none;
        background: #0e200e; display: none; padding: 0;
    }
    .nav-subdropdown.mobile-open { display: block; }
    .nav-subdropdown a { padding: 0.45rem 1.2rem 0.45rem 3rem; font-size: 0.8rem; }

    .nav-search { display: none; width: 100%; padding: 0.6rem 1.2rem; margin-left: 0; border-top: 1px solid #3a5e3a; }
    .nav-search.open { display: flex; }
    .nav-search input[type="text"] { flex: 1; width: auto; }

    #main-content { padding: 1.2rem 1rem 2rem; }
    .home-intro { padding: 2rem 1rem; margin: -1.2rem -1rem 1.5rem; }
    .home-intro h1 { font-size: 1.5rem; }
    .feature-grid { grid-template-columns: 1fr; }
    .cave-table { font-size: 0.8rem; }
    .cave-table .col-grade, .cave-table .col-date { display: none; }
    .photo-gallery img { width: 140px; height: 100px; }
    #footer-inner { flex-direction: column; gap: 1.2rem; }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.2rem; }
    .cave-nav { flex-direction: column; gap: 0.4rem; }
    .cave-nav-btn { text-align: center; }
}
