:root {
  --bg: rgb(255, 255, 255);
  --text: #111111;
  --line: #dcdcdc;
  --muted: #6d6d6d;
  --topbar-h-mobile: 56px;
  --topbar-h-desktop: 64px;
  --engrave-dark: rgba(0, 0, 0, 0.28);
  --engrave-light: rgba(255, 255, 255, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "ArialNarrow", Arial, sans-serif;
}

html {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 100%;
}

html,
body.calendar-view {
  min-height: 100%;
  background-color: var(--bg);
  background-image: url("/assets/site/frzr_bg-65db2483.jpg");
  background-repeat: repeat-y;
  background-size: 100% auto;
}

.calendar-page {
  padding: calc(var(--topbar-h-mobile) + 1rem) 1rem 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.year-block + .year-block {
  margin-top: 2rem;
}

.year-title {
  margin: 0 0 0.75rem;
  line-height: 1.2;
  display: inline-block;
}

.year-title__img {
  display: block;
  height: 2.0rem;
  width: auto;
}

.year-title--2025 {
  transform: rotate(-2deg);
}

.year-title--2026 {
  transform: rotate(1.8deg);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.calendar-month {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.calendar-month.has-projects {
  cursor: pointer;
}

.calendar-month.has-projects .month-label {
  display: none;
}

.calendar-month.has-projects .calendar-box {
  transform: rotate(var(--tilt, 0deg));
  transform-origin: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.calendar-month.has-projects:hover .calendar-box {
  transform: translateY(-2px) rotate(var(--tilt, 0deg));
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.month-modal {
  position: fixed;
  inset: 0;
  display: none;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.35);
  z-index: 3000;
}

.month-modal.is-open {
  display: grid;
  place-items: center;
}

.month-modal__dialog {
  width: min(100%, 760px);
  max-height: 85vh;
  overflow: auto;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 1rem;
  position: relative;
}

.month-modal__close {
  position: absolute;
  right: 0.55rem;
  top: 0.45rem;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
  display: none;
}

.month-modal__title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--text);
  text-align: center;
  display: none;
}

.month-modal__grid {
  position: relative;
  width: 100%;
  min-height: 60vh;
  display: block;
}

.month-modal__card {
  text-decoration: none;
  color: inherit;
  border: 0;
  box-shadow: 4px 6px 4px rgba(0, 0, 0, 0.35);
  border-radius: 0;
  overflow: hidden;
  position: absolute;
  left: 0;
  top: 0;
  width: var(--card-size, 180px);
  transform: translate(var(--card-x, 0px), var(--card-y, 0px)) rotate(var(--card-r, 0deg));
  display: block;
}

.month-modal__card img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #FFF69B
}

.month-modal__card span {
  position: absolute;
  left: 6px;
  bottom: 6px;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.25rem 0.35rem;
  border-radius: 999px;
  color: #000000;
  font-family: "OuvrieresAffamees", "ArialNarrow", Arial, sans-serif;
}

.calendar-box {
  border: 0;
  aspect-ratio: 1 / 1;
  background: #FFF69B;
  border-radius: 0;
  box-shadow: 4px 6px 4px rgba(0, 0, 0, 0.35);
  position: relative;
  padding: 0;
  container-type: inline-size;
}

.calendar-box:empty::before {
  content: none;
}

.calendar-box.is-current {
  box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.28), 4px 6px 2px rgba(0, 0, 0, 0.35);
  position: relative;
}

.calendar-box.is-current::after {
  position: absolute;
  left: 6px;
  bottom: 6px;
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.25rem 0.35rem;
  border-radius: 999px;
  color: #000000;
  font-family: "OuvrieresAffamees", "ArialNarrow", Arial, sans-serif;
}

.calendar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.12rem;
}

.project-list li {
  display: flex;
  align-items: baseline;
  gap: 0.18em;
  font-size: clamp(0.52rem, 10cqw, 0.82rem);
  line-height: 1.15;
  color: #111;
}

.project-list li::before {
  content: "•";
  flex: 0 0 auto;
  line-height: 1;
}

.calendar-legal-link {
  margin: 1.25rem 0 0;
  text-align: center;
}

.calendar-legal-link a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  opacity: 0.8;
}

.month-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.1;
  color: #705719;
  letter-spacing: 0.01em;
  text-shadow:
    0 1px 0 var(--engrave-light),
    0 -1px 0 var(--engrave-dark);
}

