/**
 * Homepage Styles — Ubi Missa
 * Dark navy + gold palette, fluid clamp() typography, modern Catholic feel
 * Note: base.css provides reset, :root tokens, and body styles.
 */

body {
    background: linear-gradient(180deg,
        var(--color-bg-gradient-start, #0c1929) 0%,
        var(--color-bg-gradient-mid, #1a2744) 50%,
        var(--color-bg-gradient-end, #0f1d30) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Hero ── */

.hero {
    padding: clamp(90px, 12vw, 130px) 24px clamp(32px, 4vw, 48px);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-icon {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    filter: drop-shadow(0 4px 24px rgba(255, 215, 0, 0.4));
}

.hero-icon svg {
    width: clamp(48px, 8vw, 72px);
    height: clamp(48px, 8vw, 72px);
}

.hero h1 {
    font-family: var(--font-serif, 'Crimson Text', serif);
    font-size: clamp(32px, 6vw, 56px);
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.hero h1 span {
    color: #FFD700;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(16px, 2.2vw, 20px);
    color: var(--color-text-secondary, #94a3b8);
    margin-bottom: 12px;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-welcome {
    font-size: clamp(14px, 1.8vw, 16px);
    color: var(--color-text-tertiary, #64748b);
    margin-bottom: 36px;
    line-height: 1.5;
    font-style: italic;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Trust Bar ── */

.trust-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    row-gap: 8px;
    padding: 16px 24px;
    max-width: 600px;
    margin: 0 auto clamp(24px, 3vw, 40px);
}

.trust-stat {
    font-size: var(--text-sm, 14px);
    color: var(--color-text-secondary, #94a3b8);
    letter-spacing: 0.3px;
}

.trust-stat strong {
    color: #FFD700;
    font-weight: 700;
}

.trust-divider {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-text-tertiary, #64748b);
    flex-shrink: 0;
}

/* ── CTA Buttons ── */

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.btn {
    padding: 16px 32px;
    border-radius: 12px;
    min-height: 44px;
    font-weight: 600;
    font-size: clamp(15px, 1.8vw, 17px);
    text-decoration: none;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a2e;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
}

.secondary-ctas {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin-top: 8px;
}

.btn-text {
    color: var(--color-text-secondary, #94a3b8);
    font-weight: 500;
    font-size: 15px;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(148, 163, 184, 0.4);
    transition: all 0.2s ease;
}

.btn-text:hover {
    color: #FFD700;
    text-decoration-color: rgba(255, 215, 0, 0.6);
}

/* ── Churches Near You ── */

.next-mass-section {
    padding: 0 24px clamp(32px, 4vw, 48px);
    max-width: 700px;
    margin: 0 auto;
}

.next-mass-heading {
    font-family: var(--font-serif, 'Crimson Text', serif);
    font-size: clamp(20px, 2.8vw, 26px);
    color: #ffffff;
    text-align: center;
    margin-bottom: clamp(16px, 2vw, 24px);
}

.next-mass-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: clamp(16px, 2vw, 24px);
}

.next-mass-tab {
    padding: 8px 20px;
    border-radius: 8px;
    min-height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: var(--color-text-secondary, #94a3b8);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.next-mass-tab:hover { border-color: rgba(255, 215, 0, 0.3); color: #ffffff; }

.next-mass-tab.active {
    background: rgba(255, 215, 0, 0.12);
    border-color: rgba(255, 215, 0, 0.4);
    color: #FFD700;
    font-weight: 600;
}

.next-mass-see-more {
    text-align: center;
    margin-top: 12px;
}

.next-mass-see-more a {
    color: var(--color-text-secondary, #94a3b8);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.next-mass-see-more a:hover { color: #FFD700; }

.next-mass-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.next-mass-time-heading {
    font-size: 13px;
    font-weight: 600;
    color: #FFD700;
    margin-top: 16px;
    margin-bottom: 4px;
}
.next-mass-time-heading:first-child {
    margin-top: 0;
}

.next-mass-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px 20px;
    transition: border-color 0.2s, background 0.2s;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.next-mass-card:hover {
    border-color: rgba(255, 215, 0, 0.25);
    background: rgba(255, 255, 255, 0.06);
}

.next-mass-info { flex: 1; min-width: 0; }

.next-mass-name {
    font-weight: 600;
    font-size: 15px;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.next-mass-detail {
    font-size: 13px;
    color: var(--color-text-secondary, #94a3b8);
    margin-top: 2px;
}

.next-mass-time { color: #FFD700; font-weight: 600; }

.next-mass-directions {
    color: var(--color-text-secondary, #94a3b8);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    min-height: 36px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.next-mass-directions:hover {
    color: #FFD700;
    border-color: rgba(255, 215, 0, 0.3);
}

.next-mass-fallback {
    text-align: center;
    padding: 20px;
    color: var(--color-text-secondary, #94a3b8);
    font-size: 14px;
}

.next-mass-fallback a { color: #FFD700; text-decoration: underline; text-underline-offset: 2px; }

/* Skeleton loading */
.next-mass-skeleton {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px 20px;
}

.skeleton-line {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.06) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-name { width: 60%; margin-bottom: 8px; }
.skeleton-detail { width: 45%; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Liturgy Feature Cards ── */

.liturgy-features {
    padding: clamp(48px, 6vw, 80px) 24px clamp(32px, 4vw, 60px);
    max-width: 1100px;
    margin: 0 auto;
}

.liturgy-features h2 {
    font-family: var(--font-serif, 'Crimson Text', serif);
    font-size: clamp(24px, 3.5vw, 32px);
    text-align: center;
    margin-bottom: clamp(32px, 4vw, 48px);
    color: #ffffff;
}

.liturgy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.liturgy-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 28px 24px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.liturgy-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--card-accent-color) 0%, transparent 100%);
    opacity: 0.8;
}

.liturgy-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
}

.liturgy-card-mass { --card-accent-color: #22C55E; }
.liturgy-card-confession { --card-accent-color: #A855F7; }
.liturgy-card-adoration { --card-accent-color: #F59E0B; }

.liturgy-icon { color: var(--card-accent-color); margin-bottom: 16px; }
.liturgy-icon svg { width: 36px; height: 36px; }

.liturgy-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.liturgy-card .liturgy-desc {
    color: var(--color-text-secondary, #94a3b8);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
}

.liturgy-cta {
    color: var(--card-accent-color);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
}

.liturgy-cta .arrow { transition: transform 0.2s ease; }
.liturgy-card:hover .liturgy-cta .arrow { transform: translateX(4px); }

/* ── Browse Section ── */

.browse-section {
    padding: clamp(40px, 5vw, 60px) 24px;
    text-align: center;
    max-width: 1100px;
    margin: 0 auto;
}

.browse-map-view { max-width: 600px; margin: 0 auto; }

.browse-section h2 {
    font-family: var(--font-serif, 'Crimson Text', serif);
    font-size: clamp(22px, 3vw, 28px);
    color: #ffffff;
    margin-bottom: 12px;
}

.browse-subtitle {
    color: var(--color-text-secondary, #94a3b8);
    font-size: 15px;
    margin-bottom: 24px;
}

.browse-map {
    margin: 20px auto 24px;
    text-align: left;
    max-width: 720px;
    width: 100%;
}

.browse-map-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 12px;
}

.browse-map-label { color: #e2e8f0; font-size: 14px; font-weight: 600; }

.browse-map-cta {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    min-height: 40px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.browse-map-cta:hover { border-color: rgba(255, 215, 0, 0.5); color: #FFD700; }

.home-mini-map {
    height: clamp(220px, 30vw, 320px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    background: rgba(15, 23, 42, 0.6);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.home-mini-map .mini-marker-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: #f0c674; border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.home-mini-map .leaflet-control-zoom a {
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.home-mini-map .leaflet-control-zoom a:hover { background: rgba(255, 255, 255, 0.1); }

.home-mini-map .leaflet-popup-content-wrapper {
    background: rgba(15, 23, 42, 0.95);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
}

.home-mini-map .leaflet-popup-tip { background: rgba(15, 23, 42, 0.95); }

.home-mini-map .mini-popup-meta {
    margin-top: 3px;
    font-size: 11px;
    color: #cbd5e1;
}

.home-mini-map .mini-popup-meta-confession {
    color: #93c5fd;
}

.home-mini-map .mini-popup-meta-adoration {
    color: #a7f3d0;
}

/* ── Diocese Directory (Global) ── */

.diocese-search-container { max-width: 500px; margin: 0 auto 24px; }

.diocese-search-input {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    font-family: inherit;
}

.diocese-search-input::placeholder { color: var(--color-text-tertiary, #64748b); }
.diocese-search-input:focus { border-color: rgba(255, 215, 0, 0.5); background: rgba(255, 255, 255, 0.08); }

.filter-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.filter-tab {
    padding: 8px 20px;
    border-radius: 8px;
    min-height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text-secondary, #94a3b8);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.filter-tab:hover { border-color: rgba(255, 215, 0, 0.3); color: #ffffff; }

.filter-tab.active {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border-color: transparent;
    color: #1a1a2e;
    font-weight: 600;
}

.diocese-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
    text-align: left;
}

.diocese-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
}

.diocese-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 215, 0, 0.25);
    background: rgba(255, 255, 255, 0.06);
}

.diocese-card-name {
    font-family: var(--font-serif, 'Crimson Text', serif);
    font-size: 17px;
    font-weight: 600;
    color: #FFD700;
    margin-bottom: 4px;
    line-height: 1.3;
}

.diocese-card-meta {
    font-size: 13px;
    color: var(--color-text-secondary, #94a3b8);
    margin-bottom: 8px;
}

.diocese-card-count { font-size: 14px; color: var(--color-text-tertiary, #64748b); }
.diocese-card-count strong { color: #ffffff; font-weight: 600; }

.diocese-loading, .diocese-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 24px;
    color: var(--color-text-secondary, #94a3b8);
    font-size: 15px;
}

/* ── Signup Section ── */

.signup-section {
    padding: clamp(40px, 5vw, 60px) 24px clamp(60px, 7vw, 80px);
    max-width: 700px;
    margin: 0 auto;
}

.signup-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: clamp(28px, 4vw, 48px);
    text-align: center;
}

.signup-box h2 {
    font-family: var(--font-serif, 'Crimson Text', serif);
    font-size: clamp(22px, 3vw, 28px);
    color: #ffffff;
    margin-bottom: 10px;
}

.signup-box p {
    color: var(--color-text-secondary, #94a3b8);
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.5;
}

.signup-box .privacy-note {
    color: var(--color-text-tertiary, #64748b);
    font-size: 12px;
    margin-top: 16px;
}

.signup-box .privacy-link {
    color: var(--color-text-tertiary, #64748b);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.signup-box .privacy-link:hover { color: var(--color-text-secondary, #94a3b8); }

.signup-form {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.signup-form input[type="email"] {
    padding: 14px 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    font-size: 15px;
    width: 280px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.signup-form input[type="email"]::placeholder,
.signup-form .signup-location-input::placeholder { color: var(--color-text-tertiary, #64748b); }

.signup-form input[type="email"]:focus,
.signup-form .signup-location-input:focus { border-color: rgba(255, 215, 0, 0.5); background: rgba(255, 255, 255, 0.08); }

.signup-location-input {
    padding: 14px 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    font-size: 15px;
    width: 200px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.signup-form button {
    padding: 14px 28px;
    border-radius: 10px;
    min-height: 44px;
    border: none;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a2e;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.signup-form button:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(255, 215, 0, 0.35); }
.signup-form button:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.signup-message { margin-top: 16px; font-size: 14px; min-height: 20px; }
.signup-message.success { color: #4ade80; }
.signup-message.error { color: #f87171; }

/* ── Stats Footer ── */

.stats-footer {
    text-align: center;
    padding: 20px 24px;
    color: var(--color-text-tertiary, #64748b);
    font-size: 13px;
    letter-spacing: 0.5px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Animations ── */
.location-detected { animation: locationPulse 0.6s ease-out; }

@keyframes locationPulse {
    0% { opacity: 0.7; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

/* ── Responsive ── */

@media (max-width: 900px) {
    .liturgy-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    body {
        background-attachment: scroll;
    }

    .hero,
    .next-mass-section,
    .liturgy-features,
    .browse-section,
    .signup-section,
    .stats-footer {
        padding-left: calc(16px + env(safe-area-inset-left));
        padding-right: calc(16px + env(safe-area-inset-right));
    }

    .trust-bar {
        gap: 10px 14px;
        padding-left: calc(16px + env(safe-area-inset-left));
        padding-right: calc(16px + env(safe-area-inset-right));
    }

    .next-mass-tab {
        flex: 1 1 110px;
        padding: 10px 14px;
    }

    .browse-map-meta {
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .trust-divider {
        display: none;
    }

    .next-mass-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .next-mass-name {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.35;
    }

    .next-mass-directions {
        width: 100%;
        min-height: 44px;
        font-size: 14px;
    }

    .browse-map-meta {
        flex-direction: column;
        align-items: stretch;
    }

    .browse-map-cta {
        width: 100%;
        min-height: 44px;
    }

    .home-mini-map {
        height: 240px;
    }
}

@media (max-width: 480px) {
    .btn { width: 100%; justify-content: center; }
    .cta-buttons { flex-direction: column; width: 100%; }
    .next-mass-tab { flex: 1 1 100%; }
    .secondary-ctas { flex-wrap: wrap; gap: 8px 16px; }
    .signup-form { flex-direction: column; }
    .signup-form input[type="email"],
    .signup-form .signup-location-input,
    .signup-form button { width: 100%; }
    .diocese-grid { grid-template-columns: 1fr; }
    .filter-tabs { gap: 6px; }
    .filter-tab { padding: 6px 14px; font-size: 13px; }
}
