/* ==========================================================================
   MICE & Communication - Cookie Consent UI
   Self-contained component. All selectors are prefixed with #cc- / .cc- so
   nothing here can leak into the existing site styles.
   Palette follows the site theme (.fs-menu background #1F1F1F on white text).
   Highest z-index on the site is 100 (.fs-menu), so 2147483000+ is safe.
   ========================================================================== */

#cc-root,
#cc-root * {
    box-sizing: border-box;
}

#cc-root {
    font-family: 'Kanit', 'Visuelt Pro ', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #fff;
}

#cc-root[hidden],
#cc-root [hidden] {
    display: none !important;
}

/* --------------------------------------------------------------- banner --- */

.cc-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483001;
    background: #1F1F1F;
    border-top: 1px solid rgba(255, 255, 255, .18);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, .35);
    padding: 20px 24px;
    transform: translateY(100%);
    transition: transform .35s ease;
}

.cc-banner.cc-is-visible {
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {

    .cc-banner,
    .cc-modal__panel {
        transition: none;
    }
}

.cc-banner__inner {
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 28px;
}

.cc-banner__text {
    flex: 1 1 420px;
    min-width: 260px;
}

.cc-banner__title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
}

.cc-banner__desc {
    margin: 0;
    font-size: 13.5px;
    color: rgba(255, 255, 255, .78);
}

.cc-banner__desc a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cc-banner__desc a:hover,
.cc-banner__desc a:focus {
    color: #fff;
    opacity: .75;
}

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

/* -------------------------------------------------------------- buttons --- */

.cc-btn {
    -webkit-appearance: none;
    appearance: none;
    display: inline-block;
    font: inherit;
    font-size: 13.5px;
    line-height: 1.2;
    /* Accept and Reject share identical geometry: equal prominence is a
       PDPA / PDPC guideline requirement, not a styling preference. */
    min-width: 132px;
    padding: 11px 20px;
    border-radius: 2px;
    border: 1px solid transparent;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.cc-btn:focus-visible,
.cc-switch input:focus-visible+.cc-switch__track,
.cc-link:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Primary pair - same weight for Accept All and Reject All */
.cc-btn--solid {
    background: #fff;
    color: #1F1F1F;
    border-color: #fff;
}

.cc-btn--solid:hover {
    background: rgba(255, 255, 255, .82);
    color: #1F1F1F;
}

/* Tertiary - opens the granular settings */
.cc-btn--ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, .45);
}

.cc-btn--ghost:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, .08);
}

.cc-link {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .7);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.cc-link:hover {
    color: #fff;
}

.cc-banner__lang {
    flex: 0 0 auto;
    width: 100%;
    text-align: right;
    margin-top: -4px;
}

/* ---------------------------------------------------------------- modal --- */

.cc-modal {
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(0, 0, 0, .68);
    overflow-y: auto;
}

.cc-modal__panel {
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    background: #1F1F1F;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 3px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
}

.cc-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.cc-modal__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
}

.cc-modal__close {
    flex: 0 0 auto;
    background: none;
    border: 0;
    color: rgba(255, 255, 255, .7);
    font-size: 26px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
}

.cc-modal__close:hover {
    color: #fff;
}

.cc-modal__body {
    padding: 18px 24px 4px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.cc-modal__intro {
    margin: 0 0 18px;
    font-size: 13.5px;
    color: rgba(255, 255, 255, .78);
}

.cc-modal__intro a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cc-modal__foot {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 24px 22px;
    border-top: 1px solid rgba(255, 255, 255, .12);
}

/* ------------------------------------------------------------ category --- */

.cc-cat {
    padding: 0 0 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.cc-cat:last-child {
    border-bottom: 0;
}

.cc-cat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cc-cat__name {
    margin: 0;
    font-size: 14.5px;
    font-weight: 600;
}

.cc-cat__desc {
    margin: 8px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, .7);
}

.cc-cat__always {
    flex: 0 0 auto;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .55);
    white-space: nowrap;
}

/* --------------------------------------------------------------- switch --- */

