/*
 * Batch 1.3G — consent banner + privacy-preferences modal.
 *
 * Loaded on every page family (homepage, Arabic homepage, every generated
 * side page, the Privacy Notice pages) since the banner must appear on all
 * public pages. Uses only existing css/base.css design tokens -- no new
 * colour is introduced. Cyan (--accent-color) is reserved for
 * focus/active state only, per the design system rule; every other
 * surface uses the navy/primary palette already used across the site.
 *
 * Logical properties throughout (inset-inline-*, padding-inline-*,
 * margin-inline-*, text-align: start) so the banner and modal mirror
 * correctly under [dir="rtl"] without a single direction-specific
 * override -- exactly like css/rtl.css already does for the rest of the
 * site, just inline rather than in a separate stylesheet.
 */

.ik-consent-banner {
    position: fixed;
    inset-inline: var(--spacing-md);
    bottom: var(--spacing-md);
    z-index: var(--z-modal);
    max-width: 720px;
    margin-inline: auto;
    background: var(--background-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-heavy);
    padding: var(--spacing-lg);
    font-family: var(--font-primary);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.ik-consent-banner__text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    text-align: start;
    color: var(--text-primary);
}

.ik-consent-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: flex-end;
}

.ik-consent-btn {
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 600;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    white-space: nowrap;
}

.ik-consent-btn--primary {
    background: var(--primary-color);
    color: #ffffff;
}
.ik-consent-btn--primary:hover {
    background: var(--primary-hover);
}
.ik-consent-btn--primary:active {
    background: var(--primary-active);
}

.ik-consent-btn--ghost {
    background: transparent;
    color: var(--secondary-color);
    border-color: var(--border-color);
}
.ik-consent-btn--ghost:hover {
    background: var(--background-secondary);
}

/* Cyan is reserved for focus/active states only -- never a resting-state
 * fill or border, on any control in this file. */
.ik-consent-btn:focus-visible,
.ik-consent-analytics-toggle:focus-visible,
.ik-consent-modal__dialog a:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

.ik-consent-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}
.ik-consent-modal[hidden] {
    display: none;
}

.ik-consent-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(31, 41, 55, 0.55);
}

.ik-consent-modal__dialog {
    position: relative;
    background: var(--background-primary);
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-heavy);
    padding: var(--spacing-xl);
    max-width: 480px;
    width: 100%;
    max-height: calc(100vh - var(--spacing-2xl));
    overflow-y: auto;
    font-family: var(--font-primary);
    text-align: start;
}

.ik-consent-modal__title {
    margin: 0 0 var(--spacing-sm);
    font-size: 1.25rem;
    color: var(--secondary-color);
}

.ik-consent-modal__intro {
    margin: 0 0 var(--spacing-lg);
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.ik-consent-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding-block: var(--spacing-md);
    border-block-end: 1px solid var(--border-color);
}
.ik-consent-row:last-of-type {
    border-block-end: none;
}

.ik-consent-row__text {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.ik-consent-row__label {
    font-weight: 700;
    color: var(--text-primary);
}

.ik-consent-row__desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.ik-consent-row input[type="checkbox"] {
    flex-shrink: 0;
    inline-size: 20px;
    block-size: 20px;
    accent-color: var(--primary-color);
    margin-block-start: var(--spacing-xs);
}

.ik-consent-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: flex-end;
    margin-block-start: var(--spacing-lg);
}

/* Footer "Privacy settings" trigger and "Privacy Notice" link -- styled to
 * sit quietly among the existing footer-bottom text, never louder than
 * the copyright line beside it. */
.ik-footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm) var(--spacing-lg);
    margin-block-start: var(--spacing-sm);
}
.ik-footer-legal a,
.ik-footer-legal button {
    font-family: var(--font-primary);
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    padding: 0;
    text-decoration: underline;
    cursor: pointer;
}
.ik-footer-legal a:hover,
.ik-footer-legal button:hover {
    color: var(--accent-color);
}

@media (max-width: 480px) {
    .ik-consent-banner {
        inset-inline: var(--spacing-sm);
        bottom: var(--spacing-sm);
        padding: var(--spacing-md);
    }
    .ik-consent-banner__actions {
        flex-direction: column;
        align-items: stretch;
    }
    .ik-consent-btn {
        width: 100%;
        text-align: center;
    }
    .ik-consent-modal__dialog {
        padding: var(--spacing-lg);
    }
    .ik-consent-modal__actions {
        flex-direction: column;
    }
}
