/*
 * The Advent Tree theme. Shared band, buttons and legend live in festive.css.
 */
.cdc-tree__header {
    text-align: center;
    max-width: 820px;
    margin: 0 auto;
}

.cdc-tree__stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    align-items: center;
    margin-top: 32px;
}

@media (min-width: 960px) {
    .cdc-tree__stage {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
        gap: 40px;
        padding: 0 28px;
    }
}

/* Tree */
.cdc-tree__tree {
    --orn: clamp(40px, 11.5vw, 64px);
    --orn-gap: clamp(6px, 2.2vw, 14px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--orn-gap) + 2px);
}

@media (min-width: 960px) {
    .cdc-tree__tree {
        --orn: 76px;
        --orn-gap: 18px;
        gap: 14px;
    }
}

.cdc-tree__star {
    width: 0;
    height: 0;
    margin-bottom: -4px;
    border-left: calc(var(--orn) * .29) solid transparent;
    border-right: calc(var(--orn) * .29) solid transparent;
    border-bottom: calc(var(--orn) * .5) solid var(--adv-gold);
    filter: drop-shadow(0 0 12px rgba(240, 194, 94, .7));
}

.cdc-tree__row {
    display: flex;
    justify-content: center;
    gap: var(--orn-gap);
}

.cdc-tree__ornament {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--orn);
    height: var(--orn);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--adv-cream);
    color: #857a6f;
    font-family: 'Raleway', sans-serif;
    font-size: calc(var(--orn) * .34);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    cursor: pointer;
    box-shadow: inset -6px -8px 0 rgba(0, 0, 0, .06);
    transform-origin: 50% -8px;
    transition: transform .18s var(--adv-ease-out), box-shadow .18s var(--adv-ease-out), background-color .18s var(--adv-ease-out);
}

/* the gold hook the ornament hangs from */
.cdc-tree__ornament::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 50%;
    width: 14px;
    height: 9px;
    margin-left: -7px;
    border-radius: 2px;
    background: var(--adv-hook);
}

.cdc-tree__ornament:hover {
    transform: scale(1.1) rotate(6deg);
}

.cdc-tree__ornament.is-today {
    background: var(--adv-gold);
    color: var(--adv-green);
    box-shadow: 0 0 0 4px rgba(240, 194, 94, .35), 0 0 30px rgba(240, 194, 94, .8);
}

.cdc-tree__ornament.is-today:hover {
    box-shadow: 0 0 0 3px #fff, 0 0 0 9px rgba(240, 194, 94, .4), 0 0 48px rgba(240, 194, 94, 1);
}

.cdc-tree__ornament.is-lit {
    background: var(--adv-red);
    color: #fff;
    box-shadow: inset -6px -8px 0 rgba(0, 0, 0, .15), 0 4px 10px rgba(0, 0, 0, .3);
}

.cdc-tree__ornament.is-today.is-lit {
    box-shadow: inset -6px -8px 0 rgba(0, 0, 0, .15), 0 0 30px rgba(240, 194, 94, .7);
}

/* passed, has an article, and this visitor has not lit it yet */
.cdc-tree__ornament.is-unopened {
    color: var(--adv-red);
    box-shadow: inset -6px -8px 0 rgba(0, 0, 0, .06), 0 0 0 3px var(--adv-green), 0 0 0 5px var(--adv-red);
}

.cdc-tree__ornament.is-unopened::after {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--adv-red);
    box-shadow: 0 0 0 2px #fff;
}

.cdc-tree__ornament[aria-pressed="true"] {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.cdc-tree__ornament:focus-visible {
    outline: 3px solid var(--adv-gold);
    outline-offset: 5px;
}

/* the one authored moment: gold warms to red while rings ripple out */
.cdc-tree__ornament.is-lighting {
    animation: cdc-tree-light .6s var(--adv-ease-out);
}

@keyframes cdc-tree-light {
    0% {
        background-color: var(--adv-gold);
        box-shadow: 0 0 0 0 rgba(240, 194, 94, .6), 0 0 0 0 rgba(240, 194, 94, .3), 0 0 30px rgba(240, 194, 94, .8);
        transform: scale(1.1);
    }

    45% {
        background-color: #e5784c;
        box-shadow: 0 0 0 12px rgba(240, 194, 94, .25), 0 0 0 26px rgba(240, 194, 94, .12), 0 0 60px rgba(211, 60, 67, .9);
        transform: scale(1.14);
    }

    100% {
        background-color: var(--adv-red);
        box-shadow: 0 0 0 30px rgba(240, 194, 94, 0), 0 0 0 44px rgba(240, 194, 94, 0), 0 4px 10px rgba(0, 0, 0, .3);
        transform: scale(1);
    }
}

/* Panel */
.cdc-tree__panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 28px;
    border-radius: 8px;
    background: #fff;
    color: var(--adv-ink);
    box-shadow: 0 0 0 4px var(--adv-red), 0 20px 40px rgba(0, 0, 0, .25);
    scroll-margin-top: 96px;
}

@media (min-width: 960px) {
    .cdc-tree__panel {
        padding: 32px;
    }
}

.cdc-tree__panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.cdc-tree__panel-date {
    color: var(--adv-red);
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.cdc-tree__panel-status {
    color: var(--adv-muted);
    font-size: 13px;
}

.cdc-tree__panel-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cdc-tree__panel-body.is-entering {
    animation: cdc-tree-panel .24s var(--adv-ease-out);
}

@keyframes cdc-tree-panel {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.cdc-tree__title {
    margin: 0;
    color: var(--adv-ink);
    letter-spacing: -.005em;
    text-transform: none;
    font-family: 'Raleway', sans-serif;
    font-size: clamp(22px, 2.6vw, 30px);
    font-weight: 800;
    line-height: 1.15;
    text-wrap: pretty;
}

.cdc-tree__byline,
.cdc-tree__text {
    margin: 0;
    color: var(--adv-muted);
    font-size: 15px;
    line-height: 1.6;
}

.cdc-tree__cover {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 560 / 300;
    object-fit: cover;
    border-radius: 6px;
    background: #f3efe8;
}

.cdc-tree__read {
    align-self: stretch;
}
