/* ===================================================
   MCB – Modellbahn Club Bahnhöfle
   Static Site Stylesheet
   =================================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Source+Sans+3:wght@300;400;600&display=swap');

/* --- Variables --- */
:root {
  --clr-bg:       #f5f3ef;
  --clr-surface:  #ffffff;
  --clr-border:   #ddd8ce;
  --clr-text:     #222222;
  --clr-muted:    #666;
  --clr-accent:   #8b1a1a;   /* railway red */
  --clr-accent2:  #3a5a2a;   /* signal green */
  --clr-nav-bg:   #1a1a1a;
  --clr-nav-text: #f0ede7;
  --font-serif:   'Playfair Display', Georgia, serif;
  --font-sans:    'Source Sans 3', system-ui, sans-serif;
  --max-w:        1100px;
  --radius:       4px;
  --shadow:       0 2px 12px rgba(0,0,0,.10);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--clr-text);
  background: var(--clr-bg);
}
a { color: var(--clr-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
p { margin-bottom: 1rem; }
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.2;
  margin-bottom: .75rem;
  color: var(--clr-text);
}
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }

/* H0m korrekt darstellen */
.main-nav a,
.site-logo span,
h1, h2, h3 {
  font-variant: normal;
  font-feature-settings: "case" 0;
}

/* --- Header --- */
.site-header {
  background: var(--clr-nav-bg);
  color: var(--clr-nav-text);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 64px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--clr-nav-text);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-logo img { width: 48px; height: auto; border-radius: 2px; }
.site-logo span { display: none; }
@media (min-width: 600px) { .site-logo span { display: inline; } }

/* --- Navigation --- */
.main-nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.main-nav a {
  color: var(--clr-nav-text);
  font-size: .88rem;
  font-weight: 600;
  padding: .35rem .6rem;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: background .15s;
}
.main-nav a:hover,
.main-nav a.active { background: var(--clr-accent); text-decoration: none; }

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown > a::after { content: ' ▾'; font-size: .7rem; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #2a2a2a;
  min-width: 200px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
  padding: .4rem 0;
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block;
  padding: .45rem 1rem;
  font-size: .88rem;
  color: var(--clr-nav-text);
  border-radius: 0;
}
.dropdown-menu a:hover { background: var(--clr-accent); }

/* Sub-dropdown */
.sub-dropdown { position: relative; }
.sub-dropdown > a::after { content: ' ›'; float: right; }
.sub-menu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  background: #2a2a2a;
  min-width: 180px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .4rem 0;
}
.sub-dropdown:hover .sub-menu { display: block; }
.sub-menu a { font-size: .85rem; }

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--clr-nav-text);
  color: var(--clr-nav-text);
  padding: .4rem .6rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--clr-nav-bg);
    padding: .75rem 1rem 1rem;
    gap: .1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: .5rem .75rem; }
  .dropdown-menu, .sub-menu {
    position: static;
    display: block;
    box-shadow: none;
    background: #333;
    padding-left: 1rem;
  }
  .nav-dropdown > a::after { content: ''; }
  .sub-dropdown > a::after { content: ''; }
}

/* --- Hero Banner --- */
.hero {
  background: linear-gradient(160deg, #1a1a1a 0%, #3d2020 100%);
  color: #fff;
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; max-width: 700px; margin: 0 auto; }
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: .5rem; }
.hero p { color: #ccc; font-size: 1.05rem; }

/* --- Photo Strip (homepage) --- */
.photo-strip {
  display: flex;
  gap: 0;
  height: 260px;
  overflow: hidden;
}
.photo-strip figure {
  flex: 1;
  margin: 0;
  overflow: hidden;
  position: relative;
}
.photo-strip figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.photo-strip figure:hover img { transform: scale(1.05); }
.photo-strip figcaption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: .78rem;
  text-align: center;
  padding: .3rem .5rem;
}
@media (max-width: 600px) {
  .photo-strip { height: 180px; }
  .photo-strip figcaption { display: none; }
}

/* --- Layout --- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.page-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}
.page-content h1 { margin-bottom: 1.25rem; }

/* --- Welcome Section --- */
.welcome-section {
  background: var(--clr-surface);
  border-top: 3px solid var(--clr-accent);
  padding: 3rem 1.5rem;
}
.welcome-section .inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.welcome-section h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-bottom: 1rem; }
.welcome-section p { color: var(--clr-muted); font-size: 1.05rem; }

