/* ===== Farben (abgestimmt auf das Bannerbild) ===== */
:root {
  --cyan: #1ec8f5;
  --blue: #1e6ff0;
  --indigo: #3b3bf5;
  --gradient: linear-gradient(135deg, var(--cyan), var(--blue) 55%, var(--indigo));

  --bg: #f5f5f6;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --text: #111521;
  --muted: #5f636e;
  --border: #e3e4e8;
  --head: #41464f;   /* Kopfbalken von Kacheln und Detailseite */
  --shadow: 0 1px 2px rgba(17, 21, 33, .05), 0 8px 24px rgba(17, 21, 33, .06);
  --glow: 0 0 0 1px rgba(30, 111, 240, .45), 0 16px 40px rgba(30, 111, 240, .18);

  --radius: 16px;
  --max: 1100px;
  color-scheme: light;
}

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

/* Vertikaler Scrollbalken immer sichtbar – sonst verspringt die Seite seitlich,
   wenn er beim Filtern ein- oder ausgeblendet wird */
html { overflow-y: scroll; }

body {
  margin: 0;
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

/* Feste Linkfarbe statt Browser-Standard: gilt für besuchte und unbesuchte Links gleich.
   (Bewusst ohne a:visited – das hätte Vorrang vor den Farben von .tile, .btn usw.) */
a { color: var(--blue); }

/* ===== Banner ===== */
.banner {
  position: relative;
  width: 100%;
  background: var(--bg);
}

/* Banner ist genau so hoch wie das Foto im Bild –
   die weissen Ränder oben und unten (Zeilen 0–144 und 595–724) werden ausgeblendet */
.banner-img {
  width: 100%;
  height: auto;
  aspect-ratio: 2172 / 450;
  object-fit: cover;
  object-position: center 53%;
}

/* weicher Übergang vom Bild in den Seitenhintergrund */
.banner::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 14%;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

/* ===== Abschnitte ===== */
main { padding: 0 16px; }

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px 0 24px;
}

.section-title {
  position: relative;
  margin: 0 0 6px;
  padding-bottom: 12px;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -.01em;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 4px;
  border-radius: 2px;
  background: var(--gradient);
}

.section-lead {
  margin: 12px 0 32px;
  color: var(--muted);
}

/* ===== Kacheln ===== */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;   /* alle Zeilen so hoch wie die höchste Kachel */
  gap: 20px;
}

@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .tiles { grid-template-columns: 1fr; }
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 26px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.tile:hover,
.tile:focus-visible {
  transform: translateY(-4px);
  border-color: transparent;
  box-shadow: var(--glow);
  outline: none;
}

.tile-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: var(--gradient);
  box-shadow: 0 6px 18px rgba(30, 111, 240, .35);
}

.tile-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tile-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.tile-text {
  color: var(--muted);
  font-size: .95rem;
}

/* Startseite: dunkler Kopf (Icon + Titel) wie auf der Detailseite, darunter weiss mit Text */
.tiles .tile {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.tile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  padding-right: 44px;   /* Platz für das Schloss */
  background: var(--head);
}

