/* Ferienwohnung Kley – vintage look (wood desk + blue paper card),
   rebuilt mobile-first, responsive and accessible.
   No external fonts or assets: fast, private, CSP-friendly. */

:root {
  --wood: #4e2e20;
  --paper: #dbe6f4;
  --paper-2: #c7d6ea;
  --frame: #1e4a86;
  --ink: #1b1b1b;
  --ink-soft: #3f4a59;
  --link: #16407a;
  --subnav: #cbd7e7;
  --subnav-hover: #b7c8e0;
  --focus: #16407a;
  --heading: #12294d;
  --maxw: 792px;
  --sans: "Segoe UI", Roboto, system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", "Iowan Old Style", serif;
}

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

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

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  background-color: var(--wood);
  background-image: url("/images/page/holz.jpg");
  background-repeat: repeat;
  /* keep decorative photos that peek past the card from causing sideways scroll */
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

a { color: var(--link); }
a:hover,
a:focus { text-decoration: underline; }

/* Visible, consistent focus indicator for keyboard users. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Visually hidden but available to assistive tech. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Skip link – hidden until focused. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #fff;
  color: var(--ink);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ---- Stage (positioning context for the scattered-photo decorations) --- */
.stage {
  position: relative;
  max-width: var(--maxw);
  margin: clamp(3.5rem, 10vh, 7rem) auto clamp(4.5rem, 12vh, 8rem);
}

/* ---- The sky card ------------------------------------------------------ */
.page {
  position: relative;
  z-index: 1;
  border: 3px solid #14407c;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.55);
  /* blue sky with a few soft clouds, echoing the original background photo */
  background:
    radial-gradient(58% 42% at 78% 30%, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 62%),
    radial-gradient(44% 30% at 12% 60%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 62%),
    radial-gradient(30% 22% at 42% 90%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 62%),
    linear-gradient(172deg, #b6d2f0 0%, #a3c3e7 52%, #cadef4 100%);
}

/* ---- Header band + main navigation ------------------------------------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: clamp(0.9rem, 2.5vw, 1.4rem) clamp(1rem, 3vw, 1.8rem);
  background: linear-gradient(180deg, #3667a9 0%, #21508f 62%, #1d4a86 100%);
  border-bottom: 3px solid #14407c;
}
.brand { display: inline-flex; }
.brand__img { width: min(360px, 74vw); height: auto; }

.nav-main ul {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-main li + li { border-left: 1px solid rgba(255, 255, 255, 0.4); }
.nav-main a {
  display: block;
  padding: 0.45rem 0.95rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}
.nav-main a:hover,
.nav-main a:focus { background: rgba(255, 255, 255, 0.18); text-decoration: none; }
.nav-main a[aria-current="true"] { background: rgba(255, 255, 255, 0.28); }
.nav-main a:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }

/* ---- Sub navigation ---------------------------------------------------- */
.nav-sub {
  background: var(--subnav);
  border-bottom: 1px solid rgba(30, 74, 134, 0.25);
}
.nav-sub ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 0.4rem;
  margin: 0;
  padding: 0.4rem 0.6rem;
  list-style: none;
}
.nav-sub a {
  display: block;
  padding: 0.35rem 0.7rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: 3px;
}
.nav-sub a:hover,
.nav-sub a:focus { background: var(--subnav-hover); text-decoration: none; }
.nav-sub a[aria-current="page"] {
  background: #fff;
  box-shadow: inset 0 -3px 0 var(--frame);
}

/* ---- Content ----------------------------------------------------------- */
.content {
  padding: clamp(1.1rem, 4vw, 2.4rem);
}
.content:focus { outline: none; }

.page-article h1 {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(1.6rem, 4.5vw, 2.2rem);
  margin: 0 0 1rem;
  color: var(--heading);
}
.prose h2 { font-family: var(--sans); font-weight: 800; color: var(--heading); font-size: 1.4rem; margin: 1.6rem 0 0.6rem; }
.prose h3 { font-family: var(--sans); font-weight: 700; color: var(--heading); font-size: 1.15rem; margin: 1.3rem 0 0.5rem; }
.prose p { margin: 0 0 1rem; }
.prose ul { margin: 0 0 1rem; padding-left: 1.4rem; }
.prose li { margin: 0.2rem 0; }
.prose address { font-style: normal; line-height: 1.7; margin: 0.5rem 0 1rem; }

/* ---- Gallery / polaroids ----------------------------------------------- */
.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1rem, 3vw, 1.75rem);
  margin: 0 0 1.5rem;
  padding: 0.5rem 0;
  list-style: none;
}
.polaroid {
  display: block;
  background: #fff;
  padding: 0.6rem 0.6rem 0;
  border: 1px solid #c9c9c9;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
  transform: rotate(-1.5deg);
  transition: transform 0.15s ease;
  text-decoration: none;
  color: var(--ink);
}
.gallery__item:nth-child(even) .polaroid { transform: rotate(1.6deg); }
.polaroid:hover,
.polaroid:focus-visible {
  transform: rotate(0) scale(1.02);
  text-decoration: none;
}
.polaroid img { display: block; width: 100%; max-width: 280px; height: auto; }
.polaroid__caption {
  display: block;
  max-width: 280px;
  padding: 0.5rem 0.2rem 0.7rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.9rem;
  text-align: center;
  color: var(--ink-soft);
}

