/**
 * Component Styles
 * Consolidated from individual component styles.js files
 * Used by the headless CMS frontend
 */

/* ============================================
   SPOTLIGHT
   ============================================ */

#spotlight p {
  white-space: pre-line;
}

#spotlight figure {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: rgba(0,0,0, .3);
  border-radius: .3rem;
  overflow: hidden;
}

#spotlight img {
  object-fit: cover;
  width: 100%;
  aspect-ratio: 16 / 9;
}

#spotlight figure:has(img) + h3 {
  margin-top: var(--gutter-small);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(0); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up {
  animation: fadeUp 0.6s linear both;
}


/* ============================================
   TRAINEES
   ============================================ */

.trainees {
  display: grid;
  gap: var(--gutter-small);
  color: #fff;
}

.trainee {
  display: grid;
  grid-template-columns: 2rem 1fr;
  grid-template-rows: repeat(2, auto);
  align-content: center;
  column-gap: .5rem;
  font-size: 1rem;
  line-height: 1;
}

.trainee > *:nth-child(1) {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  border-radius: .2rem;
  width: 100%;
  aspect-ratio: 1;
}

.trainee > *:nth-child(2) {
  font-weight: 600;
  display: grid;
  align-items: end;
}

.trainee a {
  color: #ccc;
  text-decoration: none;
}


/* ============================================
   CALENDAR ICS
   ============================================ */

.event {
  display: grid;
  grid-template-columns: 5rem 1fr;
  padding: .2rem;
}

.event:nth-child(even) {
  background-color: hsla(360, 100%, 100%, .2);
}

.event__name {
  display: flex;
  align-items: center;
  padding-right: .5rem;
  min-width: 0;
}

.event__label {
  font-size: .7rem;
  color: #fff;
  background-color: var(--aspit-red);
  padding: .2rem .4rem;
  border-radius: .3rem;
  margin-left: var(--gutter-small);
  white-space: nowrap;
}


/* ============================================
   TRANSPORT
   ============================================ */

:root {
  --icl: rgb(253,186,88);
  --ra: rgb(80,183,72);
  --re: rgb(80,174,48);
  --ic: rgb(236,52,0);
  --let: rgb(37,74,93);
  --letbane: rgb(37,74,93);
  --rx: rgb(80,174,48);
}

#transport .transport__type {
  font-size: .8rem;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: .2rem;
  padding: 0 .2rem;
}

#transport .widget__listitem {
  display: grid;
  grid-template-columns: 2.5rem 1fr 2rem auto;
  align-items: center;
  padding: 0.2rem;
  column-gap: var(--gutter-small);
}

#transport .widget__listitem > *:nth-child(1n+2) {
  text-align: left;
}

#train,
#tram {
  display: flex;
  gap: .5rem;
  align-items: center;
}

#train::after,
#tram::after {
  content: "";
  width: 1.8rem;
  height: 1.8rem;
  display: block;
  background-size: 100%;
}

#train::after {
  background: url(/assets/images/transport/icon-intercity.svg) no-repeat center;
}

#tram::after {
  background: url(/assets/images/transport/icon-letbanen.svg) no-repeat center;
}

#transport .column-labels > li {
  display: grid;
  grid-template-columns: 2.5rem 1fr 2rem auto;
  padding: 0.2rem;
  column-gap: var(--gutter-small);
  color: #ccc;
  text-transform: uppercase;
  font-size: .8rem;
  text-align: left;
}


/* ============================================
   WEATHER
   ============================================ */

#weather-forecast .widget__listitem {
  align-items: center;
  grid-template-columns: 1fr auto auto;
  line-height: calc(var(--line-height) + 1.4);
  padding: 0;
}

#weather-forecast .widget__listitem:nth-child(even) {
  background-color: transparent;
}

#weather-forecast .widget__listitem > *:last-child {
  text-align: right;
}

#weather-forecast .widget__listitem + .widget__listitem {
  border-top: dotted .1rem rgba(255,255,255, .2);
}