/* --- Cards / Grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.14); transform: translateY(-2px); }
.card img { width: 100%; height: 200px; object-fit: cover; }
.card-body { padding: 1rem 1.1rem 1.2rem; }
.card-body h3 { margin-bottom: .4rem; }
.card-body p { font-size: .93rem; color: var(--clr-muted); margin: 0; }
.card a.card-link {
  display: inline-block;
  margin-top: .75rem;
  font-size: .88rem;
  font-weight: 600;
  color: var(--clr-accent);
}

/* --- Slideshow (used in gallery pages) --- */
.slideshow { position: relative; max-width: 900px; margin: 1.5rem auto; }
.slide { display: none; text-align: center; }
.slide.active { display: block; }
.slide img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: #111;
  border-radius: var(--radius);
}
.slide-caption {
  font-size: .85rem;
  color: var(--clr-muted);
  margin-top: .5rem;
  min-height: 1.2em;
}
.slide-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: .75rem;
}
.slide-btn {
  background: var(--clr-accent);
  color: #fff;
  border: none;
  padding: .45rem 1.1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .95rem;
  font-family: var(--font-sans);
  transition: opacity .15s;
}
.slide-btn:hover { opacity: .85; }
.slide-counter { font-size: .85rem; color: var(--clr-muted); min-width: 4rem; text-align: center; }

/* --- Images inline --- */
.content-img {
  margin: 1.5rem auto;
  text-align: center;
}
.content-img img {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.content-img figcaption {
  font-size: .82rem;
  color: var(--clr-muted);
  margin-top: .4rem;
}
.img-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0;
  justify-content: center;
}
.img-row figure {
  flex: 1 1 280px;
  max-width: 360px;
}
.img-row figure img {
  width: 100%; height: 220px; object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.img-row figcaption { font-size: .8rem; color: var(--clr-muted); margin-top: .3rem; text-align: center; }

/* --- Contact Form --- */
.contact-form {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 560px;
  box-shadow: var(--shadow);
  margin: 2rem 0;
}
.form-group { margin-bottom: 1.2rem; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: .35rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: .6rem .8rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: .97rem;
  color: var(--clr-text);
  background: var(--clr-bg);
  transition: border-color .15s;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--clr-accent);
  background: #fff;
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-group.checkbox-group { display: flex; gap: .6rem; align-items: flex-start; }
.form-group.checkbox-group input { width: auto; margin-top: .15rem; }
.form-group.checkbox-group label { font-weight: 400; font-size: .88rem; }
.btn-submit {
  background: var(--clr-accent);
  color: #fff;
  border: none;
  padding: .65rem 1.8rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-submit:hover { background: #6e1414; }
.form-msg {
  display: none;
  padding: .75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-weight: 600;
}
.form-msg.success { background: #d4edda; color: #155724; display: block; }
.form-msg.error   { background: #f8d7da; color: #721c24; display: block; }
.quiz-hint { font-size: .8rem; color: var(--clr-muted); margin-top: .25rem; }

/* --- Info box --- */
.info-box {
  background: #faf7f0;
  border-left: 4px solid var(--clr-accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.info-box p { margin: 0; }

/* --- Table --- */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { text-align: left; padding: .55rem .8rem; border-bottom: 1px solid var(--clr-border); }
th { background: #f0ede7; font-weight: 700; font-family: var(--font-serif); }
tr:hover td { background: #faf8f4; }

/* --- Sponsor logos --- */
.sponsor-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  margin: 1.5rem 0;
}
.sponsor-grid img {
  max-width: 220px;
  max-height: 80px;
  object-fit: contain;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: .5rem;
  background: #fff;
}

/* --- Footer --- */
.site-footer {
  background: var(--clr-nav-bg);
  color: #aaa;
  padding: 2.5rem 1.5rem 1.5rem;
  margin-top: 3rem;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}
.footer-inner h4 {
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1rem;
  margin-bottom: .6rem;
}
.footer-inner a { color: #aaa; font-size: .9rem; display: block; margin-bottom: .25rem; }
.footer-inner a:hover { color: #fff; text-decoration: none; }
.footer-inner p { font-size: .88rem; line-height: 1.5; margin: 0; }
.footer-bottom {
  max-width: var(--max-w);
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid #333;
  text-align: center;
  font-size: .82rem;
}

/* --- Utility --- */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* --- Map embed --- */
.map-embed {
  margin: 1.5rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.map-embed iframe { display: block; width: 100%; border: 0; }


