/**
 * AdventKit – the calendar page.
 * Built on the template's own fonts and colours: the headings' font is used for the door numbers, the accent colour for
 * today's door, the buttons and the highlighted word (*word*) in headings. A thin gold line is the Christmas touch.
 * Change the look with CSS variables on .ak in the template's own CSS:
 *   --ak-accent        today's door, buttons, highlighted words, focus (default: the template's button colour)
 *   --ak-gold          the thin lines, the frame in today's door, the candle and the star
 *   --ak-panel         the sign-up band, locked doors and the round area behind the image
 *   --ak-card          doors that can be opened, the form and the prize cards
 *   --ak-line          borders
 *   --ak-radius        corners of doors and cards
 *   --ak-heading-font  the door numbers (default: the font of the page's headings, found by the script)
 *   --ak-columns       doors per row on a computer (6)
 *
 * @copyright (C) 2026 Thrane.nu
 * @license   GNU General Public License version 2 or later; see LICENSE.txt
 */

.ak {
  --ak-accent: var(--ak-site-accent, #7b1e2b);
  --ak-gold: #c6a15b;
  --ak-radius: 1.1rem;
  --ak-columns: 6;
  --ak-line: color-mix(in srgb, currentColor 14%, transparent);
  --ak-panel: color-mix(in srgb, currentColor 6%, transparent);
  --ak-card: color-mix(in srgb, currentColor 2%, transparent);
  --ak-muted: color-mix(in srgb, currentColor 72%, transparent);
  --ak-gap: clamp(.6rem, 1.4vw, 1rem);
  max-width: 76rem;
  margin-inline: auto;
  font-variant-numeric: lining-nums;
}

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

.ak h1 em,
.ak h2 em {
  color: var(--ak-accent);
}

.ak-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Focus rings only when using the keyboard – never on a click (Thrane.nu) */
.ak a:focus,
.ak button:focus,
.ak input:focus,
.ak-dialog a:focus,
.ak-dialog button:focus,
.ak [tabindex="-1"]:focus {
  outline: none;
}

.ak a:focus-visible,
.ak button:focus-visible,
.ak input:focus-visible,
.ak-dialog a:focus-visible,
.ak-dialog button:focus-visible {
  outline: 2px solid var(--ak-accent);
  outline-offset: 3px;
}

.ak-icon {
  width: .95em;
  height: 1.05em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -.15em;
}

.ak-icon__flame {
  fill: var(--ak-gold);
  stroke: none;
}

.ak-icon--star {
  stroke: var(--ak-gold);
}

/* The thin gold line between the parts */
.ak-rule {
  height: 1px;
  margin: 0;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--ak-gold) 18%, var(--ak-gold) 82%, transparent);
  opacity: 1;
}

/* Buttons: the template's own (.btn) when it has them; this is the fallback */
.ak-btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}

.ak-btn:not(.btn) {
  padding: .8rem 1.6rem;
  border: 1px solid var(--ak-accent);
  border-radius: 999px;
  background: var(--ak-accent);
  color: #fff;
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.ak-btn--quiet:not(.btn) {
  background: transparent;
  color: inherit;
  border-color: currentColor;
}

.ak-preview {
  margin: 1rem 0;
  padding: .6rem .9rem;
  border: 1px dashed var(--ak-gold);
  border-radius: .6rem;
  text-align: center;
  font-size: .95rem;
}

.ak-preview--small {
  font-size: .85rem;
  padding: .4rem .7rem;
}

/* The top: text, and the image in a round area with small labels */
.ak-hero {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: center;
  padding: clamp(1.75rem, 5vw, 4.5rem) 0 clamp(2rem, 5vw, 4rem);
}

@media (min-width: 900px) {
  .ak-hero.has-image {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  }
}

.ak-hero__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.4rem;
}

.ak-badge {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  margin: 0;
  padding: .3rem 1rem .3rem .3rem;
  border: 1px solid var(--ak-line);
  border-radius: 999px;
  background: var(--ak-card);
}

.ak-badge__label {
  padding: .3rem .75rem;
  border-radius: 999px;
  background: var(--ak-accent);
  color: #fff;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ak-badge__text {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.ak-hero__heading {
  margin: 0;
  font-size: clamp(2.6rem, 6.4vw, 5.4rem);
  line-height: 1.03;
}