#weather-forecast .widget__listitem img {
  width: 1.4rem;
  display: block;
  aspect-ratio: 1;
}


/* ============================================
   CLOCKS
   ============================================ */

:root {
  --watchface-color: white;
  --watchface-notation-short-color: #999;
  --watchface-notation-long-color: #222;
}

.watches {
  max-width: 1020rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2rem;
}

.five-columns .watch {
  max-width: 8rem;
}

.watch {
  max-width: 7rem;
  width: 100%;
  transition: max-width .3s;
}

.watch__city {
  margin-bottom: .5vw;
  text-align: center;
  font-size: 1rem;
  text-transform: capitalize;
  color: var(--aspit-red);
}

.watch__minute-notation {
  max-width: 10rem;
  width: 100%;
  position: relative;
  background-color: var(--watchface-color);
  border-radius: 50%;
}

.watch__minute-notation::before {
  content: "";
  width: 90%;
  height: 90%;
  display: block;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, #999 0deg .5deg, transparent .5deg 6deg);
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.watch__minute-notation::after {
  content: "";
  background-color: var(--watchface-color);
  display: block;
  width: 80%;
  height: 80%;
  transform: translate(-50%, -50%);
  top: 50%;
  left: 50%;
  border-radius: 50%;
  position: absolute;
  z-index: 0;
  box-sizing: border-box;
}

.watch__hour-notation {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 50%;
}

.watch__hour-notation::before {
  content: "";
  width: 90%;
  height: 90%;
  display: block;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, black 0deg 3deg, transparent 3deg 30deg);
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-1deg);
}

.watch__hour-notation::after {
  content: "";
  display: block;
  width: 70%;
  height: 70%;
  background-color: var(--watchface-color);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.watch__hour-notation > * {
  position: absolute;
  top: 50%;
  left: 50%;
  rotate: 180deg;
  background: #000;
  transform-origin: top;
  z-index: 2;
}

.watch__clock-hand-hours {
  width: .1rem;
  height: 30%;
  transform: rotate(0);
}

.watch__clock-hand-minutes {
  width: .1rem;
  height: 40%;
  transform: rotate(90deg);
}

.watch__clock-hand-seconds {
  width: .08rem;
  height: 45%;
  transform: rotate(120deg);
  background-color: red;
}

/* Aarhus special colors */
#aarhus .watch__minute-notation::before {
  background: repeating-conic-gradient(from 0deg, #fff 0deg .5deg, transparent .5deg 6deg);
}

#aarhus .watch__hour-notation::before {
  background: repeating-conic-gradient(from 0deg, #fff 0deg 3deg, transparent 3deg 30deg);
}

#aarhus .watch__minute-notation,
#aarhus .watch__minute-notation::after,
#aarhus .watch__hour-notation::after {
  background-color: var(--aspit-red);
}

#aarhus .watch__clock-hand-hours,
#aarhus .watch__clock-hand-minutes {
  background-color: #fff;
}

@media(min-width: 114rem) {
  .watch { max-width: 8rem; }
  .watch__city { font-size: 1.2rem; }
  .watch__clock-hand-hours,
  .watch__clock-hand-minutes { width: .2rem; }
  .watch__clock-hand-seconds { width: .1rem; }
  .watch__minute-notation::before { background: none; }
}


/* ============================================
   CURRENT SUBJECTS (BARCHART)
   ============================================ */

.barchart__items {
  display: grid;
  gap: calc(var(--gutter-small) - .5rem);
}

.barchart__item {
  width: calc(var(--num-students) * 1.5rem);
  height: 1rem;
  background-color: var(--color);
  padding: .2rem .3rem;
  position: relative;
  font-size: .8rem;
  color: #000;
  display: flex;
  justify-content: end;
  align-items: center;
  border-radius: 0.2rem;
  transition: width .3s;
  overflow: hidden;
}

.barchart__item::after {
  content: attr(data-num-students);
  color: #fff;
  font-weight: bold;
}