.cc-switch {
    flex: 0 0 auto;
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.cc-switch input {
    position: absolute;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.cc-switch__track {
    display: block;
    width: 46px;
    height: 24px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .22);
    border: 1px solid rgba(255, 255, 255, .3);
    transition: background-color .2s ease, border-color .2s ease;
}

.cc-switch__track::after {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    margin: 2px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s ease;
}

.cc-switch input:checked+.cc-switch__track {
    background: #fff;
    border-color: #fff;
}

.cc-switch input:checked+.cc-switch__track::after {
    background: #1F1F1F;
    transform: translateX(22px);
}

/* --------------------------------------------------- blocked embed hint --- */

/* Wrapper around a withheld embed. It adds no size of its own, so the block
   occupies exactly the same space whether the embed loads or not - the iframe
   keeps its width/height attributes even without a src. */
.cc-embed {
    position: relative;
    display: block;
}

.cc-placeholder--overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(255, 255, 255, .14);
}

.cc-placeholder--overlay .cc-btn {
    margin-top: 4px;
}

.cc-placeholder--overlay .cc-link {
    display: inline-block;
    margin-top: 10px;
}

.cc-placeholder {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 180px;
    padding: 24px;
    text-align: center;
    background: #1F1F1F;
    color: #fff;
    font-family: 'Kanit', sans-serif;
    font-size: 13.5px;
}

.cc-placeholder,
.cc-placeholder * {
    box-sizing: border-box;
}

.cc-placeholder__inner {
    max-width: 420px;
}

.cc-placeholder p {
    margin: 0 0 14px;
    color: rgba(255, 255, 255, .8);
}

/* ------------------------------------------------- legal document pages --- */

/* Used by cookie-policy.php and privacy-policy.php. Kept in this file so the
   policy pages need no extra stylesheet, and namespaced under .cc-legal so it
   cannot affect any existing page. */

.cc-legal {
    font-family: 'Kanit', sans-serif;
    font-size: 16px;
    line-height: 1.75;
}

.cc-legal h2 {
    font-size: 26px;
    line-height: 1.35;
    margin: 0 0 8px;
}

.cc-legal h3 {
    font-size: 19px;
    line-height: 1.4;
    margin: 36px 0 10px;
}

.cc-legal h4 {
    font-size: 16px;
    margin: 24px 0 8px;
}

.cc-legal p,
.cc-legal li {
    font-size: 16px;
    line-height: 1.75;
}

.cc-legal ul,
.cc-legal ol {
    padding-left: 22px;
    margin: 0 0 16px;
}

.cc-legal li {
    margin-bottom: 8px;
}

.cc-legal a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cc-legal__meta {
    font-size: 14px;
    opacity: .7;
    margin-bottom: 28px;
}

.cc-legal__toc {
    margin: 0 0 32px;
    padding: 16px 20px;
    border: 1px solid rgba(0, 0, 0, .14);
    border-radius: 3px;
}

.cc-legal__toc ul {
    margin: 8px 0 0;
}

.cc-legal__divider {
    margin: 56px 0 40px;
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, .14);
}

/* Cookie inventory table. Collapses into stacked rows on phones so no cell is
   ever cut off. */
.cc-table-wrap {
    overflow-x: auto;
    margin: 0 0 24px;
}

.cc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.6;
}

.cc-table th,
.cc-table td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    border: 1px solid rgba(0, 0, 0, .16);
}

.cc-table th {
    font-weight: 600;
    background: rgba(0, 0, 0, .05);
    white-space: nowrap;
}

@media (max-width: 575px) {
    .cc-table {
        font-size: 13px;
    }

    .cc-table th,
    .cc-table td {
        padding: 8px;
    }

    .cc-table th {
        white-space: normal;
    }
}

/* ---------------------------------------------------------- responsive --- */

@media (max-width: 767px) {
    .cc-banner {
        padding: 16px;
        max-height: 85vh;
        overflow-y: auto;
    }

    .cc-banner__inner {
        gap: 14px;
    }

    .cc-banner__actions {
        width: 100%;
    }

    .cc-btn {
        flex: 1 1 calc(50% - 5px);
        min-width: 0;
        padding: 12px 10px;
    }

    .cc-banner__actions .cc-btn--ghost {
        flex-basis: 100%;
    }

    .cc-banner__lang {
        text-align: left;
    }

    .cc-modal {
        padding: 12px 10px;
    }

    .cc-modal__panel {
        max-height: calc(100vh - 24px);
    }

    .cc-modal__head,
    .cc-modal__body,
    .cc-modal__foot {
        padding-left: 16px;
        padding-right: 16px;
    }

    .cc-modal__foot .cc-btn {
        flex-basis: 100%;
    }
}

/* Keeps the banner from covering a focused form field on very short screens */
@media (max-height: 420px) {
    .cc-banner {
        max-height: 70vh;
        overflow-y: auto;
    }
}