.ak-hero__intro {
  max-width: 34em;
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.6;
}

.ak-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin: 0;
}

.ak-hero__figure {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 18rem;
}

.ak-hero__circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(27rem, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ak-panel);
  overflow: hidden;
}

.ak-hero__circle img {
  display: block;
  width: 74%;
  height: 74%;
  object-fit: contain;
}

.ak-chip {
  position: absolute;
  padding: .55rem 1rem;
  border-radius: 999px;
  background: var(--ak-card);
  backdrop-filter: blur(6px);
  box-shadow: 0 .6rem 1.5rem -.9rem rgba(43, 34, 30, .45);
  font-size: .88rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.ak-chip--accent {
  background: var(--ak-accent);
  color: #fff;
}

.ak-chip--1 { top: 6%; left: 4%; }
.ak-chip--2 { top: 24%; right: 0; }
.ak-chip--3 { bottom: 22%; left: 0; }
.ak-chip--4 { bottom: 6%; right: 6%; }

/* The calendar */
.ak-calendar {
  padding: clamp(2rem, 5vw, 4.5rem) 0;
}

.ak-calendar__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: clamp(1.25rem, 3vw, 2.25rem);
}

.ak-calendar__head h2 {
  margin: 0;
}

.ak-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .88rem;
}

.ak-legend li {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.ak-legend__swatch {
  width: .9rem;
  height: .9rem;
  border-radius: .25rem;
  background: var(--ak-card);
  box-shadow: inset 0 0 0 1px var(--ak-line);
}

.ak-legend__swatch--today {
  background: var(--ak-accent);
  box-shadow: none;
}

.ak-legend__swatch--locked {
  background: var(--ak-panel);
  box-shadow: none;
}

.ak-doors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ak-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 768px) {
  .ak-doors {
    grid-template-columns: repeat(var(--ak-columns), minmax(0, 1fr));
  }
}

.ak-doors__item {
  margin: 0;
  padding: 0;
}

/* Every door the same: a top line, the number in the middle, a line below – so the numbers stand level */
.ak-door {
  position: relative;
  display: grid;
  grid-template-rows: 1.1rem 1fr 1.1rem;
  align-items: center;
  aspect-ratio: 1 / 1.08;
  padding: .75rem .9rem;
  border-radius: var(--ak-radius);
  background: var(--ak-card);
  box-shadow: inset 0 0 0 1px var(--ak-line);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  perspective: 900px;
  -webkit-tap-highlight-color: transparent;
}

.ak-door__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .3rem;
  min-width: 0;
}