.barchart__cat-colors {
  display: flex;
  flex-wrap: wrap;
  margin: 1rem 0;
  gap: .5rem;
}

.barchart__cat-colors li {
  display: flex;
  align-items: center;
  margin-right: var(--gutter-small);
  color: #fff;
  font-size: .7rem;
}

.barchart__cat-colors li::before {
  content: "";
  background-color: var(--color);
  display: block;
  width: 1rem;
  height: 1rem;
  margin-right: .3rem;
  border-radius: .2rem;
}


/* ============================================
   BIRTHDAYS
   ============================================ */

.five-columns {
  --gutter-large: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 50rem) {
  .five-columns { grid-template-columns: 2fr 2fr; }
}

@media (min-width: 74rem) {
  .five-columns { grid-template-columns: 1fr 1fr 1fr; }
}

@media (min-width: 104rem) {
  .five-columns { grid-template-columns: 2fr 2fr 1fr; }
}

#birthdays {
  position: relative;
  overflow: hidden;
}

#birthdays ul {
  display: grid;
  gap: 2rem;
}

#birthdays li {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.birthday__name {
  font-weight: bold;
  font-size: 1.6rem;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 300px;
}

.birthday__name::before,
.birthday__name::after {
  content: "";
  display: block;
  background: url(/assets/images/dk.svg) no-repeat center;
  background-size: cover;
  width: 3.5rem;
  height: 2.2rem;
}

.birthday__name::before {
  margin-right: 1rem;
  rotate: 180deg;
  transform-origin: center;
  animation: wave .5s linear infinite alternate;
}

.birthday__name::after {
  margin-left: 1rem;
  transform-origin: left;
  animation: wave .5s .3s linear infinite alternate;
}

@keyframes wave {
  from { transform: rotateY(10deg); }
  to   { transform: rotateY(-10deg); }
}

.slide-in {
  animation: slide-in .7s .5s cubic-bezier(0,1.01,.84,1.38) both;
}

@keyframes slide-in {
  from { transform: translateX(-300px); }
  to   { transform: translateX(0); }
}

#birthdays canvas {
  display: block;
  max-width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}


/* ============================================
   COUNTDOWN
   ============================================ */

.widget__subtitle a {
  color: #fff;
  text-decoration: none;
}

#countdown {
  min-height: 300px;
}

#countdown img {
  border-radius: .3rem;
  margin-bottom: 1rem;
  object-fit: cover;
  width: 100%;
  aspect-ratio: 16 / 9;
}

#countdown figure {
  width: 100%;
  aspect-ratio: 16/9;
}

#countdown-timer {
  display: grid;
  gap: .5rem;
  margin-top: 1rem;
}

.countdown-timeleft {
  font-weight: bold;
  font-size: 140%;
}


/* ============================================
   OPEN HOUSE / ASPIT SKOLERNES DAG (fullscreen overlay)
   ============================================ */

#open-house-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: grid;
    grid-template-rows: 1fr;
    background-color: var(--aspit-darkest-green);
}

.open-house-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: center;
    gap: 6rem;
    padding: 2rem;
    padding-top: 3rem;
}

.open-house-text {
    text-align: right;
    line-height: 1.5;
}

.open-house-text h1 {
    font-size: 4rem;
    font-weight: bold;
    line-height: 1.2;
}

.open-house-text h1 span {
    display: block;
    font-size: 60%;
    color: #ccc;
}

.open-house-text h2 {
    margin-top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    line-height: 1.2;
    color: #ccc;
}

.open-house-text ul {
    margin-top: 2rem;
    font-size: 1.6rem;
    color: #ccc;
}

.open-house-arrow {
    display: flex;
    align-items: center;
}

.open-house-arrow img {
    max-width: 300px;
    animation: open-house-point .5s infinite alternate;
}

@keyframes open-house-point {
    100% { transform: translateX(20%); }
}


