/* ==========================================================
   BaseFortify Advent Calendar
   ========================================================== */

/* Page layout */

.advent-page {
    min-height: 100vh;
    background: #000;
    color: #f8f4ed;
    padding: 105px 12px 45px;
    overflow: hidden;
}

.advent-intro {
    text-align: center;
    margin: 0 auto 8px;
    max-width: 800px;
}

.advent-eyebrow {
    color: #f2c97e;
    font-size: 12px;
    letter-spacing: .17em;
    font-weight: 700;
}

.advent-intro h1 {
    color: #fff4e2;
    font: clamp(36px, 6vw, 68px) Georgia, serif;
    margin: 10px 0;
}

.advent-intro > p:last-child {
    color: #d1dbea;
}

.advent-note {
    text-align: center;
    color: #bccde1;
    font-size: 13px;
}


/* ==========================================================
   Village canvas
   ========================================================== */

.advent-village {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    width: min(100%, 1000px);
    aspect-ratio: 1000 / 1160;
    margin: auto;

    background: radial-gradient(
        ellipse at 85% 6%,
        #25374d 0%,
        #162333 15%,
        #0b121c 30%,
        #030609 50%,
        #000000 75%
    );
}


/* ==========================================================
   Sky, stars and moon
   ========================================================== */

.advent-stars,
.advent-village .stars {
    display: none;
}

.advent-moon {
    position: absolute;
    width: 5%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #fff1b8;

    box-shadow:
        0 0 20px 5px rgba(255, 241, 184, .20),
        0 0 55px 15px rgba(185, 205, 240, .12),
        0 0 100px 30px rgba(140, 170, 220, .06);

    top: 4%;
    right: 11%;
    z-index: 1;
    pointer-events: none;
}

.advent-underlay {
    position: absolute;
    inset: 35% 0 0;
    background: linear-gradient(
        130deg,
        #e7f4ff,
        #f6f1ea
    );
    pointer-events: none;
}


/* ==========================================================
   Original village object geometry
   ========================================================== */

.advent-drift,
.advent-object {
    position: absolute;
    line-height: 0;
}

.advent-drift,
.advent-tree {
    pointer-events: none;
}

.advent-drift img,
.advent-object img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
}

.advent-object {
    transform: translate(-50%, -100%);
}

.advent-object img {
    transform: scaleX(var(--flip));
}

.advent-house {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    appearance: none;
}

.advent-house .house-hover {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .18s ease;
}

/* Only illuminate an unlocked house after clicking it. */

.advent-house.unlocked.opened .house-hover {
    opacity: 1;
}

.advent-house:focus-visible {
    outline: 2px solid #ffdf84;
    outline-offset: 3px;
}


/* ==========================================================
   Composition-driven village objects
   ========================================================== */

.advent-village .drift,
.advent-village .obj {
    position: absolute;
    line-height: 0;
}

.advent-village .drift,
.advent-village .obj:not(button) {
    pointer-events: none;
}

.advent-village .obj {
    transform: translate(-50%, -100%);
    padding: 0;
    border: 0;
    background: none;
    appearance: none;
}

.advent-village button.obj {
    cursor: pointer;
}

.advent-village button.obj:focus-visible {
    outline: 2px solid #ffdf84;
}

.advent-village .drift img,
.advent-village .obj img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
}

.advent-village .art {
    position: relative;
}


/* ==========================================================
   House artwork and lighting states
   ========================================================== */

