/* =============================================================
 FILE: Guide-Modal.css
 PURPOSE: Global CSS include for Guide Modal, shared across multiple pages.

 USED BY:
   - /Guides/index.php
 ============================================================= */
/* Guide Modal CSS - Full-screen overlay for guide articles */

.guide-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10, 12, 20, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    overflow-y: auto;
    padding: 24px;
    opacity: 0;
    transition: opacity 280ms cubic-bezier(0.4, 0.0, 0.2, 1);
}

.guide-modal-overlay.gm-visible {
    opacity: 1;
}

.guide-modal {
    position: relative;
    max-width: 780px;
    max-height: 90vh;
    margin: 32px auto;
    background: var(--content-surface, #ffffff);
    border: 1px solid var(--content-border, rgba(26, 86, 219, 0.1));
    border-radius: 22px 14px 18px 15px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 48px 40px 56px;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.04),
        0 8px 20px rgba(0, 0, 0, 0.06),
        0 24px 48px rgba(0, 0, 0, 0.08),
        0 48px 80px rgba(0, 0, 0, 0.12);
    transform: translateY(18px);
    transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.guide-modal-overlay.gm-visible .guide-modal {
    transform: translateY(0);
}

.guide-modal-close {
    position: sticky;
    top: 0;
    float: right;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--content-text-muted, #8492a6);
    background: var(--content-bg-alt, #f7f8fb);
    border: 1px solid var(--content-border, rgba(26, 86, 219, 0.1));
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    transition: color 220ms cubic-bezier(0.4, 0, 0.2, 1), background 220ms cubic-bezier(0.4, 0, 0.2, 1), border-color 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.guide-modal-close:hover {
    color: var(--content-text, #1a1f36);
    background: var(--content-surface, #ffffff);
    border-color: var(--content-border-med, rgba(26, 86, 219, 0.18));
}

/* Loading spinner */
.guide-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.guide-modal-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--content-border, rgba(26, 86, 219, 0.1));
    border-top-color: var(--content-accent, #1a56db);
    border-radius: 50%;
    animation: gm-spin 700ms linear infinite;
}

@keyframes gm-spin {
    to { transform: rotate(360deg); }
}

/* Header */
.guide-modal-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--content-border, rgba(26, 86, 219, 0.1));
}

.guide-modal-header h1 {
    font-family: var(--content-font-display, 'DM Serif Display', Georgia, serif);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--content-text, #1a1f36);
    margin: 0 0 14px;
}

.guide-modal-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.84rem;
    color: var(--content-text-muted, #8492a6);
}

.guide-modal-meta span {
    display: inline-flex;
    align-items: center;
}

.guide-modal-meta .gm-sep {
    opacity: 0.35;
}

.guide-modal-meta .gm-category {
    font-weight: 600;
    color: var(--content-accent, #1a56db);
}

.guide-modal-description {
    margin: 0 0 24px;
    max-width: 62ch;
    font-family: var(--content-font-body, 'Playfair Display', Georgia, serif);
    font-size: clamp(0.95rem, 1.9vw, 1.05rem);
    line-height: 1.65;
    color: var(--content-text-muted, #8492a6);
}

.guide-modal-description[hidden] {
    display: none;
}

/* Body content */
.guide-modal-body {
    font-family: var(--content-font-body, 'Playfair Display', Georgia, serif);
    font-size: clamp(0.92rem, 1.8vw, 1.02rem);
    color: var(--content-text, #1a1f36);
    line-height: 1.75;
}

.guide-modal-body h2 {
    font-family: var(--content-font-display, 'DM Serif Display', Georgia, serif);
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 400;
    color: var(--content-text, #1a1f36);
    margin: 36px 0 16px;
    letter-spacing: -0.01em;
}

.guide-modal-body h3 {
    font-family: var(--content-font-display, 'DM Serif Display', Georgia, serif);
    font-size: clamp(1.05rem, 2.5vw, 1.2rem);
    font-weight: 400;
    color: var(--content-text, #1a1f36);
    margin: 28px 0 12px;
}

.guide-modal-body p {
    margin: 0 0 18px;
}

.guide-modal-body ul,
.guide-modal-body ol {
    margin: 0 0 18px;
    padding-left: 24px;
    list-style: revert;
}

.guide-modal-body li {
    margin-bottom: 6px;
    list-style: revert;
}

.guide-modal-body a {
    color: var(--content-accent, #1a56db);
    text-decoration: underline;
    text-decoration-color: rgba(26, 86, 219, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.guide-modal-body a:hover {
    text-decoration-color: var(--content-accent, #1a56db);
}

.guide-modal-body blockquote {
    margin: 24px 0;
    padding: 16px 20px;
    border-left: 3px solid var(--content-accent, #1a56db);
    background: var(--content-bg-alt, #f7f8fb);
    border-radius: 0 var(--content-radius-sm, 5px) var(--content-radius-sm, 5px) 0;
    font-style: italic;
    color: var(--content-text-secondary, #4a5568);
}

.guide-modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.9rem;
}

.guide-modal-body th,
.guide-modal-body td {
    padding: 10px 14px;
    border: 1px solid var(--content-border, rgba(26, 86, 219, 0.1));
    text-align: left;
}

.guide-modal-body th {
    background: var(--content-bg-alt, #f7f8fb);
    font-weight: 600;
}

.guide-modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--content-radius-md, 10px);
    margin: 16px 0;
}

/* FAQ inside modal */
.guide-modal-faq {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--content-border, rgba(26, 86, 219, 0.1));
}

.guide-modal-faq h2 {
    font-family: var(--content-font-display, 'DM Serif Display', Georgia, serif);
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 400;
    color: var(--content-text, #1a1f36);
    margin: 0 0 20px;
}

.gm-faq-item {
    border: 1px solid var(--content-border, rgba(26, 86, 219, 0.1));
    border-radius: var(--content-radius-md, 10px);
    margin-bottom: 10px;
    overflow: hidden;
}

.gm-faq-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 16px 20px;
    min-height: 48px;
    font-family: var(--content-font-body, 'Playfair Display', Georgia, serif);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--content-text, #1a1f36);
    background: var(--content-bg-alt, #f7f8fb);
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.gm-faq-q:hover {
    background: var(--content-surface, #ffffff);
}

.gm-faq-q::after {
    content: '+';
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--content-text-muted, #8492a6);
    flex-shrink: 0;
    transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.gm-faq-item.gm-faq-open .gm-faq-q::after {
    content: '-';
}

.gm-faq-a {
    display: none;
    padding: 0 20px 16px;
    font-size: 0.9rem;
    color: var(--content-text-secondary, #4a5568);
    line-height: 1.7;
}

.gm-faq-item.gm-faq-open .gm-faq-a {
    display: block;
}

/* Error state */
.guide-modal-error {
    text-align: center;
    padding: 48px 24px;
    color: var(--content-text-muted, #8492a6);
    font-size: 0.95rem;
}

/* No body placeholder */
.guide-modal-nobody {
    text-align: center;
    padding: 32px 24px;
    color: var(--content-text-muted, #8492a6);
    font-size: 0.95rem;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .guide-modal-overlay {
        padding: 0;
    }

    .guide-modal {
        margin: 0;
        max-height: 100vh;
        min-height: 100vh;
        border-radius: 0;
        padding: 24px 18px 40px;
    }
}

@media (max-width: 480px) {
    .guide-modal {
        padding: 20px 14px 32px;
    }

    .guide-modal-header h1 {
        font-size: 1.4rem;
    }
}

@media (max-width: 320px) {
    .guide-modal {
        padding: 16px 10px 28px;
    }

    .guide-modal-header h1 {
        font-size: 1.2rem;
    }

    .guide-modal-body {
        font-size: 0.88rem;
    }

    .guide-modal-body h2 {
        font-size: 1.1rem;
    }

    .guide-modal-body h3 {
        font-size: 1rem;
    }

    .gm-faq-q {
        padding: 12px 14px;
        font-size: 0.88rem;
    }

    .gm-faq-a {
        padding: 0 14px 12px;
        font-size: 0.84rem;
    }
}

@media (hover: none) and (pointer: coarse) {
    .guide-modal-close {
        min-width: 48px;
        min-height: 48px;
    }

    .gm-faq-q {
        min-height: 48px;
    }

    .guide-modal-body a {
        display: inline-block;
        min-height: 48px;
        line-height: 48px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .guide-modal-overlay {
        transition: none;
    }

    .guide-modal {
        transition: none;
        transform: none;
    }

    .guide-modal-spinner {
        animation-duration: 1400ms;
    }

    .guide-modal-close,
    .gm-faq-q,
    .guide-modal-body a {
        transition: none;
    }
}