.tile-head .tile-icon { flex: none; margin: 0; }
.tile-head .tile-title { color: #fff; line-height: 1.25; }

.tiles .tile-text {
  flex: 1;
  padding: 18px 22px 22px;
}

.tiles .tile-lock { color: #c4c7ce; }
.tile--locked .tile-head .tile-title { color: #9a9ea8; }

/* --- Platzhalter ohne Icon: Anfangsbuchstabe --- */
.tile-icon--letter {
  color: #fff;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
}

.tile-icon--letter.tile-icon--lg { font-size: 1.9rem; }
.tile-icon--letter.tile-icon--sm { font-size: 1.15rem; }

/* --- Eigenes Icon (PNG) --- */
.tile-icon--img {
  background: none;
  box-shadow: none;
  overflow: hidden;
}

.tile-icon--img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ohne Berechtigung: auch das eigene Icon grau */
.tile.tile--locked .tile-icon--img,
.tile-icon--img.tile-icon--locked { background: none; box-shadow: none; }

.tile--locked .tile-icon--img img,
.tile-icon--img.tile-icon--locked img { filter: grayscale(1); opacity: .55; }

/* --- Kachel ohne Berechtigung: grau --- */
.tile { position: relative; }

.tile--locked .tile-icon,
.tile-icon--locked {
  background: #c4c7ce;
  box-shadow: none;
}

.tile--locked .tile-title,
.tile--locked .tile-text { color: #9a9ea8; }

.tile--locked:hover,
.tile--locked:focus-visible {
  box-shadow: 0 0 0 1px #c4c7ce, 0 12px 30px rgba(17, 21, 33, .08);
}

.tile-lock {
  position: absolute;
  top: 18px;
  right: 18px;
  color: #9a9ea8;
}

.tile-lock svg,
.btn--disabled svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
}

/* ===== Kontaktformular ===== */
.section--contact { padding-bottom: 80px; }

.section-title + .contact-form,
.section-title + .tiles { margin-top: 32px; }

.contact-form {
  display: grid;
  gap: 18px;
  padding: 32px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field {
  display: grid;
  gap: 6px;
  font-weight: 500;
  font-size: .95rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field textarea { resize: vertical; min-height: 160px; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30, 111, 240, .25);
}

.field .invalid { border-color: #e5484d; }

.field--captcha { max-width: 280px; }

.hp { position: absolute; left: -9999px; }

.form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.btn {
  padding: 13px 28px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--gradient);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(30, 111, 240, .45); }
.btn:disabled { opacity: .6; cursor: default; transform: none; box-shadow: none; }

.form-status { margin: 0; font-size: .95rem; }
.form-status.ok { color: #1f9d55; }
.form-status.error { color: #e5484d; }

/* ===== Detailseite ===== */
.banner a { display: block; }

.detail { padding-bottom: 80px; }

.back-link {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover { color: var(--blue); }

/* Rahmen um alle Infos der Detailseite – wie beim Kontaktformular */
.detail-card {
  padding: 40px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.detail-card > :last-child { margin-bottom: 0; }

/* Trennlinie vor den Screenshots */
.detail-card .detail-subtitle {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
  .detail-card { padding: 20px; }
}

.preview-note {
  margin: 0 0 24px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff6db;
  color: #7a5a00;
  font-size: .95rem;
}

/* Inhalt links, Info-Fläche rechts */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 40px;   /* ohne align-items: start – die Info-Fläche ist so hoch wie der Text */
}

.detail-aside {
  padding: 22px 24px;
  background: #f3f4f6;
  border-radius: 14px;
}

.detail-aside h2 {
  margin: 0 0 12px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-aside dl { margin: 0; }

.detail-aside dl > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #e3e5ea;
}

.detail-aside dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.detail-aside dt { color: var(--muted); }
.detail-aside dd { margin: 0; text-align: right; font-weight: 500; }
.detail-aside a { text-decoration: none; }
.detail-aside a:hover { text-decoration: underline; }
.access-ok { color: #1f9d55; }
.access-private { white-space: nowrap; }
.access-private svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -2px;
  margin-right: 2px;
}

@media (max-width: 900px) {
  .detail-layout { grid-template-columns: 1fr; gap: 28px; }
}

/* Kopf: dunkler Balken über die ganze Breite der Karte (hebt das Padding der Karte auf),
   Icon + Titel in einer Zeile, bündig mit dem Inhalt darunter */
.detail-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: -40px -40px 40px;
  padding: 32px 40px;
  background: var(--head);
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}

.detail-head .detail-title { color: #fff; }

@media (max-width: 600px) {
  .detail-head { margin: -20px -20px 24px; padding: 20px; }
}

.tile-icon--lg {
  flex: none;
  width: 64px;
  height: 64px;
  margin: 0;
  border-radius: 18px;
}

.tile-icon--lg svg { width: 32px; height: 32px; }

.detail-title {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.15;
}

.detail-text {
  margin-top: 24px;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Formatierter Text: Titel, Absätze, Aufzählungen, fett */
.detail-text p { margin: 0 0 14px; }

/* Zwischentitel: fett und 2px grösser als der Fliesstext */
.detail-text .detail-heading {
  margin: 24px 0 8px;
  font-size: calc(1em + 2px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}
.detail-text .detail-heading:first-child { margin-top: 0; }
.detail-text p:last-child,
.detail-text ul:last-child { margin-bottom: 0; }

.detail-text ul {
  margin: 0 0 14px;
  padding-left: 0;
  list-style: none;
}

.detail-text li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 4px;
}

.detail-text li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .72em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gradient);
}

.detail-text strong { font-weight: 600; color: var(--text); }

/* Knopf zum Tool unten in der Seitenleiste, über die ganze Breite und mit der Eckenform der Box */
.detail-cta { margin-top: 20px; }
.detail-cta .btn {
  display: block;
  width: 100%;
  text-align: center;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: 14px;
}
.detail-cta .btn + .btn { margin-top: 10px; }
.detail-aside .detail-cta a:hover { text-decoration: none; }

/* Eigene Fokus-Markierung statt des schwarzen Browser-Rahmens */
.btn:focus { outline: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--blue); }

.btn--lg { display: inline-block; padding: 15px 34px; font-size: 1.05rem; text-decoration: none; }

.btn--disabled {
  background: var(--border);
  color: var(--muted);
  cursor: default;
}

.btn--disabled:hover { transform: none; box-shadow: none; }

/* ===== Anmeldung ===== */
.auth-card {
  display: grid;
  gap: 18px;
  max-width: 420px;
  margin: 0 auto;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-card .section-title { margin-bottom: 8px; }
.auth-card p { margin: 0; }
.auth-card .field small { color: var(--muted); font-weight: 400; }
.auth-switch { text-align: center; color: var(--muted); font-size: .95rem; }
.auth-card .btn { text-align: center; text-decoration: none; }

/* Leiste oberhalb der Apps */
.auth-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  max-width: var(--max);
  margin: 0 auto;
  padding-top: 28px;
  color: var(--muted);
}

.auth-bar strong { color: var(--text); }
.auth-bar .btn { padding: 10px 22px; text-decoration: none; }

/* Navigation «Apps / Kontakt» als Blasen links in der Leiste */
.site-nav {
  display: flex;
  gap: 4px;
  margin-right: auto;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--border), var(--shadow);   /* Rahmen innen → trägt nicht auf */
}

/* Blasen genau so gross wie .auth-bar .btn */
.site-nav a {
  padding: 10px 22px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
  border-radius: 999px;
  transition: color .15s ease, background-color .15s ease;
}

.site-nav a:hover { color: var(--blue); background: rgba(30, 111, 240, .08); }
.site-nav a.is-active { color: #fff; background: var(--gradient); }
.site-nav a:focus { outline: none; }
.site-nav a:focus-visible { box-shadow: 0 0 0 3px rgba(30, 111, 240, .35); }

/* «Angemeldet als …» als Blase – gleich gross wie .auth-bar .btn */
.user-badge {
  padding: 10px 22px;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--border), var(--shadow);
}

.section--apps,
.section--contact { padding-top: 32px; }

.btn--outline {
  color: var(--blue);
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--blue);
}

.btn--outline:hover { box-shadow: inset 0 0 0 1.5px var(--blue), 0 8px 22px rgba(30, 111, 240, .2); }

/* Filter «alle / nur berechtigte Apps» – gleiche Form wie die Knöpfe daneben */
.app-filter { display: flex; gap: 8px; margin: 0; }

.app-filter select {
  padding: 10px 44px 10px 20px;
  font: inherit;
  font-weight: 500;
  color: var(--text);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231e6ff0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 18px center;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color .15s ease;
}

.app-filter select:hover { border-color: var(--blue); }
.app-filter select:focus { outline: none; }
.app-filter select:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30, 111, 240, .25); }

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

@media (max-width: 600px) {
  .site-nav { flex-basis: 100%; margin-right: 0; }
  .site-nav a { flex: 1; }
  .app-filter { flex-basis: 100%; }
  .app-filter select { flex: 1; }
  .auth-bar > span { flex-basis: 100%; text-align: center; }
  .auth-bar .btn, .auth-bar .inline-form { flex: 1; }
  .auth-bar .inline-form .btn { width: 100%; }
}
.auth-card .back-link { margin: 0; justify-self: center; font-size: .95rem; }

.detail-subtitle { margin-top: 56px; margin-bottom: 28px; }

/* --- Galerie --- */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 900px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .gallery { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

.shot { margin: 0; }

.shot-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: zoom-in;
  transition: transform .2s ease, box-shadow .2s ease;
}

.shot-btn:hover,
.shot-btn:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--glow);
  outline: none;
}

