/* ============================================================
   DuTecHub: promotional poster (print-friendly, A4 portrait)
   Reuses the palette + fonts from styles.css (:root variables).
   ============================================================ */

.poster-page {
  min-height: 100vh;
  padding: 40px 20px;
  background: var(--poster-page-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* A small screen-only bar to get back to the site (hidden when printing). */
.poster-bar {
  width: 100%;
  max-width: 794px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-soft);
  font-size: 0.85rem;
}
.poster-bar a { color: var(--text-soft); }
.poster-bar a:hover { color: var(--text); }

/* Right-hand cluster: theme toggle + Print link (Back stays on the left). */
.poster-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.poster-bar .theme-toggle { width: 32px; height: 32px; }
.poster-bar .theme-icon { width: 17px; height: 17px; }

/* ------------------------------------------------------------
   The printable sheet, sized to A4 portrait (210×297mm ≈ 794×1123px @96dpi)
   ------------------------------------------------------------ */
.poster {
  width: 794px;
  max-width: 100%;
  aspect-ratio: 210 / 297;      /* exactly one A4 page */
  overflow: hidden;
  /* Gradient removed; flat sheet: white (light) / navy (dark). */
  background: var(--poster-sheet);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--poster-shadow);
  padding: 46px 46px 40px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* Header: brand + eyebrow */
.poster-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}
.poster-brand {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.poster-brand .brand-mark { color: var(--blue-bright); }
.poster-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.68rem;
  color: var(--text-soft);
  text-align: right;
  max-width: 160px;
  line-height: 1.5;
}

/* Headline / aim */
.poster-headline h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 2.5rem;
  line-height: 1.08;
  color: var(--text);
  margin: 0 0 12px 0;
}
.poster-headline h1 .accent { color: var(--blue-bright); }
.poster-aim {
  font-size: 1.02rem;
  color: var(--text-soft);
  max-width: 100%;
  margin: 0;
}

/* ------------------------------------------------------------
   Property gallery, the original collage: a big tall photo (villa) on the
   left, a big wide photo (study room) top-right, and five smaller tiles.
   Fills the remaining A4 height; photos fill their slots (no margins).
   ------------------------------------------------------------ */
.poster-gallery {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 8px;
}
.poster-gallery img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;                    /* fill the slot, no side/edge margins */
  border-radius: 7px;
  border: 1px solid var(--line);
}
.poster-gallery img:nth-child(1) { grid-row: span 2; }    /* villa, big & tall, left */
.poster-gallery .poster-photo--kurhaus { grid-column: span 2; } /* Kurhaus, big & wide, top-right */

/* Photo tile that carries an overlaid caption (e.g. Kurhaus). */
.poster-gallery .poster-photo {
  position: relative;
  margin: 0;
  min-width: 0;
  min-height: 0;
}
.poster-gallery .poster-photo img {
  border-radius: 7px;
}
.poster-gallery .poster-photo figcaption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  background: rgba(15, 17, 32, 0.62);
  backdrop-filter: blur(2px);
}

/* ------------------------------------------------------------
   Footer: address + QR row
   ------------------------------------------------------------ */
.poster-foot {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.poster-foot-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}
.poster-foot-info { align-self: flex-end; }
.poster-foot-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-soft);
  margin: 0 0 6px 0;
}
.poster-address {
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--text);
  margin: 0 0 16px 0;
  font-style: normal;
}
.poster-org { font-weight: 700; }
.poster-org .brand-mark { color: var(--blue-bright); }
.poster-mail {
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--text);
  margin: 0;
}
.poster-web {
  font-family: 'Poppins', sans-serif;
  font-size: 1.05rem;
  color: var(--text);
  margin: 0;
}
.poster-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
/* QR is rendered by qrcodejs into this box (canvas + img). White quiet zone
   keeps it scannable against the dark poster. */
#qr {
  width: 128px;
  height: 128px;
  padding: 8px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);   /* defines the white QR box against a white sheet */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#qr img, #qr canvas { display: block; width: 100% !important; height: 100% !important; }
.poster-qr-caption {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-soft);
  transition: color 0.2s ease;
}

/* ------------------------------------------------------------
   Footer links: address (→ Google Maps), email (→ mailto),
   website (→ site) and the QR (→ site). They blend with the
   poster text at rest but are clearly hoverable, and because
   each is a real <a href> they stay clickable in the printed
   / "Save as PDF" output too.
   ------------------------------------------------------------ */
.poster-link {
  color: inherit;                       /* sit within the poster text at rest */
  text-decoration: none;                /* no underline on screen, in any state */
  transition: color 0.2s ease;
}
.poster-link--map { display: inline-block; }   /* one clean box around the 2-line address */

.poster-link:hover,
.poster-link:focus-visible {
  color: var(--link);                   /* hover/focus: just turn blue, still no underline */
}
.poster-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* The QR image is a link too: lift + ring it on hover/focus so it
   reads as tappable, and echo the state on its caption. */
