/* Main Stylesheet - Sioux Falls Churches */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --secondary-color: #7b68ee;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --border-color: #404040;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: url('../images/bg-pattern.png');
    background-size: cover;
    background-attachment: fixed;
}

.main-content {
    flex: 1;
    padding: 2rem;
    padding-bottom: 4rem; /* Space for fixed footer tab */
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* Church public detail: let body / pattern show through; keep content width capped */
body.church-public-detail .main-content {
    background: transparent;
    max-width: 1200px;
}

/* Above fixed .church-page-bg (z-index 0), which otherwise paints over earlier siblings */
body.church-public-detail .main-content > .breadcrumbs {
    position: relative;
    z-index: 2;
}

.text-secondary {
    color: var(--text-secondary);
}

/* Navbar */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow);
    overflow: visible;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: visible;
    position: relative;
}

.navbar-brand a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    overflow: visible;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    overflow: visible;
}

.navbar-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.navbar-nav a:hover {
    color: var(--text-primary);
}

.navbar-dropdown {
    position: relative;
    overflow: visible;
}

.navbar-dropdown > .js-navbar-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.navbar-dropdown > .js-navbar-dropdown-trigger::after {
    content: '';
    width: 0.4rem;
    height: 0.4rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-0.08rem) rotate(45deg);
    transition: transform 0.2s ease;
    opacity: 0.9;
}

.navbar-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 10px var(--shadow);
    padding: 0.35rem 0;
    z-index: 1000;
    /* Fallback until JS pins desktop panels (see .navbar-submenu--desktop-fixed). */
    max-height: min(70vh, calc(100dvh - 88px));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Desktop: pin dropdown to the viewport so it cannot extend document scroll height
   and max-height matches space below the trigger (set via CSS vars in main.js). */
@media (min-width: 769px) {
    .navbar-dropdown.is-open .navbar-submenu.navbar-submenu--desktop-fixed {
        position: fixed;
        top: var(--navbar-submenu-fixed-top, auto);
        left: var(--navbar-submenu-fixed-left, auto);
        width: var(--navbar-submenu-fixed-width, auto);
        max-height: var(--navbar-submenu-fixed-max-height, min(70vh, calc(100dvh - 88px)));
        right: auto;
        bottom: auto;
        margin: 0;
    }
}

.navbar-submenu a {
    display: block;
    padding: 0.5rem 0.85rem;
    white-space: nowrap;
}

.navbar-submenu-subitem {
    padding-left: 1.7rem !important;
    opacity: 0.92;
}

.navbar-submenu--voices {
    min-width: 280px;
    max-width: 360px;
}

.navbar-submenu--resources {
    min-width: 280px;
    max-width: 360px;
}

.navbar-submenu a.navbar-submenu-heading {
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.2rem;
    padding-bottom: 0.45rem;
}

.navbar-submenu .navbar-submenu-voice {
    white-space: normal;
    padding: 0.55rem 0.85rem;
}

.navbar-submenu-voice-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.navbar-submenu-voice-titlelink {
    display: inline-flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
    padding: 0 !important;
}

.navbar-submenu-voice-title {
    display: inline-block;
    font-weight: 600;
    color: var(--text-primary);
}

.navbar-submenu-voice-info {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.navbar-submenu-voice-desc {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.35;
    margin-top: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.2s ease, opacity 0.2s ease, margin-top 0.2s ease;
}

.navbar-submenu-voice.is-desc-open .navbar-submenu-voice-desc {
    margin-top: 0.15rem;
    max-height: 5rem;
    opacity: 1;
}

.voices-intro {
    max-width: 52rem;
    margin-bottom: 1rem;
}

.page-header.voices-page-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    text-align: left;
}

.page-header.voices-page-header .voices-header-row-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.page-header.voices-page-header .voices-header-row-title h1 {
    margin: 0;
    text-align: left;
}

.page-header.voices-page-header .voices-header-row-description {
    margin: 0;
    text-align: left;
}

.voices-spaces-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.voices-space-card {
    display: block;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.voices-space-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 12px var(--shadow);
}

.voices-space-card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}

.voices-space-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0;
}

.voices-space-card-cta {
    display: inline-block;
    margin-top: 0.65rem;
    font-size: 0.85rem;
    color: var(--primary-color);
}

/* Voices hub: article grid cards match space cards (no default link styling on whole card) */
.voices-page .articles-grid .article-card > a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.voices-page .articles-grid .article-card .card-content .article-type {
    display: inline-block;
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.voices-page .articles-grid .article-card .card-content h3 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.voices-page .articles-grid .article-card .card-content .voice-article-card-date {
    margin: 0 0 0.5rem;
    font-size: 0.82rem;
}

.voices-page .articles-grid .article-card .card-content .voice-article-card-excerpt {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.detail-sidebar-report-wrap {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    text-align: center;

}

.resource-space-card .resource-space-card-media {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 3rem;
    margin-bottom: 0.5rem;
}

.resource-space-card .resource-space-card-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--primary-color);
    border: 1px solid color-mix(in srgb, var(--primary-color) 45%, var(--border-color) 55%);
    background: color-mix(in srgb, var(--primary-color) 12%, var(--bg-secondary) 88%);
}

.resource-space-card p {
    min-height: 3.6rem;
}

.voices-recent-heading {
    margin: 1.5rem 0 1rem;
    font-size: 1.25rem;
}

.article-video-embed {
    position: relative;
    width: 100%;
    max-width: 720px;
    margin: 1rem 0;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.article-video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.article-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.article-gallery-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 6px;
}

.comment-report {
    margin-top: 0.35rem;
    font-size: 0.85rem;
}

.comment-report-form {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-width: 22rem;
}

.comment-report-form textarea {
    min-height: 3rem;
}

.navbar-dropdown.is-open .navbar-submenu {
    display: block;
}

.navbar-dropdown.is-open > .js-navbar-dropdown-trigger::after {
    transform: translateY(0.08rem) rotate(-135deg);
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    padding: 6px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.navbar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.user-dropdown {
    position: relative;
}

.user-icon {
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    position: relative;
}

.user-icon .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-width: 200px;
    margin-top: 0.5rem;
    box-shadow: 0 4px 10px var(--shadow);
}

.user-menu.active {
    display: block;
}

.user-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.3s;
}

.user-menu a:hover {
    background: var(--bg-tertiary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 1rem;
    box-sizing: border-box;
    height: 38px; /* Standard button height */
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #357abd;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Cards */
.church-card, .business-card, .article-card, .event-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.church-card:hover, .business-card:hover, .article-card:hover, .event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px var(--shadow);
}

.church-card img, .business-card img, .article-card img, .event-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 1rem;
}

.card-content h3 {
    margin-bottom: 0.5rem;
}

.card-content a {
    color: var(--text-primary);
    text-decoration: none;
}

/* Grids */
.churches-grid, .businesses-grid, .articles-grid, .events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

/* Gallery Carousel */
.gallery-carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.gallery-strip {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    flex: 1;
    padding: 0.5rem 0;
}

.gallery-strip::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.gallery-thumbnail {
    flex-shrink: 0;
    width: 200px;
    height: 150px;
    cursor: pointer;
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s, border-color 0.3s;
}

.gallery-thumbnail:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbnail-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 0.5rem;
    font-size: 0.875rem;
    text-align: center;
}

.gallery-nav {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.3s;
}

.gallery-nav:hover {
    background: var(--primary-color);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox-content {
    position: relative;
    max-width: 95%;
    max-height: 90%;
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#media-lightbox .lightbox-content {
    max-width: 95%;
    width: auto;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-caption {
    color: white;
    margin-top: 1rem;
    font-size: 1.1rem;
}

.lightbox-credit {
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-style: italic;
}

.media-lightbox-player {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.media-lightbox-player video,
.media-lightbox-player iframe {
    width: 100%;
    max-width: 1200px;
    height: auto;
    min-height: 400px;
    max-height: 80vh;
    border-radius: 4px;
}

.media-lightbox-player video {
    aspect-ratio: 16 / 9;
}

.media-lightbox-player iframe {
    aspect-ratio: 16 / 9;
    min-height: 450px;
}

.media-lightbox-player audio {
    width: 100%;
    max-width: 800px;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
}

table thead {
    background: var(--bg-tertiary);
}

table th, table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    font-weight: bold;
}

table tbody tr:hover {
    background: var(--bg-tertiary);
}

.table-logo, .table-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

/* Detail Pages */
.detail-header {
  /*  margin-bottom: 2rem; */
}

.detail-main-image {
    width: 100%;
    /* max-height: 400px; */
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.event-featured-open-btn {
    border: none;
    padding: 0;
    margin: 0 0 0.5rem 0;
    background: transparent;
    cursor: pointer;
    display: block;
    width: 100%;
    text-align: left;
    border-radius: 8px;
    overflow: hidden;
}

.event-featured-open-btn:hover {
    opacity: 0.92;
}

.event-featured-open-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.event-featured-inline-caption {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
}

.event-description-rich .rich-content {
    line-height: 1.55;
}

.detail-title h1 {
    margin-bottom: 0.5rem;
}

.detail-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
    align-items: start;
}

.detail-main-section {
    min-width: 0; /* Prevents grid overflow */
}

.detail-content {
    display: block;
    margin-top: 0;
}

.detail-sidebar {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    height: fit-content;
    position: sticky;
    top: 2rem;
}

/* ——— Event detail (public) ——— */
.event-detail-page.detail-layout {
    align-items: start;
}

.event-detail-maincol {
    min-width: 0;
}

.event-hero {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1.35rem;
    margin-bottom: 1.5rem;
}

.event-hero-grid {
    display: grid;
    gap: 1.25rem;
    align-items: start;
}

@media (min-width: 720px) {
    .event-hero-grid--has-media {
        grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    }
}

.event-hero-image-btn {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
}

.event-hero-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

.event-hero-caption {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
}

.event-hero-kicker {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--primary-color);
    font-weight: 600;
    margin: 0 0 0.4rem;
}

.event-hero-title {
    margin: 0 0 0.85rem;
    line-height: 1.22;
    font-size: clamp(1.45rem, 2.8vw, 2rem);
}

.event-hero-meta {
    margin: 0;
}

.event-meta-row {
    display: grid;
    grid-template-columns: minmax(4.5rem, 5.5rem) minmax(0, 1fr);
    gap: 0.35rem 1rem;
    align-items: baseline;
    margin-bottom: 0.55rem;
    font-size: 0.95rem;
}

.event-meta-row:last-of-type {
    margin-bottom: 0;
}

.event-meta-row dt {
    margin: 0;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.82rem;
}

.event-meta-row dd {
    margin: 0;
    line-height: 1.45;
}

.event-meta-time {
    margin-left: 0.35rem;
    font-weight: 500;
}

.event-meta-sep {
    margin: 0 0.25rem;
    opacity: 0.6;
}

.event-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.15rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.event-detail-article {
    padding: 0 0.15rem;
}

.event-section {
    margin-bottom: 1.85rem;
}

.event-section:last-child {
    margin-bottom: 0;
}

.event-section-title {
    font-size: 1.12rem;
    font-weight: 600;
    margin: 0 0 0.7rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.event-prose.rich-content {
    line-height: 1.62;
    font-size: 1.02rem;
}

.event-prose.rich-content p:first-child {
    margin-top: 0;
}

.event-address-block {
    margin: 0;
    line-height: 1.55;
    font-size: 1rem;
}

.event-message-form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0.65rem 0.75rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
}

.event-detail-sidebar .event-sidebar-heading {
    margin: 0 0 0.85rem;
    font-size: 1rem;
    font-weight: 600;
}

.event-sidebar-card {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.event-sidebar-card:last-child {
    margin-bottom: 0;
}

.event-dl {
    margin: 0;
}

.event-dl-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.event-dl-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.event-dl-row:first-child {
    padding-top: 0;
}

.event-dl-row dt {
    margin: 0;
    color: var(--text-secondary);
    font-weight: 600;
    flex-shrink: 0;
}

.event-dl-row dd {
    margin: 0;
    text-align: right;
    line-height: 1.35;
}

.event-rsvp-count {
    font-weight: 500;
    color: var(--text-secondary);
}

.event-rsvp-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 280px;
    overflow-y: auto;
}

.event-rsvp-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
}

