/* Kunstinstituut Melly — Rental. Fonts are in fonts.css. */

:root {
  /* Change the colours of the whole site here. */
  --pink: #f3d9eb;
  --blue: #2a2aff;
  --yellow: #ffff00;

  --bg: var(--pink);
  --ink: var(--blue);
  --line: rgba(42, 42, 255, 0.28);
  --gutter: clamp(16px, 4vw, 48px);
  --text: "Melly Sans", Helvetica, Arial, sans-serif;
  --display: "Melly Sans 2", "Melly Sans", Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: normal clamp(1rem, 0.94rem + 0.28vw, 1.1875rem)/1.38 var(--text);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }

h1, h2, h3, h4 { font-weight: normal; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; max-width: 36em; }
p:last-child { margin-bottom: 0; }

/* The irregular display font is for headings only (h1, h2, h3). */
/* Small uppercase labels */
h4, .label, .facts dt, .tier__prices dt, .prices__group th, .jump__fact, summary {
  font-size: 0.8em;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
h3 { font-family: var(--display); font-size: 1.45em; line-height: 1.1; margin-bottom: 0.6em; }
h4 { margin-bottom: 0.5em; }
* + h4 { margin-top: 2em; }
.lede { font-size: 1.3em; line-height: 1.28; max-width: 30em; }
.small { font-size: 0.85em; margin-bottom: 0.4em; }
.spaced { margin-top: 2.5em; }

/* ---------- layout ---------- */

.wrap { padding-inline: var(--gutter); max-width: 1440px; margin-inline: auto; }

.sec { border-top: 1px solid var(--ink); }
.sec__grid { display: grid; gap: 1.5rem var(--gutter); padding-block: clamp(2.5rem, 6vw, 5rem); }
.sec__title { font-family: var(--display); font-size: 1.9em; line-height: 1.05; }
@media (min-width: 1000px) {
  .sec__grid { grid-template-columns: minmax(180px, 2fr) 9fr; }
  .sec__title { position: sticky; top: 5rem; align-self: start; font-size: 1.6em; }
}

.cols { display: grid; gap: 2.5rem var(--gutter); }
@media (min-width: 760px) {
  .cols { grid-template-columns: 1fr 1fr; }
  .cols--3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- header ---------- */

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 0.5rem 1.5rem;
  padding: 0.75rem var(--gutter);
  background: var(--pink);
  border-bottom: 1px solid var(--blue);
  font-size: 0.9em;
}
.brand { display: inline-flex; align-items: baseline; gap: 0.45em; font-size: 1.2em; line-height: 1.2; text-decoration: none; white-space: nowrap; }
/* Sized so the logo's letters are exactly as tall as the text next to it;
   the shift puts both on the same baseline (the rest is the tail of the y). */
.brand__logo { height: 0.928em; width: auto; position: relative; top: 0.217em; }
.nav { display: flex; gap: 1.3rem; margin-left: auto; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { text-decoration: none; }
.nav a:hover { text-decoration: underline; }
.lang { display: flex; flex: none; border: 1px solid var(--blue); border-radius: 999px; overflow: hidden; }
.lang button {
  font: inherit; font-size: 0.85em; color: var(--blue); background: none; border: 0;
  padding: 0.25em 0.8em; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--blue); color: var(--pink); }
@media (max-width: 900px) {
  .top { flex-wrap: wrap; }
  .lang { margin-left: auto; }
  .nav { order: 3; width: 100%; margin-left: 0; }
  html { scroll-padding-top: 6.5rem; }
}

/* ---------- hero ---------- */

.hero .wrap { padding-block: clamp(2.5rem, 7vw, 6rem) clamp(2rem, 4vw, 3.5rem); }
.hero .label { margin-bottom: 1.5em; }
.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.5rem, 8.5vw, 8rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  max-width: 11em;
}
/* The changing word in the title. Each word gets its own line, so the
   lines around it never jump when a longer or shorter word comes in. */