/* ---- Map (static OpenStreetMap image) ---------------------------------- */
.map-figure { margin: 0.5rem 0 0; }
.map-figure a { display: block; line-height: 0; }
.map-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 6px solid #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}
.map-figure figcaption {
  margin-top: 0.45rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink-soft);
}
.map-link { margin-top: 0.9rem; }

/* ---- Guestbook --------------------------------------------------------- */
.gb-form-wrap h2,
.gb-entries h2 {
  font-family: var(--sans);
  font-weight: 800;
  color: var(--heading);
  font-size: 1.4rem;
  margin: 1.6rem 0 0.8rem;
}
.gb-form-wrap { margin: 1.5rem 0 2rem; }
.gb-form__hint { font-size: 0.9rem; color: var(--ink-soft); margin: 0 0 0.8rem; }
.field { margin: 0 0 0.9rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.25rem; }
.field__hint { font-weight: 400; color: var(--ink-soft); font-size: 0.85rem; }
.gb-form input[type="text"],
.gb-form input[type="email"],
.gb-form textarea {
  width: 100%;
  max-width: 32rem;
  padding: 0.5rem 0.6rem;
  font: inherit;
  border: 1px solid #7a95bd;
  border-radius: 3px;
  background: #fff;
}
.gb-form textarea { resize: vertical; }
.gb-form button {
  font: inherit;
  font-weight: 700;
  padding: 0.55rem 1.4rem;
  color: #fff;
  background: var(--frame);
  border: 0;
  border-radius: 3px;
  cursor: pointer;
}
.gb-form button:hover,
.gb-form button:focus-visible { background: #163a6b; }

/* Honeypot – present in the DOM, invisible & unreachable for humans. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.gb-status {
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
  border-radius: 3px;
  border: 1px solid transparent;
}
.gb-status.is-ok { background: #dff0d8; border-color: #a3ca8e; color: #234d1e; }
.gb-status.is-error { background: #f6d9d9; border-color: #d09a9a; color: #6b1f1f; }

/* No-JS error feedback: shown only when the URL targets #gb-error
   (the PHP endpoint redirects failed no-JS submits there). */
.gb-status--static { display: none; }
.gb-status--static:target { display: block; }

.gb-entry {
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(30, 74, 134, 0.25);
}
.gb-entry__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.9rem;
  margin: 0 0 0.4rem;
  font-family: var(--serif);
  font-size: 1.05rem;
}
.gb-entry__name { font-weight: 700; }
.gb-entry__meta time { font-size: 0.85rem; font-weight: 400; color: var(--ink-soft); }
.gb-entry__text { margin: 0; }

/* ---- Footer ------------------------------------------------------------ */
.site-footer {
  padding: 1.1rem clamp(1.1rem, 4vw, 2.4rem);
  border-top: 2px solid rgba(30, 74, 134, 0.2);
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.site-footer p { margin: 0.2rem 0; }

/* ---- Decorations: scattered photos + seasonal sign (wide screens only) - */
.deco-photos { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.deco-photos img { position: absolute; filter: drop-shadow(0 4px 9px rgba(0, 0, 0, 0.4)); }
.deco-top    { top: -72px;  left: 36px; }
.deco-left   { left: -28px; top: 46px; }
.deco-right  { right: -86px; top: 26px; }
.deco-bottom { right: -2px; bottom: -70px; }

.deco-sign {
  position: absolute;
  left: -110px;
  top: 330px;
  width: 320px;
  height: auto;
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 6px 11px rgba(0, 0, 0, 0.45));
}

/* Below this width there is no room for the desk decorations. */
@media (max-width: 900px) {
  .deco-photos,
  .deco-sign { display: none; }
}

/* ---- Phone: edge-to-edge card, no wood border and no gap at the top ---- */
@media (max-width: 640px) {
  .stage { margin: 0; max-width: none; }
  .page {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ---- Lightbox (pure CSS, :target — no JavaScript required) ------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(0.5rem, 3vw, 2rem);
  background: rgba(18, 11, 7, 0.97);
}
.lightbox:target { display: flex; }
.lightbox__backdrop { position: absolute; inset: 0; }
.lightbox__figure { margin: 0; max-width: 100%; position: relative; z-index: 1; }
.lightbox__figure img {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  height: auto;
  background: #fff;
  padding: 0.6rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.lightbox__figure figcaption {
  margin-top: 0.6rem;
  color: #f4ecdf;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
}
.lightbox__close,
.lightbox__nav {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.9rem;
  height: 2.9rem;
  font-size: 1.6rem;
  line-height: 1;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
}
.lightbox__close:hover, .lightbox__close:focus-visible,
.lightbox__nav:hover, .lightbox__nav:focus-visible {
  background: rgba(255, 255, 255, 0.32);
  text-decoration: none;
}
.lightbox__close { top: 1rem; right: 1rem; }
.lightbox__prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 1rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) {
  .lightbox__prev { top: auto; bottom: 1rem; transform: none; }
  .lightbox__next { top: auto; bottom: 1rem; transform: none; }
}

/* ---- Motion preferences ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .polaroid { transform: none; }
}
