/* ============================================
   GUIDE MODAL — native <dialog>
   ============================================ */

.cj-guide-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 860px;
    width: calc(100% - 32px);
    max-height: 90vh;
    padding: 0;
    border: none;
    border-radius: 24px;
    background: var(--bg);
    color: var(--text);
    box-shadow: 0 32px 80px rgba(44, 35, 33, 0.28);
    overflow: hidden;
}

.cj-guide-modal[open] {
    display: flex;
    flex-direction: column;
}

.cj-guide-modal::backdrop {
    background: rgba(44, 35, 33, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.cj-guide-modal__header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 2;
}

.cj-guide-modal__title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    padding-right: 24px;
    line-height: 1.2;
}

.cj-guide-modal__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s ease;
}

.cj-guide-modal__close:hover,
.cj-guide-modal__close:focus-visible {
    background: var(--border);
    outline: none;
}

.cj-guide-modal__close svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
}

.cj-guide-modal__body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0 32px;
    flex: 1 1 auto;
}

.cj-guide-modal__body > * {
    margin-left: auto;
    margin-right: auto;
}

/* Neutralize the Seeking-Joy-specific section margins inside the modal so
   content stacks consistently regardless of which page the visitor came from. */
.cj-guide-modal__body section,
.cj-guide-modal__body .welcome,
.cj-guide-modal__body .scripture-block,
.cj-guide-modal__body .card-row,
.cj-guide-modal__body .cta-section {
    margin-top: 0;
    margin-bottom: 0;
}

.cj-guide-modal__body img {
    max-width: 100%;
    height: auto;
}

.cj-guide-modal__loading,
.cj-guide-modal__error {
    padding: 48px 28px;
    text-align: center;
    font-family: 'Nunito', sans-serif;
    color: var(--muted);
}

.cj-guide-modal__error {
    color: var(--primary-dk);
}

/* Trigger button hint — subtle visual indicator on modal-enabled buttons */
.card .btn[data-modal-slug]::after {
    content: '';
    display: inline-block;
    width: 0.55em;
    height: 0.55em;
    margin-left: 0.5em;
    border-right: 2px solid currentColor;
    border-top: 2px solid currentColor;
    transform: rotate(45deg) translateY(-0.1em);
    opacity: 0.7;
}

/* Mobile: full-screen modal */
@media (max-width: 768px) {
    .cj-guide-modal {
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .cj-guide-modal__header {
        padding: 16px 20px;
    }

    .cj-guide-modal__title {
        font-size: 1.35rem;
    }
}

/* Body scroll-lock helper (iOS Safari fallback) */
body.cj-modal-open {
    overflow: hidden;
}
