/* ==========================================================================
   ruegen.ch – Design-System 2026
   Apple-inspiriert: Systemschrift, klare Hierarchie, transluzente Navigation,
   ruhige Bewegungen (reduced-motion-fähig), WCAG 2.2 AA.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #5f5f66;            /* 6.2:1 auf Weiß */
  --line: #d2d2d7;
  --accent: #0a5fb4;           /* Ostseeblau, 6.4:1 auf Weiß */
  --accent-hover: #084d93;
  --accent-soft: #e8f1fb;
  --swiss: #d52b1e;
  --chrome: rgba(255, 255, 255, 0.72);
  --chrome-line: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.06), 0 16px 40px rgba(0,0,0,.08);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --nav-h: 3.5rem;
  --wrap: 75rem;
  --measure: 42rem;
  --ease: cubic-bezier(.32, .72, 0, 1);   /* iOS-Sheet-Kurve, kein Overshoot */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-soft: #111113;
    --surface: #1c1c1e;
    --ink: #f5f5f7;
    --ink-2: #d1d1d6;
    --muted: #a1a1a6;
    --line: #38383a;
    --accent: #4da3ff;
    --accent-hover: #7bbcff;
    --accent-soft: #0c2440;
    --chrome: rgba(22, 22, 23, 0.72);
    --chrome-line: rgba(255,255,255,.1);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 8px 30px rgba(0,0,0,.5);
  }
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 1rem); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font: 400 1.0625rem/1.6 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, video, iframe, svg { max-width: 100%; }
img { height: auto; border: 0; }
a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip-link {
  position: fixed; left: 1rem; top: .75rem; z-index: 100;
  padding: .7rem 1.1rem; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- Typografie (größenabhängiges Tracking) ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); font-weight: 700; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.5rem); line-height: 1.07; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.55rem, 1.2rem + 1.3vw, 2.15rem); line-height: 1.15; letter-spacing: -0.018em; }
h3 { font-size: 1.3rem; line-height: 1.3; letter-spacing: -0.01em; }
h4 { font-size: 1.1rem; line-height: 1.35; }
p { margin: 0 0 1.1em; }
.eyebrow { font-size: .875rem; font-weight: 600; letter-spacing: .02em; color: var(--accent); margin: 0 0 .6rem; }
.lead { font-size: clamp(1.15rem, 1rem + .5vw, 1.35rem); line-height: 1.5; color: var(--ink-2); letter-spacing: -0.005em; }

/* ---------- Navigation: transluzentes Material ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--chrome);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--chrome-line);
}
.nav { display: flex; align-items: center; gap: 1rem; height: var(--nav-h); }
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font: 700 1.2rem/1 var(--font-display); letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none; margin-right: auto;
  min-height: 44px;
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand .tld { color: var(--swiss); }
.nav-list { display: flex; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: block; padding: .55rem .8rem; border-radius: 999px;
  font-size: .9375rem; font-weight: 500; color: var(--ink-2); text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}
.nav-list a:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.nav-list a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.nav-cta {
  display: inline-flex; align-items: center; min-height: 36px; padding: .45rem 1rem;
  border-radius: 999px; background: var(--accent); color: #fff !important; font-size: .9rem; font-weight: 600; text-decoration: none;
}
.nav-cta:hover { background: var(--accent-hover); }
@media (prefers-color-scheme: dark) { .nav-cta { color: #00152b !important; } }
.menu-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-right: -.5rem;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer;
}
.menu-toggle:active { transform: scale(.94); }
.menu-toggle .bar { display: block; width: 18px; height: 1.5px; background: currentColor; border-radius: 2px; transition: transform .35s var(--ease), opacity .2s ease; }
.menu-toggle .bars { display: grid; gap: 5px; }
.menu-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(3.25px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bar:nth-child(2) { transform: translateY(-3.25px) rotate(-45deg); }

@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  .nav-cta { display: none; }
  .nav-panel {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    max-height: calc(100dvh - var(--nav-h)); overflow-y: auto;
    background: var(--bg);
    box-shadow: 0 24px 48px rgba(0,0,0,.14);
    border-bottom: 1px solid var(--chrome-line);
    padding: .5rem 1.25rem 1.5rem;
    /* visibility + opacity Muster – unterbrechbar, kein display-Toggle */
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .25s ease, transform .4s var(--ease), visibility 0s linear .4s;
  }
  .nav-panel.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity .25s ease, transform .4s var(--ease), visibility 0s; }
  .nav-list { flex-direction: column; gap: 0; }
  .nav-list li + li { border-top: 1px solid var(--chrome-line); }
  .nav-list a { padding: .95rem .25rem; border-radius: 0; font-size: 1.15rem; font-weight: 600; color: var(--ink); }
  .nav-list a:hover, .nav-list a[aria-current="page"] { background: none; color: var(--accent); }
  .nav-panel .nav-cta { display: flex; justify-content: center; margin-top: 1rem; min-height: 48px; font-size: 1rem; }
  body.menu-open { overflow: hidden; }
  body.menu-open::after { content: ""; position: fixed; inset: var(--nav-h) 0 0 0; z-index: 40; background: rgba(0,0,0,.3); }
}
@media (min-width: 901px) { .nav-panel { display: flex; align-items: center; gap: .75rem; } }

