/*
 * Rusthuis Cupido, 2027.
 *
 * Colour is taken from the poster's own layers rather than sampled off a
 * flattened image. The PDF keeps each text element on its own layer, so
 * these are the exact values the designer set:
 *
 *   #9b1547   the title            (layer 003)
 *   #203d5d   the secondary text   (layers 002, 004, 006)
 *   #374e60   the small print      (layers 007, 008)
 *   #314a60   the blue field in the illustration
 *   #e0bfa0   the paper
 *
 * The title pink is #9b1547, which is all but identical to the #9b1646 the
 * booking pages already use. The poster and the application were designed
 * apart and landed on the same colour.
 *
 * Measured contrast (AA wants 4.5 for body, 3.0 for large text):
 *
 *   pink  on paper    4.68   AA
 *   white on pink     8.10   AAA     <- the button
 *   navy  on paper    6.43   AA
 *   paper on blue     5.32   AA
 *   white on blue     9.21   AAA
 *   pink  on blue     1.14   FAIL    <- never put pink on the blue field
 */
:root {
  --paper: #e0bfa0;
  --pink: #9b1547;
  --navy: #203d5d;
  --muted: #374e60;
  --blue: #314a60;

  /* Fluid, with a gutter that never collapses on a phone. */
  --text: min(44rem, 100% - 2rem);
}

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

html {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  line-height: 1.55;
  background: var(--paper);
  color: var(--navy);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding-bottom: 3rem;
}

/* --- hero ----------------------------------------------------------------
 *
 * The blue field runs nearly the full width of the window, with the artwork
 * to the left of the type. Below 54rem the two stack, artwork first.
 */
/* --- the artwork --------------------------------------------------------
 *
 * The illustration alone, nothing over it. This is the poster's artwork
 * layer, which the PDF keeps separate from the type; checking it for
 * title-coloured pixels inside the title's own bounding box returns 0.000%,
 * against 97.4% on the text layer. So there is genuinely no lettering in it
 * and everything the poster says is set below as real text.
 *
 * No border, no shadow, no rounded corner. The drawing sits on paper of the
 * same colour as the page, so framing it would only draw a box around a
 * thing that has no edge.
 */
.artwork {
  display: block;
  width: 100%;
  height: auto;
  /* Pulled up under the title, which needs it because h1 has line-height
     0.95 and so leaves space below its last line.

     Written low-to-high. clamp(-0.5rem, -2vw, -1.5rem) has a minimum
     greater than its maximum, and CSS resolves that to the minimum, so it
     was stuck at -8px at every width rather than scaling. */
  /* Pulled up so the title and the logo sit over the top of the drawing.
     Safe to do here: the first 5% of the artwork is only 18% opaque and the
     next 5% barely half, so the type lands on paper rather than on the
     picture.

     Written low-to-high. clamp() with a minimum greater than its maximum
     resolves to the minimum and stops scaling altogether. */
  margin: clamp(-3rem, -3.5vw, -1rem) auto 0;
}

/* --- the rule under the illustration ------------------------------------
 *
 * The drawing stops dead against the paper. This closes it off, and runs the
 * full width of the window rather than the text measure so it reads as the
 * bottom of the picture area rather than as a divider inside the column.
 *
 * It is an <hr>, so it is a separator in the document and not only a stripe
 * drawn with CSS.
 */
.rule {
  width: 100%;
  height: 2px;
  margin: 0 0 clamp(1.75rem, 4vw, 3rem);
  border: 0;
  background: var(--pink);
}

/* --- title --------------------------------------------------------------
 *
 * Two words, two colours, as the affiche sets them. Measured off the
 * poster's own text layers:
 *
 *   Rusthuis   #203d5d   glyph band 6.1% of the page height
 *   Cupido     #9b1547   glyph band 16.6%, so 2.7x the first
 *
 * Both pass on paper: navy 6.43, pink 4.68, and the pink is large text
 * besides.
 */
header {
  width: var(--text);
  margin: clamp(1.5rem, 4vw, 2.5rem) auto 0;
}

/*
 * Logo beside the title rather than above it. Wraps on a very narrow screen
 * rather than squeezing either one.
 */
/*
 * Lifted above the artwork. Without this the overlap goes the wrong way:
 * the image comes after the title in the document, so it paints on top and
 * would cover the words it is supposed to sit under.
 */