/* ============================================
   DIMISSION (fullscreen overlay)
   ============================================ */

#dimission-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: grid;
    grid-template-rows: 1fr;
}

.dimission-content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    padding-top: 3rem;
    overflow: hidden;
    background-color: var(--aspit-darkest-green);
}

.dimission-content > article {
    position: relative;
    z-index: 50;
    font-size: 3rem;
    color: rgba(255, 255, 255, .9);
}

.dimission-title {
    font-size: 5rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 3rem;
    position: relative;
}

.dimission-title::before,
.dimission-title::after {
    content: "";
    display: block;
    width: 160px;
    height: 100px;
    background: url(/assets/images/dk.svg) no-repeat center;
    background-size: 100%;
    position: absolute;
    top: 0;
    opacity: .9;
}

.dimission-title::before {
    left: 0;
    transform: translate(-120%, 20%) rotate(-10deg);
    transform-origin: right center;
    animation: dimission-flag-before .5s infinite alternate linear;
}

.dimission-title::after {
    right: 0;
    transform: translate(120%, 20%) rotate(10deg);
    transform-origin: left center;
    animation: dimission-flag-after .5s .2s infinite alternate linear;
}

.dimission-greeting {
    margin-bottom: 2rem;
    font-size: 1.6rem;
    color: #ccc;
}

.dimission-graduates li {
    font-size: 2.2rem;
    line-height: 1.5;
    font-weight: bold;
}

@keyframes dimission-flag-before {
    from { transform: translate(-120%, 20%) rotate(-10deg) skewY(5deg); }
    to   { transform: translate(-120%, 20%) rotate(-10deg) skewY(-5deg); }
}

@keyframes dimission-flag-after {
    from { transform: translate(120%, 20%) rotate(10deg) skewY(-5deg); }
    to   { transform: translate(120%, 20%) rotate(10deg) skewY(5deg); }
}


/* ============================================
   CHRISTMAS CANDLE
   ============================================ */

:root {
  --text-size: 1.7vh;
  --candle-width: 12vh;
  --bg-color: black;
  --candle-wrapper-height: 73vh;
  --flame-padding: 1vh;
  --flame-max-width: 7vh;
  --flame-max-height: 7vh;
  --wick-height: 1.9vh;
  --wick-width: 1vh;
}

#christmas-candle.widget {
  padding-bottom: 0;
}

.candle-wrapper {
  display: flex;
  position: relative;
  flex-direction: column;
  width: 100%;
  height: var(--candle-wrapper-height);
  box-sizing: border-box;
}

.snowflakes {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: absolute;
  display: flex;
  background-color: rgb(17 45 42);
  justify-content: space-evenly;
}

.snowflake {
  display: block;
  color: #fff;
  top: -10%;
  position: relative;
  animation-iteration-count: infinite;
  z-index: 10;
}

.snowflake:nth-of-type(2n)   { animation-name: snowflake-1, snowflake; }
.snowflake:nth-of-type(2n+1) { animation-name: snowflake-2, snowflake; }
.snowflake:nth-of-type(3n)   { animation-timing-function: linear; }
.snowflake:nth-of-type(3n+1) { animation-timing-function: ease-in-out; }
.snowflake:nth-of-type(3n+2) { animation-timing-function: ease-out; }

.snowflake:nth-of-type(3n)   { animation-duration: 10s; }
.snowflake:nth-of-type(3n+1) { animation-duration: 8s; }
.snowflake:nth-of-type(3n+2) { animation-duration: 12s; }

.snowflake:nth-of-type(1) { animation-delay: .6s; }
.snowflake:nth-of-type(2) { animation-delay: -.34s; }
.snowflake:nth-of-type(3) { animation-delay: -5s; }
.snowflake:nth-of-type(4) { animation-delay: -3s; }
.snowflake:nth-of-type(5) { animation-delay: -1.4s; }
.snowflake:nth-of-type(6) { animation-delay: -1.87s; }
.snowflake:nth-of-type(7) { animation-delay: -6.2s; }
.snowflake:nth-of-type(8) { animation-delay: -2.2s; }