.calendar-month.is-empty {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

.calendar-month.is-empty .month-label {
  font-size: 0.95rem;
  font-weight: 700;
  opacity: 0.85;
  text-align: center;
  color: #121212;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5),
    0 -1px 0 rgba(89, 82, 82, 0.32);
}

.calendar-month.is-empty .calendar-box {
  display: none;
}

.calendar-box__preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.calendar-box__stack {
  position: relative;
  width: 100%;
  height: 100%;
}

.calendar-box__stack-item {
  position: absolute;
  inset: 0;
  z-index: calc(10 - var(--stack-i));
  transform: translate(var(--stack-offset, 0px), var(--stack-offset, 0px)) rotate(var(--stack-r, 0deg));
}

.calendar-box__stack-card {
  width: 100%;
  height: 100%;
  background: #FFF69B;
  box-shadow: 2px 3px 4px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.calendar-box__stack-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* simple yellow text card inside month modal */
.month-modal__card.month-modal__text {
  position: relative;
  left: auto;
  top: auto;
  width: auto;
  max-width: 720px;
  transform: none;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  background: #FFF69B;
  color: #111;
  padding: 16px;
  border-radius: 0px;
  overflow: visible;
}

/* ensure inner text uses readable styles */
.month-modal__card.month-modal__text p {
  margin: 0 0 0.75rem;
  line-height: 1.45;
}

/* ========== Desktop Styles ========== */

@media (min-width: 768px) {
  .calendar-page {
    padding: calc(var(--topbar-h-desktop) + 1.25rem) 1.25rem 1.25rem;
  }

  .calendar-grid {
    gap: 0.8rem;
  }

  .year-title {
    font-size: 1.5rem;
  }

  .year-title__img {
    height: 3.0rem;
  }

  .month-modal__grid {
    min-height: 70vh;
  }

  .calendar-box:empty::before {
    font-size: clamp(0.5rem, 3.2cqw, 0.66rem);
    line-height: 1.28;
  }

  /* Desktop: kleineres, zentriertes Hintergrundbild als Base-Layer */
  html, body.calendar-view {
    background-size: 70% auto; /* Bild schmaler machen */
    background-position: center top;
    background-repeat: repeat-y;
  }
}


/* ========== Fonts ========== */

@font-face {
  font-family: "ArialNarrow";
  src: url("/assets/fonts/arialnarrow-f0a7ff15.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Sniglet";
  src: url("/assets/fonts/Sniglet-Regular-5a3e893e.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "OuvrieresAffamees";
  src: url("/assets/fonts/Ouvrieres-affamees-24c3e09a.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

.project-list li,
.calendar-month.is-empty .month-label {
  font-family: "ArialNarrow", "Comic Sans MS", "Trebuchet MS", sans-serif;
}

.calendar-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
}

.calendar-footer__logo {
  height: 2.4rem;
  width: auto;
  max-width: 90vw;
  display: block;
}

.calendar-legal-link {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.95rem;
}


@media (min-width: 768px) {
  .calendar-footer__logo {
    height: 3.6rem;
  }
  .calendar-legal-link {
    font-size: 1.7rem;
  }
}

/* kleine, zentrierte PNG-Vorschau (kein gelbes Post-it) */
.calendar-box__mini {
  width: 50%;
  max-width: 115px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.calendar-box__mini-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Desktop: etwas größer */
@media (min-width: 768px) {
  .calendar-box__mini {
    max-width: 1600px;
    width: 45%;
  }
}

.calendar-month.is-empty.has-mini .calendar-box {
  display: flex; /* override: zeige Box, auch wenn JS sie als "is-empty" markiert */
  background: transparent !important;
  box-shadow: none !important;
}

/* Für Monate mit Mini-Vorschaubild: keine gelbe Post-it-Box, zentrierte Darstellung */
.calendar-month.has-mini .calendar-box,
.calendar-month.is-empty.has-mini .calendar-box {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  padding: 0 !important;
}

/* Stelle sicher, dass das Mini-Bild nicht das Post-it-Styling erbt */
.calendar-month.has-mini .calendar-box__mini,
.calendar-month.is-empty.has-mini .calendar-box__mini {
  background: transparent !important;
  box-shadow: none !important;
  margin: 0;
  width: 55%;
  max-width: 130px;
}

/* Bild selbst: korrekt skalieren, kein cover */
.calendar-month.has-mini .calendar-box__mini-img,
.calendar-month.is-empty.has-mini .calendar-box__mini-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}