.event-rsvp-item:last-child {
    border-bottom: none;
}

.event-rsvp-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-rsvp-badge {
    flex-shrink: 0;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Church detail: header + main in left column, sidebar spans both rows on the right (wide).
   Narrow: header, then sidebar (photo + contact), then main body — without changing wide layout. */
.church-detail-page.detail-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    grid-template-rows: auto 1fr;
    gap: 2rem;
    align-items: start;
}

.church-detail-page .church-detail-header {
    grid-column: 1;
    grid-row: 1;
    padding: 0.5rem;
}

.church-detail-page .detail-main {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    padding: 1.5rem;
}

.church-detail-page .detail-sidebar {
    grid-column: 2;
    grid-row: 1 / span 2;
}

/* Church detail: compact content tabs (About / Media / Events / Messages) */
.church-detail-page .church-content-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
    margin: 0 0 0.75rem 0;
    padding: 0;
    border-bottom: 1px solid var(--border-color);
}

.church-detail-page .church-tab-btn {
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin: 0 0 -1px 0;
    padding: 0.4rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.church-detail-page .church-tab-btn:hover {
    color: var(--primary-color);
    background: var(--bg-tertiary);
}

.church-detail-page .church-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.church-detail-page .church-tab-panels {
    min-height: 0;
    /* Body copy matches header address (.detail-title .address) — easier than pure white */
    color: var(--text-secondary);
}

.church-detail-page .detail-main .church-tab-panels h1,
.church-detail-page .detail-main .church-tab-panels h2,
.church-detail-page .detail-main .church-tab-panels h3,
.church-detail-page .detail-main .church-tab-panels .section-title,
.church-detail-page .detail-main .church-tab-panels .collapsible-header,
.church-detail-page .detail-main .church-tab-panels .news-title,
.church-detail-page .detail-main .church-tab-panels .staff-name,
.church-detail-page .detail-main .church-tab-panels .recording-title {
    color: var(--text-primary);
}

.church-detail-page .detail-main .church-tab-panels .rich-content a {
    color: var(--primary-color);
}

.church-detail-page .detail-main .church-tab-panels .rich-content a:hover {
    opacity: 0.9;
}

.church-detail-page .church-events-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.church-detail-page .church-events-list li {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.church-detail-page .church-events-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Q&A accordion (church & business profile tabs) */
.sfc-qna-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sfc-qna-item-wrap {
    margin-bottom: 0.5rem;
}

.sfc-qna-item {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-secondary, #fff);
}

.sfc-qna-item summary {
    cursor: pointer;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--text-primary);
    list-style: none;
}

.sfc-qna-item summary::-webkit-details-marker {
    display: none;
}

.sfc-qna-answer {
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* Gallery: triple state — closed, one scrollable row, three-row grid */
.church-detail-page .gallery-triple-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.church-detail-page .gallery-triple-header:hover {
    color: var(--primary-color);
}

.church-detail-page .gallery-state-hint {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.church-detail-page .gallery-triple-panel {
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}

.church-detail-page .image-gallery.gallery-state-0 .gallery-triple-panel {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.church-detail-page .image-gallery.gallery-state-1 .gallery-triple-panel,
.church-detail-page .image-gallery.gallery-state-2 .gallery-triple-panel {
    max-height: 2000px;
    opacity: 1;
    pointer-events: auto;
}

.church-detail-page .image-gallery.gallery-state-0 .gallery-carousel-container {
    margin-top: 0;
    margin-bottom: 0;
}

.church-detail-page .image-gallery.gallery-state-2 .gallery-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    grid-auto-rows: 150px;
    gap: 1rem;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: calc(150px * 3 + 1rem * 2 + 1.5rem);
    padding: 0.5rem 0;
    scroll-behavior: auto;
}

.church-detail-page .image-gallery.gallery-state-2 .gallery-thumbnail {
    width: auto;
    height: 100%;
    max-height: 150px;
}

.church-detail-page .image-gallery.gallery-state-2 .gallery-nav {
    display: none;
}

.church-detail-page .image-gallery.gallery-state-2 .gallery-carousel-container {
    gap: 0;
}

.church-detail-page .image-gallery.gallery-state-2 .gallery-strip .gallery-thumbnail {
    min-width: 0;
}

.church-detail-page .image-gallery.gallery-state-2 .gallery-strip {
    scrollbar-width: auto;
    scrollbar-color: var(--border-color) var(--bg-tertiary);
}

.church-detail-page .image-gallery.gallery-state-2 .gallery-strip::-webkit-scrollbar {
    width: 11px;
}

.church-detail-page .image-gallery.gallery-state-2 .gallery-strip::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.church-detail-page .image-gallery.gallery-state-2 .gallery-strip::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

/* Media tab: bordered panels + collapsible-style headers */
.church-detail-page .church-media-panel {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 1rem 1rem;
    margin-bottom: 1.25rem;
    background: var(--bg-secondary);
}

.church-detail-page .church-media-panel-title,
.church-detail-page .church-media-panel .church-media-panel-title {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.church-detail-page .live-services-section .section-content {
    padding-top: 0.25rem;
}

.church-detail-page .gallery-triple-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
}

.church-detail-page .gallery-triple-title-wrap {
    flex: 1;
    min-width: 0;
}

.church-detail-page .gallery-triple-state-icon {
    flex-shrink: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
}

.church-detail-page .gallery-triple-state-icon svg {
    width: 1.1em;
    height: 1.1em;
}

/* Align Gallery header row with Livestreams section (.collapsible-header uses 1rem 1.5rem padding) */
.church-detail-page .church-media-panel.image-gallery > .gallery-triple-header {
    padding: 1rem 1.5rem;
    margin: 0.75rem 0;
    box-sizing: border-box;
}

.church-detail-page .church-welcome-inline-body {
    padding-top: 0.5rem;
}

.church-detail-page .gallery-thumb-placeholder {
    width: 100%;
    height: 100%;
    min-height: 120px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.church-detail-page .gallery-thumb-icon {
    font-size: 2rem;
    opacity: 0.6;
}

.church-detail-page .gallery-thumbnail.gallery-thumb-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lightbox-gallery-body {
    max-width: 90vw;
    max-height: 80vh;
}

.lightbox-gallery-body iframe {
    max-width: 90vw;
    width: min(960px, 90vw);
    min-height: 50vh;
    border: 0;
    border-radius: 4px;
}

/* Sidebar: church name stays bright; field labels match address tone */
.church-detail-page .detail-sidebar .contact-info h3 {
    color: var(--text-primary);
}

.church-detail-page .detail-sidebar .contact-info p > strong {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Church detail sidebar: contact links match former quick-tab styling (primary, no underline) */
.church-detail-page .detail-sidebar .contact-info a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.church-detail-page .detail-sidebar .contact-info a:hover {
    color: var(--primary-color);
    text-decoration: none;
    opacity: 0.85;
}

/* Primary-style text links outside the church sidebar (forms, admin copy, etc.) */
a.church-contact-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

a.church-contact-link:hover {
    color: var(--primary-color);
    text-decoration: none;
    opacity: 0.85;
}

.form-page .news-current-file-line {
    margin-top: 0.35rem;
}

.church-detail-page .church-sidebar-quicktabs-inner {
    font-size: 0.85rem;
    line-height: 1.8;
}

.church-detail-page .church-sidebar-quicktabs-inner a.church-sidebar-tab {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.church-detail-page .church-sidebar-quicktabs-inner a.church-sidebar-tab:hover {
    color: var(--primary-color);
    text-decoration: none;
    opacity: 0.85;
}

.church-detail-page .church-sidebar-sep {
    color: var(--text-secondary);
}

.church-detail-page .detail-sidebar .contact-info a.church-sidebar-subtle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.church-detail-page .detail-sidebar .contact-info a.church-sidebar-subtle:hover {
    color: var(--primary-color);
    opacity: 1;
}

/* Church sidebar: social icons (below contact info) */
.church-sidebar-social {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.church-sidebar-social-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.church-sidebar-social-list li {
    margin: 0;
    padding: 0;
}

.church-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.church-social-link:hover {
    background: var(--primary-color);
    color: var(--bg-primary, #fff);
    transform: translateY(-1px);
}

.church-social-icon {
    width: 1.35rem;
    height: 1.35rem;
    display: block;
}

.church-form .form-row-social {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.75rem 1rem;
    width: 100%;
}

.church-form .form-row-social .form-group {
    margin-bottom: 0;
}

/* Welcome popup (church detail) */
.church-welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.church-welcome-overlay[hidden] {
    display: none !important;
}

.church-welcome-dialog {
    position: relative;
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 1.25rem 1.5rem 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
}

.church-welcome-close {
    position: absolute;
    top: 0.5rem;
    right: 0.65rem;
    background: transparent;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
}

.church-welcome-heading {
    font-size: 1.25rem;
    margin: 0 0 0.75rem 0;
    padding-right: 2rem;
}

.church-welcome-body .media-player {
    margin: 0;
}

.church-welcome-dont {
    display: block;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Church page: optional full-page background (behind content, not navbar) */
.church-detail-has-page-bg {
    position: relative;
}

.church-page-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    opacity: var(--church-page-bg-opacity, 0.5);
}

.church-detail-has-page-bg .detail-layout.church-detail-page {
    position: relative;
    z-index: 1;
}

/* Tunable bg-secondary scrims (same color as .detail-sidebar default) over main column + sidebar */
.church-detail-surface-tuned .detail-layout.church-detail-page {
    position: relative;
    z-index: 1;
}

.church-detail-surface-tuned .church-detail-page .church-detail-header {
    position: relative;
    isolation: isolate;
}

.church-detail-surface-tuned .church-detail-page .church-detail-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-secondary);
    opacity: var(--church-main-surface-opacity, 0);
    border-radius: 8px;
    pointer-events: none;
    z-index: 0;
}

.church-detail-surface-tuned .church-detail-page .church-detail-header > * {
    position: relative;
    z-index: 1;
}

.church-detail-surface-tuned .church-detail-page .detail-main {
    position: relative;
    isolation: isolate;
}

.church-detail-surface-tuned .church-detail-page .detail-main::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-secondary);
    opacity: var(--church-main-surface-opacity, 0);
    border-radius: 8px;
    pointer-events: none;
    z-index: 0;
}

.church-detail-surface-tuned .church-detail-page .detail-main > * {
    position: relative;
    z-index: 1;
}

.church-detail-surface-tuned .church-detail-page .detail-sidebar {
    position: sticky;
    top: 2rem;
    background: transparent;
    isolation: isolate;
}

.church-detail-surface-tuned .church-detail-page .detail-sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-secondary);
    opacity: var(--church-sidebar-surface-opacity, 1);
    border-radius: 8px;
    pointer-events: none;
    z-index: 0;
}

.church-detail-surface-tuned .church-detail-page .detail-sidebar > * {
    position: relative;
    z-index: 1;
}

/* Church detail: sponsor rails outside <main>; shell center column still caps at 1200px */
body.church-public-detail .main-content.church-detail-main-in-wide-shell {
    max-width: 1200px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.church-detail-page-shell--has-ads {
    --church-content-col-width: 1200px;
    --church-rail-col-width: 320px;
    --church-rail-gap: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

/* Base: rails sit under content, stacked left then right. */
.church-page-ads-aside {
    order: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: var(--church-content-col-width);
    box-sizing: border-box;
}

.church-detail-main-slot {
    order: 1;
    width: 100%;
    max-width: var(--church-content-col-width);
    min-width: 0;
    box-sizing: border-box;
}

.church-rail-balance-spacer {
    display: none !important;
}

.church-rail-slot {
    position: relative;
    z-index: 12;
    width: min(100%, var(--church-rail-col-width));
    max-width: var(--church-rail-col-width);
    min-width: 0;
    padding: 0.5rem;
    box-sizing: border-box;
}

.church-page-ad-rail {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
    padding: 0.35rem;
    box-sizing: border-box;
}

.church-page-ad-rail-item img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

.church-page-ad-rail-item video {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    background: #111;
}

.church-page-ad-rail-item a {
    display: block;
    line-height: 0;
}

/* Mid-wide: one left rail column + content; right rail stacks below left in same column. */
@media (min-width: 1540px) and (max-width: 1859px) {
    .church-detail-page-shell--has-ads {
        display: grid;
        grid-template-columns: var(--church-rail-col-width) minmax(0, var(--church-content-col-width));
        column-gap: var(--church-rail-gap);
        justify-content: center;
        align-items: start;
    }

    .church-page-ads-aside {
        grid-column: 1;
        grid-row: 1 / span 2;
        order: unset;
        max-width: var(--church-rail-col-width);
        width: var(--church-rail-col-width);
        align-items: stretch;
    }

    .church-rail-slot {
        width: 100%;
        max-width: var(--church-rail-col-width);
        padding: 0.5rem 0.4rem;
    }

    .church-detail-main-slot {
        grid-column: 2;
        grid-row: 1 / span 2;
        order: unset;
        width: 100%;
        max-width: var(--church-content-col-width);
    }
}

/* Wide: two rail columns around content. */
@media (min-width: 1860px) {
    .church-detail-page-shell--has-ads {
        display: grid;
        grid-template-columns: var(--church-rail-col-width) minmax(0, var(--church-content-col-width)) var(--church-rail-col-width);
        column-gap: var(--church-rail-gap);
        justify-content: center;
        align-items: start;
    }

    .church-page-ads-aside {
        display: contents;
    }

    .church-rail-slot-left {
        grid-column: 1;
        grid-row: 1;
        width: var(--church-rail-col-width);
        max-width: var(--church-rail-col-width);
        padding: 0.5rem 0.4rem;
        box-sizing: border-box;
        display: block;
    }

    .church-rail-slot-right {
        grid-column: 3;
        grid-row: 1;
        width: var(--church-rail-col-width);
        max-width: var(--church-rail-col-width);
        padding: 0.5rem 0.4rem;
        box-sizing: border-box;
        display: block;
    }

    .church-detail-main-slot {
        grid-column: 2;
        grid-row: 1;
        width: 100%;
        max-width: var(--church-content-col-width);
        min-width: 0;
    }
}

@media (max-width: 899px) {
    .church-page-ads-aside {
        max-width: 100%;
    }

    .church-rail-slot {
        width: min(100%, var(--church-rail-col-width));
        max-width: var(--church-rail-col-width);
    }
}

.church-page-comments-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.church-page-comment-item {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-color);
}

.church-page-comment-item:last-child {
    border-bottom: none;
}

.church-page-comment-meta {
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.church-page-comment-body {
    line-height: 1.5;
}

/* Church profile tab: testimonials in a two-column card grid */
.church-testimonials-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

@media (min-width: 680px) {
    .church-testimonials-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.church-testimonials-cards .church-page-comment-item {
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-secondary);
    box-sizing: border-box;
    min-width: 0;
}

.church-testimonials-cards .church-page-comment-item:last-child {
    border-bottom: 1px solid var(--border-color);
}

.church-testimonials-cards .church-page-comment-media img,
.church-testimonials-cards .church-page-comment-media video,
.church-testimonials-cards .church-page-comment-media iframe {
    max-width: 100%;
    height: auto;
}

.church-testimonial-clickable-image {
    cursor: zoom-in;
}

.testimonial-image-modal-dialog {
    width: min(96vw, 1000px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.testimonial-image-modal-close {
    align-self: flex-end;
}

#testimonial-image-modal-img {
    max-width: 100%;
    max-height: 78vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.church-comment-row-hidden td {
    opacity: 0.75;
}

.church-inline-table-input {
    width: 100%;
    max-width: 14rem;
    box-sizing: border-box;
    font-size: 0.9rem;
}

.church-livestreams-edit-table .church-inline-table-input {
    max-width: 18rem;
}

.church-inline-table-select {
    font-size: 0.9rem;
    max-width: 10rem;
}

.church-messages-edit-table th a {
    color: inherit;
    text-decoration: none;
}
.church-messages-edit-table th a:hover {
    text-decoration: underline;
    color: var(--primary-color);
}

.supporter-card-placeholder {
    width: 100%;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-secondary);
}

.church-page-bg-credit {
    position: fixed;
    bottom: 0.35rem;
    right: 0.75rem;
    max-width: min(42vw, 15rem);
    font-size: 0.68rem;
    line-height: 1.2;
    color: var(--text-secondary);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
    z-index: 99;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Church edit: nested Media sub-sections */
.media-sub-collapsible {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    background: var(--bg-secondary);
}

.media-sub-collapsible-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    margin: 0;
    border: none;
    background: var(--bg-tertiary);
    color: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.media-sub-collapsible-header:hover {
    background: var(--bg-primary);
}

.media-sub-collapsible-content {
    padding: 1rem;
}

.media-sub-collapsible-content.collapsed {
    display: none;
}

.media-sub-collapse-arrow {
    font-size: 0.85rem;
    opacity: 0.85;
}

.church-gallery-edit-table .gallery-row-inactive {
    opacity: 1;
}

.church-gallery-edit-table .gallery-row-inactive .gallery-preview-cell {
    filter: none;
}

.church-gallery-edit-table .gallery-row-inactive .gallery-preview-cell img,
.church-gallery-edit-table .gallery-row-inactive .gallery-preview-cell video {
    /* Keep thumbnails bright; inactive state is already communicated elsewhere. */
    opacity: 1;
    filter: none;
}

.church-gallery-edit-table .gallery-active-cell {
    width: 3.25rem;
    text-align: center;
}

.edit-gallery-thumb-audio {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 60px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.gallery-thumb-audio {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 80px;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.church-surface-opacity-group input[type="range"] {
    display: block;
    width: 100%;
    max-width: 22rem;
    margin-top: 0.35rem;
}

/* Church edit: gallery table + modals */
.gallery-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}

.gallery-toolbar-bulk {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.gallery-toolbar-single-row {
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
}

.gallery-toolbar-single-row .gallery-toolbar-bulk {
    flex-wrap: nowrap;
    flex: 0 1 auto;
    min-width: 0;
}

.gallery-toolbar-single-row .btn.btn-primary {
    flex-shrink: 0;
    margin-left: auto;
}

.gallery-meta-cell {
    max-width: 16rem;
}

.gallery-meta-line {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.35;
}

.gallery-meta-credit {
    font-size: 0.85rem;
}

.gallery-sort-btns {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
}

.church-gallery-edit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.church-gallery-edit-table th,
.church-gallery-edit-table td {
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.6rem;
    vertical-align: middle;
    text-align: left;
}

.church-gallery-edit-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.church-gallery-edit-table .gallery-preview-cell {
    width: 100px;
}

.church-gallery-edit-table .gallery-preview-cell img,
.church-gallery-edit-table .gallery-preview-cell video {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    display: block;
    opacity: 1;
    filter: none;
}

.church-gallery-edit-table .edit-gallery-thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 60px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.church-gallery-edit-table .gallery-type-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.is-open {
    display: flex;
}

.modal-dialog-panel {
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#admin-form-modal .modal-dialog-panel {
    width: min(800px, 96vw) !important;
    max-width: min(800px, 96vw) !important;
    max-height: 92vh;
}

#admin-form-modal-body {
    max-height: min(80vh, 900px);
    overflow: auto;
    padding-right: 0.5rem; /* room next to vertical scrollbar on long forms */
}

#admin-form-modal-body .form-page {
    max-width: none;
}

.modal-dialog-panel h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: flex-end;
}

.contact-info h3, .tags h3 {
    margin-bottom: 1rem;
}

.contact-info a {
    color: var(--text-primary);
    text-decoration: underline;
    transition: color 0.3s;
}

.contact-info a:hover {
    color: var(--primary-color);
}

.media-icon {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 1.2rem;
    vertical-align: middle;
    opacity: 0.8;
}

.media-player {
    margin: 1.5rem 0;
    width: 100%;
}

.media-player iframe,
.media-player video,
.media-player audio {
    width: 100%;
    border-radius: 4px;
    max-width: 100%;
}

.media-player video {
    /* max-height: 500px; */
}

.service-hours-inline {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.service-times-inline,
.hours-inline {
    flex: 1;
    min-width: 200px;
}

.service-times-inline strong,
.hours-inline strong {
    display: block;
    margin-bottom: 0.5rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top:10px;
}

.tag {
    background: var(--bg-tertiary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.pagination-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.pagination-record-count {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.pagination-page-form {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-primary);
}

.pagination-page-form input[type="number"] {
    width: 76px;
    padding: 0.35rem 0.45rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
}

.pagination-link.is-disabled {
    pointer-events: none;
    opacity: 0.45;
}

/* Forms */
.form-page {
    max-width: 1000px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group input[type="checkbox"],
.form-group input[type="radio"],
.form-group input[type="color"] {
    width: auto;
    margin-right: 0.5rem;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: nowrap;
    margin-top: 0.5rem;
}

.radio-group label {
    white-space: nowrap;
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Rich Text Editor */
.rich-text-wrapper {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-tertiary);
}

.rich-text-toolbar {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
}

.toolbar-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.875rem;
    flex-shrink: 0;
    white-space: nowrap;
    height: 28px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.toolbar-btn:hover {
    background: var(--bg-primary);
}
.toolbar-btn.active {
    background: var(--primary-color);
    color: var(--bg-primary);
    border-color: var(--primary-color);
}

.toolbar-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.25rem;
    border-radius: 3px;
    font-size: 0.875rem;
    min-width: 80px;
    flex-shrink: 0;
    height: 28px;
    box-sizing: border-box;
}

.toolbar-select.toolbar-compact {
    min-width: 50px;
    max-width: 70px;
    font-size: 0.75rem;
    padding: 0.2rem 0.3rem;
    flex-shrink: 0;
    height: 28px;
}

.toolbar-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.875rem;
    flex-shrink: 0;
    height: 28px;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.toolbar-input.toolbar-compact {
    min-width: 50px;
    max-width: 70px;
    font-size: 0.75rem;
    padding: 0.2rem 0.3rem;
    padding-right: 1.5rem; /* Space for dropdown arrow */
    height: 28px;
    flex-shrink: 0;
    box-sizing: border-box;
    background: var(--bg-tertiary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 3px !important;
}

/* Hide native datalist arrow - multiple approaches for different browsers */
.toolbar-input[list]::-webkit-calendar-picker-indicator {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.toolbar-input[list]::-webkit-list-button {
    display: none !important;
}

.toolbar-input[list]::-webkit-inner-spin-button,
.toolbar-input[list]::-webkit-outer-spin-button {
    display: none !important;
}

/* Firefox */
.toolbar-input[list] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Ensure no native arrows show on hover */
.toolbar-input[list]:hover::-webkit-calendar-picker-indicator {
    display: none !important;
    opacity: 0 !important;
}

/* Add dropdown arrow for datalist inputs to match select styling */
.toolbar-font-size-wrapper {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.toolbar-font-size-wrapper::after {
    content: '';
    position: absolute;
    right: 0.3rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--text-primary);
    opacity: 0.7;
}

.toolbar-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.toolbar-input:hover {
    border-color: var(--border-color);
}

.toolbar-select:hover {
    border-color: var(--border-color);
}

.toolbar-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.toolbar-color {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    padding: 3px !important;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    background: var(--bg-tertiary);
    flex-shrink: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.toolbar-color::-webkit-color-swatch-wrapper {
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.toolbar-color::-webkit-color-swatch {
    border: none !important;
    border-radius: 2px !important;
    width: 100% !important;
    height: 100% !important;
}

.toolbar-color::-moz-color-swatch {
    border: none !important;
    border-radius: 2px !important;
    width: 100% !important;
    height: 100% !important;
}

.toolbar-color-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    padding: 0 !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: transform 0.1s ease;
}

.toolbar-color-btn:hover {
    transform: scale(1.05);
}

.color-palette-popup {
    display: none;
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 200px;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    border-radius: 2px;
    transition: transform 0.1s ease, z-index 0s;
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.1);
    z-index: 10;
}

.rich-text-toolbar {
    align-items: center;
}

.toolbar-help {
    background: var(--primary-color);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: help;
    margin-left: auto;
}

.rich-text-area {
    width: 100%;
    min-height: 150px;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.rich-text-area[data-wysiwyg="true"] {
    display: none;
}

/* WYSIWYG Editor */
.wysiwyg-editor {
    min-height: 150px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    line-height: 1.6;
}

.wysiwyg-editor:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.2);
}

.wysiwyg-editor p {
    margin: 0.5rem 0;
    line-height: 1.5;
}

.wysiwyg-editor p:first-child {
    margin-top: 0;
}

.wysiwyg-editor p:last-child {
    margin-bottom: 0;
}

.wysiwyg-editor strong,
.wysiwyg-editor b {
    font-weight: bold;
    line-height: inherit;
    display: inline;
}

.wysiwyg-editor em,
.wysiwyg-editor i {
    font-style: italic;
}

.wysiwyg-editor u {
    text-decoration: underline;
}

.formatting-help {
    margin-top: 0.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.875rem;
}

.formatting-help code {
    background: var(--bg-tertiary);
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}

.rich-content {
    line-height: 1.6;
    overflow-x: auto;
}

.rich-content img {
    max-width: 100%;
    height: auto;
}

.rich-content iframe {
    max-width: 100%;
}

.rich-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.rich-content th,
.rich-content td {
    border: 1px solid var(--border-color, #ccc);
    padding: 0.35rem 0.5rem;
    vertical-align: top;
}

.rich-content pre {
    overflow-x: auto;
    padding: 0.75rem;
    border-radius: 4px;
    background: var(--bg-tertiary, #f0f0f0);
    font-size: 0.9em;
}

/* Church TinyMCE: single resize handle on this wrapper; inner editor height is synced in JS */
.church-form .form-group:has(textarea.tinymce-church),
.church-form .form-group:has(.tox-tinymce) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    max-height: min(76vh, calc(100vh - 8.5rem));
    min-height: 240px;
    resize: vertical;
    overflow: hidden;
    border-radius: 6px;
}

.church-form .form-group:has(.tox-tinymce) .tox-tinymce {
    flex: 1 1 auto;
    min-height: 0;
}

.account-page .account-item-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.account-page .account-item-list li {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
}

.account-item-type {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    min-width: 6.5rem;
}

.account-item-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.message-inbox-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.message-inbox-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.message-inbox-item.unread {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.message-inbox-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.message-inbox-item .message-title {
    margin: 0 0 0.35rem 0;
    font-size: 1rem;
}

.rich-content strong {
    font-weight: bold;
}

.rich-content em {
    font-style: italic;
}

.rich-content u {
    text-decoration: underline;
}

/* Ensure all formatting spans in rich-content are inline */
.rich-content span {
    display: inline !important;
    line-height: inherit !important;
    vertical-align: baseline !important;
}

/* Specific rules for style-based spans (more specific, will override general span rule if needed) */
.rich-content span[style*="font-size"],
.rich-content span[style*="font-family"],
.rich-content span[style*="color"] {
    display: inline !important;
    line-height: inherit !important;
    vertical-align: baseline !important;
}

/* Also handle spans that might have multiple style attributes */
.rich-content span[style*="font-size"][style*="font-family"],
.rich-content span[style*="font-size"][style*="color"],
.rich-content span[style*="font-family"][style*="color"],
.rich-content span[style*="font-size"][style*="font-family"][style*="color"] {
    display: inline !important;
    line-height: inherit !important;
    vertical-align: baseline !important;
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--text-primary);
}

.breadcrumbs span {
    color: var(--text-primary);
}

/* Church Logo */
.church-logo {
    max-width: 80px;
    max-height: 80px;
    margin-right: 1rem;
    vertical-align: top;
    border-radius: 4px;
    flex-shrink: 0;
}

.detail-title {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
}

.title-with-logo {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
}

.title-text {
    flex: 1;
    min-width: 0;
}

/* Church detail: compact welcome control (top-right of title row) */
.church-detail-page .church-title-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.church-detail-page .church-title-heading-row h1 {
    margin: 0;
    flex: 1;
    min-width: 0;
}

.church-detail-page .church-welcome-icon-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.church-detail-page .church-welcome-icon-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.church-detail-page .church-welcome-icon-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.detail-title h1 {
    margin: 0 0 0.5rem 0;
}

.detail-title .address {
    margin: 0;
    color: var(--text-secondary);
}

/* Map Link */
.map-link {
    display: inline-block;
    margin-left: 0.5rem;
    position: relative;
    text-decoration: none;
}

.map-icon {
    font-size: 1.2rem;
    cursor: pointer;
}

.map-preview {
    position: absolute;
    z-index: 1000;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    display: none;
    box-shadow: 0 4px 10px var(--shadow);
}

.map-preview iframe {
    border: none;
}

/* Announcements */
.announcement-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 2rem;
    z-index: 10000;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.announcement-content h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.announcement-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    line-height: 30px;
}

.announcement-close:hover {
    color: var(--danger-color);
}

/* News Popup */
.news-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 2rem;
    z-index: 10000;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.news-popup-content h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.news-popup-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    line-height: 30px;
}

.news-popup-close:hover {
    color: var(--danger-color);
}

.news-popup-message {
    color: var(--text-primary);
    line-height: 1.6;
}

.news-popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* News Carousel */
.news-carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.news-strip {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    flex: 1;
    padding: 0.5rem 0;
}

.news-strip::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.news-item {
    min-width: 300px;
    max-width: 300px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.news-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.news-item a {
    text-decoration: none;
    color: inherit;
}

.news-item .news-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
}

.news-item .news-video,
.news-item .news-external {
    width: 100%;
    height: 200px;
    border-radius: 4px;
    overflow: hidden;
}

.news-item .news-video video,
.news-item .news-external iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-title {
    margin: 0.5rem 0 0 0;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: color 0.3s;
}

.news-title:hover {
    color: var(--primary-color);
}

.news-content-preview {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.news-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0.25rem 0;
}

.news-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.news-nav {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    flex-shrink: 0;
}

.news-nav:hover {
    background: var(--primary-color);
}

.news-lightbox-content {
    width: 100%;
    max-width: 1200px;
    color: white;
}

.news-lightbox-content h3 {
    margin-bottom: 1rem;
}

/* News Detail Page */
.news-detail-page {
    /* max-width: 900px; */
    margin: 0 auto;
    /* padding: 2rem; */
    padding: 0 2rem 2rem 2rem;
}

.news-detail-header {
  /*  margin-bottom: 2rem; */
}

.news-detail-header h1 {
    margin: 1rem 0;
    color: var(--text-primary);
}

.news-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.news-detail-content {
    line-height: 1.8;
}

.news-media {
    margin-bottom: 2rem;
}

.news-external-video,
.news-video-file {
    margin-bottom: 2rem;
}

.news-external-video iframe,
.news-video-file video {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
}

.news-image-container {
    margin-bottom: 2rem;
    text-align: center;
}

.news-detail-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.news-detail-image:hover {
    transform: scale(1.02);
}

.news-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.other-news-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.other-news-section h2 {
    margin-bottom: 1rem;
}

.other-news-item {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: background 0.2s;
}

.other-news-item:hover {
    background: var(--bg-tertiary);
}

.other-news-item a {
    text-decoration: none;
    color: inherit;
}

.other-news-item a:hover h3 {
    text-decoration: underline;
}

/* Staff Carousel */
.staff-carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.staff-strip {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    flex: 1;
    padding: 0.5rem 0;
}

.staff-strip::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.staff-thumbnail {
    flex-shrink: 0;
    width: 150px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s;
}

.staff-thumbnail:hover {
    transform: scale(1.05);
}

.staff-thumbnail img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto;
    border: 2px solid var(--border-color);
    transition: border-color 0.3s;
}

.staff-thumbnail:hover img {
    border-color: var(--primary-color);
}

.staff-thumbnail-link {
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
    width: 150px;
}

.staff-thumbnail-link:hover {
    text-decoration: none;
}

.staff-name {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.staff-title-small {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

.staff-nav {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.3s, border-color 0.3s;
}

.staff-nav:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

/* Service Recordings Carousel */
.recordings-carousel-container {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin: 1rem 0;
}

.recordings-strip {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    flex: 1;
    padding: 0.5rem 0;
}

.recordings-strip::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.recording-item {
    flex-shrink: 0;
    width: 280px;
    max-width: 100%;
}

.recording-player {
    width: 100%;
    margin-bottom: 0.5rem;
}

.recording-player video,
.recording-player audio,
.recording-player iframe {
    width: 100%;
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
}

.recording-title {
    font-size: 1rem;
    margin: 0.25rem 0 0 0;
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.2s ease;
}

.recording-title:hover {
    color: var(--primary-color);
}

.recording-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.recordings-nav {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.3s, border-color 0.3s;
    align-self: center;
}

.recordings-nav:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

/* Staff Grid (for edit page) */
.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.staff-member {
    text-align: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.staff-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
}

.staff-title {
    color: var(--text-secondary);
    font-style: italic;
    margin: 0.5rem 0;
}

.staff-bio {
    margin-top: 1rem;
    text-align: left;
    font-size: 0.875rem;
}

.staff-profile-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
}

/* Staff Bio Page */
.staff-bio-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.staff-bio-container {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.staff-bio-header {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
}

.staff-bio-photo-wrapper {
    flex-shrink: 0;
}

.staff-bio-photo {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.staff-bio-photo-placeholder {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    background: var(--bg-tertiary);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: bold;
    color: var(--text-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.staff-bio-info {
    flex: 1;
}

.staff-bio-info h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2.5rem;
    color: var(--text-primary);
}

.staff-bio-title {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
    font-style: italic;
}

.staff-bio-profile-link {
    margin-top: 1rem;
}

.staff-bio-main {
    display: grid;
    gap: 2rem;
}

.staff-bio-content h2,
.staff-organizations h2,
.staff-contact h2 {
    font-size: 1.75rem;
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.staff-bio-content .rich-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.staff-organizations {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 8px;
}

.staff-organizations h2 {
    margin-top: 0;
}

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

.organizations-group h3 {
    font-size: 1.25rem;
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

.organizations-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.organizations-list li {
    margin-bottom: 0.75rem;
}

.org-link {
    display: block;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.org-link:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.org-name {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.org-location {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.staff-contact {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 8px;
}

.staff-contact h2 {
    margin-top: 0;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.contact-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 80px;
}

.contact-value {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-value:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .staff-bio-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .staff-bio-photo,
    .staff-bio-photo-placeholder {
        width: 150px;
        height: 150px;
    }
    
    .staff-bio-info h1 {
        font-size: 2rem;
    }
    
    .organizations-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .contact-label {
        min-width: auto;
    }
}

.staff-management {
    margin-bottom: 1.5rem;
}

.staff-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.table-action-link {
    text-decoration: none !important;
}

.church-gallery-edit-table .table-action-link {
    color: #4a9eff;
    background: transparent;
    border: none;
    padding-left: 0;
    padding-right: 0;
}

.church-gallery-edit-table .table-action-link:hover {
    color: #6bb3ff;
    text-decoration: none;
}

.church-gallery-edit-table .btn.btn-small.btn-danger {
    padding: 0.15rem 0.45rem;
    font-size: 0.8rem;
}

.admin-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 1rem;
}

body.admin-full-width .main-content {
    max-width: none !important;
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

.admin-sidebar {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    height: fit-content;
}

.admin-side-link {
    display: block;
    padding: 0.55rem 0.7rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 6px;
}

.admin-side-link:hover {
    background: var(--bg-tertiary);
}

.admin-side-link.active {
    background: var(--primary-color);
    color: #fff;
}

.admin-main {
    width: 100%;
}

.admin-main a:not(.btn):not(.admin-side-link) {
    color: var(--primary-color);
    text-decoration: none;
}

.admin-main a:not(.btn):not(.admin-side-link):hover,
.admin-main a:not(.btn):not(.admin-side-link):focus-visible {
    text-decoration: underline;
}

.admin-action-link {
    color: #4a9eff !important;
    text-decoration: none !important;
    font-weight: 500;
}

.admin-action-link:hover,
.admin-action-link:focus-visible {
    color: #6bb3ff !important;
    text-decoration: underline !important;
}

.admin-toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 0.75rem 0 1rem;
    flex-wrap: wrap;
}

.admin-toolbar select {
    min-width: 170px;
    min-height: 38px;
}

.admin-toolbar-right {
    margin-left: auto;
}

.navbar-site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-site-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.navbar-site-logo-mask {
    display: inline-block;
    background-color: var(--site-logo-color, currentColor);
    -webkit-mask-image: var(--site-logo-src);
    mask-image: var(--site-logo-src);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.navbar-site-brand-text {
    display: inline-flex;
    align-items: flex-end;
    white-space: nowrap;
}

.navbar-site-rising-tagline {
    display: inline-flex;
    align-items: flex-end;
    white-space: nowrap;
    font-size: 0.88em;
    font-style: italic;
    color: var(--primary-color);
    margin-left: 0.35rem;
}

.brand-arc-char {
    display: inline-block;
    transform: translateY(var(--brand-arc-y, 0)) rotate(var(--brand-arc-r, 0deg));
    transform-origin: center bottom;
}

/* Keep text+logo brand balanced on narrow widths. */
body.brand-mode-text_logo .navbar-site-brand {
    gap: 0.45rem;
}

@media (max-width: 900px) {
    body.brand-mode-text_logo .navbar-site-brand {
        gap: 0.35rem;
    }
    body.brand-mode-text_logo .navbar-site-logo {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 640px) {
    body.brand-mode-text_logo .navbar-site-brand {
        gap: 0.3rem;
    }
    body.brand-mode-text_logo .navbar-site-logo {
        width: 24px;
        height: 24px;
    }
}

/* Very narrow screens: for logo + text + rising tagline, place tagline under name. */
@media (max-width: 560px) {
    body.brand-mode-logo_text_tagline .navbar-site-brand {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "logo name"
            "logo tag";
        column-gap: 0.4rem;
        row-gap: 0.05rem;
        align-items: end;
    }
    body.brand-mode-logo_text_tagline .navbar-site-logo {
        grid-area: logo;
        width: 24px;
        height: 24px;
        align-self: center;
    }
    body.brand-mode-logo_text_tagline .navbar-site-brand-text {
        grid-area: name;
    }
    body.brand-mode-logo_text_tagline .navbar-site-rising-tagline {
        grid-area: tag;
        margin-left: 0;
    }
}

.btn-link-like {
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.theme-field-with-palette {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
}

.theme-field-with-palette .theme-palette-input {
    width: 2.3rem;
    height: 2.3rem;
    border: 1px solid var(--border-color);
    background: transparent;
    padding: 0.15rem;
    border-radius: 6px;
    cursor: pointer;
}

.events-widget {
    position: relative;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin: 0.75rem 0 1rem;
}

.events-widget-main,
.events-widget-upcoming {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.9rem;
}

.events-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.events-widget-header--nav-only {
    justify-content: center;
}

.events-widget-header--nav-only .events-month-nav {
    flex-wrap: wrap;
    justify-content: center;
}

.events-month-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.events-month-picker-btn {
    min-width: 10rem;
    text-align: center;
    font-weight: 600;
}

.events-filter-icon-btn {
    padding: 0.28rem 0.45rem;
    line-height: 0;
    flex-shrink: 0;
}

.events-filter-icon-btn svg {
    display: block;
    vertical-align: middle;
}

.events-month-picker-popover:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 10070;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.events-month-picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.events-month-picker-dialog {
    position: relative;
    z-index: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.15rem 1.1rem;
    max-width: 26rem;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.events-month-picker-title {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
}

.events-month-picker-hint {
    margin: 0 0 0.85rem;
    font-size: 0.82rem;
    line-height: 1.4;
}

.events-month-picker-wheels {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.events-wheel-wrap {
    flex: 1;
    min-width: 0;
    max-width: 11rem;
}

.events-wheel-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.events-wheel-viewport {
    position: relative;
    height: 220px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    overflow: hidden;
}

.events-wheel-shade {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 2;
    height: 72px;
    pointer-events: none;
}

.events-wheel-shade--top {
    top: 0;
    background: linear-gradient(to bottom, var(--bg-primary), transparent);
}

.events-wheel-shade--bottom {
    bottom: 0;
    background: linear-gradient(to top, var(--bg-primary), transparent);
}

.events-wheel-list {
    position: relative;
    z-index: 1;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scrollbar-width: thin;
    outline: none;
}

.events-wheel-list:focus-visible {
    box-shadow: inset 0 0 0 2px var(--primary-color);
    border-radius: 8px;
}

.events-wheel-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 0 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    scroll-snap-align: center;
    flex-shrink: 0;
    box-sizing: border-box;
}

.events-wheel-item:hover {
    background: rgba(74, 144, 226, 0.08);
}

.events-month-picker-native {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: flex-end;
    margin-bottom: 1rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--border-color);
}

.events-month-picker-native-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex: 1;
    min-width: 8rem;
}

.form-select-like {
    width: 100%;
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.events-month-picker-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.events-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.35rem;
}

.events-cal-head {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-bottom: 0.2rem;
}

.events-cal-cell {
    min-height: 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.25rem 0.35rem;
    font-size: 0.85rem;
}

.events-cal-cell small {
    color: var(--text-secondary);
    font-size: 0.65rem;
    line-height: 1.2;
    text-align: left;
}

/* Temporarily disabled: event-day border highlight (keep selected-day border only)
.events-cal-cell.has-events {
    border-color: var(--primary-color);
}
*/

.events-cal-cell.is-selected {
    outline: 2px solid var(--primary-color);
}

.events-cal-cell.is-today {
    background: rgba(74, 144, 226, 0.12);
}

.events-cal-cell.is-empty {
    border: none;
    background: transparent;
}

.events-day-list {
    margin-top: 0.8rem;
}

.events-day-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.events-day-list-date {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    flex: 1;
    min-width: 0;
}

.events-day-list-body {
    min-height: 0;
}

.events-day-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.events-day-item {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--border-color);
}

.events-day-item:last-child {
    border-bottom: none;
}

.events-day-item-link {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.65rem 0;
    text-decoration: none;
    color: inherit;
}

.events-day-item-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}

.events-day-item-thumb.is-placeholder {
    display: inline-block;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
}

.events-day-item-body {
    flex: 1;
    min-width: 0;
}

.events-day-item-title {
    display: block;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.events-day-item-meta {
    display: block;
    font-size: 0.88rem;
}

.events-day-item-desc {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    line-height: 1.35;
}

.events-widget a.events-widget-event-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.events-widget a.events-widget-event-link:hover {
    color: var(--primary-color);
    text-decoration: none;
    opacity: 0.88;
}

.church-detail-page .events-widget a.events-widget-event-link {
    color: var(--primary-color);
    text-decoration: none;
}

.church-detail-page .events-widget a.events-widget-event-link:hover {
    color: var(--primary-color);
    opacity: 0.85;
}

.church-detail-page .events-widget a.events-widget-event-link.events-upcoming-item-link[data-upcoming-hover]:hover,
.church-detail-page .events-widget a.events-widget-event-link.events-upcoming-item-link[data-upcoming-hover]:focus-visible {
    opacity: 1;
}

.events-upcoming-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.events-upcoming-toolbar h4 {
    margin: 0;
    flex: 1;
    min-width: 0;
}

.events-upcoming-group {
    margin-bottom: 1rem;
}

.events-upcoming-group:last-child {
    margin-bottom: 0;
}

.events-upcoming-group-date {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.events-upcoming-group-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.events-upcoming-item {
    border-bottom: 1px solid var(--border-color);
}

.events-upcoming-item:last-child {
    border-bottom: none;
}

.events-upcoming-item-link {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.5rem 0;
    text-decoration: none;
    color: inherit;
}

.events-upcoming-item-link[data-upcoming-hover] {
    position: relative;
    z-index: 1;
}

.events-upcoming-item-link[data-upcoming-hover]::after {
    content: attr(data-upcoming-hover);
    position: absolute;
    left: 0;
    top: calc(100% + 0.25rem);
    z-index: 11050;
    width: min(250px, 75vw);
    white-space: pre-line;
    line-height: 1.3;
    padding: 0.45rem 0.55rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease 0.5s, visibility 0s linear 0.5s;
    pointer-events: none;
}

.events-upcoming-item-link[data-upcoming-hover]:hover::after,
.events-upcoming-item-link[data-upcoming-hover]:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

.events-upcoming-item-link[data-upcoming-hover]:hover,
.events-upcoming-item-link[data-upcoming-hover]:focus-visible {
    z-index: 12000;
}

.events-widget-upcoming,
.events-upcoming-group,
.events-upcoming-group-list,
.events-upcoming-item {
    overflow: visible;
}

.events-upcoming-item-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 5px;
    flex-shrink: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}

.events-upcoming-item-thumb.is-placeholder {
    display: inline-block;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
}

.events-upcoming-item-body {
    flex: 1;
    min-width: 0;
}

.events-upcoming-item-title {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.events-upcoming-item-meta {
    display: block;
    font-size: 0.82rem;
}

.events-upcoming-item-desc {
    margin: 0.3rem 0 0;
    font-size: 0.82rem;
    line-height: 1.35;
}

.events-cat-filter-popover:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.events-cat-filter-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

.events-cat-filter-dialog {
    position: relative;
    z-index: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    max-width: 22rem;
    width: 100%;
    max-height: 85vh;
    overflow: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.events-cat-filter-title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.events-cat-checkboxes {
    margin-bottom: 0.75rem;
}

.events-cat-filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.35rem 0;
    cursor: pointer;
    font-size: 0.92rem;
}

.events-cat-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.events-widget-upcoming ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Sidebar Main Image */
.sidebar-main-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.main-image-sidebar {
    margin-bottom: 1.5rem;
}

.main-image-sidebar img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

/* Gallery Preview */
.gallery-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Gallery Edit Styles */
.gallery-edit-list {
    margin-bottom: 1.5rem;
}

.gallery-edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.gallery-edit-item {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.gallery-edit-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.gallery-edit-list-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.gallery-edit-item-full {
    display: flex;
    gap: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    background: var(--bg-secondary);
}

.gallery-edit-item-image {
    flex-shrink: 0;
    width: 200px;
    height: 150px;
    overflow: hidden;
    border-radius: 4px;
}

.gallery-edit-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-edit-item-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gallery-edit-item-fields .form-group {
    margin-bottom: 0;
}

.gallery-edit-item-fields .form-group label {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.gallery-edit-item-fields input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.875rem;
}

.gallery-edit-actions {
    padding: 0.5rem 0;
    text-align: left;
}

.gallery-edit-actions label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

/* Service Recordings Management */
.recordings-management-list {
    margin-bottom: 2rem;
}

.recordings-list-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.recording-edit-item-full {
    display: flex;
    gap: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    background: var(--bg-secondary);
}

.recording-edit-item-preview {
    flex-shrink: 0;
    width: 200px;
    height: 150px;
    overflow: hidden;
    border-radius: 4px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.recording-preview-placeholder {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.recording-edit-item-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recording-edit-item-fields .form-group {
    margin-bottom: 0;
}

.recording-edit-item-fields .form-group label {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.recording-edit-item-fields input[type="text"],
.recording-edit-item-fields input[type="number"],
.recording-edit-item-fields input[type="datetime-local"],
.recording-edit-item-fields textarea {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.875rem;
}

.recording-edit-actions {
    padding: 0.5rem 0;
    text-align: left;
}

.recording-edit-actions label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

/* Form Sections */
.form-section {
    margin-bottom: 3rem;
}

/* Collapsible Sections */
.collapsible-section {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0;
    background: var(--bg-secondary);
    width: 100%;
    max-width: 100%;
    margin: 0 0 10px 0;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
    user-select: none;
    transition: background-color 0.2s ease;
}

.collapsible-header:hover {
    background: var(--bg-tertiary);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.collapsible-header .collapse-arrow {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.section-content {
    padding: 1.5rem;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.section-content.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

/* Recording Cards (similar to gallery cards) */
.recordings-edit-list {
    margin-bottom: 1.5rem;
}

.recordings-edit-list-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.recording-edit-item-full {
    display: flex;
    gap: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    background: var(--bg-secondary);
}

.recording-edit-item-preview {
    flex-shrink: 0;
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 1rem;
    min-height: 150px;
}

.recording-preview-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.recording-preview-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

.recording-edit-item-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recording-edit-item-fields .form-group {
    margin-bottom: 0;
}

.recording-edit-item-fields label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    display: block;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.slug-status {
    margin-top: 0.5rem;
    min-height: 1.5rem;
}

.slug-status .slug-checking {
    color: var(--text-secondary);
}

.slug-status .slug-available {
    color: var(--success-color);
}

.slug-status .slug-error {
    color: var(--danger-color);
}

/* Auth Pages */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-container {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-color);
}

.auth-container h1 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.alert-success {
    background: rgba(40, 167, 69, 0.15);
    border: 1px solid var(--success-color);
    color: #8fd9a8;
}

.auth-container--wide {
    max-width: 460px;
}

.auth-mode-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
}

.auth-mode-tab {
    flex: 1;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
}

.auth-mode-tab.active {
    border-color: var(--primary-color);
    color: var(--text-primary);
    background: rgba(74, 144, 226, 0.15);
}

.auth-meta a {
    color: var(--primary-color);
}

/* Footer */
.footer {
    margin-top: auto;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.footer-tab {
    background: var(--bg-tertiary);
    padding: 0.1rem 1.5rem;
    text-align: center;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    width: fit-content;
    margin: 0 auto;
    display: block;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.footer-tab:hover {
    background: var(--bg-primary);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

.footer-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

.footer-content.active {
    max-height: min(72vh, 520px);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.footer-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
    max-height: min(68vh, 480px);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-section a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* Carousel */
.featured-carousel {
    position: relative;
    margin-bottom: 3rem;
    border-radius: 8px;
    overflow: hidden;
}

.carousel-container {
    position: relative;
    height: 400px;
}

.carousel-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 2rem;
    color: white;
}

.carousel-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
}

.carousel-prev, .carousel-next {
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
}

.carousel-indicators {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}

.carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
}

.carousel-indicator.active {
    background: white;
}

/* Random Features */
.random-features {
    margin: 3rem 0;
}

.random-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.random-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.btn-random {
    margin: 1rem 0;
}

.home-page-rich {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.home-featured-carousel {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    padding: 0.75rem;
}

.home-featured-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.home-featured-filter-panel {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: color-mix(in srgb, var(--bg-secondary) 72%, var(--bg-primary) 28%);
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.35rem 0.75rem;
}

.home-featured-slide {
    background: #111;
}

.home-featured-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.home-featured-space,
.home-featured-event {
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.28);
}

.neighbors-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.neighbors-col {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.9rem;
}

.neighbor-card {
    display: grid;
    grid-template-columns: minmax(120px, 200px) minmax(0, 1fr);
    gap: 0.9rem;
    align-items: stretch;
}

.neighbor-card-image-wrap {
    border-radius: 8px;
    overflow: hidden;
}

.neighbor-card-image {
    width: 100%;
    height: 100%;
    min-height: 170px;
    object-fit: cover;
}

.neighbor-card-content h3 {
    margin: 0 0 0.2rem;
}

.neighbor-card-about {
    margin: 0.45rem 0 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.home-events-section .events-widget {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem;
    background: var(--bg-secondary);
}

.home-side-by-side-cards .events-widget.events-widget-no-upcoming {
    grid-template-columns: 1fr;
    margin: 0;
}

.home-side-by-side-cards .home-calendar-col .events-widget-main {
    padding: 0.7rem;
}

.home-mini-calendar-months {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

.home-card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.45rem;
}

.home-card-header-row h2,
.home-card-header-row h3 {
    margin: 0;
}

.home-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.home-calendar-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.mini-month {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    padding: 0.4rem;
}

.mini-month-head {
    display: grid;
    grid-template-columns: 1.5rem 1fr 1.5rem;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.mini-month-head strong {
    text-align: center;
}

.mini-month-nav {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    padding: 0;
    line-height: 1;
}

.mini-month-nav:hover,
.mini-month-nav:focus-visible {
    color: var(--text-primary);
    background: color-mix(in srgb, var(--primary-color) 18%, transparent);
}

.mini-month-nav-spacer {
    width: 1.4rem;
    height: 1.4rem;
    display: inline-block;
}

.mini-month-weekdays,
.mini-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.14rem;
}

.mini-month-weekdays span {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.mini-day {
    text-align: center;
    color: var(--text-primary);
    font-size: 0.82rem;
    line-height: 1.45;
    border-radius: 4px;
    padding: 0.06rem 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.mini-day-empty {
    visibility: hidden;
}

.mini-day.has-events {
    font-weight: 700;
    background: color-mix(in srgb, var(--primary-color) 18%, transparent);
}

.mini-day.is-selected {
    outline: 1px solid var(--primary-color);
    background: color-mix(in srgb, var(--primary-color) 28%, transparent);
}

.mini-day.is-today {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text-primary) 55%, transparent);
}

.mini-day:hover,
.mini-day:focus-visible {
    background: color-mix(in srgb, var(--primary-color) 26%, transparent);
}

.home-mini-day-events {
    margin-top: 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    padding: 0.45rem;
}

.home-mini-day-events-head {
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.home-mini-day-events-body {
    max-height: 180px;
    overflow-y: auto;
}

.home-mini-day-event-row {
    display: grid;
    grid-template-columns: 5.8rem 1fr;
    gap: 0.5rem;
    padding: 0.2rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 70%, transparent);
}

.home-mini-day-event-row:last-child {
    border-bottom: 0;
}

.home-mini-day-event-time {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.home-mini-day-event-title {
    font-size: 0.9rem;
}

@media (max-width: 820px) {
    .home-mini-calendar-months {
        grid-template-columns: 1fr;
    }
}

.bible-reader-shell {
    max-width: 980px;
    --bible-font-family: system-ui, sans-serif;
    --bible-font-size: 18px;
    --bible-text-color: #f3f4f6;
    --bible-bg-color: #1f2937;
    --bible-highlight-color: #4e6fa8;
    --bible-verse-number-color: #c78a17;
}

.bible-compact-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
    flex-wrap: wrap;
}

.bible-compact-nav .breadcrumbs {
    margin: 0;
}

.bible-compact-nav--hub {
    align-items: flex-start;
}

.bible-compact-nav--hub .page-header {
    min-width: 0;
}

.bible-reader-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    margin-bottom: 0.75rem;
}

.bible-chapter-input {
    max-width: 110px;
}

.bible-reader-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.bible-toggle-group {
    display: inline-flex;
    gap: 0.3rem;
    padding: 0.2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: color-mix(in srgb, var(--bg-secondary) 70%, transparent);
}

.bible-toggle-group .btn.active {
    border-color: var(--primary-color);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-color) 40%, transparent);
}

.bible-settings-panel {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.6rem;
    margin-bottom: 0.7rem;
    background: color-mix(in srgb, var(--bg-secondary) 75%, transparent);
}

.bible-font-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.6rem;
}

#bibleFindInput {
    min-width: 210px;
    padding: 0.45rem 0.55rem;
}

.bible-inline-check {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.88rem;
}

.bible-inline-check[hidden] {
    display: none !important;
}

.bible-panes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.8rem;
}

.bible-panes.is-parallel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.bible-pane {
    min-width: 0;
}

.bible-pane.is-hidden {
    display: none;
}

.bible-pane-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
}

.bible-pane-toolbar select,
.bible-pane-toolbar input[type="number"] {
    padding: 0.36rem 0.45rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    height: 32px;
    box-sizing: border-box;
}

.bible-reader-content {
    border: 1px solid var(--border-color);
    background: var(--bible-bg-color);
    color: var(--bible-text-color);
    border-radius: 10px;
    padding: 1rem;
    line-height: 1.65;
    font-family: var(--bible-font-family);
    font-size: var(--bible-font-size);
    min-height: 260px;
}

.bible-commentary-chapter-intro {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.92em;
    line-height: 1.55;
}

.bible-heading {
    margin: 1rem 0 0.45rem;
    font-size: 1.08rem;
}

.bible-verse {
    margin: 0;
}

.bible-panes[data-mode="paragraph"] .bible-reader-content .bible-verse {
    display: inline;
}

.bible-panes[data-mode="paragraph"] .bible-reader-content .bible-verse + .bible-verse::before {
    content: " ";
}

.bible-panes[data-mode="paragraph"] .bible-reader-content .bible-line-break {
    display: block;
    height: 0.85rem;
}

.bible-panes[data-mode="paragraph"] .bible-line-break + .bible-verse .bible-verse-text::before {
    content: "    ";
}

.bible-panes[data-mode="paragraph"] .bible-reader-content .bible-verse.bible-verse-paragraph-start {
    display: block;
    margin-top: 0.5rem;
}

.bible-panes[data-mode="paragraph"] .bible-reader-content .bible-verse.bible-verse-paragraph-start .bible-verse-text::before {
    content: "    ";
}

.bible-panes[data-mode="wrapped"] .bible-reader-content .bible-verse {
    display: flex;
    gap: 0.6rem;
    margin: 0.15rem 0;
}

.bible-panes[data-mode="wrapped"] .bible-reader-content .bible-line-break {
    height: 0.35rem;
}

.bible-verse-num {
    color: var(--bible-verse-number-color);
    font-size: 0.82em;
    font-weight: 700;
    margin-right: 0.2rem;
}

.bible-verse.is-verse-selected {
    background: color-mix(in srgb, var(--bible-highlight-color) 40%, transparent);
    border-radius: 4px;
}

.bible-find-mark {
    background: rgba(255, 230, 120, 0.45);
    color: inherit;
    border-radius: 3px;
    padding: 0 0.08rem;
}

@media (max-width: 980px) {
    .bible-panes,
    .bible-panes.is-parallel {
        grid-template-columns: 1fr;
    }
}

body.bible-reader-full-width .main-content {
    max-width: none;
    padding: 1rem 1.2rem 4rem;
}

body.bible-reader-full-width .form-page.bible-reader-shell {
    max-width: none;
    width: 100%;
}

.bible-chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.45rem;
}

body.bible-reader-page:not(.bible-reader-dual) .main-content {
    max-width: 1200px;
}

body.bible-reader-page.bible-reader-dual .main-content {
    max-width: none;
    padding-left: 1rem;
    padding-right: 1rem;
}

body.bible-reader-page.bible-reader-dual .form-page.bible-reader-shell {
    max-width: none;
    width: 100%;
}

body.bible-reader-page.bible-reader-full-width .main-content {
    max-width: none;
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (max-width: 900px) {
    .neighbors-grid {
        grid-template-columns: 1fr;
    }
    .neighbor-card {
        grid-template-columns: 1fr;
    }
}

/* Directory Controls */
.directory-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.church-search-autocomplete {
    position: relative;
    min-width: 260px;
}

.church-search-autocomplete input {
    width: 100%;
    height: 38px;
    box-sizing: border-box;
}

.church-search-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 14000;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    max-height: 18.4rem; /* about 8 rows */
    overflow-y: auto;
}

.church-search-suggestions.is-open {
    display: block;
}

.church-search-suggestion-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    padding: 0.5rem 0.65rem;
    cursor: pointer;
}

.church-search-suggestion-item:hover,
.church-search-suggestion-item:focus-visible {
    background: var(--bg-tertiary);
}

.search-form input,
.search-form select {
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
}

.view-controls {
    display: flex;
    gap: 0.5rem;
}

.view-controls select {
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
}

.church-directory-per-page-select {
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
}

.church-directory-link {
    color: var(--text-primary);
    text-decoration: none;
}

.church-directory-link:hover,
.church-directory-link:focus-visible {
    color: var(--primary-color);
    text-decoration: underline;
}

.churches-grid .church-directory-name-link,
.businesses-grid .church-directory-name-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.churches-grid .church-directory-name-link:hover,
.churches-grid .church-directory-name-link:focus-visible,
.businesses-grid .church-directory-name-link:hover,
.businesses-grid .church-directory-name-link:focus-visible {
    color: var(--text-primary);
    text-decoration: none;
    opacity: 0.85;
}

.churches-grid .church-location-line,
.churches-grid .church-location-line .church-directory-link,
.churches-grid .phone .church-directory-link,
.businesses-grid .church-location-line,
.businesses-grid .church-location-line .church-directory-link,
.businesses-grid .phone .church-directory-link {
    color: var(--primary-color);
}

.churches-grid .church-location-line .church-directory-link:hover,
.churches-grid .church-location-line .church-directory-link:focus-visible,
.churches-grid .phone .church-directory-link:hover,
.churches-grid .phone .church-directory-link:focus-visible,
.businesses-grid .church-location-line .church-directory-link:hover,
.businesses-grid .church-location-line .church-directory-link:focus-visible,
.businesses-grid .phone .church-directory-link:hover,
.businesses-grid .phone .church-directory-link:focus-visible {
    color: var(--primary-color);
    text-decoration: none;
    opacity: 0.85;
}

.churches-grid .card-content h3,
.businesses-grid .card-content h3 {
    font-weight: 400;
}

.churches-page .church-card > a > img,
.churches-page .church-card > img,
.businesses-page .business-card > a > img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

.churches-page .church-directory-address,
.businesses-page .church-directory-address {
    color: var(--text-secondary);
}

.churches-page .church-location-line,
.businesses-page .church-location-line {
    margin-bottom: 0.35rem;
}

.churches-page .church-list-phone,
.businesses-page .church-list-phone {
    min-width: 145px;
    white-space: nowrap;
}

.church-directory-website-link {
    color: #4a9eff;
    text-decoration: none;
}

.church-directory-website-link:hover,
.church-directory-website-link:focus-visible {
    color: #6bb3ff;
    text-decoration: underline;
}

.church-denom-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-width: 38px;
    padding: 0.25rem;
    line-height: 1;
}

.church-denom-filter-btn span[aria-hidden="true"] {
    font-size: 1.5rem;
}

.church-city-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    width: 38px;
    min-width: 38px;
    padding: 0.25rem;
    line-height: 1;
}

.church-city-filter-btn span[aria-hidden="true"] {
    font-size: 1.25rem;
}

.church-location-modal-panel p {
    margin: 0.75rem 0 0.5rem;
    color: var(--text-secondary);
}

.church-directory-clear-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    align-self: center;
    margin-left: 0.25rem;
}

.church-directory-clear-link:hover,
.church-directory-clear-link:focus-visible {
    color: #6bb3ff;
    text-decoration: underline;
}

.church-filter-toggle {
    display: none;
}

.city-modal-options { margin-bottom: 1rem; }

.denomination-modal-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.denomination-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 0.5rem 1rem;
    max-height: 45vh;
    overflow: auto;
    margin-bottom: 1rem;
    padding-right: 0.25rem;
}

.denomination-option {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.pagination .pagination-link {
    color: var(--text-primary);
    border-color: var(--border-color);
    background: var(--bg-tertiary);
}

.pagination .pagination-link:hover,
.pagination .pagination-link:focus-visible {
    color: #fff;
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Favorites */
.btn-favorite {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 38px; /* Match standard button height */
    box-sizing: border-box;
    transition: none; /* Prevent style changes on click */
}

.btn-favorite .favorite-star {
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    display: inline-block;
    flex-shrink: 0; /* Prevent star from changing size */
}

.btn-favorite.active .favorite-star {
    color: #ffd700 !important; /* Yellow for favorited star */
}

.btn-favorite:not(.active) .favorite-star {
    color: var(--text-secondary) !important; /* Ensure white/light color when not active */
}

.btn-favorite .favorite-text {
    font-size: 0.875rem;
    flex-shrink: 0; /* Prevent text from changing size */
}

.btn-edit-church {
    height: 38px; /* Match favorite button height */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-align: center;
}

.detail-actions-sidebar {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.staff-table td:last-child {
    white-space: nowrap;
}

.staff-table .btn-small {
    color: #4a9eff; /* Light blue for better visibility on dark background */
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    margin-right: 0.75rem;
}

.staff-table .btn-small:last-child {
    margin-right: 0;
}

.staff-table .btn-small:hover {
    color: #6bb3ff; /* Lighter blue on hover */
    text-decoration: none;
}

.staff-table .btn-small.btn-danger {
    color: #ffffff !important; /* White for delete links */
}

.staff-table .btn-small.btn-danger:hover {
    color: #ffcccc !important; /* Light pink on hover */
}

/* Sort order controls */
.sort-controls {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sort-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 3px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.sort-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.staff-item-wrapper,
.gallery-item-wrapper,
.recording-item-wrapper {
    position: relative;
    display: inline-block;
}

.staff-item-wrapper .staff-thumbnail-link,
.gallery-item-wrapper .gallery-thumbnail,
.recording-item-wrapper .recording-item {
    position: relative;
}

/* Recordings table */
.recordings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.recordings-table th,
.recordings-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.recordings-table th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.recordings-table td {
    vertical-align: middle;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-toggle {
        display: inline-flex;
    }
    
    /* Gallery carousel responsive */
    .gallery-thumbnail {
        width: 150px;
        height: 112px;
    }
    
    .gallery-nav {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .lightbox-prev {
        left: 0.5rem;
    }
    
    .lightbox-next {
        right: 0.5rem;
    }
    
    .lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .navbar-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 1rem;
        display: none;
        max-height: calc(100dvh - 72px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    
    .navbar-menu.active {
        display: flex;
    }
    
    .navbar-nav {
        flex-direction: column;
        width: 100%;
    }
    .navbar-submenu {
        position: static;
        display: none;
        border: 0;
        box-shadow: none;
        padding: 0.25rem 0 0.5rem 0.75rem;
        min-width: 0;
        max-width: 100%;
        max-height: none;
        overflow: visible;
    }
    .navbar-dropdown.is-open .navbar-submenu {
        display: block;
    }

    .pagination {
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 0.75rem;
        row-gap: 0.65rem;
        align-items: center;
    }

    .pagination > :not(.pagination-controls) {
        grid-row: 1;
    }

    .pagination > .pagination-controls {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        justify-content: center;
        flex-wrap: nowrap;
        gap: 0.45rem;
    }

    .pagination > span:first-of-type {
        justify-self: start;
    }

    .pagination > .pagination-record-count {
        justify-self: end;
        text-align: right;
        white-space: nowrap;
    }

    .pagination > span {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        white-space: nowrap;
    }

    .pagination-page-form {
        white-space: nowrap;
    }
    
    .detail-content {
        grid-template-columns: 1fr;
    }
    
    .churches-grid,
    .businesses-grid,
    .articles-grid,
    .events-grid {
        grid-template-columns: 1fr;
    }
    
    .directory-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .voices-page-header {
        gap: 0.55rem;
    }

    .voices-header-row-breadcrumbs {
        margin-bottom: 0;
    }

    .voices-header-row-title {
        flex-wrap: nowrap;
        align-items: center;
    }

    .voices-header-row-title h1 {
        min-width: 0;
        font-size: 1.5rem;
        line-height: 1.2;
    }

    .voices-header-row-title .btn {
        flex-shrink: 0;
    }

    .voices-header-row-description {
        margin-top: 0.1rem;
    }

    .directory-controls--church .church-filter-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .directory-controls--church .view-controls {
        width: 100%;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .directory-controls--church .view-controls select {
        min-width: 0;
        flex: 1 1 auto;
    }

    .directory-controls--church .search-filters {
        width: 100%;
    }

    .directory-controls--church .search-filters.is-collapsed {
        display: none;
    }

    .directory-controls--church .search-filters.is-expanded {
        display: block;
    }

    .directory-controls--church .search-form {
        flex-wrap: wrap;
        align-items: center;
    }

    .directory-controls--church .church-search-autocomplete {
        min-width: 0;
        flex: 1 1 100%;
    }

    .directory-controls--church .church-directory-clear-link {
        margin-left: auto;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .church-detail-page.detail-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .church-detail-page .church-detail-header {
        grid-column: 1;
        grid-row: 1;
    }

    .church-detail-page .detail-sidebar {
        grid-column: 1;
        grid-row: 2;
        position: static;
    }

    /* Keep a positioning context so ::before scrim aligns on narrow layout */
    .church-detail-surface-tuned .church-detail-page .detail-sidebar {
        position: relative;
    }

    .church-detail-page .detail-main {
        grid-column: 1;
        grid-row: 3;
        margin-top: 0.75rem;
    }

    .admin-layout,
    .events-widget {
        grid-template-columns: 1fr;
    }

    /* Let action buttons wrap below helper text on narrow screens */
    .gallery-toolbar-single-row {
        flex-wrap: wrap;
        align-items: flex-start;
    }
    .gallery-toolbar-single-row .btn.btn-primary {
        margin-left: 0;
    }

    /* Church edit table column reductions for smaller screens */
    .church-gallery-edit-table .gallery-meta-cell,
    .church-gallery-edit-table th.gallery-meta-cell,
    .church-gallery-edit-table td.gallery-meta-cell,
    .church-gallery-edit-table .livestream-col-logo,
    .church-gallery-edit-table .livestream-col-details,
    .church-gallery-edit-table .supporter-col-logo {
        display: none;
    }

    /* Church edit staff table: compact mobile columns */
    .staff-table .staff-col-photo,
    .staff-table .staff-col-title {
        display: none;
    }
}

/* Church detail: messages blog roll, livestream actions, supporters grid, reviews, reminders */
.church-news-blog-roll {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.church-news-blog-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.church-news-blog-card-link {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    padding: 1rem;
}

.church-news-blog-media {
    flex: 0 0 min(100%, 220px);
    max-width: 280px;
}

.church-news-blog-media img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

.church-news-blog-media video {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

.church-news-blog-body {
    flex: 1;
    min-width: 0;
}

.church-news-blog-title {
    margin: 0 0 0.35rem 0;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.church-news-edit-title-ellipsis {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    max-width: 18rem;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.news-breadcrumb-title {
    display: inline-block;
    max-width: min(42ch, calc(100vw - 8rem));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

.church-news-load-sentinel {
    height: 1px;
    margin-top: 0.5rem;
}

.service-item-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.service-item-text {
    flex: 1;
    min-width: 0;
}

.sfc-schedule-actions {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
    flex-shrink: 0;
}

.sfc-icon-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.sfc-icon-action-btn:hover {
    background: var(--primary-color);
    color: var(--bg-primary);
    border-color: var(--primary-color);
}

.sfc-reminder-advance-menu {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    padding: 0.35rem;
    min-width: 10rem;
}

.sfc-reminder-advance-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.65rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    cursor: pointer;
    border-radius: 6px;
}

.sfc-reminder-advance-item:hover {
    background: var(--bg-tertiary);
}

.church-supporters-pager {
    display: block;
}

.church-supporters-grid-viewport {
    flex: 1;
    min-width: 0;
    height: calc(120px * 3 + 1rem * 2 + 1.5rem);
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
}

.church-supporters-grid-inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    grid-auto-rows: 120px;
    gap: 1rem;
    padding: 0.75rem;
    height: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    scroll-behavior: smooth;
    scrollbar-width: auto;
    scrollbar-color: var(--border-color) var(--bg-tertiary);
}

.church-supporters-grid-inner::-webkit-scrollbar {
    width: 11px;
}

.church-supporters-grid-inner::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.church-supporters-grid-inner::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.church-supporters-grid-cell {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.35rem;
    background: var(--bg-tertiary);
}

.church-supporters-grid-cell img {
    max-width: 100%;
    max-height: 64px;
    object-fit: contain;
}

.church-supporters-grid-cell .supporter-name {
    margin-top: 0.45rem;
    width: 100%;
    font-size: 0.82rem;
    line-height: 1.25;
    color: var(--text-primary);
    text-align: center;
}

.church-supporters-grid-prev[disabled],
.church-supporters-grid-next[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
}

.church-reviews-intro {
    max-width: 52rem;
    line-height: 1.5;
}

.church-review-admin-response {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--primary-color);
    background: var(--bg-tertiary);
    border-radius: 0 6px 6px 0;
}

.church-review-admin-response-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.35rem;
}

.church-review-modal .church-review-modal-dialog {
    max-width: 520px;
}

.events-upcoming-item-row,
.events-day-item-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.events-upcoming-item-row .events-upcoming-item-link,
.events-day-item-row .events-day-item-link {
    flex: 1;
    min-width: 0;
}

.events-widget-sfc-actions {
    flex-shrink: 0;
    align-self: center;
}

.sfc-reminder-manager-dialog {
    width: min(720px, 96vw);
    max-height: 88vh;
}

.sfc-reminder-manager-list {
    margin-top: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    max-height: 55vh;
    overflow: auto;
}

.sfc-reminder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.sfc-reminder-item:last-child {
    border-bottom: none;
}

.sfc-reminder-item-main {
    min-width: 0;
}

.sfc-reminder-item-meta {
    font-size: 0.85rem;
    margin-top: 0.2rem;
}