/* ---------- Startseiten-Hero ---------- */
.hero { position: relative; isolation: isolate; min-height: min(88svh, 52rem); display: grid; align-items: end; color: #fff; overflow: hidden; }
.hero picture, .hero picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0,20,40,.05) 30%, rgba(0,18,36,.72) 100%); }
@media (max-width: 700px) { .hero::after { background: linear-gradient(180deg, rgba(0,20,40,0) 15%, rgba(0,18,36,.55) 45%, rgba(0,18,36,.85) 100%); } .hero-actions .btn { flex: 1 1 100%; } }
.hero-inner { padding-block: 6rem 3.5rem; }
.hero h1 { color: #fff; font-size: clamp(2.6rem, 1.6rem + 5vw, 5.25rem); letter-spacing: -0.035em; line-height: 1.02; max-width: 14ch; margin-bottom: .35em; text-shadow: 0 2px 24px rgba(0,0,0,.25); }
.hero .eyebrow { color: #fff; opacity: .92; font-size: 1rem; }
.hero .lead { color: rgba(255,255,255,.92); max-width: 38rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .75rem 1.4rem; border-radius: 999px;
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; border: 0;
  transition: background-color .2s ease, transform .1s ease-out;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-glass { background: rgba(255,255,255,.18); color: #fff; -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%); box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.btn-glass:hover { background: rgba(255,255,255,.28); color: #fff; }
.btn-quiet { background: var(--bg-soft); color: var(--ink); }
.btn-quiet:hover { background: color-mix(in srgb, var(--ink) 10%, var(--bg-soft)); color: var(--ink); }
.btn svg { width: 1em; height: 1em; }

/* ---------- Kennzahlen ---------- */
.facts { background: var(--bg-soft); }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 1rem; padding-block: 2.5rem; margin-block: 0; }
.fact { margin: 0; }
@media (max-width: 600px) { .facts-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem 1rem; } }
.fact dt { font: 700 clamp(2rem, 1.5rem + 2vw, 2.9rem)/1 var(--font-display); letter-spacing: -0.03em; color: var(--ink); }
.fact dd { margin: .35rem 0 0; color: var(--muted); font-size: .95rem; }

/* ---------- Sektionen ---------- */
.section { padding-block: clamp(3.5rem, 2rem + 5vw, 6.5rem); }
.section-soft { background: var(--bg-soft); }
.section-head { max-width: 44rem; margin-bottom: 2.25rem; }
.section-head p { color: var(--muted); font-size: 1.1rem; }

/* Orte-Karten */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 1.25rem; list-style: none; padding: 0; margin: 0; }
.card {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .35s var(--ease), transform .35s var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card:active { transform: scale(.985); transition-duration: .1s; }
.card img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.card:hover img { transform: scale(1.03); }
.card-body { padding: 1rem 1.15rem 1.25rem; }
.card h3 { font-size: 1.15rem; margin: 0 0 .2rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.45; }
.card a { color: inherit; text-decoration: none; }
.card a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card a:focus-visible { outline: none; }
.card:has(a:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- Unterseiten ---------- */
.page-head { padding-block: clamp(2.25rem, 1.5rem + 3vw, 4rem) clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.page-head h1 { max-width: 22ch; margin-bottom: 0; }
.breadcrumb { margin-bottom: 1.1rem; font-size: .875rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0; color: var(--muted); }
.breadcrumb li + li::before { content: "›"; margin-right: .4rem; color: var(--line); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }

.layout { display: grid; gap: clamp(2.5rem, 2rem + 3vw, 4.5rem); padding-bottom: clamp(3.5rem, 2rem + 5vw, 6rem); }
@media (min-width: 1024px) { .layout { grid-template-columns: minmax(0, 1fr) 19.5rem; } }

/* ---------- Fließtext (prose) ---------- */
.prose { min-width: 0; max-width: var(--measure); }
.prose > :first-child, .prose .post:first-child > :first-child { margin-top: 0; }
.prose .post + .post { margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.prose h2 { margin-top: 2.2em; }
.prose h3 { margin-top: 1.9em; }
.prose h4 { margin-top: 1.6em; }
.prose .post-title { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose li > p { margin-bottom: .3em; }
.prose li::marker { color: var(--accent); }
.prose strong { font-weight: 650; color: var(--ink); }
.prose blockquote { margin: 1.5em 0; padding: .25em 0 .25em 1.25em; border-left: 3px solid var(--accent); color: var(--ink-2); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose img { border-radius: var(--radius); display: block; }
.prose figure { margin: 2rem 0; }
.prose figure img { width: 100%; object-fit: cover; box-shadow: var(--shadow-sm); }
.prose figure img[width="544"][height="92"], .prose figure img.is-panorama { object-fit: contain; }
.prose figcaption { margin-top: .65rem; font-size: .9rem; line-height: 1.45; color: var(--muted); }
.prose p > img { margin: 1.5rem 0; }
.prose .img-inline { display: inline-block; border-radius: 6px; vertical-align: middle; margin: 0 .25rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { padding: .65rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { font-weight: 650; background: var(--bg-soft); }
.prose iframe { border: 0; border-radius: var(--radius-sm); background: var(--bg-soft); width: 100%; }
.prose .entry::after { content: ""; display: table; clear: both; }
.prose [itemscope] { margin: 1.5rem 0; }
.prose [itemprop="name"] { display: block; font-weight: 650; margin-top: .5rem; }

/* Video-Teaser (2-Klick, datensparsam) */
.video-link { position: relative; display: block; border-radius: var(--radius); overflow: hidden; }
.video-link img { margin: 0 !important; width: 100%; }
.video-link::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%;
  background: rgba(255,255,255,.85) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='%231d1d1f'/%3E%3C/svg%3E") 55% 50% / 30px no-repeat;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 6px 24px rgba(0,0,0,.25); transition: transform .3s var(--ease);
}
.video-link:hover::after { transform: scale(1.06); }

/* 360°-Panorama */
.pano { width: 100% !important; height: auto !important; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); margin: 1.5rem 0; }

/* Hinweis-Box */
.note { padding: 1.1rem 1.25rem; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--ink); font-size: .975rem; }
.note a { font-weight: 600; }

/* FAQ (details/summary) */
.faq { display: grid; gap: .75rem; max-width: 48rem; }
.faq details { background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.faq summary {
  list-style: none; cursor: pointer; padding: 1.1rem 3rem 1.1rem 1.25rem; position: relative;
  font-weight: 600; font-size: 1.05rem; min-height: 48px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 1.25rem; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .35s var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { padding: 0 1.25rem 1.15rem; margin: 0; color: var(--ink-2); }

/* ---------- Sidebar ---------- */
.sidebar { display: grid; gap: 1.25rem; align-content: start; }
@media (min-width: 1024px) { .sidebar { position: sticky; top: calc(var(--nav-h) + 1.5rem); } }
.widget { background: var(--bg-soft); border-radius: var(--radius); padding: 1.35rem 1.35rem 1.45rem; }
.widget h2 { font-size: 1.05rem; letter-spacing: -0.005em; margin: 0 0 .85rem; }
.widget p { font-size: .95rem; line-height: 1.55; color: var(--ink-2); margin: 0; }
.widget-list { list-style: none; margin: 0; padding: 0; }
.widget-list li + li { border-top: 1px solid var(--line); }
.widget-list a {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .62rem 0; min-height: 44px; color: var(--ink); text-decoration: none; font-size: .975rem;
}
.widget-list a::after { content: "›"; color: var(--muted); font-size: 1.2rem; line-height: 1; transition: transform .25s var(--ease); }
.widget-list a:hover { color: var(--accent); }
.widget-list a:hover::after { transform: translateX(3px); color: var(--accent); }
.widget-list a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.widget-cta { background: linear-gradient(160deg, #0a5fb4, #063a73); color: #fff; }
.widget-cta h2, .widget-cta p { color: #fff; }
.widget-cta p { opacity: .9; margin-bottom: 1.1rem; }
.widget-cta .btn { background: #fff; color: #063a73; width: 100%; }
.widget-cta .btn:hover { background: #eaf3ff; color: #063a73; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-soft); color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
.footer-grid { display: grid; gap: 2rem; padding-block: 3rem 2rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.site-footer h2 { font-size: .9rem; font-weight: 650; color: var(--ink); margin: 0 0 .8rem; letter-spacing: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.site-footer ul a { display: inline-block; padding: .3rem 0; color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer p { margin: 0 0 .8rem; line-height: 1.55; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; padding-block: 1.25rem 2rem; border-top: 1px solid var(--line); }
.footer-bottom nav { display: flex; gap: 1.25rem; }
.footer-bottom a { color: var(--ink-2); }

/* ---------- Scroll-Reveal (nur mit JS & ohne reduced motion) ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Präferenzen & Barrierefreiheit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .card:hover, .card:hover img { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .site-header, .nav-panel { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .btn-glass { background: rgba(0,0,0,.55); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --muted: var(--ink-2); --line: var(--ink); --chrome: var(--bg); }
  .card, .widget, .faq details { border: 1px solid var(--ink); }
  a { text-decoration-color: currentColor; }
}
@media (forced-colors: active) {
  .btn, .nav-cta { border: 1px solid ButtonText; }
}

/* ---------- Druck ---------- */
@media print {
  .site-header, .sidebar, .site-footer .footer-grid, .skip-link, .hero-actions { display: none !important; }
  .hero { min-height: 0; color: #000; } .hero h1 { color: #000; text-shadow: none; } .hero picture, .hero::after { display: none; }
  a { color: #000; } body { font-size: 11pt; }
}
