/* ==========================================================================
   Irmas Geschenkeshop
   1. Tokens   2. Base   3. Layout   4. Header   5. Intro   6. Gallery
   7. About    8. Contact   9. Footer   10. Lightbox   11. Simple pages
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------
   Change the look of the whole site here, e.g. to match the real logo. */

:root {
  color-scheme: light;

  --color-paper: #faf6f0;
  --color-surface: #ffffff;
  --color-ink: #2e2a26;
  --color-ink-soft: #655c54;
  --color-accent: #a3324a;
  --color-accent-strong: #7d2438;
  --color-line: #e6ddd1;

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --step--1: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.6rem, 1.4rem + 1vw, 2.25rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3.25rem);

  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.5rem;
  --space-xl: clamp(3rem, 2rem + 5vw, 6rem);

  --content-width: 75rem;
  --text-width: 40rem;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2rem);
  --radius: 0.5rem;

  /* Gallery tiles: "cover" fills the tile and crops the edges,
     "contain" shows the whole photo inside the tile. */
  --tile-fit: cover;
  --tile-ratio: 1;
}

/* 2. Base ----------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-m);
}

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3 {
  margin: 0 0 var(--space-s);
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-3);
}

h2 {
  font-size: var(--step-2);
}

h3 {
  font-size: var(--step-1);
}

p,
ul,
ol,
address {
  margin: 0 0 var(--space-s);
}

p {
  text-wrap: pretty;
}

a {
  color: var(--color-accent);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--color-accent-strong);
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* 3. Layout --------------------------------------------------------------- */

.wrap {
  width: min(100% - 2 * var(--gutter), var(--content-width));
  margin-inline: auto;
}

.section {
  padding-block: var(--space-xl);
}

.section--tint {
  background: var(--color-surface);
  border-block: 1px solid var(--color-line);
}

.section__lead {
  max-width: var(--text-width);
  margin-bottom: var(--space-l);
  color: var(--color-ink-soft);
}

.prose {
  max-width: var(--text-width);
}

.skip-link {
  position: absolute;
  top: 0;
  left: var(--space-s);
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--color-ink);
  color: #fff;
  transform: translateY(-120%);
}

.skip-link:focus {
  color: #fff;
  transform: none;
}

/* 4. Header --------------------------------------------------------------- */

.site-header {
  padding-block: var(--space-m);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-l);
}

.site-header__logo {
  display: block;
}

.site-header__logo img {
  width: auto;
  height: clamp(3rem, 2.5rem + 2vw, 4.25rem);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-m);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding: 0.75rem 0.25rem;
  border-bottom: 2px solid transparent;
  color: var(--color-ink);
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
}

@media (max-width: 34rem) {
  .site-header__inner {
    flex-direction: column;
    justify-content: center;
  }
}

/* 5. Intro ---------------------------------------------------------------- */

.intro {
  padding-block: var(--space-l) var(--space-xl);
  text-align: center;
}

.intro h1 {
  max-width: 22ch;
  margin-inline: auto;
}

.intro h1::after {
  content: "";
  display: block;
  width: 4rem;
  height: 3px;
  margin: var(--space-m) auto 0;
  border-radius: 3px;
  background: var(--color-accent);
}

.intro__lead {
  max-width: 38rem;
  margin: var(--space-m) auto 0;
  color: var(--color-ink-soft);
  font-size: var(--step-1);
  line-height: 1.5;
}

/* 6. Gallery -------------------------------------------------------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.75rem, 0.4rem + 1.5vw, 1.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 44rem) {
  .gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 69rem) {
  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.gallery figure {
  margin: 0;
}

.gallery a {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--color-line);
  aspect-ratio: var(--tile-ratio);
}

.gallery picture {
  height: 100%;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: var(--tile-fit);
  transition: transform 0.4s ease;
}

.gallery a:hover img,
.gallery a:focus-visible img {
  transform: scale(1.04);
}

.gallery figcaption {
  padding-top: var(--space-xs);
  color: var(--color-ink-soft);
  font-size: var(--step--1);
  line-height: 1.4;
}

/* 7. About ---------------------------------------------------------------- */