.ak-door__tag,
.ak-door__sub {
  min-width: 0;
  overflow: hidden;
  font-size: .75rem;
  font-weight: 500;
  line-height: 1.1rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ak-door__sub {
  font-weight: 400;
}

.ak-door__num {
  font-family: var(--ak-heading-font, inherit);
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}

.ak-door__check {
  display: none;
}

a.ak-door--open:hover {
  box-shadow: inset 0 0 0 1px var(--ak-gold);
}

/* Opened before in this browser: quieter, with a tick */
.ak-door.is-opened {
  color: var(--ak-muted);
}

.ak-door.is-opened .ak-door__check {
  display: block;
}

/* Today: filled with the accent colour and a thin gold frame inside */
.ak-door.is-today,
.ak-door.is-today.is-opened {
  background: var(--ak-accent);
  color: #fff;
  box-shadow: inset 0 0 0 5px var(--ak-accent), inset 0 0 0 6px var(--ak-gold), 0 .9rem 1.9rem -.9rem color-mix(in srgb, var(--ak-accent) 70%, transparent);
}

.ak-door.is-today .ak-icon--star,
.ak-door.is-today .ak-door__check {
  stroke: currentColor;
}

/* Locked doors: the panel colour and a small lock */
.ak-door--locked {
  background: var(--ak-panel);
  box-shadow: none;
  color: var(--ak-muted);
}

.ak-calendar .ak-calendar__note {
  margin: 1.25rem 0 0;
  text-align: left;
}

/* The leaf that folds open – a calm turn on the door's left edge, nothing that jumps */
.ak-door__leaf {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  transform-origin: left center;
  transition: transform .45s ease, opacity .45s ease;
  pointer-events: none;
  opacity: 0;
}

.ak-door.is-opening .ak-door__leaf {
  opacity: 1;
  background: color-mix(in srgb, var(--ak-gold) 14%, Canvas);
  box-shadow: inset 0 0 0 1px var(--ak-gold);
  transform: rotateY(-78deg);
}

@media (prefers-reduced-motion: reduce) {
  .ak-door__leaf {
    transition: none;
  }

  .ak-door.is-opening .ak-door__leaf {
    transform: none;
    opacity: 0;
  }
}

@media (max-width: 479.98px) {
  .ak-door {
    padding: .6rem .7rem;
    border-radius: calc(var(--ak-radius) - .2rem);
  }

  .ak-door__tag,
  .ak-door__sub {
    font-size: .7rem;
  }
}

/* The door's content: in a dialog, or under the calendar without JavaScript */
.ak-dialog {
  width: min(34rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  border-radius: calc(var(--ak-radius) + .25rem);
  background: Canvas;
  color: CanvasText;
  box-shadow: 0 1.5rem 3rem rgba(20, 12, 10, .25);
}

.ak-dialog::backdrop {
  background: rgba(20, 12, 10, .5);
}

.ak-dialog__body {
  padding: 2rem 1.75rem 1.75rem;
}

.ak-dialog__close {
  position: absolute;
  top: .6rem;
  right: .6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.ak-dialog__close svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.ak-dialog__close:hover {
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.ak-opened {
  max-width: 34rem;
  margin: 1.5rem auto 0;
  padding: 1.75rem;
  border-radius: var(--ak-radius);
  box-shadow: inset 0 0 0 1px var(--ak-line);
}

.ak-content {
  text-align: center;
}

.ak-content__day {
  margin: 0 0 1rem;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ak-gold);
}

.ak-content__logo img {
  display: block;
  max-width: 11rem;
  max-height: 5rem;
  object-fit: contain;
  margin: 0 auto .75rem;
}

.ak-content__title {
  margin: 0 0 .75rem;
}

.ak-content__offer {
  font-size: 1.15rem;
  margin: 0 0 1.25rem;
}

.ak-code {
  margin: 0 auto 1rem;
  padding: .8rem 1rem;
  max-width: 22rem;
  border: 1px dashed var(--ak-gold);
  border-radius: var(--ak-radius);
}

.ak-code__label {
  display: block;
  font-size: .8rem;
  opacity: .75;
  margin-bottom: .35rem;
}

.ak-code__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .6rem;
}

.ak-code__value {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: .15rem .4rem;
  background: none;
  color: inherit;
  user-select: all;
}

.ak-content__expires {
  font-size: .9rem;
  opacity: .8;
}

.ak-content__expires.is-expired {
  opacity: 1;
  font-weight: 600;
}

.ak-content__action {
  margin: 1.25rem 0 0;
}

.ak-content__prize {
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--ak-line);
  font-size: .95rem;
}

/* Sign-up: a band in the panel colour, the text on the left and the form in a card */
.ak-signup {
  position: relative;
  padding: clamp(2.25rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem);
  border-radius: calc(var(--ak-radius) + .4rem);
  background: var(--ak-panel);
}

.ak-signup__inner {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: start;
}

@media (min-width: 900px) {
  .ak-signup__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  }
}

.ak-signup__text h2 {
  margin: 0 0 1.1rem;
}

.ak-lead {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  line-height: 1.6;
}