.advent-village .obj .lit,
.advent-village .art .snow-mask,
.advent-village .art .night-window {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Hide illuminated artwork by default. */

.advent-village .obj .lit,
.advent-village .hover-mask,
.advent-village .hover-window {
    display: none !important;
}

/*
 * Only unlocked houses may display illuminated artwork.
 * This includes the current day and all previous days.
 */

.advent-village .unlocked:hover .lit,
.advent-village .unlocked:hover .hover-mask,
.advent-village .unlocked:hover .hover-window,
.advent-village .unlocked.opened .lit,
.advent-village .unlocked.opened .hover-mask,
.advent-village .unlocked.opened .hover-window {
    display: block !important;
}

/*
 * Hide idle snow and window masks whenever an unlocked
 * house displays its illuminated artwork.
 */

.advent-village .unlocked:hover .art:has(.hover-mask) .idle-mask,
.advent-village .unlocked:hover .art:has(.hover-window) .night-window:not(.hover-window),
.advent-village .unlocked.opened .art:has(.hover-mask) .idle-mask,
.advent-village .unlocked.opened .art:has(.hover-window) .night-window:not(.hover-window) {
    display: none;
}


/* ==========================================================
   Snowdrift colours and brightness
   ========================================================== */

.advent-village .drift img {
    filter:
        brightness(var(--snow-brightness, .9))
        brightness(var(--drift-brightness, 1))
        var(--drift-tint, brightness(1));
}


/* ==========================================================
   Garlands and snow reflections
   ========================================================== */

.advent-village .obj .garland {
    position: absolute;
    height: auto;
    pointer-events: none;
    transform-origin: center;
}

.advent-village .reflection {
    position: absolute;
    pointer-events: none;
    mix-blend-mode: normal;
}

.advent-village.twinkle .garland {
    animation: adventGlow 5s ease-in-out infinite alternate;
}

@keyframes adventGlow {
    from {
        opacity: .82;
    }

    to {
        opacity: 1;
    }
}


/* ==========================================================
   Snowfall
   ========================================================== */

.advent-snowfall {
    position: absolute;
    inset: 0;
    z-index: 200;
    pointer-events: none;
    opacity: .36;

    background-image:
        radial-gradient(
            circle,
            #fff 1.4px,
            transparent 2.6px
        ),
        radial-gradient(
            circle,
            #fff 2px,
            transparent 3.2px
        );

    background-size:
        93px 117px,
        163px 191px;

    animation: adventSnowfall 22s linear infinite;
}

@keyframes adventSnowfall {
    from {
        background-position:
            0 0,
            40px 20px;
    }

    to {
        background-position:
            93px 117px,
            203px 211px;
    }
}

.advent-village .snowfall-overlay {
    position: absolute;
    pointer-events: none;
    z-index: 200;
}


/* ==========================================================
   Original Advent dialog
   ========================================================== */

.advent-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: #050a17c9;
    display: grid;
    place-items: center;
    padding: 18px;
}

.advent-dialog-backdrop[hidden] {
    display: none;
}

.advent-dialog {
    position: relative;
    background: #f8f1e7;
    color: #253047;
    width: min(100%, 470px);
    border-radius: 20px;
    padding: 36px;
    box-shadow: 0 20px 90px #0008;
}

.advent-dialog h2 {
    color: #26354e;
    font: 32px Georgia, serif;
}

.advent-dialog-close {
    position: absolute;
    top: 10px;
    right: 16px;
    border: 0;
    background: transparent;
    font-size: 32px;
    color: #253047;
    cursor: pointer;
}

.advent-dialog-footnote {
    font-size: 12px;
    opacity: .65;
}


/* ==========================================================
   Cybersecurity article dialog
   ========================================================== */

.advent-tip {
    width: min(690px, 94vw);
    max-height: 88vh;
    overflow: auto;
    border: 0;
    border-radius: 16px;
    padding: 0;
    background: #fff;
    color: #172943;
    box-shadow: 0 24px 80px #0008;
}

.advent-tip::backdrop {
    background: #081426b8;
}


/* Article header */

.advent-tip-head {
    background: #172943;
    color: white;
    padding: 22px 28px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.advent-tip-head h2 {
    color: white;
    font: 30px Georgia;
    margin: 8px 0 0;
}

.advent-tip-head button {
    align-self: start;
    font-size: 26px;
    background: transparent;
    border: 0;
    color: white;
    cursor: pointer;
}


/* ==========================================================
   Advent article typography
   ========================================================== */

.advent-tip-content {
    padding: 30px 28px;
    font-family: "Open Sans", sans-serif;
    font-size: 15px !important;
    font-weight: 400;
    line-height: 1.7 !important;
    color: #29313b;
}


/* Paragraphs */

.advent-tip-content p {
    font-size: inherit !important;
    font-weight: 400;
    line-height: inherit !important;
    color: inherit;
    margin: 0 0 14px !important;
}

.advent-tip-content > :last-child {
    margin-bottom: 0 !important;
}


/* Section headings */

.advent-tip-content h2,
.advent-tip-content h3,
.advent-tip-content h4 {
    font-family: "Open Sans", sans-serif;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    letter-spacing: normal;
    color: #173a60 !important;
    margin: 28px 0 12px !important;
}

.advent-tip-content h2 {
    font-size: 22px !important;
}

.advent-tip-content h3 {
    font-size: 20px !important;
}

.advent-tip-content h4 {
    font-size: 17px !important;
}


/* Emphasis */

.advent-tip-content strong,
.advent-tip-content b {
    font-weight: 600 !important;
    color: #172943;
}


/* Lists */

.advent-tip-content ul,
.advent-tip-content ol {
    font-family: inherit;
    font-size: inherit !important;
    line-height: inherit !important;
    margin: 0 0 18px !important;
    padding-left: 24px !important;
}

.advent-tip-content ul {
    list-style: disc outside !important;
}

.advent-tip-content ol {
    list-style: decimal outside !important;
}

.advent-tip-content li {
    font-size: inherit !important;
    line-height: inherit !important;
    margin: 0 0 6px !important;
    padding-left: 2px;
}

.advent-tip-content li:last-child {
    margin-bottom: 0 !important;
}

.advent-tip-content li::marker {
    color: #526b84;
}

.advent-tip-content li > ul,
.advent-tip-content li > ol {
    margin: 6px 0 !important;
}


/* Hyperlinks */

.advent-tip-content a {
    color: #285f94 !important;
    font-weight: inherit;
    text-decoration: underline !important;
    text-decoration-color: #9bb6d0 !important;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
    transition: color .15s ease;
}

.advent-tip-content a:hover {
    color: #173a60 !important;
    text-decoration-color: #173a60 !important;
}

.advent-tip-content a:focus-visible {
    outline: 2px solid #285f94;
    outline-offset: 3px;
    border-radius: 2px;
}


/* Illustrations */

.advent-tip-content img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 0 auto 22px !important;
}