.outer-candle-container {
  display: flex;
  overflow-y: hidden;
  padding-top: 4vh;
  background-color: var(--bg-color);
  flex: 1;
  height: 90%;
  align-items: end;
}

.inner-candle-container {
  overflow-y: visible;
  display: flex;
  justify-content: center;
  flex: 1;
  height: 90%;
}

.candle {
  z-index: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  border-radius: 1.5vh 1.5vh 0 0;
  max-width: var(--candle-width);
  animation: hide-candle forwards linear;
  background-image: linear-gradient(110deg, rgb(223 62 62), rgb(123 17 17));
  box-shadow: 12px 10px 3px rgba(0, 0, 0, .164);
}

.candle .wick {
  position: absolute;
  transform: translateY(-100%);
  height: var(--wick-height);
  width: var(--wick-width);
  border-radius: 2px 2px 0 0;
  background-color: #fff;
  opacity: .5;
  animation-name: wick;
  animation-fill-mode: forwards;
  z-index: 1;
}

.candle .content-wrapper {
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
  height: 100%;
  width: 100%;
}

.candle ul {
  animation: movetext linear;
  display: flex;
  justify-content: space-evenly;
  flex-direction: column;
  margin: 0;
  padding: 0;
  height: 100%;
}

.candle ul > li {
  display: flex;
  color: #fff;
  font-size: var(--text-size);
  width: 100%;
  justify-content: center;
}

.candle-flame {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  transform: translateY(-100%);
  position: absolute;
  width: var(--candle-width);
  height: var(--candle-width);
  animation: candle-flame;
  padding-bottom: var(--flame-padding);
  opacity: 0;
}

.flame {
  width: 100%;
  height: 100%;
  max-width: var(--flame-max-width);
  max-height: var(--flame-max-height);
  padding-bottom: 5px;
  border-radius: 50%;
  border-top-left-radius: 100%;
  border-top-right-radius: 100%;
  background-image: linear-gradient(red, #ff0, #fff);
  box-shadow: 0 0 24px #ff0;
  animation: flame 8.5s linear infinite;
  transform-origin: bottom;
}

@keyframes hide-candle {
  to { transform: translateY(100%); }
}

@keyframes movetext {
  to { transform: translateY(-100%); }
}

@keyframes candle-flame {
  from, to { transform: translateY(-100%); opacity: 1; }
}

@keyframes flame {
  25% { box-shadow: 0 0 32px #ff8; border-radius: 100%; transform: skewX(-10deg) scaleY(1.5); }
  50% { box-shadow: 0 0 24px red; border-radius: 50%; border-top-left-radius: 100%; border-top-right-radius: 100%; transform: skewX(10deg) scaleY(1.3); }
  75% { box-shadow: 0 0 32px #f80; border-radius: 100%; transform: skewX(0) scaleY(.9); }
}

@keyframes snowflake {
  from { top: -20px; }
  to   { top: 100%; }
}

@keyframes snowflake-1 {
  25%  { transform: translateX(190%); }
  50%  { transform: translateX(-143%); }
  80%  { transform: translateX(-47%); }
  100% { transform: translateX(-78%); }
}

@keyframes snowflake-2 {
  25%  { transform: translateX(56%); }
  50%  { transform: translateX(-211%); }
  80%  { transform: translateX(-34%); }
  100% { transform: translateX(70%); }
}

@keyframes wick {
  from, to { background-color: #000; }
}

@media (max-width: 330px) {
  .snowflakes .snowflake:nth-of-type(2n) { display: none; }
}


/* ============================================
   SHARED: PULSE ANIMATION (calendar "I dag" label)
   ============================================ */

@keyframes pulse-more {
  0%, 100% { scale: .9; }
  50%      { scale: 1.1; }
}

.pulse-more {
  animation: pulse-more .8s ease-in-out infinite;
}