.ak-points {
  display: grid;
  gap: .7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ak-points li {
  display: flex;
  align-items: center;
  gap: .8rem;
}

.ak-points li::before {
  content: "";
  flex: none;
  width: 1.4rem;
  height: 1px;
  background: var(--ak-gold);
}

.ak-signup__card {
  padding: clamp(1.25rem, 3.5vw, 2.25rem);
  border-radius: calc(var(--ak-radius) + .4rem);
  background: Canvas;
  color: CanvasText;
  box-shadow: 0 1.5rem 3rem -2.25rem rgba(43, 34, 30, .5);
}

.ak-signup__card .ak-form__submit {
  text-align: left;
}

.ak-signup__card .ak-small {
  text-align: left;
}

.ak-form {
  display: grid;
  gap: 1rem;
}

.ak-consent {
  padding: 1rem;
  border: 1px solid var(--ak-line);
  border-radius: .9rem;
}

.ak-consent .ak-check:last-child {
  margin-bottom: 0;
}

.ak-form__row {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .ak-form__row {
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  }
}

.ak-field label {
  display: block;
  margin-bottom: .3rem;
  font-weight: 600;
}

.ak-optional {
  font-weight: 400;
  opacity: .7;
}

.ak-field input {
  display: block;
  width: 100%;
  padding: .65rem .75rem;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  border-radius: calc(var(--ak-radius) - .2rem);
  background: Field;
  color: FieldText;
  font: inherit;
}

.ak-field input[aria-invalid="true"],
.ak-check input[aria-invalid="true"] {
  border-color: #b3261e;
}

.ak-field__error {
  margin: .3rem 0 0;
  color: #b3261e;
  font-size: .9rem;
}

.ak-check {
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: .25rem .6rem;
  align-items: start;
  margin: 0 0 .8rem;
}

.ak-check input {
  width: 1.15rem;
  height: 1.15rem;
  margin: .2rem 0 0;
  accent-color: var(--ak-accent);
}

.ak-check label {
  line-height: 1.45;
}

.ak-check .ak-field__error {
  grid-column: 2;
}

.ak-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.ak-form__submit {
  margin: 1.25rem 0 .75rem;
  text-align: center;
}

.ak-small {
  font-size: .88rem;
  opacity: .85;
  text-align: center;
}

.ak-message {
  margin: 0 auto 1.25rem;
  max-width: 36rem;
  padding: .8rem 1rem;
  border-radius: calc(var(--ak-radius) - .2rem);
  border-left: 4px solid var(--ak-gold);
  background: color-mix(in srgb, var(--ak-gold) 10%, transparent);
  text-align: left;
}

.ak-message p {
  margin: 0;
}

.ak-message--warn {
  border-left-color: #b3261e;
  background: color-mix(in srgb, #b3261e 7%, transparent);
}

/* Prizes and winners */
.ak-prizes {
  padding: clamp(2.25rem, 6vw, 4.5rem) 0 clamp(1rem, 3vw, 2rem);
}

.ak-prizes h2 {
  margin: 0 0 clamp(1.25rem, 3vw, 2rem);
}

.ak-prizes__list {
  display: grid;
  gap: 1.1rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

@media (min-width: 768px) {
  .ak-prizes__list {
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
  }
}

.ak-prize {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: clamp(1.25rem, 3vw, 1.9rem);
  border-radius: var(--ak-radius);
  background: var(--ak-card);
  box-shadow: inset 0 0 0 1px var(--ak-line);
}

.ak-prize__when {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.ak-prize__what {
  font-family: var(--ak-heading-font, inherit);
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  line-height: 1.2;
}

.ak-prize__note {
  font-size: .92rem;
}

.ak-prize--big {
  background: var(--ak-accent);
  color: #fff;
  box-shadow: inset 0 0 0 6px var(--ak-accent), inset 0 0 0 7px var(--ak-gold);
}

.ak-prize--big .ak-icon--star {
  fill: var(--ak-gold);
}

.ak-prizes .ak-small {
  text-align: left;
}

.ak-winners {
  display: grid;
  gap: 1.25rem 3rem;
  align-items: start;
  padding: clamp(1.5rem, 4vw, 2.5rem) 0 clamp(2.25rem, 6vw, 4.5rem);
}

@media (min-width: 900px) {
  .ak-winners {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  }
}

.ak-winners__text h2 {
  margin: 0 0 .6rem;
}

.ak-winners__text p {
  margin: 0;
}

.ak-winners__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ak-line);
}

.ak-winners__list li {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) 2.5fr;
  gap: .25rem 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--ak-line);
}

.ak-winners__day {
  font-weight: 600;
}

@media (max-width: 479.98px) {
  .ak-winners__list li {
    grid-template-columns: 1fr;
  }
}

.ak-small {
  font-size: .88rem;
  line-height: 1.55;
  color: var(--ak-muted);
}

.ak-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  margin: 0;
  padding: 1.5rem 0 2rem;
  font-size: .9rem;
  color: var(--ak-muted);
}

.ak-terms {
  max-width: 44rem;
}

.ak-terms h2 {
  margin-top: 1.75rem;
}

.ak-stop {
  max-width: 36rem;
  text-align: center;
}