.swap { display: block; }
.swap__word {
  display: inline-block;
  transform-origin: 0 70%;
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.35s ease;
}
.swap__word.is-out { opacity: 0; transform: translateY(-0.35em) rotate(-4deg); transition-timing-function: ease-in; }
.swap__word.is-in { opacity: 0; transform: translateY(0.45em) rotate(3deg); transition: none; }
@media (prefers-reduced-motion: reduce) {
  .swap__word, .swap__word.is-out, .swap__word.is-in { transform: none; }
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.hero__row { display: grid; gap: 1.5rem var(--gutter); margin-top: clamp(2rem, 5vw, 4rem); }
.hero__text { font-size: 1.2em; line-height: 1.3; }
.hero__cta { margin: 0; }
@media (min-width: 860px) {
  .hero__row { grid-template-columns: minmax(0, 40em) auto; justify-content: space-between; align-items: end; }
}

.button {
  display: inline-block;
  padding: 0.7em 1.4em 0.65em;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.button:hover { background: transparent; color: var(--ink); }
.button--invert { background: var(--pink); color: var(--blue); border-color: var(--pink); }
.button--invert:hover { background: transparent; color: var(--pink); }

.jumps { display: grid; margin-top: clamp(2.5rem, 6vw, 5rem); border-top: 1px solid var(--ink); }
.jump {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.9em 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.jump__name { font-size: 1.25em; line-height: 1.15; }
.jump__name::after { content: " ↓"; }
.jump:hover .jump__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
.jump__fact { white-space: nowrap; }
@media (min-width: 860px) {
  .jumps { grid-template-columns: repeat(3, 1fr); column-gap: var(--gutter); }
  .jump { flex-direction: column; gap: 0.4rem; border-bottom: 0; padding-bottom: 0; }
}

/* ---------- lists ---------- */

.list { list-style: none; margin: 0 0 1em; padding: 0; border-bottom: 1px solid var(--line); }
.list li { padding: 0.55em 0; border-top: 1px solid var(--line); }
.list + .small { margin-top: 1em; }

/* ---------- spaces ---------- */

.space { display: grid; gap: 2rem var(--gutter); padding-block: clamp(2rem, 4vw, 3.5rem); border-top: 1px solid var(--line); }
.sec__body > .lede { margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.space:last-child { padding-bottom: 0; }
.space h3 { font-size: 1.9em; }

.facts { display: flex; flex-wrap: wrap; gap: 1.2rem 2.2rem; margin: 1.8em 0 0; }
.facts dd { margin: 0.15em 0 0; font-size: 1.6em; line-height: 1.05; white-space: nowrap; }

.space__photos { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; order: -1; max-width: 860px; }
.photo { margin: 0; }
.photo img { width: 100%; aspect-ratio: 10 / 7; object-fit: cover; background: var(--line); }
.photo figcaption { font-size: 0.7em; margin-top: 0.35em; opacity: 0.8; }

@media (min-width: 760px) {
  .space { grid-template-columns: 1fr 1fr; }
  .space__photos { grid-column: 1 / -1; }
}
@media (min-width: 1240px) {
  /* Photos move to a narrow third column, so they are never enlarged much. */
  .space { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 300px); }
  .space__photos { grid-column: auto; grid-template-columns: 1fr; order: 0; align-content: start; }
}

/* ---------- rates ---------- */

.tiers { display: grid; gap: 0.75rem; margin: clamp(2rem, 4vw, 3.5rem) 0 1.2rem; }
.tier { display: flex; flex-direction: column; border: 1px solid var(--ink); padding: 1.4rem 1.4rem 1.2rem; }
.tier > p { flex: 1; margin-bottom: 1.5em; }
.tier__prices { margin: 0; display: grid; gap: 0; }
.tier__prices > div, .tier__free { border-top: 1px solid var(--line); padding: 0.7em 0 0.5em; margin: 0; }
.tier__prices dd { margin: 0.1em 0 0; }
.tier .price { font-size: 1.7em; line-height: 1.1; }
.tier__free { font-size: 1.25em; line-height: 1.15; }
.tier__free + .small { margin: 0; }
.price, .unit { white-space: nowrap; }
@media (min-width: 900px) { .tiers { grid-template-columns: repeat(3, 1fr); } }

/* ---------- price list ---------- */

.prices { width: 100%; max-width: 46rem; border-collapse: collapse; margin-bottom: 1.2em; }
.prices th, .prices td { text-align: left; vertical-align: top; font-weight: normal; padding: 0.55em 0; border-top: 1px solid var(--line); }
.prices td { text-align: right; white-space: nowrap; padding-left: 1.5rem; }
/* Longer text in the price column may wrap, but never one word per line. */
@media (max-width: 600px) { .prices td.prices__text { white-space: normal; min-width: 11.5em; text-wrap: balance; } }
.prices .prices__group th { border-top: 1px solid var(--ink); padding-top: 1.1em; padding-bottom: 0.9em; }
.prices tbody + tbody .prices__group th { padding-top: 1.1em; }
.prices tbody:not(:last-child) tr:last-child > * { padding-bottom: 1.6em; }
.prices { border-bottom: 1px solid var(--ink); }
.detail { display: block; font-size: 0.8em; opacity: 0.8; }

/* ---------- code of conduct ---------- */

details { margin-top: 2em; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
summary { cursor: pointer; padding: 1.1em 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.4em; line-height: 0.8; }
details[open] summary::after { content: "–"; }
.details__body { padding: 1rem 0 2.5rem; }
.details__body > .cols { margin-block: 2.5rem; }

/* ---------- contact + footer ---------- */

.contact { background: var(--blue); color: var(--pink); --ink: var(--pink); --bg: var(--blue); }
.contact__grid { display: grid; gap: 2.5rem var(--gutter); padding-block: clamp(3rem, 7vw, 6rem); }
.contact h2 { font-family: var(--display); font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1; margin-bottom: 0.5em; }
.contact .label { margin-bottom: 0.8em; }
@media (min-width: 860px) { .contact__grid { grid-template-columns: 3fr 2fr; align-items: end; } }

.footer { background: var(--yellow); color: #000; font-size: 0.85em; }
.footer__grid { display: grid; gap: 1.2rem var(--gutter); padding-block: 2.2rem; align-items: start; }
.footer p { margin: 0; }
.footer a { text-decoration-color: var(--blue); }
.footer__logo { width: 64px; height: 64px; }
@media (min-width: 760px) { .footer__grid { grid-template-columns: auto repeat(3, 1fr); } }

/* ---------- print (File > Print gives a tidy PDF) ---------- */

@media print {
  .top, .button, .jumps, summary::after { display: none; }
  body { font-size: 10.5pt; }
  .sec__title { position: static; }
  .space, .tier { break-inside: avoid; }
}
