/* ==========================================================================
   Olde Hansa — tankard vote landing page (tankard.oldehansa.ee)
   Design source: index.jpeg mockup + corrections.png
   ========================================================================== */

@font-face {
  font-family: 'OldeHansaScript';
  src: url('/fonts/OldeHansaScriptRegular.woff2') format('woff2'),
       url('/fonts/OldeHansaScriptRegular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'OldeHansaAntique';
  src: url('/fonts/OldeHansaAntiqueRegular.woff2') format('woff2'),
       url('/fonts/OldeHansaAntiqueRegular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'OldeHansaCapitals';
  src: url('/fonts/OldeHansaCapitalsRegular.woff2') format('woff2'),
       url('/fonts/OldeHansaCapitalsRegular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink-blue: #274a8f;
  --ink-blue-dark: #1d3a75;
  --ink-red: #9c3a22;
  --bg-maroon: #4c150e;
  --parchment: #f6eecb;
  --field-border: #b9a878;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'OldeHansaAntique', Georgia, 'Times New Roman', serif;
  background-color: var(--bg-maroon);
  background-image: radial-gradient(ellipse at 50% 0%, #5d1d13 0%, #4c150e 55%, #3c0f09 100%);
  color: var(--ink-blue);
  min-height: 100vh;
}

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

/* --- top ornament strip ------------------------------------------------- */
.top-strip {
  height: 30px;
  background: url('/img/decorative-border-block-horizontal-RGB.png') repeat-x center / auto 100%;
  border-bottom: 3px solid #2c0c07;
}

/* --- language dropdown (same pattern as reserve.oldehansa.ee) ------------ */
.lang-dd { position: absolute; top: 44px; right: 14px; z-index: 50; }
.lang-dd-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'OldeHansaAntique', Georgia, serif;
  font-size: 14px; color: #2c2416;
  background: #fffdf4; border: 1px solid var(--field-border); border-radius: 8px;
  padding: 7px 10px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.lang-flag {
  width: 21px; height: 14px; border-radius: 2px; flex-shrink: 0;
  background-size: cover; background-position: center;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
}
.lang-caret { font-size: 10px; color: #8d7f5c; }
.lang-dd-menu {
  display: none; list-style: none;
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 150px;
  background: #fffdf4; border: 1px solid var(--field-border); border-radius: 10px;
  padding: 5px; box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
}
.lang-dd.open .lang-dd-menu { display: block; }
.lang-dd-menu li {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  font-size: 14.5px; color: #2c2416;
  border-radius: 7px; cursor: pointer;
}
.lang-dd-menu li:hover { background: var(--parchment); }
.lang-dd-menu li.active { background: #f0e0c0; color: var(--ink-red); }
.flag-et { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 6'%3E%3Crect width='9' height='6' fill='%23fff'/%3E%3Crect width='9' height='4' fill='%23000'/%3E%3Crect width='9' height='2' fill='%230072CE'/%3E%3C/svg%3E"); }
.flag-fi { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 11'%3E%3Crect width='18' height='11' fill='%23fff'/%3E%3Crect x='5' width='3' height='11' fill='%23003580'/%3E%3Crect y='4' width='18' height='3' fill='%23003580'/%3E%3C/svg%3E"); }
.flag-ru { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 6'%3E%3Crect width='9' height='6' fill='%23D52B1E'/%3E%3Crect width='9' height='4' fill='%230039A6'/%3E%3Crect width='9' height='2' fill='%23fff'/%3E%3C/svg%3E"); }
.flag-en { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3CclipPath id='s'%3E%3Crect width='60' height='30'/%3E%3C/clipPath%3E%3Cg clip-path='url(%23s)'%3E%3Crect width='60' height='30' fill='%23012169'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0,0 L60,30 M60,0 L0,30' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M30,0 L30,30 M0,15 L60,15' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30,0 L30,30 M0,15 L60,15' stroke='%23C8102E' stroke-width='6'/%3E%3C/g%3E%3C/svg%3E"); }

/* --- parchment sheet ------------------------------------------------------ */
.sheet-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 104px 12px 44px;  /* top room for the emblem overlapping above the sheet */
}

.sheet {
  position: relative;
  background: var(--parchment) url('/img/pergamentti.webp') center top / cover no-repeat;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .55);
  border: 1px solid #d8c894;
}

/* the illuminated border forms a full frame, as in the mockup */
.frame {
  position: absolute;
  pointer-events: none;
}
.frame--left,
.frame--right {
  top: 12px; bottom: 12px; width: 26px;
  background-repeat: repeat-y;
  background-size: 100% auto;
  z-index: 2;
}
.frame--left  { left: 12px;  background-image: url('/img/B2B-border.jpeg'); }
.frame--right { right: 12px; background-image: url('/img/B2B-BORDER-B.jpeg'); }
.frame--top,
.frame--bottom {
  left: 12px; right: 12px; height: 26px;
  background: url('/img/border-horizontal.jpeg') repeat-x;
  background-size: auto 100%;
  z-index: 1;
}
.frame--top    { top: 12px; }
.frame--bottom { bottom: 12px; }

/* emblem straddles the sheet's top edge, over the top border, onto the maroon */
.emblem {
  position: absolute;
  left: 50%;
  top: -86px;
  transform: translateX(-50%);
  width: 212px;
  height: auto;
  z-index: 3;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .35));
}

.sheet-inner {
  position: relative;
  padding: 156px 64px 60px;
  text-align: center;
  z-index: 2;
}

/* --- headings & copy ------------------------------------------------------- */
.script-heading {
  font-family: 'OldeHansaScript', 'OldeHansaAntique', Georgia, serif;
  font-weight: normal;
  color: var(--ink-blue);
  font-size: 34px;
  line-height: 1.25;
  margin: 0 0 20px;
}
.script-heading--large {
  font-size: 40px;
  margin: 34px 0 8px;
}

.intro p {
  font-size: 16.5px;
  line-height: 1.55;
  margin: 0 auto 14px;
  max-width: 46em;
}

/* --- tankard options --------------------------------------------------------- */
.tankards {
  border: 0;
  display: flex;
  justify-content: center;
  gap: 4%;
  margin: 18px 0 6px;
}

.tankard {
  flex: 1 1 0;
  max-width: 170px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 8px 14px;
  border: 2px solid transparent;
  border-radius: 12px;
  transition: transform .15s ease, border-color .15s ease, background-color .15s ease;
}
.tankard.selected,
.tankard:has(input:checked) {
  border-color: var(--ink-blue);
  background: rgba(39, 74, 143, .07);
}

.tankard__name {
  font-family: 'OldeHansaCapitals', 'OldeHansaAntique', Georgia, serif;
  color: var(--ink-red);
  font-size: 19px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tankard img {
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
  transition: transform .15s ease;
}
.tankard:hover img { transform: scale(1.04); }

/* hide the native radio, draw our own ring */
.tankard input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tankard__radio {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--ink-blue);
  background: #fffdf4;
  display: inline-block;
  position: relative;
}
.tankard input:checked + .tankard__radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--ink-blue);
}
.tankard input:focus-visible + .tankard__radio {
  outline: 3px solid var(--ink-red);
  outline-offset: 2px;
}

/* --- form ----------------------------------------------------------------------- */
.fields {
  max-width: 380px;
  margin: 22px auto 0;
  text-align: left;
}

.field { display: block; margin-bottom: 14px; }

.field input,
.field textarea {
  width: 100%;
  font-family: 'OldeHansaAntique', Georgia, serif;
  font-size: 16px;
  color: #2c2416;
  background: #fffdf4;
  border: 1px solid var(--field-border);
  border-radius: 3px;
  padding: 11px 12px;
}
.field textarea { resize: vertical; min-height: 96px; }

.field input::placeholder,
.field textarea::placeholder { color: #8d7f5c; }

.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--ink-blue);
  outline-offset: 1px;
}

/* honeypot — visually removed, still in the DOM for bots */
.field--website {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px; overflow: hidden;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15.5px;
  cursor: pointer;
  margin: 4px 0 18px;
}
.checkbox input {
  width: 19px; height: 19px;
  accent-color: var(--ink-blue);
}

.form-message {
  min-height: 1.2em;
  font-size: 15px;
  color: var(--ink-red);
  text-align: center;
  margin-bottom: 12px;
}

.submit-btn {
  display: block;
  margin: 0 auto;
  font-family: 'OldeHansaAntique', Georgia, serif;
  font-size: 17px;
  letter-spacing: .04em;
  color: #fdf7e0;
  background: var(--ink-blue);
  border: 1px solid var(--ink-blue-dark);
  border-radius: 4px;
  padding: 11px 44px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.submit-btn:hover  { background: var(--ink-blue-dark); }
.submit-btn:disabled { opacity: .6; cursor: wait; }

/* consent row link */
.checkbox a { color: var(--ink-blue); text-decoration: underline; }
.checkbox a:hover { color: var(--ink-red); }

/* --- consent modal ------------------------------------------------------------------ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 8, 4, .68);
}
.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--parchment) url('/img/pergamentti.webp') center top / cover no-repeat;
  border: 1px solid #d8c894;
  border-radius: 6px;
  box-shadow: 0 12px 50px rgba(0, 0, 0, .6);
}
.modal__close {
  position: absolute;
  top: 6px; right: 10px;
  width: 40px; height: 40px;
  font-size: 28px; line-height: 1;
  color: var(--ink-red);
  background: none; border: 0; cursor: pointer;
}
.modal__body {
  overflow-y: auto;
  padding: 30px 30px 12px;
  color: #3a2c14;
  -webkit-overflow-scrolling: touch;
}
.modal__body h1 {
  font-family: 'OldeHansaScript', 'OldeHansaAntique', Georgia, serif;
  font-weight: normal;
  color: var(--ink-blue);
  font-size: 30px;
  line-height: 1.2;
  margin-bottom: 16px;
}
.modal__body h2 {
  font-family: 'OldeHansaCapitals', 'OldeHansaAntique', Georgia, serif;
  color: var(--ink-red);
  font-size: 16px;
  letter-spacing: .04em;
  margin: 20px 0 8px;
}
.modal__body p { font-size: 15.5px; line-height: 1.55; margin-bottom: 12px; }
.modal__body ul, .modal__body ol { margin: 0 0 12px 22px; }
.modal__body li { font-size: 15.5px; line-height: 1.5; margin-bottom: 6px; }
.modal__body a { color: var(--ink-blue); }
.modal__body hr { border: 0; border-top: 1px solid rgba(39, 74, 143, .25); margin: 16px 0; }
.modal__foot {
  padding: 14px 30px 20px;
  border-top: 1px solid rgba(39, 74, 143, .2);
  text-align: center;
}

/* --- thanks ------------------------------------------------------------------------ */
.thanks p { font-size: 17px; line-height: 1.6; }

/* --- directions ---------------------------------------------------------------------- */
.directions {
  margin-top: 40px;
  padding-top: 26px;
  border-top: 2px solid rgba(39, 74, 143, .25);
}
.directions h2 { margin-bottom: 6px; }
.directions p {
  font-size: 16.5px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.directions__buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}
.directions__buttons a {
  font-family: 'OldeHansaAntique', Georgia, serif;
  font-size: 16px;
  text-decoration: none;
  color: #fdf7e0;
  background: var(--ink-red);
  border-radius: 4px;
  padding: 11px 22px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.directions__buttons a:hover { background: #7f2e1a; }
.directions__buttons a.alt {
  background: transparent;
  color: var(--ink-blue);
  border: 2px solid var(--ink-blue);
  box-shadow: none;
}
.directions__buttons a.alt:hover { background: rgba(39, 74, 143, .1); }

/* --- footer ------------------------------------------------------------------------------ */
.site-footer {
  text-align: center;
  padding: 10px 16px 46px;
}
.site-footer img {
  width: 220px;
  max-width: 70%;
  height: auto;
  /* recolour the dark logo to parchment-cream for the dark background */
  filter: brightness(0) invert(0.93) sepia(0.35) saturate(1.4);
  opacity: .95;
}

/* --- small screens (QR-scan phones are the main audience) ---------------------------------- */
@media (max-width: 620px) {
  .sheet-wrap { padding: 76px 6px 28px; }
  .sheet-inner { padding: 104px 22px 40px; }  /* thin sides give the text column room */

  .frame--left, .frame--right { width: 13px; top: 7px; bottom: 7px; }
  .frame--left  { left: 7px; }
  .frame--right { right: 7px; }
  .frame--top, .frame--bottom { height: 13px; left: 7px; right: 7px; }
  .frame--top    { top: 7px; }
  .frame--bottom { bottom: 7px; }

  .emblem { width: 150px; top: -58px; }

  .lang-dd { top: 38px; right: 10px; }

  .script-heading { font-size: 27px; margin-bottom: 16px; }
  .script-heading--large { font-size: 30px; margin: 26px 0 4px; }
  .intro p { font-size: 16.5px; line-height: 1.5; margin-bottom: 12px; }

  /* two-up grid keeps the choice above the fold instead of a 3-tall stack */
  .tankards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 8px;
    margin: 14px 0 6px;
  }
  .tankard {
    max-width: none;
    padding: 12px 6px 16px;
    border-width: 2px;
  }
  /* the odd one out (Cauppias) spans both columns, centred */
  .tankard:last-child { grid-column: 1 / -1; }
  .tankard:last-child img { max-width: 56%; }
  .tankard__name { font-size: 20px; }

  /* bigger touch targets (Apple/WCAG min 44px) */
  .tankard__radio { width: 34px; height: 34px; }
  .checkbox { gap: 12px; font-size: 16px; padding: 6px 0; }
  .checkbox input { width: 26px; height: 26px; }
  .lang-dd-toggle { padding: 9px 12px; font-size: 15px; }
  .lang-dd-menu li { padding: 12px 12px; font-size: 16px; }

  .field input, .field textarea { font-size: 16px; padding: 13px 12px; }  /* 16px = no iOS zoom-on-focus */
  .submit-btn { width: 100%; padding: 15px 0; font-size: 18px; }

  .directions p { font-size: 16px; }
  .directions__buttons { flex-direction: column; }
  .directions__buttons a { text-align: center; padding: 14px 22px; }
}