/* Vorschau: quadratische Fläche, Bild proportional verkleinert und immer vollständig sichtbar */
.shot-btn img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center;
  background: var(--bg);
}

.shot figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: .9rem;
}

/* --- Vollbildansicht --- */
.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox::backdrop { background: rgba(10, 12, 18, .88); }

.lightbox figure {
  margin: 0;
  max-width: calc(100vw - 140px);
  text-align: center;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 110px);
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.lightbox figcaption { margin-top: 12px; color: #e8eaf0; }

.lb-close,
.lb-nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  font: 400 2rem/1 "Outfit", sans-serif;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background .15s ease;
}

.lb-close:hover,
.lb-nav:hover { background: var(--blue); }

.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox--single .lb-nav { display: none; }

@media (max-width: 600px) {
  .detail-head { gap: 14px; }
  .tile-icon--lg { width: 48px; height: 48px; border-radius: 14px; }
  .tile-icon--lg svg { width: 24px; height: 24px; }
  .lightbox figure { max-width: calc(100vw - 24px); }
  .lb-nav { top: auto; bottom: 16px; transform: none; }
  .btn--lg { display: block; text-align: center; }
}

/* ===== Footer ===== */
.footer {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  border-top: 1px solid var(--border);
}

.footer p { margin: 0; }
.footer .sep { margin: 0 6px; opacity: .6; }
.footer a { color: inherit; text-decoration: none; }
.footer a:hover { color: var(--blue); }
.footer-user { color: var(--text); font-weight: 500; margin-right: 6px; }

.inline-form { display: inline; margin: 0; }

.link-btn {
  padding: 0;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.link-btn:hover { color: var(--blue); }

/* ===== Mobil ===== */
@media (max-width: 600px) {
  .section { padding-top: 40px; }
  .field-row { grid-template-columns: 1fr; }
  .contact-form { padding: 20px; }
  .field--captcha { max-width: none; }
  .btn { width: 100%; }
}
