/* ==========================================================================
   Weingut Männchen · Probierstube
   One screen: a dark board hung on two cords tells whether the tasting
   room is open. Hours, how to find us, contact. 12 / 8 / 4 columns.
   ========================================================================== */

:root {
  --paper: #FFFFFF;
  --ink: #2B241F;
  --board: #2A2A2A;
  --cream: #F0E8D9;
  --muted: #8C8272;
  --twine: #7C6B58;
  --rule: rgba(43, 36, 31, .18);

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Figtree", "Helvetica Neue", Arial, system-ui, sans-serif;

  --m: clamp(20px, 3.4vw, 56px);
  --g: clamp(12px, 1.6vw, 24px);
  --cols: 12;
  --ease: cubic-bezier(.22, .7, .2, 1);
}
@media (max-width: 999px) { :root { --cols: 8; } }
@media (max-width: 599px) { :root { --cols: 4; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 14.5px/1.62 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p, h1, h2, figure, dl, dd { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--twine); outline-offset: 3px; }
::selection { background: rgba(124, 107, 88, .22); }

.serif { font-family: var(--serif); }
.wrap { padding-inline: var(--m); }
.grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: var(--g); }
.ul { background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; transition: background-size .5s var(--ease); padding-bottom: 2px; }
.ul:hover { background-size: 0 1px; background-position: 100% 100%; }

/* ---------- One screen ---------- */
.page { min-height: max(100svh, 620px); display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; position: relative; }

