/*
  Tomasz & Trường.
  Red is the colour the Polish and Vietnamese flags share; it carries the page on plain white.
  The star yellow appears only as a highlight (text selection). Bricolage Grotesque for display,
  Newsreader for reading. Left-aligned throughout; desktop from 900px.
*/

:root {
  --red: #B4141E;
  --red-deep: #8E0F17;
  --ink: #1F1E1C;
  --grey: #67645F;
  --rule: #E3E1DD;
  --paper: #FFFFFF;
  --star: #FFCD00;

  --display: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
  --text: 'Newsreader', Georgia, serif;
  --gutter: 20px;
  --max: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 18px;
  line-height: 1.6;
  font-optical-sizing: auto;
  overflow-x: hidden;
}

::selection { background: var(--star); color: var(--ink); }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
p, h1, h2, h3, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3 { font-weight: 600; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.muted { color: var(--grey); }
.lede { font-size: clamp(20px, 2vw, 24px); line-height: 1.5; max-width: 34em; }

.link {
  font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 1.3;
  color: var(--ink); text-decoration: underline; text-decoration-color: var(--red);
  text-decoration-thickness: 2px; text-underline-offset: 5px;
  display: inline-block; padding: 10px 0;
}
.link:hover { color: var(--red); }
.link--inline { font: inherit; padding: 0; display: inline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.link--button { background: none; border: 0; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px; border-radius: 4px; border: 2px solid transparent;
  font-family: var(--display); font-size: 17px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn--block { width: 100%; }
.btn--on-red { background: var(--paper); color: var(--red); }
.btn--on-red:hover { background: var(--ink); color: var(--paper); }
.btn--outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--paper); }
.btn:disabled { opacity: .6; cursor: progress; }

.input {
  width: 100%; min-height: 52px; padding: 0 14px; border-radius: 4px; border: 2px solid var(--ink);
  background: var(--paper); color: var(--ink); font-family: var(--text); font-size: 19px;
}

/* ---- Header ---- */

.site-header {
  position: relative; z-index: 10; max-width: var(--max); margin: 0 auto; padding: 12px var(--gutter);
  display: flex; align-items: center; gap: 8px;
}
.site-header__home {
  margin-right: auto; font-family: var(--display); font-weight: 700; font-size: 18px;
  text-decoration: none; min-height: 44px; display: flex; align-items: center;
}
.site-header__menu {
  width: 44px; height: 44px; padding: 0; margin-right: -10px; border: 0; background: transparent; color: var(--ink);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.site-header__menu .when-open, .site-header__menu[aria-expanded="true"] .when-closed { display: none; }
.site-header__menu[aria-expanded="true"] .when-open { display: inline; }

.site-nav {
  display: none; position: absolute; top: 100%; left: 0; right: 0; padding: 4px var(--gutter) 16px;
  flex-direction: column; background: var(--paper); border-bottom: 2px solid var(--ink);
}
.site-nav.is-open { display: flex; }
.site-nav__link {
  color: var(--ink); min-height: 52px; display: flex; align-items: center; font-family: var(--display); font-weight: 600;
  font-size: 24px; text-decoration: none; border-top: 1px solid var(--rule);
}
.site-nav__link:hover { color: var(--red); }

.lang { display: flex; }
.lang__btn {
  min-width: 40px; min-height: 44px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 15px; font-weight: 600; color: var(--grey); text-decoration: none;
}
.lang__btn:hover { color: var(--ink); }
.lang__btn[aria-current="true"] {
  color: var(--red); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px;
}

/* ---- Home hero: the names are the design ---- */

.hero { padding-top: 24px; }
.hero__names {
  font-family: var(--display); font-weight: 800; font-stretch: 75%;
  font-variation-settings: "opsz" 96;
  font-size: clamp(60px, 19vw, 140px); line-height: .88; letter-spacing: -.012em;
  color: var(--red);
}
.hero__name { display: block; }

.hero__meta { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.hero__date {
  font-family: var(--display); font-weight: 700; font-stretch: 75%; font-size: 44px; line-height: 1;
  letter-spacing: -.01em; font-variant-numeric: tabular-nums;
  font-size: 34px;
}
.hero__announce { list-style: none; padding: 0; font-size: 20px; line-height: 1.3; }

.hero__photo { position: relative; margin-top: 24px; aspect-ratio: 4 / 5; overflow: hidden; background: var(--rule); }
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.hero__caption {
  position: absolute; right: 10px; bottom: 10px; padding: 3px 9px; border-radius: 2px;
  background: rgba(255, 255, 255, .88); color: var(--ink); font-style: italic; font-size: 14px; line-height: 1.4;
}

.peek { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.peek__item { display: block; aspect-ratio: 1; overflow: hidden; background: var(--rule); }
.peek__item img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Rows: heading on the left, content on the right (stacked on phones) ---- */

.row { padding-top: 64px; display: flex; flex-direction: column; gap: 18px; }
.row__head {
  font-family: var(--display); font-weight: 700; font-stretch: 85%;
  font-size: clamp(32px, 3.6vw, 44px); line-height: 1.05; letter-spacing: -.015em;
}
.row__body { display: flex; flex-direction: column; gap: 16px; min-width: 0; max-width: 33em; }

/* ---- Timetable ---- */

/* Text is capped at a comfortable line length; the timetable, venues and photos use the full column. */
.row__body:has(> .schedule, > .venues, > .peek, > .dress) { max-width: none; }
.schedule { list-style: none; padding: 0; border-bottom: 1px solid var(--rule); }
.schedule__row {
  display: grid; grid-template-columns: 88px minmax(0, 1fr); column-gap: 16px; row-gap: 2px;
  padding: 16px 0; border-top: 1px solid var(--rule);
}
.schedule__time {
  grid-row: span 2; font-family: var(--display); font-weight: 700; font-stretch: 75%;
  font-size: 34px; line-height: 1; color: var(--red); font-variant-numeric: tabular-nums;
}
.schedule__what { display: flex; flex-direction: column; }
.schedule__title { font-family: var(--display); font-weight: 600; font-size: 21px; line-height: 1.3; }
.schedule__place { color: var(--grey); font-size: 17px; line-height: 1.45; }
.schedule__who { grid-column: 2; font-style: italic; font-size: 17px; }

/* Two-column rows (timetable, venues, dress code, travel) line up by the tops of the capitals,
   so a big red time and a smaller title start at the same height. Older browsers ignore this. */
.schedule__time, .schedule__title, .schedule__who,
.venue__town, .venue__name,
.dress dt, .dress dd, .travel dt, .travel dd {
  text-box: trim-start cap alphabetic;
}
.schedule__row { align-items: start; }
.travel { align-items: start; }

/* ---- Venues ---- */

.venues { display: grid; gap: 40px; }
.venue { display: flex; flex-direction: column; gap: 6px; }
.venue__town {
  font-family: var(--display); font-weight: 700; font-stretch: 75%; font-size: 40px; line-height: 1;
  color: var(--red); letter-spacing: -.01em;
}
.venue__name { font-family: var(--display); font-weight: 600; font-size: 21px; margin-top: 6px; }
.venue__role { font-style: italic; color: var(--grey); }
.bullets { padding-left: 1.1em; }
.travel { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; }
.travel dt { font-family: var(--display); font-weight: 600; font-size: 16px; }
.travel dd { margin: 0; }

/* ---- Album call to action ---- */

.album-cta { margin-top: 96px; background: var(--red); color: var(--paper); padding-bottom: 72px; }
.album-cta .row { padding-top: 64px; }
.album-cta :focus-visible { outline-color: var(--paper); }

/* ---- Day page ---- */

.page-title { padding-top: 32px; display: flex; flex-direction: column; gap: 20px; }
.page-title__h {
  font-family: var(--display); font-weight: 800; font-stretch: 75%;
  font-variation-settings: "opsz" 96;
  font-size: clamp(72px, 15vw, 168px); line-height: .88; letter-spacing: -.008em; color: var(--red);
}
.dress { display: flex; flex-direction: column; border-bottom: 1px solid var(--rule); }
.dress__item { display: flex; flex-direction: column; gap: 4px; padding: 16px 0; border-top: 1px solid var(--rule); }
.dress dt { font-family: var(--display); font-weight: 600; font-size: 20px; }
.dress dd { margin: 0; }
.contacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.contact__name { font-family: var(--display); font-weight: 600; font-size: 21px; }

/* ---- Album lock (red page) ---- */

.page-lock { background: var(--red); color: var(--paper); }
.page-lock .site-header__menu { color: var(--paper); }
.page-lock .lang__btn { color: rgba(255, 255, 255, .78); }
.page-lock .lang__btn:hover, .page-lock .lang__btn[aria-current="true"] { color: var(--paper); }
.page-lock :focus-visible { outline-color: var(--paper); }
.lock { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; padding: 48px var(--gutter); }
.lock__inner { width: 100%; max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.lock__h {
  font-family: var(--display); font-weight: 800; font-stretch: 75%; font-variation-settings: "opsz" 96;
  font-size: clamp(56px, 15vw, 96px); line-height: .9; letter-spacing: -.008em; margin-bottom: 8px; overflow-wrap: anywhere;
}
.lock__langs { list-style: none; padding: 0; font-style: italic; }
.lock__form { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.lock__label { font-family: var(--display); font-weight: 600; font-size: 17px; }
.lock .input { border-color: var(--paper); }
.lock__error { color: var(--star); font-family: var(--display); font-weight: 600; }
.lock__help { margin-top: 8px; }
.lock__back { font-family: var(--display); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }

/* ---- Album ---- */

.album-top { padding-top: 32px; display: flex; flex-direction: column; gap: 32px; }
.album-top__intro { display: flex; flex-direction: column; gap: 20px; }

.uploader { padding: 24px; background: var(--red); color: var(--paper); border-radius: 4px; display: flex; flex-direction: column; gap: 12px; }
.uploader :focus-visible { outline-color: var(--paper); }
.uploader.is-dragging { outline: 3px dashed var(--paper); outline-offset: -10px; }
.uploader__title { font-family: var(--display); font-weight: 700; font-stretch: 85%; font-size: 30px; line-height: 1.1; }
.uploader__label { font-family: var(--display); font-weight: 600; font-size: 16px; margin-top: 4px; }
.uploader .input { border-color: var(--paper); }
.uploader__progress { height: 6px; background: var(--red-deep); overflow: hidden; }
.uploader__bar { height: 100%; width: 0; background: var(--paper); transition: width .2s ease; }
.uploader__status { font-family: var(--display); font-weight: 600; font-size: 16px; }
.uploader__status:empty { display: none; }

.album-bar { padding-top: 48px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.segmented { display: inline-flex; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; }
.segmented button {
  min-height: 44px; padding: 0 18px; border: 0; background: transparent; color: var(--ink); cursor: pointer;
  font-family: var(--display); font-size: 16px; font-weight: 600;
}
.segmented button + button { border-left: 2px solid var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.grid { margin-top: 20px; columns: 2; column-gap: 10px; }
.tile {
  display: block; width: 100%; margin: 0 0 14px; padding: 0; border: 0; background: none; text-align: left;
  cursor: zoom-in; break-inside: avoid; color: var(--ink);
}
.tile img { width: 100%; height: auto; background: var(--rule); }
.tile__by { display: block; padding-top: 4px; font-family: var(--text); font-style: italic; font-size: 15px; color: var(--grey); }
.grid-empty { padding: 24px 0; font-style: italic; }
.grid-more { display: flex; justify-content: center; padding-top: 24px; }
.admin-hint { padding-top: 16px; }

.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #000; color: var(--paper);
}
.lightbox::backdrop { background: #000; }
.lightbox__figure { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 12px 20px; gap: 10px; }
.lightbox__figure img { max-width: 100%; max-height: calc(100% - 40px); object-fit: contain; }
.lightbox__caption { font-style: italic; min-height: 1.5em; }
.lightbox__btn {
  position: absolute; width: 48px; height: 48px; border: 0; border-radius: 4px; background: transparent;
  color: var(--paper); font-size: 32px; line-height: 1; cursor: pointer;
}
.lightbox__btn:hover { background: rgba(255, 255, 255, .15); }
.lightbox :focus-visible { outline-color: var(--paper); }
.lightbox__btn--close { top: 8px; right: 8px; }
.lightbox__btn--prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lightbox__btn--next { right: 4px; top: 50%; transform: translateY(-50%); }

/* ---- Admin ---- */

.admin-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding-top: 8px; }
.admin-bar__who { font-family: var(--display); font-weight: 600; color: var(--grey); }
.admin-nav { display: flex; gap: 20px; border-bottom: 2px solid var(--ink); overflow-x: auto; }
.admin-nav__link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 52px; margin-bottom: -2px;
  font-family: var(--display); font-weight: 700; font-size: 19px; text-decoration: none; color: var(--grey); white-space: nowrap;
  border-bottom: 4px solid transparent;
}
.admin-nav__link:hover { color: var(--ink); }
.admin-nav__link[aria-current="page"] { color: var(--ink); border-bottom-color: var(--red); }
.admin-nav__badge {
  font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 3px; background: var(--ink); color: var(--paper);
}
.admin-nav__badge--red { background: var(--red); }
.admin-section { display: flex; flex-direction: column; gap: 20px; padding-top: 8px; }
.admin-section__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.admin-section__hint { font-size: 16px; }
.admin__tabs { flex-wrap: nowrap; max-width: 100%; }
.admin__tabs button { padding: 0 12px; white-space: nowrap; }
.admin-add { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.admin-add summary { list-style: none; min-height: 44px; }
.admin-add summary::-webkit-details-marker { display: none; }
.admin-add[open] summary { background: var(--ink); color: var(--paper); }
.admin-add .uploader { width: min(420px, 100%); text-align: left; }

.admin { padding-bottom: 64px; display: flex; flex-direction: column; gap: 20px; }
.admin__tabs { align-self: flex-start; }
.count { font-variant-numeric: tabular-nums; opacity: .7; margin-left: 4px; }
.admin__list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px 16px; }
.admin-item { display: flex; flex-direction: column; gap: 8px; }
.admin-item img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--rule); }
.admin-item__edit { display: flex; flex-direction: column; gap: 8px; }
.admin-field { display: flex; flex-direction: column; gap: 2px; }
.admin-field label { font-family: var(--display); font-weight: 600; font-size: 14px; }
.admin-field input, .admin-field textarea {
  width: 100%; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 4px;
  font-family: var(--text); font-size: 16px; color: var(--ink); background: var(--paper); resize: vertical;
}
.admin-item__edit button {
  align-self: flex-start; min-height: 40px; padding: 0 14px; border-radius: 4px; border: 2px solid var(--ink);
  background: transparent; font: 600 14px var(--display); cursor: pointer;
}
.admin-item__saved { font-family: var(--display); font-size: 14px; color: var(--grey); }
.admin-item__meta { font-size: 15px; color: var(--grey); line-height: 1.4; }
.admin-item__actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.admin-item__actions button {
  min-height: 40px; padding: 0 12px; border-radius: 4px; border: 2px solid var(--ink); background: transparent;
  color: var(--ink); font: 600 14px var(--display); cursor: pointer;
}
.admin-item__actions button[data-primary] { background: var(--red); border-color: var(--red); color: var(--paper); }
.admin-item__actions label { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 14px; min-height: 40px; }

/* ---- Maintenance ---- */

.site-notice {
  margin: 0; padding: 10px var(--gutter); background: var(--star); color: var(--ink);
  font-family: var(--display); font-weight: 600; font-size: 15px; text-align: center;
}
.site-notice a { color: var(--ink); }
.btn--red { background: var(--red); color: var(--paper); }
.btn--red:hover { background: var(--red-deep); color: var(--paper); }
.maintenance-admin { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; max-width: 40em; }
.maintenance-admin.is-on .maintenance-admin__state { color: var(--red); font-family: var(--display); font-weight: 600; }

/* ---- Admin: share ---- */

.share { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; }
.share__cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; }
.share-card { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 2px solid var(--ink); }
.share-card__title { font-family: var(--display); font-weight: 700; font-size: 26px; }
.share-card__qr { width: 220px; height: 220px; }
.share-card__url { overflow-wrap: anywhere; }
.share-card__url .link { font-size: 15px; }
.share-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-card__actions .btn { min-height: 44px; padding: 0 18px; font-size: 16px; }
.share-card__downloads { font-size: 16px; }
.share-card__downloads .link { font-size: 16px; padding: 4px 0; }
.share-card__password strong { font-family: var(--display); font-size: 20px; margin: 0 8px 0 4px; }
.share__status { font-family: var(--display); font-weight: 600; min-height: 1.5em; }

/* ---- Footer ---- */

.site-footer { max-width: var(--max); margin: 0 auto; padding: 56px var(--gutter) 64px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; }
.album-cta + * .site-footer, .site-footer { font-family: var(--display); font-weight: 700; font-size: 18px; }
.site-footer__date { font-variant-numeric: tabular-nums; color: var(--grey); }

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

@media (min-width: 900px) {
  :root { --gutter: 48px; }
  body { font-size: 19px; }

  .site-header { padding-top: 20px; padding-bottom: 20px; gap: 32px; }
  .site-header__menu { display: none; }
  .site-nav { display: flex; position: static; flex-direction: row; gap: 28px; padding: 0; border: 0; background: none; }
  .site-nav__link { min-height: 44px; font-size: 17px; border: 0; }
  .page-lock .site-nav__link { color: var(--paper); }
  .lang { order: 3; margin-left: -8px; }

  .hero { padding-top: 32px; }
  /* One line on desktop so the names don't push the photo out of view. */
  .hero__names { font-size: clamp(96px, 11.6vw, 176px); white-space: nowrap; }
  .hero__name { display: inline; }
  /* Date and the three languages read as one line under the names. */
  .hero__meta { margin-top: 22px; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 8px 40px; }
  .hero__date { font-size: 44px; }
  .hero__announce { display: flex; flex-wrap: wrap; gap: 4px 40px; font-size: 26px; }
  .hero__photo { margin-top: 40px; aspect-ratio: 16 / 9; }
  .hero__photo img { object-position: center 28%; }

  .row { padding-top: 120px; display: grid; grid-template-columns: 4fr 8fr; column-gap: 48px; align-items: start; }

  .schedule__row { grid-template-columns: 120px minmax(0, 1fr) 160px; padding: 24px 0; align-items: start; }
  .schedule__time { grid-row: auto; font-size: 42px; }
  .schedule__who { grid-column: auto; text-align: right; }

  /* Venues in the order of the day: town on the left, details beside it. */
  .venues { gap: 0; border-bottom: 1px solid var(--rule); }
  .venue { display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: 24px; row-gap: 6px; padding: 24px 0; border-top: 1px solid var(--rule); }
  .venue > * { grid-column: 2; }
  .venue__town { grid-column: 1; grid-row: 1 / span 10; font-size: 44px; }
  .venue__name { margin-top: 0; }
  .venue .link { justify-self: start; }

  .album-cta { margin-top: 140px; padding-bottom: 120px; }
  .album-cta .row { padding-top: 96px; }

  .page-title { padding-top: 48px; }
  .dress__item { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; padding: 24px 0; align-items: start; }
  .dress dt { font-size: 21px; }

  .album-top { padding-top: 48px; display: grid; grid-template-columns: 7fr 5fr; gap: 64px; align-items: start; }
  .uploader { padding: 32px; }
  .album-bar { padding-top: 80px; }
  .grid { columns: 240px 4; column-gap: 16px; margin-top: 28px; }
  .tile { margin-bottom: 20px; }

  .admin-nav { gap: 28px; }
  .admin-nav__link { font-size: 22px; }
  .admin__tabs button { padding: 0 18px; }
  .site-footer { padding-top: 96px; padding-bottom: 80px; font-size: 20px; }
}
