/* ==========================================================================
   Legal layer, on every page: cookie notice, accessibility widget,
   and the /privacy/ + /accessibility/ pages. Markup comes from build.mjs
   (legalWidgets), behaviour from js/legal.js.
   ========================================================================== */

/* ----- Cookie notice: a quiet dark-glass card, not a full-width bar ----- */
.cookie-note {
    position: fixed;
    z-index: 9000;
    bottom: 1rem;
    inset-inline: 1rem;
    max-width: 620px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 14px;
    background: rgba(10, 14, 13, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    color: var(--color-white-soft, #f5f5f5);
    font-family: 'Heebo', sans-serif;
    direction: rtl;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.cookie-note.show {
    transform: none;
    opacity: 1;
}

.cookie-note[hidden] {
    display: none;
}

.cookie-note p {
    flex: 1;
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.55;
    opacity: 0.88;
}

.cookie-note a {
    color: var(--color-gold, #d4af37);
    text-underline-offset: 3px;
}

.cookie-note-ok {
    flex-shrink: 0;
    padding: 0.55rem 1.3rem;
    border: 0;
    border-radius: 999px;
    font: 600 0.9rem 'Heebo', sans-serif;
    color: var(--color-dark, #0a0e0d);
    background: linear-gradient(135deg, var(--color-gold-light, #f0d057), var(--color-gold, #d4af37));
    cursor: pointer;
}

.cookie-note-ok:hover {
    filter: brightness(1.08);
}

@media (max-width: 600px) {
    .cookie-note {
        bottom: 0.75rem;
        inset-inline: 0.75rem;
        padding: 0.8rem 0.9rem;
        gap: 0.75rem;
    }

    .cookie-note p {
        font-size: 0.8rem;
    }
}

/* ----- Accessibility widget: small, muted, gold line icon ----- */
.a11y {
    position: fixed;
    z-index: 8999;
    bottom: calc(var(--cookie-h, 0px) + 1rem);
    inset-inline-end: 1rem;
    direction: rtl;
    font-family: 'Heebo', sans-serif;
    transition: bottom 0.35s ease;
}

.a11y-toggle {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 50%;
    color: var(--color-gold, #d4af37);
    background: rgba(10, 14, 13, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    opacity: 0.8;
    cursor: pointer;
    transition: opacity 0.2s, border-color 0.2s;
}

.a11y-toggle:hover,
.a11y-toggle[aria-expanded="true"] {
    opacity: 1;
    border-color: var(--color-gold, #d4af37);
}

.a11y-toggle svg {
    width: 22px;
    height: 22px;
}

.a11y-panel {
    position: absolute;
    bottom: 52px;
    inset-inline-end: 0;
    width: 264px;
    padding: 1rem;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 16px;
    color: var(--color-white-soft, #f5f5f5);
    background: rgba(15, 41, 34, 0.97);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.a11y-panel[hidden] {
    display: none;
}

.a11y-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.a11y-head strong {
    font-size: 1rem;
    color: var(--color-gold-light, #f0d057);
}

.a11y-close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    font-size: 0.8rem;
    color: var(--color-white-soft, #f5f5f5);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.a11y-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.a11y-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.7rem 0.3rem;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 10px;
    font: 500 0.78rem 'Heebo', sans-serif;
    color: inherit;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.a11y-opt i {
    font-size: 1rem;
    color: var(--color-gold, #d4af37);
}

.a11y-opt:hover {
    border-color: rgba(212, 175, 55, 0.55);
}

.a11y-opt.is-on {
    border-color: var(--color-gold, #d4af37);
    color: var(--color-dark, #0a0e0d);
    background: var(--color-gold, #d4af37);
}

.a11y-opt.is-on i {
    color: inherit;
}

.a11y-reset {
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.5rem;
    border: 0;
    border-radius: 10px;
    font: 500 0.8rem 'Heebo', sans-serif;
    color: inherit;
    background: rgba(255, 255, 255, 0.07);
    cursor: pointer;
}

.a11y-statement {
    display: block;
    margin-top: 0.6rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-gold, #d4af37);
}

.a11y-toggle:focus-visible,
.a11y-opt:focus-visible,
.a11y-reset:focus-visible,
.a11y-close:focus-visible,
.cookie-note-ok:focus-visible {
    outline: 2px solid var(--color-gold-light, #f0d057);
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .a11y {
        bottom: calc(var(--cookie-h, 0px) + 0.75rem);
        inset-inline-end: 0.75rem;
    }

    .a11y-toggle {
        width: 38px;
        height: 38px;
    }
}

@media print {
    .a11y,
    .cookie-note {
        display: none !important;
    }
}

/* Applied by the widget as classes on <html> */
html.a11y-contrast {
    filter: contrast(1.35) saturate(1.15);
}

html.a11y-links a {
    text-decoration: underline !important;
    text-underline-offset: 3px;
    outline: 1px dashed currentColor;
    outline-offset: 2px;
}

html.a11y-readable,
html.a11y-readable body,
html.a11y-readable * {
    font-family: Arial, 'Heebo', sans-serif !important;
    letter-spacing: 0.02em;
}

html.a11y-nomotion *,
html.a11y-nomotion *::before,
html.a11y-nomotion *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

/* ----- Footer links to the legal pages ----- */
.legal-links {
    margin-top: 0.6rem;
    font-size: 0.85rem;
}

.legal-links a {
    color: inherit;
    text-decoration: none;
    opacity: 0.85;
}

.legal-links a:hover {
    color: var(--color-gold, #d4af37);
    opacity: 1;
}

.legal-links span {
    margin-inline: 0.5rem;
    opacity: 0.5;
}

/* ----- /privacy/ and /accessibility/ pages ----- */
.legal-page {
    min-height: 70vh;
    padding: 8.5rem 1.25rem 4rem;
    color: var(--color-white-soft, #f5f5f5);
    background: radial-gradient(ellipse at top, rgba(26, 60, 52, 0.55), transparent 60%), var(--color-dark, #0a0e0d);
}

.legal-wrap {
    max-width: 760px;
    margin: 0 auto;
}

.legal-wrap h1 {
    margin: 0 0 0.4rem;
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    font-weight: 800;
    color: var(--color-gold-light, #f0d057);
}

.legal-wrap .legal-updated {
    margin: 0 0 2.5rem;
    font-size: 0.9rem;
    opacity: 0.6;
}

.legal-wrap section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.12);
}

.legal-wrap section:last-child {
    border-bottom: 0;
}

.legal-wrap h2 {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-gold, #d4af37);
}

.legal-wrap p,
.legal-wrap li {
    font-size: 1rem;
    line-height: 1.8;
    opacity: 0.88;
}

.legal-wrap p {
    margin: 0 0 0.6rem;
}

.legal-wrap ul {
    margin: 0.4rem 0 0.6rem;
    padding-inline-start: 1.3rem;
}

.legal-wrap a {
    color: var(--color-gold, #d4af37);
}

.legal-box {
    margin-top: 0.8rem;
    padding: 1rem 1.2rem;
    border-inline-start: 3px solid var(--color-gold, #d4af37);
    border-radius: 10px;
    font-size: 0.95rem;
    background: rgba(212, 175, 55, 0.07);
}