.about {
  display: grid;
  gap: var(--space-l);
}

@media (min-width: 54rem) {
  .about {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: var(--space-xl);
    align-items: start;
  }
}

.card {
  padding: var(--space-m);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.card > :last-child {
  margin-bottom: 0;
}

.card h3 {
  margin-bottom: var(--space-xs);
}

.checklist {
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding: 0.35rem 0 0.35rem 1.5rem;
}

.checklist li + li {
  border-top: 1px solid var(--color-line);
}

.checklist li::before {
  content: "";
  position: absolute;
  top: 1.05em;
  left: 0.2rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--color-accent);
}

/* 8. Contact -------------------------------------------------------------- */

.contact {
  display: grid;
  gap: var(--space-l);
}

@media (min-width: 54rem) {
  .contact {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: var(--space-xl);
    align-items: start;
  }
}

.contact address {
  font-style: normal;
}

.contact__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact__list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-xs);
  padding-block: 0.25rem;
}

.contact__label {
  min-width: 5rem;
  color: var(--color-ink-soft);
}

.contact__list a {
  display: inline-block;
  padding-block: 0.4rem;
  margin-block: -0.4rem;
  overflow-wrap: anywhere;
}

/* 9. Footer --------------------------------------------------------------- */

.site-footer {
  padding-block: var(--space-l);
  border-top: 1px solid var(--color-line);
  color: var(--color-ink-soft);
  font-size: var(--step--1);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-l);
}

.site-footer p {
  margin: 0;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-m);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  display: inline-block;
  padding-block: 0.75rem;
  color: inherit;
}

.site-footer a:hover {
  color: var(--color-accent-strong);
}

/* 10. Lightbox ------------------------------------------------------------
   The <dialog> is created by js/main.js. Without JavaScript the gallery
   links simply open the large image. */

html:has(.lightbox[open]) {
  overflow: hidden;
}

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #fff;
}

.lightbox::backdrop {
  background: rgb(24 20 17 / 0.95);
}

.lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 4rem 0.75rem 1.25rem;
}

@media (min-width: 44rem) {
  .lightbox__figure {
    padding-inline: 5rem;
  }
}

.lightbox__figure picture {
  display: contents;
}

.lightbox__img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 9.5rem);
  max-height: calc(100dvh - 9.5rem);
  border-radius: 4px;
  object-fit: contain;
  transition: opacity 0.2s ease;
}

.lightbox.is-loading .lightbox__img {
  opacity: 0.35;
}

.lightbox__caption {
  max-width: 60ch;
  min-height: 1.4em;
  color: #f3ede6;
  font-size: var(--step--1);
  line-height: 1.4;
  text-align: center;
}

.lightbox__counter {
  position: absolute;
  top: 0.5rem;
  left: 1rem;
  margin: 0;
  color: #f3ede6;
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  line-height: 3rem;
}

.lightbox__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(60 52 46 / 0.75);
  color: #fff;
  cursor: pointer;
}

.lightbox__btn:hover {
  background: rgb(110 98 88 / 0.9);
}

.lightbox__btn:focus-visible {
  outline-color: #fff;
  border-radius: 50%;
}

.lightbox__btn svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lightbox__btn--close {
  top: 0.5rem;
  right: 0.5rem;
}

.lightbox__btn--prev,
.lightbox__btn--next {
  top: 50%;
  translate: 0 -50%;
}

.lightbox__btn--prev {
  left: 0.5rem;
}

.lightbox__btn--next {
  right: 0.5rem;
}

/* 11. Simple pages (Impressum, Datenschutz, 404) --------------------------- */

.page {
  padding-block: var(--space-l) var(--space-xl);
}

.page h1 {
  font-size: var(--step-2);
}

.page h2 {
  margin-top: var(--space-l);
  font-size: var(--step-1);
}

.page address {
  font-style: normal;
}

.page--center {
  text-align: center;
}

.page--center .prose {
  margin-inline: auto;
}

.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  background: var(--color-accent-strong);
  color: #fff;
}