.titlerow {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  flex-direction: row-reverse;
  align-items: center;
  gap: clamp(0.75rem, 2.5vw, 1.5rem);
}

.title-left {
  flex-grow: 2;
}

.title-right {
  text-align: right;
}

.logo {
  display: block;
  margin-left: auto;
  /* Smaller than the title it sits next to, deliberately. */
  width: clamp(3.75rem, 12vw, 10rem);
  height: auto;
}

.presents {
  margin: 0 0 0.2rem;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  color: var(--muted);
}

h1 {
  margin: 0;
  font-weight: 600;
  line-height: 0.95;
}

/* Stacked, because the words are stacked on the poster and because "Cupido"
   at this size would not share a line with anything. */
.word-one,
.word-two {
  display: block;
}

.word-one {
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  color: var(--navy);
}

/* 2.4 : 6.5 keeps the 1 : 2.7 the poster uses. */
.word-two {
  font-size: clamp(4rem, 11vw, 6.5rem);
  color: var(--pink);
}

.credits {
  margin: 1rem 0 0;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  color: var(--muted);
}

/* --- content -------------------------------------------------------------
 *
 * An auto-fitting grid rather than one narrow column: on a wide window the
 * three short blocks sit side by side instead of leaving two thirds of the
 * screen empty.
 */
main {
  width: var(--text);
  margin: 0 auto;
}

section + section {
  margin-top: clamp(2rem, 5vw, 3rem);
}

/* Prose and lists stay at a readable measure even though the hero and the
   footer run wide. */
section {
  width: var(--text);
}


h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 600;
  color: var(--pink);
}

p {
  margin: 0 0 0.8rem;
}

p:last-child {
  margin-bottom: 0;
}

.note {
  font-size: 0.9375rem;
  color: var(--muted);
}

ul {
  margin: 0 0 0.8rem;
  padding: 0;
  list-style: none;
}

.dates li,
.prices li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
  padding: 0.45rem 0;
}

.dates li + li,
.prices li + li {
  border-top: 1px solid rgb(32 61 93 / 0.18);
}

/* --- the order link on each performance -------------------------------- */

.dates-action {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.75rem;
}

/*
 * The same pink as the main button but smaller, so a row of them does not
 * compete with "Bestel je kaarten online" lower down.
 */
.order {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  background: var(--pink);
  color: #fff;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
  /* A tap must not be read as a double tap and zoom the page. */
  touch-action: manipulation;
}

.order:hover,
.order:focus {
  background: var(--navy);
  color: #fff;
}

.order:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 2px;
}

/* --- availability --------------------------------------------------------
 *
 * Shown only when there is something to say. No mark means seats are free,
 * which is the ordinary case; marking every line would hide the two that
 * matter.
 */
.status {
  flex: none;
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-gone {
  color: var(--pink);
}

.status-few {
  color: var(--muted);
}

.status-gone::before,
.status-few::before {
  content: "— ";
}

/* --- links and booking ---------------------------------------------------- */

a {
  color: var(--pink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--navy);
}

.button {
  display: inline-block;
  margin: 0.4rem 0;
  padding: 0.75rem 1.5rem;
  background: var(--pink);
  color: #fff;
  font-size: 1.0625rem;
  text-decoration: none;
  /* A tap must not be read as a double tap and zoom the page. */
  touch-action: manipulation;
}

.button:hover,
.button:focus {
  background: var(--navy);
  color: #fff;
}

a:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}

.button:focus-visible {
  outline-color: var(--pink);
}

.sold-out-all {
  margin: 0.4rem 0;
  padding: 0.7rem 0;
  border-top: 2px solid var(--pink);
  border-bottom: 2px solid var(--pink);
  color: var(--pink);
  font-weight: 700;
  text-align: center;
}

footer {
  width: var(--text);
  margin: clamp(2.5rem, 6vw, 4rem) auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgb(32 61 93 / 0.18);
  font-size: 0.875rem;
  color: var(--muted);
}

/*
 * The icons inherit the surrounding colour through fill: currentColor, so
 * they follow the link colour on hover instead of needing a second rule.
 */
.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.social a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.social svg {
  width: 1.1em;
  height: 1.1em;
  fill: currentColor;
  /* Sits on the text baseline rather than hanging below it. */
  flex: none;
}

/* --- printing ------------------------------------------------------------- */

@media print {
  html {
    background: #fff;
    color: #000;
  }

  .artwork,
  .button {
    display: none;
  }
}
