/* Grundlegendes Layout */
:root{
  --bg:#f9f9f9;
  --accent:#334;
  --muted:#666;
  --card-bg:#fff;
  --gap:1rem;
}

*{box-sizing:border-box}
body {
  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  background-color: var(--bg);
  color: #333;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* Header */
header {
  background: var(--accent);
  color: #fff;
  padding: 1rem 0;
  text-align: center;
}

header h1 {
  margin: 0.2rem 0;
  font-weight: 400;
}

/* Einheitliche Navigation */
.main-nav {
  margin-top: 0.6rem;
  display:inline-block;
}

.main-nav .nav-link {
  color: #eee;
  text-decoration: none;
  margin: 0 0.6rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.main-nav .nav-link:hover,
.main-nav .nav-link.active {
  color: #111;
  background: #ffd70022;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.04);
}

/* Hauptbereich */
main {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Karten / Sektionen */
.intro, .contact, .impressum {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Galerie: Rahmen passt sich der Bildgröße an */
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  justify-content: center;
  align-items: flex-start;
  margin: 0;
  padding: 0;
}

/* Jede Figure ist ein shrink-wrapping flex-item */
.gallery figure {
  margin: 0;
  list-style: none;
  /* verhindert dehnen in Flex-Layout */
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 2px 5px rgba(0,0,0,0.06);
  transition: transform .15s ease, box-shadow .15s ease;
}

/* subtile Hoverwirkung */
.gallery figure:hover{
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.09);
}

/* Bilddarstellung: nicht erzwungenes Strecken;
   Bild zeigt in nativer Größe — aber begrenzt für kleine Screens */
.gallery img {
  display: block;
  width: auto;              /* keine erzwungene Breite */
  height: auto;
  max-width: 90vw;          /* schützt vor Seitenüberlauf auf kleinen Geräten */
  max-height: 70vh;         /* verhindert zu hohe Bilder auf kleinen Bildschirmen */
}

/* Beschriftung zentriert unter dem Bild */
.gallery figcaption {
  margin-top: 0.45rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

/* Kontaktformular */
form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: transparent;
  padding: 0;
  border-radius: 0;
}

label {
  font-weight: 600;
  font-size: 0.95rem;
}

input, textarea {
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  width: 100%;
}

button {
  align-self: flex-start;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.7rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

button:hover {
  background: #556;
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem;
  background: var(--accent);
  color: #ccc;
  font-size: 0.9rem;
  margin-top: 2rem;
}

/* Responsive Anpassungen */
@media (max-width:640px){
  .main-nav .nav-link{ display:inline-block; margin:0 .4rem; font-size:.95rem; }
  .gallery { gap: .6rem; }
  .gallery img { max-width: 88vw; max-height: 55vh; }
}

/* Link "nach oben" */
.backtotop {
  text-align: center;
  margin: 2rem 0;
}
.backtotop a {
  color: #334;
  text-decoration: none;
  font-weight: bold;
  border: 1px solid #334;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: background 0.2s;
}
.backtotop a:hover {
  background: #334;
  color: #fff;
}
.success {
  color: green;
  font-weight: bold;
  margin-bottom: 1rem;
}

.error {
  color: red;
  font-weight: bold;
  margin-bottom: 1rem;
}