/* Header */
.hdr { height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.hdr__id { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.hdr__mark { font-size: 23px; font-weight: 400; line-height: 1; }
.hdr__sub, .hdr__nav { font: 500 10.5px/1.4 var(--sans); text-transform: uppercase; letter-spacing: .16em; }
.hdr__sub { color: var(--muted); }
.hdr__nav { display: flex; gap: 26px; }
@media (max-width: 599px) {
  .hdr { height: 68px; }
  .hdr__sub { display: none; }
  .hdr__nav { gap: 18px; }
}

/* Main: two rows on the grid */
.main { grid-template-rows: auto auto; row-gap: clamp(28px, 4vh, 56px); align-content: space-between; padding-block: 8px clamp(24px, 4vh, 48px); }
.pic figcaption { margin-top: 8px; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.pic figcaption b { display: block; font: 600 10px/1.4 var(--sans); text-transform: uppercase; letter-spacing: .16em; color: var(--ink); }
.ph { aspect-ratio: 3 / 4; overflow: hidden; background: var(--avg, #DDD6CB); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.pic--1 { grid-column: 1 / 3; grid-row: 1; align-self: start; margin-top: clamp(8px, 3vh, 40px); }
.pic--2 { grid-column: 11 / 13; grid-row: 1; align-self: end; }
.hang { grid-column: 5 / 9; grid-row: 1; min-height: clamp(260px, 42vh, 560px); display: flex; align-items: flex-end; justify-content: center; }
.slot { position: relative; width: min(100%, 58svh * 1.5); aspect-ratio: 3 / 2; }

.lead { font-weight: 300; font-size: clamp(21px, 1.72vw, 28px); line-height: 1.16; letter-spacing: -.005em; max-width: 17ch; margin-bottom: 14px; }
.note { grid-column: 1 / 4; grid-row: 2; }
.note p { max-width: 36ch; }
.count { grid-column: 5 / 9; grid-row: 2; }
.count .lead { max-width: none; }
.hours { grid-column: 10 / 13; grid-row: 2; }

/* Countdown */
.cells { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--rule); }
.cells div { padding: 12px 0 10px 14px; border-left: 1px solid var(--rule); }
.cells div:first-child { border-left: 0; padding-left: 0; }
.cells b { display: block; font: 300 clamp(30px, 3.1vw, 50px)/1 var(--sans); letter-spacing: -.03em; font-variant-numeric: tabular-nums lining-nums; }
.cells span { display: block; margin-top: 6px; font: 500 10px/1 var(--sans); text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }
.when { margin-top: 12px; font-style: italic; font-weight: 300; font-size: 17px; }

/* Hours */
.times { border-bottom: 1px solid var(--rule); }
.times div { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-top: 1px solid var(--rule); font-size: 13.5px; }
.times dt { color: var(--ink); }
.times dd { text-align: right; color: var(--muted); }
.times .is-today dt::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--twine); margin: 0 8px 1px 0; }
.times .is-today dd { color: var(--ink); }
.times .is-off dd { font-style: italic; }
.ask { margin-top: 18px; }
.ask__lbl { display: block; font-size: 13px; color: var(--muted); }
.ask__row { display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--ink); margin-top: 6px; }
.ask__row input { flex: 1; min-width: 0; border: 0; background: none; font: 400 14.5px/1 var(--sans); padding: 10px 0; color: var(--ink); }
.ask__row input:focus { outline: none; }
.ask__row button { font: 600 10.5px/1 var(--sans); text-transform: uppercase; letter-spacing: .16em; white-space: nowrap; }
.ask__msg { min-height: 1.6em; margin-top: 6px; font-size: 12px; color: var(--twine); }

/* Footer */
.foot { padding-bottom: 22px; }
.foot__rule { display: block; height: 1px; background: var(--rule); transform-origin: 0 50%; }
.foot__cols { padding-top: 16px; row-gap: 14px; font-size: 13px; line-height: 1.5; }
.foot__cols > div { grid-column: span 3; }
.flabel { font: 600 10px/1.4 var(--sans); text-transform: uppercase; letter-spacing: .16em; color: var(--muted); margin-bottom: 4px; }

/* Tablets: sign in columns 3 to 6, pictures beside it */
@media (max-width: 999px) {
  .pic--1 { grid-column: 1 / 3; }
  .hang { grid-column: 3 / 7; }
  .pic--2 { grid-column: 7 / 9; }
  .note { grid-column: 1 / 5; grid-row: 2; }
  .count { grid-column: 5 / 9; grid-row: 2; }
  .hours { grid-column: 1 / 5; grid-row: 3; }
  .foot__cols > div { grid-column: span 4; }
}
/* Phones: the sign centred, everything else in one column */
@media (max-width: 599px) {
  .page { overflow: visible; }
  .main { grid-template-rows: none; }
  .hang { grid-column: 1 / -1; grid-row: 1; min-height: 270px; }
  .slot { width: 100%; }
  .pic--1, .pic--2 { grid-row: auto; margin-top: 0; }
  .pic--1 { grid-column: 1 / 3; } .pic--2 { grid-column: 3 / 5; align-self: start; margin-top: 40px; }
  .note, .count, .hours { grid-column: 1 / -1; grid-row: auto; }
  .foot__cols > div { grid-column: 1 / -1; }
}

/* ---------- The sign ---------- */
.sign {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  container-type: inline-size;
  transform-origin: 50% 50%;
  will-change: transform;
  cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.sign__in {
  position: absolute; inset: 0;
  font-size: calc(100cqw / 36);
  background: var(--board);
  color: var(--cream);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 2.1em 2em 1.7em;
  box-shadow: 0 1.2em 2.4em -1.2em rgba(0, 0, 0, .35);
}
.sign__frame { position: absolute; inset: .8em; border: 1px solid rgba(240, 232, 217, .26); pointer-events: none; }
.eyelet { position: absolute; top: 1.9em; width: 1.1em; height: 1.1em; margin: -.55em 0 0 -.55em; border-radius: 50%; background: radial-gradient(circle, var(--twine) 0 32%, #151515 34% 100%); box-shadow: 0 0 0 1px rgba(240, 232, 217, .18); }
.eyelet--l { left: 1.9em; } .eyelet--r { left: calc(100% - 1.9em); }
.sign__top { text-align: center; font: 500 .8em/1 var(--sans); text-transform: uppercase; letter-spacing: .32em; opacity: .74; }
.sign__mid { text-align: center; }
.sign__title { font: 200 5em/.95 var(--serif); letter-spacing: -.01em; }
.sign__status { margin-top: .5em; font: italic 300 1.55em/1.25 var(--serif); }
.sign__status b { font-weight: 400; }
.sign__foot { display: flex; justify-content: space-between; font: 500 .74em/1 var(--sans); text-transform: uppercase; letter-spacing: .2em; opacity: .74; }
.sign:focus-visible { outline: none; }
.sign:focus-visible .sign__in { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--twine); }

/* the sign once it hangs in the page layer */
.sign.is-free { position: absolute; z-index: 5; }
.cords { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; overflow: visible; }
.cords path { fill: none; stroke: var(--twine); stroke-width: 1.4; stroke-linecap: round; }

/* ---------- Intro ---------- */
.js .rise { opacity: 0; transform: translateY(14px); transition: opacity 1.1s var(--ease), transform 1.2s var(--ease); transition-delay: calc(var(--o, 0) * 85ms); }
.js.in .rise { opacity: 1; transform: none; }
.js .foot__rule { transform: scaleX(0); transition: transform 1.4s var(--ease) .5s; }
.js.in .foot__rule { transform: none; }
.js .foot__cols { opacity: 0; transition: opacity 1.1s var(--ease) .7s; }
.js.in .foot__cols { opacity: 1; }
.js:not(.still) .sign { visibility: hidden; }
.js .sign.is-free { visibility: visible; }

.rm *, .rm *::before, .rm *::after { transition: none !important; }

/* Shift+G grid */
.grid-cols { position: fixed; inset: 0; z-index: 0; pointer-events: none; display: none; padding-inline: var(--m); grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: var(--g); }
.grid-on .grid-cols { display: grid; }
.grid-cols i { background: rgba(43, 36, 31, .05); box-shadow: inset 1px 0 rgba(43, 36, 31, .28), inset -1px 0 rgba(43, 36, 31, .28); }
