/**
 * ob-gate-modal.css
 *
 * Styles for the upgrade gate modal.
 * Enqueue in functions.php alongside ourboox-feature-gate.js.
 *
 * Design: clean, on-brand, minimal — consistent with Ourboox brand kit.
 * Units: px only (no rem/em) per Ourboox HTML skill.
 * Colors: Ourboox brand palette only.
 * Font: Mulish (loaded by theme).
 */

/* -------------------------------------------------------------------------
   Overlay
   ------------------------------------------------------------------------- */

.ob-gate-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* hidden attribute hides the element entirely between sessions */
.ob-gate-modal[hidden] {
    display: none;
}

/* -------------------------------------------------------------------------
   Backdrop
   ------------------------------------------------------------------------- */

.ob-gate-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 220ms ease;
}

.ob-gate-modal.is-visible .ob-gate-modal__backdrop {
    opacity: 1;
}

/* -------------------------------------------------------------------------
   Panel
   ------------------------------------------------------------------------- */

.ob-gate-modal__panel {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 16px;
    padding: 40px 32px 32px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow:
            0 4px 6px -1px rgba(0, 0, 0, 0.07),
            0 20px 40px -8px rgba(0, 0, 0, 0.14);
    transform: translateY(12px) scale(0.97);
    opacity: 0;
    transition:
            transform 260ms cubic-bezier(0.34, 1.4, 0.64, 1),
            opacity 220ms ease;
}

.ob-gate-modal.is-visible .ob-gate-modal__panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* -------------------------------------------------------------------------
   Close button
   ------------------------------------------------------------------------- */

.ob-gate-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: #9CA3AF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 150ms ease, background 150ms ease;
    padding: 0;
}

.ob-gate-modal__close:hover {
    color: #1F2937;
    background: #F9FAFB;
}

.ob-gate-modal__close:focus-visible {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   Icon
   ------------------------------------------------------------------------- */

.ob-gate-modal__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #EFF6FF;
    color: #3B82F6;
    margin: 0 auto 20px;
}

/* Warning icon for grace tier */
.ob-gate-modal[data-tier="full_premium_grace"] .ob-gate-modal__icon {
    background: #FFFBEB;
    color: #F59E0B;
}

/* -------------------------------------------------------------------------
   Copy
   ------------------------------------------------------------------------- */

.ob-gate-modal__headline {
    font-family: 'Mulish', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #1F2937;
    margin: 0 0 8px;
    line-height: 1.35;
}

.ob-gate-modal__body {
    font-family: 'Mulish', sans-serif;
    font-size: 16px;
    color: #6B7280;
    margin: 0 0 28px;
    line-height: 1.6;
}

/* -------------------------------------------------------------------------
   CTA
   ------------------------------------------------------------------------- */

.ob-gate-modal__cta {
    display: block;
    width: 100%;
    padding: 12px 24px;
    background: #3B82F6;
    color: #ffffff;
    font-family: 'Mulish', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 10px;
    box-sizing: border-box;
    transition: background 150ms ease, transform 120ms ease;
}

.ob-gate-modal__cta:hover {
    background: #2563EB;
    color: #ffffff;
    transform: translateY(-1px);
}

.ob-gate-modal__cta:active {
    transform: translateY(0);
}

.ob-gate-modal__cta:focus-visible {
    outline: 2px solid #3B82F6;
    outline-offset: 3px;
}

/* -------------------------------------------------------------------------
   Body scroll lock
   ------------------------------------------------------------------------- */

body.ob-gate-modal-open {
    overflow: hidden;
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */

@media ( max-width: 480px ) {
    .ob-gate-modal__panel {
        padding: 32px 24px 28px;
    }

    .ob-gate-modal__headline {
        font-size: 18px;
    }
}