.advent-tip-content figure {
    margin: 0 0 22px !important;
}

.advent-tip-content figure img {
    margin-bottom: 8px !important;
}

.advent-tip-content figcaption {
    font-size: 13px;
    line-height: 1.5;
    color: #687585;
    text-align: center;
}


/* ==========================================================
   Editorial tables
   ========================================================== */

.advent-tip-content table {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    border: 0 !important;
    margin: 18px 0 22px !important;
    font-family: inherit;
    font-size: 14px !important;
    line-height: 1.55 !important;
}

.advent-tip-content table thead {
    display: table-header-group !important;
}

.advent-tip-content table tbody {
    display: table-row-group !important;
}

.advent-tip-content table tr {
    display: table-row !important;
    height: auto !important;
}

.advent-tip-content table th,
.advent-tip-content table td {
    display: table-cell !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;

    padding: 12px 10px !important;

    font-family: inherit;
    font-size: inherit !important;
    line-height: inherit !important;

    text-align: left !important;
    vertical-align: top !important;

    /* Disable application table truncation */
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;

    border: 0 !important;
    border-bottom: 1px solid #e2e8ef !important;
}


/* Table header */

.advent-tip-content table thead th {
    background: #edf2f7 !important;
    color: #173a60 !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.advent-tip-content table thead th:first-child {
    border-radius: 6px 0 0 0;
}

.advent-tip-content table thead th:last-child {
    border-radius: 0 6px 0 0;
}


/* Table body */

.advent-tip-content table tbody td {
    background: #fff !important;
    color: #29313b !important;
}

.advent-tip-content table tbody tr:nth-child(even) td {
    background: #f8fafc !important;
}

.advent-tip-content table tbody td:first-child {
    font-weight: 600;
}


/* Column proportions for three-column comparison tables */

.advent-tip-content table th:first-child:nth-last-child(3) {
    width: 23% !important;
}

.advent-tip-content table th:first-child:nth-last-child(3) ~ th:nth-child(2) {
    width: 27% !important;
}

.advent-tip-content table th:first-child:nth-last-child(3) ~ th:nth-child(3) {
    width: 50% !important;
}


/* ==========================================================
   Today's challenge
   ========================================================== */

.advent-tip-content .tip-note {
    display: block;
    background: #edf3f9 !important;
    border: 0;
    border-left: 4px solid #285477;
    border-radius: 0 8px 8px 0;
    padding: 16px 18px !important;
    margin: 24px 0 0 !important;
    color: #293d52 !important;
    font-size: 14px !important;
    line-height: 1.65 !important;
}

.advent-tip-content .tip-note strong:first-child {
    display: block;
    font-size: 15px;
    font-weight: 600 !important;
    color: #173a60 !important;
    margin-bottom: 6px;
}


/* ==========================================================
   Additional editorial elements
   ========================================================== */

.advent-tip-content blockquote {
    margin: 18px 0 !important;
    padding: 8px 16px !important;
    border-left: 3px solid #b8c9da;
    color: #526477;
    background: #f8fafc;
}

.advent-tip-content hr {
    border: 0;
    border-top: 1px solid #e2e8ef;
    margin: 24px 0 !important;
}


