/**
 * Council Cookie Compliance - Banner Styles
 *
 * GOV.UK Design System inspired cookie consent banner.
 * All classes prefixed with .ccc- to avoid conflicts.
 * Colours use GOV.UK defaults; admin-configurable values
 * are applied via inline CSS from PHP and override these.
 *
 * WCAG 2.2 AA compliant:
 *   - Focus indicators (2.4.7)
 *   - Touch target sizes >= 44x44px (2.5.8)
 *   - Colour contrast ratios >= 4.5:1
 *   - Reduced motion support
 */

/* ==========================================================================
   Banner container
   ========================================================================== */

.ccc-banner {
    font-family: inherit;
    font-size: 16px;
    line-height: 1.1875; /* 19px / 16px */
    color: #0b0c0c;
    background-color: #f3f2f1;
    box-sizing: border-box;
}

.ccc-banner *,
.ccc-banner *::before,
.ccc-banner *::after {
    box-sizing: border-box;
}

.ccc-banner[hidden] {
    display: none;
}

.ccc-banner--bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    border-top: 1px solid #b1b4b6;
}

.ccc-banner--top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    border-bottom: 1px solid #b1b4b6;
}

/* ==========================================================================
   Banner inner
   ========================================================================== */

.ccc-banner__inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
}

/* ==========================================================================
   Banner heading
   ========================================================================== */

.ccc-banner__heading {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 15px 0;
    line-height: 1.25;
}

/* ==========================================================================
   Banner message
   ========================================================================== */

.ccc-banner__message {
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 20px 0;
    max-width: 680px;
}

.ccc-banner__message p {
    margin: 0 0 10px 0;
}

.ccc-banner__message p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Banner actions
   ========================================================================== */

.ccc-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* ==========================================================================
   Banner sections
   ========================================================================== */

.ccc-banner__section {
    padding: 20px 0;
}

.ccc-banner__section[hidden] {
    display: none;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.ccc-btn {
    display: inline-block;
    padding: 8px 16px;
    min-height: 44px;
    min-width: 44px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    vertical-align: middle;
    -webkit-appearance: none;
    appearance: none;
}

/* Primary button */

.ccc-btn-primary {
    background-color: #1d70b8;
    color: #ffffff;
    border-radius: 0;
}

.ccc-btn-primary:hover {
    background-color: #165da2;
}

.ccc-btn-primary:active {
    background-color: #114d89;
}

/* Secondary button */

.ccc-btn-secondary {
    background-color: transparent;
    color: inherit;
    border: 2px solid currentColor;
    border-radius: 0;
}

.ccc-btn-secondary:hover {
    background-color: rgba(11, 12, 12, 0.05);
}

.ccc-btn-secondary:active {
    background-color: rgba(11, 12, 12, 0.1);
}

/* ==========================================================================
   Links
   ========================================================================== */

.ccc-banner__link {
    color: #1d70b8;
    text-decoration: underline;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.ccc-banner__link:hover {
    color: #003078;
}

.ccc-banner__link:visited {
    color: #4c2c92;
}

/* ==========================================================================
   Focus styles (WCAG 2.4.7)
   GOV.UK focus state: yellow background, dark text, 3px yellow outline
   ========================================================================== */

.ccc-btn:focus,
.ccc-banner a:focus,
.ccc-toggle input:focus + .ccc-toggle__label {
    outline: 3px solid #ffdd00;
    outline-offset: 0;
    background-color: #ffdd00;
    color: #0b0c0c;
    box-shadow: none;
    text-decoration: none;
}

/* ==========================================================================
   Preferences panel
   ========================================================================== */

.ccc-preferences {
    padding: 20px 0;
}

/* ==========================================================================
   Category fieldset
   ========================================================================== */

.ccc-category {
    border: none;
    padding: 0 0 20px 0;
    margin: 0 0 20px 0;
    border-bottom: 1px solid #b1b4b6;
}

.ccc-category:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

/* Category heading / legend */

.ccc-category__heading {
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 10px 0;
    display: block;
    line-height: 1.3;
}

/* Category count */

.ccc-category__count {
    font-weight: 400;
    color: #505a5f;
}

/* Category status */

.ccc-category__status {
    font-size: 16px;
}

/* ==========================================================================
   Toggle radio group
   ========================================================================== */

.ccc-toggle {
    display: flex;
    gap: 10px;
}

/* Toggle option */

.ccc-toggle__option {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Toggle radio input - visually hidden but accessible */

.ccc-toggle__input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* Toggle label */

.ccc-toggle__label {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    min-height: 44px;
    border: 2px solid #b1b4b6;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
}

/* Toggle input checked + label */

.ccc-toggle__input:checked + .ccc-toggle__label {
    background-color: #1d70b8;
    color: #ffffff;
    border-color: #1d70b8;
}

/* Toggle input focused + label (handled in focus section above as well) */

.ccc-toggle__input:focus + .ccc-toggle__label {
    outline: 3px solid #ffdd00;
    outline-offset: 0;
    background-color: #ffdd00;
    color: #0b0c0c;
    box-shadow: none;
}

/* ==========================================================================
   Floating icon
   ========================================================================== */

.ccc-floating-icon {
    position: fixed;
    z-index: 999998;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #1d70b8;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    padding: 0;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.ccc-floating-icon:hover {
    background-color: #165da2;
}

.ccc-floating-icon:focus {
    outline: 3px solid #ffdd00;
    outline-offset: 0;
    background-color: #ffdd00;
    color: #0b0c0c;
    box-shadow: none;
}

.ccc-floating-icon[hidden] {
    display: none;
}

.ccc-floating-icon--bottom-left {
    bottom: 20px;
    left: 20px;
}

.ccc-floating-icon--bottom-right {
    bottom: 20px;
    right: 20px;
}

/* ==========================================================================
   Footer link
   ========================================================================== */

.ccc-footer-link {
    padding: 10px 0;
    text-align: center;
    font-size: 14px;
}

/* ==========================================================================
   Cookie table
   ========================================================================== */

.ccc-cookie-table-wrapper {
    margin: 20px 0;
}

.ccc-cookie-table__heading {
    font-size: 19px;
    font-weight: 700;
    margin: 20px 0 10px 0;
    line-height: 1.3;
}

.ccc-cookie-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.ccc-cookie-table th {
    text-align: left;
    padding: 10px;
    border-bottom: 2px solid #0b0c0c;
    font-weight: 700;
}

.ccc-cookie-table td {
    padding: 10px;
    border-bottom: 1px solid #b1b4b6;
    vertical-align: top;
}

/* ==========================================================================
   Manage button
   ========================================================================== */

.ccc-manage-btn {
    background-color: transparent;
    color: inherit;
    border: 2px solid currentColor;
    border-radius: 0;
}

.ccc-manage-btn:hover {
    background-color: rgba(11, 12, 12, 0.05);
}

.ccc-manage-btn:active {
    background-color: rgba(11, 12, 12, 0.1);
}

/* ==========================================================================
   Responsive - mobile first (max-width: 640px)
   ========================================================================== */

@media (max-width: 640px) {
    .ccc-banner__inner {
        padding: 15px;
    }

    .ccc-banner__heading {
        font-size: 20px;
    }

    .ccc-banner__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ccc-btn {
        display: block;
        width: 100%;
        text-align: center;
    }

    .ccc-cookie-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .ccc-banner,
    .ccc-floating-icon {
        transition: none !important;
        animation: none !important;
    }
}
