:root {
    --bg: #f4f7f6;
    --bg-alt: #e7efeb;
    --surface: #ffffff;
    --ink: #192024;
    --muted: #5f6c74;
    --line: #d6dfdd;
    --brand: #0f7a66;
    --brand-deep: #0a5f50;
    --accent: #c76b2a;
    --ok: #1d9a54;
    --radius: 14px;
    --shadow: 0 14px 30px rgba(17, 30, 38, 0.08);
    --shadow-lg: 0 20px 40px rgba(17, 30, 38, 0.14);
    --container-pad: 2%;
    --notice-bg: #ecf8f3;
    --notice-border: #c8dfd8;
    --notice-ink: #1f5f46;
    --section-surface: #f7fbfa;
    --section-surface-alt: #edf6f3;
    --section-ink: #17333a;
    --section-head: #102f3b;
    --section-badge-bg: rgba(15, 122, 102, 0.14);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    color: var(--ink);
    font-family: "Sora", "Segoe UI", sans-serif;
    background:
        radial-gradient(1200px 360px at 10% -20%, #d6ebe6 0%, transparent 60%),
        radial-gradient(1000px 320px at 95% -10%, #f5dfd0 0%, transparent 52%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
}

img {
    max-width: 100%;
    display: block;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: none;
    padding-left: var(--container-pad);
    padding-right: var(--container-pad);
    margin: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 80;
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
    background: var(--surface);
}

.header-wrap {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 62px;
}

.brand-left img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.brand-center {
    font-weight: 800;
    letter-spacing: 0.2px;
}

.header-left,
.header-center,
.header-right {
    display: flex;
    align-items: center;
}

.header-center {
    justify-content: center;
}

.header-right {
    justify-content: flex-end;
    gap: 10px;
}

.top-nav {
    display: flex;
    gap: 8px;
}

/* Mobile nav transition + overlay styling */
.top-nav {
    transition: transform .22s cubic-bezier(.2,.9,.2,1), opacity .22s ease;
}

.top-nav.open {
    display: flex !important;
    transform: translateY(0);
    opacity: 1;
}

.top-nav.hidden {
    transform: translateY(-8px);
    opacity: 0;
}

.top-nav a {
    color: var(--muted);
    border-radius: 999px;
    padding: 7px 11px;
}

.top-nav a:hover {
    background: rgba(15, 122, 102, 0.1);
    color: var(--brand-deep);
}

.top-nav .anon-nav-link {
    background: rgba(199, 107, 42, 0.12);
    color: #7a3f15;
    font-weight: 700;
}

.top-nav .anon-nav-link:hover {
    background: rgba(199, 107, 42, 0.2);
    color: #5d2f10;
}

.top-nav .blog-nav-link {
    background: rgba(199, 107, 42, 0.12);
    color: #7a3f15;
    font-weight: 700;
}

.top-nav .blog-nav-link:hover {
    background: rgba(199, 107, 42, 0.2);
    color: #5d2f10;
}

.top-nav .admin-nav-link {
    color: var(--muted);
    font-size: 0.9em;
}

.top-nav .admin-nav-link::before {
    content: "🔒 ";
    font-size: 0.85em;
    margin-right: 2px;
}

.top-nav .admin-nav-link:hover {
    color: var(--brand-deep);
}

.nav-divider {
    color: var(--line);
    opacity: 0.5;
    margin: 0 4px;
}

.top-nav .nav-whatsapp {
    background: linear-gradient(135deg, #25d366, #20ba5c);
    color: white;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.top-nav .nav-whatsapp:hover {
    background: linear-gradient(135deg, #20ba5c, #1a8d52);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.nav-phone {
    color: var(--brand);
    font-weight: 600;
    font-size: 0.95em;
    padding: 7px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-phone:hover {
    background: rgba(15, 122, 102, 0.1);
    color: var(--brand-deep);
}

.theme-toggle {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    padding: 7px 10px;
    cursor: pointer;
}

/* Responsive header nav */
.nav-toggle {
    display: none;
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}

@media (max-width: 900px) {
    .top-nav { display: none; }
    .nav-toggle { display: inline-flex; }
    .nav-phone { display: none; }
    .header-wrap { grid-template-columns: auto 1fr auto; }
}

@media (max-width: 900px) {
    .top-nav {
        display: none;
        position: absolute;
        right: 12px;
        top: 64px;
        background: var(--surface);
        padding: 12px;
        border-radius: 10px;
        box-shadow: 0 6px 22px rgba(0,0,0,0.12);
        flex-direction: column;
        gap: 8px;
        z-index: 1200;
    }

    .top-nav.open { display: flex; }

    .nav-divider { display: none; }

    .top-nav a {
        padding: 10px 12px;
        border-radius: 6px;
        font-size: 0.95em;
    }

    .top-nav .nav-whatsapp {
        margin-top: 4px;
        padding: 10px 14px;
        font-size: 1em;
    }
}

.home-main,
.article-page,
.location-page,
.util-page {
    width: 100%;
    padding-top: 24px;
    padding-bottom: 36px;
}

.notice {
    border: 1px solid var(--notice-border);
    background: var(--notice-bg);
    color: var(--notice-ink);
    border-radius: 10px;
    padding: 12px 14px;
}

.section-head {
    margin-bottom: 6px;
}

.discover-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    transition: all .25s ease;
}

.discover-card {
    break-inside: auto;
    margin: 0;
    border-radius: var(--radius);
    overflow: visible;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.discover-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Slightly tighter card spacing and smoother hover for small screens */
.discover-card { transition: transform .22s ease, box-shadow .22s ease, opacity .18s ease; }
.discover-card .card-body { padding: clamp(10px, 1.5vw, 16px); }

.discover-card img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center center;
    aspect-ratio: auto !important;
}

.discover-card img,
.article-banner-grid img,
.full-image {
    transition: transform .18s ease, opacity .18s ease;
}

details[open] summary { color: var(--brand-deep); }
summary { cursor: pointer; }

/* Thumbnail grid columns: desktop min 4 / max 6, mobile min 1 / max 2 */
@media (max-width: 1399px) {
    .discover-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 1199px) {
    .discover-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .discover-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wa-float {
        left: 12px;
        right: 12px;
        text-align: center;
    }
}

@media (max-width: 479px) {
    .discover-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
        gap: 10px;
    }
}

/* Article banner grid responsiveness */
@media (max-width: 900px) {
    .article-banner-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 420px) {
    .article-banner-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.internal-links {
    margin-top: 20px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
}

.internal-links-list a {
    color: var(--brand-deep);
    font-weight: 600;
}

.article-card,
.location-card,
.util-card,
.location-tile,
.tool-card {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Improve card responsive layout */
@media (max-width: 900px) {
    .article-card, .location-card, .util-card { padding: 12px; }
    .article-banner-grid { grid-template-columns: repeat(2, 1fr); }
}

.article-card,
.location-card,
.util-card {
    padding: clamp(14px, 2vw, 24px);
}

.blog-article-card {
    width: 100%;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.article-card h1,
.blog-article-card h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3.8vw, 3rem);
    line-height: 1.1;
}

.article-card .meta,
.blog-article-card .meta {
    margin: 10px 0 0;
    font-size: 0.96rem;
}

.article-content {
    margin-top: 18px;
    display: grid;
    gap: 14px;
    color: var(--ink);
}

.source-section {
    border: 1px solid var(--line);
    border-left: 6px solid var(--brand);
    border-radius: 14px;
    background: linear-gradient(160deg, var(--section-surface), var(--section-surface-alt));
    color: var(--section-ink);
    padding: 14px 16px;
    box-shadow: 0 10px 24px rgba(17, 30, 38, 0.06);
    opacity: 1;
}

.source-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.source-section h2 {
    margin: 0;
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    line-height: 1.3;
    color: var(--section-head);
}

.source-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--section-badge-bg);
    box-shadow: inset 0 0 0 1px rgba(15, 122, 102, 0.2);
    font-size: 1.05rem;
    flex: 0 0 auto;
}

.source-points {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
}

.source-points li {
    margin: 0;
    line-height: 1.7;
    color: var(--section-ink);
    opacity: 1;
}

.source-points li::marker {
    color: var(--brand-deep);
}

.source-accent-1 { border-left-color: #0f7a66; }
.source-accent-2 { border-left-color: #1f6ea5; }
.source-accent-3 { border-left-color: #c76b2a; }
.source-accent-4 { border-left-color: #7a4bb3; }
.source-accent-5 { border-left-color: #cf3b57; }
.source-accent-6 { border-left-color: #1d9a54; }

.article-content p,
.article-content li {
    margin: 0;
    font-size: 1rem;
    line-height: 1.75;
}

.blog-post-content {
    margin-top: 22px;
}

.blog-post-content .custom-html-embed {
    margin-top: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(244, 247, 246, 0.9));
}

.cta-inline {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.article-card img,
.location-card img,
.location-tile img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    border-radius: 10px;
    object-fit: contain !important;
    object-position: center center;
    aspect-ratio: auto !important;
}

.article-banner-grid {
    margin-top: 10px;
    display: grid;
    width: 100%;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.article-banner-grid img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center center;
    aspect-ratio: auto !important;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.bottom-banner {
    margin-top: 18px;
    display: grid;
    width: 100%;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    align-items: center;
}

@media (max-width: 1399px) {
    .article-banner-grid,
    .bottom-banner {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 1199px) {
    .article-banner-grid,
    .bottom-banner {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .article-banner-grid,
    .bottom-banner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 479px) {
    .article-banner-grid,
    .bottom-banner {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

.bottom-banner img {
    width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    transition: transform .18s ease, box-shadow .18s ease;
}

.bottom-banner img:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.full-image,
.no-crop-image {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center center;
    aspect-ratio: auto !important;
}

.meta,
.note,
.location-count-meta {
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-actions form {
    margin: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 700;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: #ffffff;
}

.btn-ghost {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
}

.related-list,
.related-block ul,
.checklist,
.stats-list {
    margin: 10px 0 0;
    padding-left: 18px;
}

.related-list li,
.related-block li,
.checklist li,
.stats-list li {
    margin: 6px 0;
}

/* Hide internal link sections when disabled in config */
.hidden-links {
    display: none !important;
}

.faq-block {
    margin-top: 18px;
}

.faq-items details {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 8px;
    background: var(--surface);
}

.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.pages-index-list-wrap {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.pages-index-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pages-index-list li + li {
    border-top: 1px solid var(--line);
}

.pages-index-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    width: 100%;
}

.pages-index-list a:hover {
    background: rgba(15, 122, 102, 0.06);
}

.pages-index-title {
    font-weight: 700;
    color: var(--section-head);
}

.pages-index-emoji {
    display: inline-block;
    width: 1.2em;
    margin-right: 4px;
    text-align: center;
}

@media (max-width: 580px) {
    .pages-index-list a {
        flex-direction: column;
        align-items: flex-start;
    }
}

.blog-form {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.blog-form label {
    display: grid;
    gap: 6px;
}

.blog-form input,
.blog-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
}

.blog-form-card {
    margin-bottom: 16px;
}

.config-group {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}

.config-group legend {
    padding: 0 6px;
    font-weight: 700;
    color: var(--ink);
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

.config-item {
    display: grid;
    gap: 6px;
}

.config-item small {
    color: var(--muted);
    font-weight: 500;
}

.config-item input[readonly],
.config-item textarea[readonly],
.config-item input:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.blog-tile {
    padding-bottom: 12px;
}
.blog-tile .meta {
    margin: 0;
    padding: 0 12px;
}

.location-tile h3 {
    margin: 0;
    padding: 10px 12px 12px;
    font-size: 0.95rem;
}

.wa-float {
    position: fixed;
    right: 12px;
    bottom: 12px;
    z-index: 90;
    border-radius: 999px;
    background: linear-gradient(135deg, #23a455, #14713a);
    color: #ffffff;
    font-weight: 700;
    padding: 11px 15px;
    box-shadow: 0 14px 28px rgba(20, 113, 58, 0.28);
}

.site-footer {
    margin-top: auto;
}


@media (max-width: 800px) {
    .top-nav {
        display: flex;
        gap: 4px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .top-nav a {
        padding: 6px 9px;
        font-size: 0.86rem;
    }
}

@media (max-width: 800px) {
    .blog-post-content .custom-html-embed {
        padding: 8px;
        border-radius: 14px;
    }

    .source-section {
        padding: 12px;
    }

    .source-section-head {
        align-items: flex-start;
    }

    .source-badge {
        width: 30px;
        height: 30px;
        font-size: 0.95rem;
    }

    .source-points {
        padding-left: 16px;
        gap: 5px;
    }
}

/* Lightbox styles */
#bf-lightbox { display:flex; }
#bf-lightbox img { border-radius: 8px; }

/* Enhanced mobile lightbox controls */
#bf-lightbox button {
    min-width: 48px;
    min-height: 48px;
    padding: 12px;
}

.lightbox-counter {
    font-size: clamp(12px, 2vw, 16px);
    padding: clamp(8px, 1.5vw, 12px);
    min-width: 60px;
    text-align: center;
}

/* Enhanced form styling for mobile */
.blog-form input,
.blog-form textarea {
    padding: clamp(10px, 2.5vw, 14px);
    font-size: clamp(14px, 1.1vw, 16px);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.blog-form input:focus,
.blog-form textarea:focus {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(15, 122, 102, 0.1);
}

.blog-form label {
    font-size: clamp(13px, 1.1vw, 15px);
    margin-bottom: clamp(12px, 2vw, 16px);
    font-weight: 600;
}

.blog-form button {
    min-height: 44px;
    min-width: 100%;
    padding: clamp(10px, 2vw, 14px);
    font-size: clamp(13px, 1.1vw, 15px);
    transition: all 0.2s ease;
}

.blog-form button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.blog-form button:active {
    transform: translateY(0);
}

/* Enhanced form field grouping */
.blog-form label {
    display: grid;
    gap: 8px;
}

/* Improved spacing between form fields */
.blog-form {
    gap: clamp(12px, 2vw, 20px);
}

/* Enhanced navigation toggle button */
.nav-toggle {
    min-width: 44px;
    min-height: 44px;
    transition: all 0.3s ease;
}

.nav-toggle:active {
    background: var(--line);
}

/* Improve mobile header responsiveness */
@media (max-width: 580px) {
    .header-wrap {
        gap: 8px;
        min-height: 56px;
    }

    .brand-left img {
        width: 36px;
        height: 36px;
    }

    .nav-toggle {
        padding: 10px 12px;
    }

    .theme-toggle {
        padding: 8px 10px;
    }
}

/* Further enhance button sizes on ultra-small screens */
@media (max-width: 380px) {
    .wa-float {
        padding: 12px 16px;
        font-size: 0.9rem;
        min-height: 48px;
    }

    .nav-toggle,
    .theme-toggle {
        min-width: 40px;
        min-height: 40px;
    }
}

/* Enhanced article content on mobile */
@media (max-width: 900px) {
    .article-card {
        padding: clamp(14px, 3vw, 20px);
    }

    .article-banner-grid {
        gap: 10px;
    }

    .article-banner-grid img {
        border-radius: 6px;
    }
}

/* Better spacing for small phones */
@media (max-width: 580px) {
    .discover-card {
        margin-bottom: 12px;
    }

    .article-card {
        border-radius: 10px;
    }

    h1, h2, h3 {
        font-size: clamp(16px, 5vw, 24px);
        line-height: 1.3;
        margin: clamp(8px, 2vw, 14px) 0;
    }

    p {
        line-height: 1.6;
        margin: clamp(8px, 1.5vw, 12px) 0;
    }
}

/* Improve lightbox accessibility on mobile */
.lightbox-nav {
    display: flex;
    gap: clamp(8px, 2vw, 12px);
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 2vw, 16px);
}

.lightbox-nav button {
    min-width: 44px;
    min-height: 44px;
}

[data-theme="dark"] {
    --bg: #071312;
    --bg-alt: #0b1a19;
    --surface: #102321;
    --ink: #e6f3ef;
    --muted: #9ab4ac;
    --line: #23423d;
    --brand: #2ba58a;
    --brand-deep: #178169;
    --notice-bg: #11312c;
    --notice-border: #2d5a52;
    --notice-ink: #c8efe3;
    --section-surface: #173532;
    --section-surface-alt: #12302d;
    --section-ink: #e2f7f1;
    --section-head: #f1fffb;
    --section-badge-bg: rgba(43, 165, 138, 0.22);
}