.poster-qr-link {
  display: inline-block;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.poster-qr-link:hover,
.poster-qr-link:focus-visible {
  transform: translateY(-2px);
}
.poster-qr-link:hover #qr,
.poster-qr-link:focus-visible #qr {
  border-color: var(--link);
  box-shadow: 0 6px 18px rgba(61, 79, 181, 0.28);
}
.poster-qr-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.poster-qr-link:hover ~ .poster-qr-caption,
.poster-qr-link:focus-visible ~ .poster-qr-caption {
  color: var(--link);
}

/* ------------------------------------------------------------
   Responsive (screen): a purpose-built mobile "Visit us" page.
   The A4 sheet is a desktop / print artifact; on phones we drop the
   sheet framing and re-lay the content as a proper mobile page: a clean
   header, a compact photo mosaic of uniform rounded tiles, and a raised
   "Find us" card with a larger QR. Print + desktop are untouched.
   ------------------------------------------------------------ */
@media (max-width: 640px) {
  .poster-page {
    padding: 0 0 36px;
    gap: 0;
    background: var(--poster-page-bg);
  }
  .poster-bar {
    max-width: none;
    padding: 14px 20px;
  }

  /* Drop the sheet framing: the page itself is the surface now, so the
     photo tiles and the Find-us card read as the structure. */
  .poster {
    width: 100%;
    max-width: 100%;
    aspect-ratio: auto;          /* grow with content instead of A4-locking */
    overflow: visible;
    padding: 8px 20px 0;
    gap: 26px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }

  /* Header: brand stacked over a left-aligned eyebrow. */
  .poster-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .poster-brand { font-size: 1.55rem; }
  .poster-eyebrow {
    text-align: left;
    max-width: none;
    font-size: 0.66rem;
  }

  .poster-headline h1 { font-size: 1.95rem; line-height: 1.12; }
  .poster-aim { font-size: 1rem; }

  /* Photo mosaic: uniform rounded cover tiles (no letterboxing). Two
     landscape features up top, a 2-column grid of interiors, then a
     full-width closer. */
  .poster-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: auto;
    gap: 10px;
  }
  .poster-gallery > img,
  .poster-gallery > .poster-photo {
    margin: 0;
    grid-row: auto;              /* clear the desktop collage spans */
    grid-column: auto;
    aspect-ratio: 4 / 3;
    min-height: 0;
  }
  .poster-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;           /* fill the tile, clean edges, no margins */
    object-position: center;
    border-radius: 13px;
    border: 1px solid var(--line);
  }
  /* Full-width features: the villa, the Kurhaus, and the closing room. */
  .poster-gallery > img:first-child,
  .poster-gallery > .poster-photo--kurhaus,
  .poster-gallery > img:last-child {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 10;
  }
  .poster-gallery > img:first-child { object-position: center 42%; }  /* keep the villa facade framed */
  .poster-gallery .poster-photo { aspect-ratio: 16 / 10; }
  .poster-gallery .poster-photo img { border-radius: 13px; }
  .poster-gallery .poster-photo figcaption {
    left: 12px;
    bottom: 12px;
    font-size: 12px;
  }

  /* "Find us", a raised card: details centred, QR below a hairline. */
  .poster-foot {
    margin-top: 6px;
    padding: 26px 22px;
    border: 1px solid var(--alt-panel-border);
    border-radius: 18px;
    background: var(--alt-panel);
    box-shadow: var(--alt-panel-shadow);
  }
  .poster-foot-row {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 22px;
  }
  .poster-foot-info { align-self: stretch; }
  .poster-address { margin-bottom: 12px; }
  .poster-mail    { margin-bottom: 4px; }
  .poster-qr {
    align-self: stretch;
    padding-top: 22px;
    border-top: 1px solid var(--line);
  }
  #qr { width: 150px; height: 150px; }
}

/* ------------------------------------------------------------
   Print: one clean A4 sheet, no screen chrome
   ------------------------------------------------------------ */
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  /* Always print the LIGHT poster (ink-friendly), regardless of the active
     on-screen theme; values are hardcoded so data-theme can't darken paper. */
  .poster-page {
    padding: 0;
    background: #edeef6;
    display: block;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .poster-bar { display: none !important; }
  .poster {
    width: 100%;
    max-width: 100%;
    background: #edeef6;
    color: #14182A;
    box-shadow: none;
    border: none;
    border-radius: 0;
  }
  .poster-brand,
  .poster-headline h1,
  .poster-address,
  .poster-mail,
  .poster-web { color: #14182A; }
  .poster-eyebrow,
  .poster-aim,
  .poster-foot-label,
  .poster-qr-caption { color: #575A7E; }
  .poster-gallery img { border-color: rgba(87, 90, 126, 0.18); }
  .poster-foot { border-top-color: rgba(87, 90, 126, 0.18); }
  /* Footer links: force the ink-friendly dark colour (theme-independent) but
     keep them visibly underlined so they read as links on paper, and they
     stay clickable in the PDF because each is a real <a href>. */
  .poster-link {
    color: #14182A;
    text-decoration: underline;
    text-decoration-color: rgba(20, 24, 42, 0.55);
  }
  /* .brand-mark and the headline .accent stay blue (#596EE6), fine on white. */
}
