/* ═══════════════════════════════════════════════════════════
   Legal / policy pages + footer link grids (mobile-first)
   ═══════════════════════════════════════════════════════════ */

/* ── Legal page shell ── */
.legal-page,
.public-main > .legal-page,
.public-shell .legal-page.mobile-page {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: normal;
    /* Beat mobile-comfort-spacing .mobile-page { padding-left/right: 0 !important } */
    padding-top: 1.15rem !important;
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)) !important;
    padding-left: max(1.1rem, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(1.1rem, env(safe-area-inset-right, 0px)) !important;
}

.public-main > .legal-page {
    background: #fff;
    border-radius: 0;
    box-shadow: none;
}

@media (min-width: 768px) {
    .legal-page,
    .public-main > .legal-page,
    .public-shell .legal-page.mobile-page {
        padding-top: 1.75rem !important;
        padding-bottom: 2.75rem !important;
        padding-left: 1.75rem !important;
        padding-right: 1.75rem !important;
    }

    .public-main > .legal-page {
        margin-top: 1rem;
        margin-bottom: 1.5rem;
        border-radius: 16px;
        box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
        border: 1px solid rgba(15, 23, 42, 0.06);
    }
}

.legal-page__header {
    margin-bottom: 1.25rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.legal-page__eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0b6e84;
    margin-bottom: 0.35rem;
}

.legal-page h1 {
    font-size: clamp(1.35rem, 4.2vw, 1.85rem);
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: #111827;
    line-height: 1.25;
}

.legal-page__lead {
    margin: 0;
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.55;
}

.legal-page__meta {
    margin-top: 0.55rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.legal-page h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 1.35rem 0 0.5rem;
    color: #111827;
    line-height: 1.3;
}

.legal-page h3 {
    font-size: 0.98rem;
    font-weight: 650;
    margin: 1rem 0 0.35rem;
    color: #1f2937;
}

.legal-page p,
.legal-page li {
    color: #374151;
    font-size: 0.94rem;
    line-height: 1.65;
}

.legal-page ul,
.legal-page ol {
    margin: 0.35rem 0 0.8rem;
    padding-left: 1.35rem !important;
    margin-right: 0.15rem;
}

.legal-page li + li {
    margin-top: 0.3rem;
}

.legal-page a {
    color: #0b6e84;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-card {
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 0.95rem 1rem;
    margin: 0.85rem 0;
}

.legal-contact-grid {
    display: grid;
    gap: 0.75rem;
    margin: 1rem 0 1.15rem;
}

@media (min-width: 640px) {
    .legal-contact-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.legal-contact-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 1rem;
    min-width: 0;
}

.legal-contact-card h2 {
    margin-top: 0;
    font-size: 1.02rem;
}

.legal-contact-card .legal-muted {
    color: #6b7280;
    font-size: 0.86rem;
    margin-bottom: 0.5rem;
}

.legal-contact-actions {
    display: grid;
    gap: 0.45rem;
}

.legal-contact-actions a {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    min-height: 2.5rem;
    padding: 0.35rem 0.55rem;
    border-radius: 10px;
    background: rgba(11, 110, 132, 0.06);
    word-break: break-word;
}

.legal-address-box {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.95rem 1rem;
    margin: 1rem 0;
    min-width: 0;
}

.legal-address-box i {
    color: #0b6e84;
    font-size: 1.15rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.pay-policy-note {
    font-size: 0.8rem;
    color: #4b5563;
    margin: 0.65rem 0 0.85rem;
    line-height: 1.45;
}

.pay-policy-note a {
    color: #0b6e84;
    font-weight: 600;
}

/* ── Public footer (landing / policy pages) ── */
.public-footer {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    box-sizing: border-box;
}

.public-footer-inner {
    width: 100%;
    max-width: 42rem;
    margin: 0 auto;
    padding: 0 0.25rem;
    box-sizing: border-box;
}

.public-footer-title {
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.public-footer-address {
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.45;
}

.public-footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    margin: 0.85rem 0 0.65rem;
    padding: 0;
}

.public-footer-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.15rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff !important;
    text-decoration: none !important;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
}

.public-footer-nav a:hover,
.public-footer-nav a:focus-visible {
    background: rgba(0, 168, 204, 0.28) !important;
    border-color: rgba(77, 208, 225, 0.55);
    color: #fff !important;
}

.public-footer-contact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem 0.75rem;
    margin: 0.45rem 0 0.35rem;
    font-size: 0.82rem;
}

.public-footer-contact a {
    color: var(--d2kss-teal-glow, #4dd0e1) !important;
    text-decoration: none;
    font-weight: 600;
    word-break: break-word;
}

.public-footer-contact a:hover {
    color: #fff !important;
    text-decoration: underline;
}

/* Back-compat if old class remains somewhere */
.public-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    max-width: 42rem;
    margin: 0.65rem auto;
}

/* ── Devotee app footer ── */
.theme-ayyappa .temple-footer,
.temple-footer {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 1rem 0.85rem calc(5.75rem + env(safe-area-inset-bottom, 0px)) !important;
    overflow-x: clip;
}

@media (min-width: 992px) {
    .theme-ayyappa .temple-footer,
    .temple-footer {
        padding: 1.15rem 1.5rem 1.35rem !important;
    }
}

.temple-footer-copy {
    margin: 0 0 0.45rem !important;
    font-size: 0.78rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.temple-footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    margin: 0.35rem 0 0.5rem;
}

.temple-footer-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.9rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0 !important;
    text-decoration: none !important;
    font-size: 0.72rem;
    font-weight: 650;
    white-space: nowrap;
}

.temple-footer-nav a:hover,
.temple-footer-nav a:focus-visible {
    background: rgba(0, 168, 204, 0.28) !important;
    color: #fff !important;
}

.temple-footer .footer-tagline {
    margin: 0.15rem 0 0 !important;
    font-size: 0.72rem;
}

/* ── Auth footer ── */
.auth-footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    margin: 0.45rem 0 0.25rem;
}

.auth-footer-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.85rem;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(13, 60, 45, 0.14);
    background: rgba(13, 60, 45, 0.05);
    color: #0b6e84 !important;
    text-decoration: none !important;
    font-size: 0.72rem;
    font-weight: 650;
    white-space: nowrap;
}

.auth-page-d2kss .auth-footer-nav a {
    border-color: rgba(0, 136, 168, 0.22);
    background: rgba(0, 136, 168, 0.08);
    color: #0a2540 !important;
}

.auth-footer-nav a:hover,
.auth-footer-nav a:focus-visible {
    background: rgba(0, 136, 168, 0.16) !important;
}

.auth-page-note {
    max-width: 18rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

/* Mobile polish */
@media (max-width: 575.98px) {
    .legal-page {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    }

    .public-footer {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0px)) !important;
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px)) !important;
    }

    .public-footer-nav a,
    .temple-footer-nav a,
    .auth-footer-nav a {
        flex: 0 1 auto;
    }

    .legal-contact-actions a {
        font-size: 0.9rem;
    }
}
