/* Public Portal Specific Styles (Navbar, Hero, Gallery, Timeline, Map, Warta) */
.mm-top-utility-bar {
    background-color: #f1f5f9;
    border-bottom: 1px solid var(--mm-outline);
    font-size: 0.78rem;
    color: var(--mm-on-surface-variant);
}

.m3-navbar {
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--mm-outline);
}
.navbar-toggler.mm-icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    line-height: 1;
}

.m3-alert-banner {
    background: linear-gradient(90deg, #1e3a5f 0%, #274c77 100%);
    color: #f8fafc;
}
.m3-alert-banner .alert-link {
    color: #fde68a;
}
.m3-alert-banner .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}
.m3-alert-warning-banner {
    background-color: #fffbeb;
    color: #78350f;
    border: 1px solid #fde68a !important;
}
.m3-giving-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #bbf7d0;
}

/* Editorial Hero & Section Banners */
.m3-hero-gradient {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 60%, #e8eff7 100%);
    color: var(--mm-on-surface);
    border-bottom: 1px solid var(--mm-outline);
}
.m3-header-gradient {
    background: linear-gradient(135deg, #1e3a5f 0%, #274c77 100%);
    color: #ffffff;
}
.m3-header-gradient .text-secondary,
.m3-header-gradient .lead {
    color: #dbeafe !important;
}
.m3-cta-gradient {
    background: linear-gradient(135deg, #1e3a5f 0%, #2b5485 100%);
    color: #ffffff;
}

.m3-hero-badge {
    background-color: var(--mm-accent-soft);
    color: var(--mm-accent);
    border: 1px solid rgba(180, 83, 9, 0.2);
    letter-spacing: 0.08em;
}
.m3-header-badge {
    background-color: rgba(255, 255, 255, 0.16);
    color: #fef3c7;
    border: 1px solid rgba(255, 255, 255, 0.22);
}
.m3-highlight-cyan {
    color: var(--mm-accent);
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-weight: 500;
}
.m3-card-backdrop {
    background: #ffffff;
    border: 1px solid var(--mm-outline) !important;
    box-shadow: var(--mm-shadow-hover);
}

/* Pastor & Council Portraits */
.m3-avatar-circle {
    width: 72px;
    height: 72px;
    border: 1px solid rgba(30, 58, 95, 0.15);
    font-family: 'Lora', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 600;
}
.m3-avatar-hero-box {
    width: 100%;
    max-width: 360px;
    height: 400px;
    background: linear-gradient(180deg, #ffffff 0%, #eef2f6 100%);
    border: 1px solid var(--mm-outline);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mm-on-surface);
}
.mm-portrait-monogram {
    width: 88px;
    height: 88px;
    border-radius: 9999px;
    border: 2px solid var(--mm-primary-container);
    background-color: var(--mm-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Lora', Georgia, serif;
    font-size: 2rem;
    color: #ffffff;
}

/* Pinterest Style Masonry Grid */
.m3-pinterest-grid {
    column-count: 1;
    column-gap: 1.5rem;
}
@media (min-width: 576px) {
    .m3-pinterest-grid {
        column-count: 2;
        column-gap: 1.5rem;
    }
}
@media (min-width: 992px) {
    .m3-pinterest-grid {
        column-count: 3;
        column-gap: 1.5rem;
    }
}
@media (min-width: 1400px) {
    .m3-pinterest-grid {
        column-count: 4;
        column-gap: 1.5rem;
    }
}
.m3-pinterest-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    display: inline-block;
    width: 100%;
}
.m3-pinterest-card {
    border-radius: var(--mm-radius-md);
    overflow: hidden;
    background: var(--mm-surface-pure);
    border: 1px solid var(--mm-outline);
    box-shadow: var(--mm-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
}
.m3-pinterest-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--mm-shadow-hover);
    border-color: var(--mm-primary);
}
.m3-pin-h-tall { height: 340px; }
.m3-pin-h-mid { height: 250px; }
.m3-pin-h-wide { height: 220px; }

/* Fullscreen Gallery Lightbox */
.m3-gallery-fullscreen-modal .modal-content {
    background-color: #0b1524;
    color: #f8fafc;
    border: none;
    border-radius: 0;
}
.mm-gallery-modal-header {
    background-color: #070e19;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.m3-gallery-info-pane {
    background: #162338;
    border-radius: var(--mm-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Church History Timeline */
.mm-timeline {
    position: relative;
    padding-left: 2.25rem;
}
.mm-timeline::before {
    content: '';
    position: absolute;
    left: 0.65rem;
    top: 0.45rem;
    bottom: 0.45rem;
    width: 2px;
    background: linear-gradient(180deg, var(--mm-primary) 0%, var(--mm-outline-strong) 100%);
}
.mm-timeline-item {
    position: relative;
    padding-bottom: 1.75rem;
}
.mm-timeline-item:last-child {
    padding-bottom: 0;
}
.mm-timeline-marker {
    position: absolute;
    left: -1.95rem;
    top: 0.35rem;
    width: 14px;
    height: 14px;
    border-radius: 9999px;
    background-color: var(--mm-surface-pure);
    border: 3px solid var(--mm-primary);
}
.mm-timeline-item:first-child .mm-timeline-marker {
    border-color: var(--mm-accent);
    background-color: var(--mm-accent-soft);
}
.mm-timeline-year {
    display: inline-block;
    font-family: 'Lora', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--mm-primary);
    background-color: var(--mm-primary-container);
    padding: 0.15rem 0.7rem;
    border-radius: var(--mm-radius-pill);
    margin-bottom: 0.45rem;
}

/* Location Map Container */
.mm-map-card {
    border-radius: var(--mm-radius-md);
    overflow: hidden;
    border: 1px solid var(--mm-outline);
    background: var(--mm-surface-pure);
}
.mm-map-frame {
    border: 0;
    width: 100%;
    height: 100%;
}

/* WinPoin-Style News Feed & Popular Sidebar */
.mm-news-card {
    background: var(--mm-surface-pure);
    border-radius: var(--mm-radius-md);
    border: 1px solid var(--mm-outline);
    box-shadow: var(--mm-shadow);
    overflow: hidden;
}
.mm-news-thumb {
    position: relative;
    min-height: 220px;
    height: 100%;
    overflow: hidden;
}
.mm-news-thumb-img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
}
@media (min-width: 768px) {
    .mm-news-thumb-img {
        position: absolute;
        inset: 0;
        height: 100%;
    }
}
.mm-news-featured-thumb {
    height: 240px;
    overflow: hidden;
}
img.mm-news-featured-thumb {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}
.mm-article-cover {
    max-height: 420px;
    overflow: hidden;
}
.mm-article-body img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin-block: 1rem;
}
.mm-article-body blockquote {
    border-left: 4px solid var(--mm-primary);
    background-color: var(--mm-surface-container);
    padding: 0.85rem 1.15rem;
    margin-block: 1rem;
    border-radius: 0 0.75rem 0.75rem 0;
    color: var(--mm-on-surface-variant);
    font-style: italic;
}
.mm-article-body pre,
.mm-article-body .ql-code-block-container {
    background-color: #0f172a;
    color: #e2e8f0;
    padding: 1rem 1.25rem;
    margin-block: 1rem;
    border-radius: 0.75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    overflow-x: auto;
}
.mm-article-body .ql-code-block {
    white-space: pre;
}
.mm-article-body code {
    background-color: var(--mm-surface-container);
    color: var(--mm-primary);
    padding: 0.15rem 0.4rem;
    border-radius: 0.35rem;
    font-size: 0.875em;
}
.mm-article-body pre code,
.mm-article-body .ql-code-block-container code {
    background-color: transparent;
    color: inherit;
    padding: 0;
}
.mm-popular-item {
    border-bottom: 1px solid var(--mm-outline);
    padding-bottom: 0.85rem;
    margin-bottom: 0.85rem;
    transition: background-color 0.15s ease;
}
.mm-popular-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* Redesigned Public Schedule Ledger & Timetable */
#heroScheduleCarousel .carousel-item {
    padding: 3px 2px;
}
.mm-hero-ledger-row {
    padding: 0.9rem 1rem;
    border-radius: var(--mm-radius-md);
    background-color: var(--mm-surface-pure);
    border: 1px solid var(--mm-outline);
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}
.mm-hero-ledger-row:hover {
    border-color: var(--mm-primary);
    background-color: #f8fafc;
    transform: translate3d(0, -2px, 0);
}
.mm-hero-ledger-row.is-featured {
    background: linear-gradient(135deg, #f8fafc 0%, #e8eff7 100%);
    border-color: var(--mm-primary);
}
.mm-time-block {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.55rem;
    font-weight: 600;
    line-height: 1;
    color: var(--mm-primary);
    min-width: 78px;
}
.mm-timetable-board {
    background-color: var(--mm-surface-pure);
    border: 1px solid var(--mm-outline);
    border-radius: var(--mm-radius-lg);
    overflow: hidden;
    box-shadow: var(--mm-shadow);
}
.mm-timetable-row {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--mm-outline);
    transition: background-color 0.2s ease;
}
.mm-timetable-row:last-child {
    border-bottom: none;
}
.mm-timetable-row:hover {
    background-color: #f8fafc;
}
.mm-timetable-row.is-featured {
    background: linear-gradient(90deg, rgba(232, 239, 247, 0.55) 0%, #ffffff 100%);
    border-left: 4px solid var(--mm-primary);
}
.mm-timetable-row.is-special {
    background: linear-gradient(90deg, rgba(254, 243, 199, 0.45) 0%, #ffffff 100%);
    border-left: 4px solid var(--mm-accent);
}
.mm-hero-carousel-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: var(--mm-radius-pill);
    background-color: var(--mm-surface);
    border: 1px solid var(--mm-outline);
    color: var(--mm-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s ease;
}
.mm-hero-carousel-btn:hover {
    background-color: var(--mm-primary);
    border-color: var(--mm-primary);
    color: #ffffff;
}
.mm-hero-carousel-dots {
    position: static;
    margin: 0;
    gap: 0.35rem;
}
.mm-hero-carousel-dots [data-bs-target] {
    width: 22px;
    height: 4px;
    border-radius: var(--mm-radius-pill);
    background-color: var(--mm-outline-strong);
    border: 0;
    margin: 0;
    opacity: 0.6;
    transition: all 0.2s ease;
}
.mm-hero-carousel-dots .active {
    background-color: var(--mm-primary);
    width: 32px;
    opacity: 1;
}
.mm-timetable-time-col {
    min-width: 145px;
}
.mm-timetable-clock {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.9rem;
    font-weight: 600;
    line-height: 1;
    color: var(--mm-primary);
}
.mm-hours-row {
    padding: 0.75rem 0.9rem;
    border-radius: var(--mm-radius-sm);
    background-color: var(--mm-surface);
    border: 1px solid var(--mm-outline);
}
.mm-hours-row.is-closed {
    background-color: #fef2f2;
    border-color: #fecaca;
}

/* Deep Sanctuary Navy Architectural Footer */
.mm-footer {
    background: linear-gradient(180deg, #162b47 0%, #0f1f33 100%);
    color: #cbd5e1;
}
.mm-footer-highlight-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--mm-radius-md);
    padding: 1rem 1.25rem;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.mm-footer-highlight-card:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(253, 230, 138, 0.4);
}
.mm-footer-brand-badge {
    width: 36px;
    height: 36px;
    border-radius: var(--mm-radius-sm);
    background: rgba(253, 230, 138, 0.14);
    border: 1px solid rgba(253, 230, 138, 0.35);
    color: #fde68a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}
.mm-footer-heading {
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}
.mm-footer-link {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.15s ease, transform 0.15s ease;
    display: inline-block;
}
.mm-footer-link:hover {
    color: #fde68a;
    transform: translateX(3px);
}
.mm-footer-social-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border-radius: var(--mm-radius-pill);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #f8fafc;
    text-decoration: none;
    transition: all 0.2s ease;
}
.mm-footer-social-btn:hover {
    background-color: #fde68a;
    border-color: #fde68a;
    color: #0f1f33;
    transform: translateY(-2px);
}
.mm-footer-time-pill {
    background: rgba(255, 255, 255, 0.08);
    color: #fde68a;
    border-radius: var(--mm-radius-pill);
    padding: 0.15rem 0.6rem;
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}
.mm-footer-divider {
    border-color: rgba(255, 255, 255, 0.12);
    opacity: 1;
}

/* Home Pastoral Quick-Info Section */
.mm-cta-section {
    background: linear-gradient(180deg, #eef2f6 0%, #e5ecf4 100%);
    color: var(--mm-on-surface);
    border-top: 1px solid var(--mm-outline);
}
.mm-cta-glass-card {
    background: var(--mm-surface-pure);
    border: 1px solid var(--mm-outline);
    border-radius: var(--mm-radius-md);
    box-shadow: var(--mm-shadow);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.mm-cta-glass-card:hover {
    border-color: var(--mm-primary);
    box-shadow: var(--mm-shadow-hover);
    transform: translateY(-2px);
}

/* Performance: Skip layout/paint of offscreen sections until scrolled */
main > section:not(:first-child),
footer.mm-footer {
    content-visibility: auto;
    contain-intrinsic-size: auto 360px;
}

/* Seksi Badge Pills inside Profile Hover Overlay */
.mm-seksi-pill {
    display: inline-block;
    background-color: var(--mm-surface);
    border: 1px solid var(--mm-outline);
    color: var(--mm-on-surface-variant);
    border-radius: var(--mm-radius-pill);
    padding: 0.2rem 0.65rem;
    font-size: 0.74rem;
    font-weight: 500;
}
.mm-seksi-pill.is-overlay {
    background-color: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
    color: #f8fafc;
}

/* Profile Card CSS Hover Effect (GPU Rounded Clipping Fix) */
.mm-profile-hover-card {
    position: relative;
    height: 400px;
    border-radius: var(--mm-radius-lg);
    overflow: hidden;
    clip-path: inset(0 round var(--mm-radius-lg));
    isolation: isolate;
    transform: translateZ(0);
    background-color: #152b47;
    border: 1px solid var(--mm-outline);
    box-shadow: var(--mm-shadow);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.3s ease;
    cursor: pointer;
}
.mm-profile-hover-card.is-compact {
    height: 340px;
}
.mm-profile-hover-card:hover,
.mm-profile-hover-card:focus-within {
    transform: translate3d(0, -5px, 0);
    box-shadow: 0 20px 38px -10px rgba(15, 31, 51, 0.28);
    border-color: var(--mm-primary);
}
.mm-profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transform: scale(1);
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.mm-profile-hover-card:hover .mm-profile-photo,
.mm-profile-hover-card:focus-within .mm-profile-photo {
    transform: scale(1.06);
}
.mm-profile-top-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 3;
    background: rgba(15, 31, 51, 0.88);
    color: #fde68a;
    border: 1px solid rgba(253, 230, 138, 0.3);
    border-radius: var(--mm-radius-pill);
    padding: 0.28rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.mm-profile-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    color: #ffffff;
    background: linear-gradient(180deg, rgba(15, 31, 51, 0) 25%, rgba(15, 31, 51, 0.65) 62%, rgba(15, 31, 51, 0.96) 100%);
    transition: background-color 0.35s ease;
}
.mm-profile-hover-card:hover .mm-profile-overlay,
.mm-profile-hover-card:focus-within .mm-profile-overlay {
    background: linear-gradient(180deg, rgba(15, 31, 51, 0.3) 0%, rgba(15, 31, 51, 0.82) 45%, rgba(15, 31, 51, 0.97) 100%);
}
.mm-profile-role {
    color: #fde68a;
    font-size: 0.82rem;
    font-weight: 600;
}
.mm-profile-bio {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(14px);
    transition: max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), margin-top 0.35s ease;
}
.mm-profile-hover-card:hover .mm-profile-bio,
.mm-profile-hover-card:focus-within .mm-profile-bio {
    max-height: 220px;
    opacity: 1;
    transform: translateY(0);
    margin-top: 0.75rem;
}
@media (hover: none) {
    .mm-profile-bio {
        max-height: 220px;
        opacity: 1;
        transform: translateY(0);
        margin-top: 0.6rem;
    }
}

/* Big News & Announcement Banner Carousel */
.mm-news-banner-carousel {
    border: 1px solid var(--mm-outline);
    background-color: var(--mm-surface-pure);
}
.mm-news-banner-slide {
    background: linear-gradient(135deg, #1e3a5f 0%, #2b5485 100%);
    height: 310px;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.mm-news-banner-slide > .row {
    width: 100%;
}
.mm-news-banner-slide.is-warm {
    background: linear-gradient(135deg, #78350f 0%, #b45309 100%);
}
.mm-news-banner-slide.is-sage {
    background: linear-gradient(135deg, #14532d 0%, #166534 100%);
}
.mm-news-banner-title,
.mm-news-banner-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (min-width: 992px) {
    .mm-news-banner-slide {
        height: 225px;
    }
}
.mm-news-banner-controls {
    background-color: var(--mm-surface-pure);
    border-top: 1px solid var(--mm-outline);
}

/* Floating Back to Top Button (Bottom Right) */
.mm-back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 46px;
    height: 46px;
    padding: 0;
    z-index: 1030;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--mm-primary);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, 16px, 0);
    transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.2s ease;
}
.mm-back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
}
.mm-back-to-top:hover,
.mm-back-to-top:focus-visible {
    background-color: var(--mm-primary-hover);
    color: #ffffff;
    transform: translate3d(0, -2px, 0);
}