/* ==========================================================
   Mobile article layout
   ========================================================== */

@media (max-width: 540px) {

    .advent-tip-content {
        padding: 22px 18px;
        font-size: 14px !important;
    }

    .advent-tip-content h2 {
        font-size: 20px !important;
    }

    .advent-tip-content h3 {
        font-size: 18px !important;
        margin-top: 24px !important;
    }

    .advent-tip-content h4 {
        font-size: 16px !important;
    }

    .advent-tip-content table {
        font-size: 12px !important;
    }

    .advent-tip-content table th,
    .advent-tip-content table td {
        padding: 9px 6px !important;
    }

    .advent-tip-content .tip-note {
        padding: 14px !important;
    }
}


/* Article footer */

.advent-tip-footer {
    padding: 0 28px 24px;
    text-align: right;
}

.advent-tip-footer button {
    background: #173a60;
    color: white;
    padding: 10px 18px;
    border: 0;
    border-radius: 7px;
}


/* ==========================================================
   Development and demo controls
   ========================================================== */

.advent-demo-controls {
    text-align: center;
    margin: 12px;
}


/* ==========================================================
   Responsive layout
   ========================================================== */

@media (max-width: 700px) {
    .advent-page {
        padding-top: 85px;
    }
}


/* ==========================================================
   Accessibility: reduced motion
   ========================================================== */

@media (prefers-reduced-motion: reduce) {
    .advent-snowfall {
        animation: none;
    }

    .house-hover {
        transition: none;
    }

    .advent-village.twinkle .garland {
        animation: none;
    }
}

/* Hide the calendar status counter. */

#adventStatus {
    display: none;
}

/* ==========================================================
   About the Advent Calendar
   ========================================================== */

.advent-about {
    max-width: 800px;
    margin: 45px auto 15px;
    padding: 30px 24px 10px;
    border-top: 1px solid rgba(209, 219, 234, .15);
    text-align: center;
}

.advent-about h2 {
    color: #fff4e2;
    font: clamp(24px, 4vw, 32px) Georgia, serif;
    margin: 0 0 22px;
}

.advent-about p {
    color: #d1dbea;
    font-size: 14px;
    line-height: 1.8;
    margin: 0 0 16px;
}

.advent-about .advent-about-greeting {
    color: #f2c97e;
    font-weight: 500;
    margin-top: 25px;
}

@media (max-width: 700px) {
    .advent-about {
        margin-top: 25px;
        padding: 24px 16px 10px;
    }
}

/* ==========================================================
   Christmas article decorations
   ========================================================== */


/* Festive article header */

.advent-tip-head {
    position: relative;
    isolation: isolate;
    overflow: hidden;

    background: #172943;
    border-bottom: 2px solid #c7a66c;
}


/* Evergreen branches and Christmas lights */

.advent-tip-head::before {
    content: "";
    position: absolute;

    top: 0;
    right: 0;

    width: 240px;
    height: 115px;

    background-image:
        url("/static/advent/assets/decorations/article-header.svg");

    background-repeat: no-repeat;
    background-position: top right;
    background-size: contain;

    pointer-events: none;
    z-index: -1;
}


/* Keep header content above the decorations */

.advent-tip-head > * {
    position: relative;
    z-index: 1;
}


/* Preserve title readability */

.advent-tip-head h2 {
    text-shadow: 0 1px 4px rgba(10, 20, 35, .65);
}


/* Close button */

.advent-tip-head button {
    position: relative;
    z-index: 2;

    flex-shrink: 0;

    text-shadow: 0 1px 4px rgba(10, 20, 35, .8);
}


/* ==========================================================
   Christmas ornament above Today's challenge
   ========================================================== */

.advent-tip-content .tip-note {
    position: relative;
    margin-top: 64px !important;
}


/* Decorative snowflake divider */

.advent-tip-content .tip-note::before {
    content: "";

    position: absolute;

    top: -47px;
    left: 50%;

    width: 240px;
    max-width: 80%;
    height: 34px;

    transform: translateX(-50%);

    background-image:
        url("/static/advent/assets/decorations/article-divider.svg");

    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    pointer-events: none;
}


/* ==========================================================
   Responsive Christmas decorations
   ========================================================== */

@media (max-width: 540px) {

    .advent-tip-head::before {
        width: 165px;
        height: 80px;
        opacity: .7;
    }

    .advent-tip-content .tip-note {
        margin-top: 54px !important;
    }

    .advent-tip-content .tip-note::before {
        top: -41px;
        width: 200px;
        height: 28px;
    }
}