/* ============================================================
   Schachclub Lindau – style.css (optimiert + mobile-responsive)
   ============================================================ */

/* ── CSS-Variablen (Farben & Abstände) ─────────────────────── */
:root {
  --color-primary: #333;
  --color-secondary: #555;
  --color-muted: #666;
  --color-black: #000;
  --color-white: #fff;
  --color-bg-body: #f4f4f4;
  --color-bg-light: #f9f9f9;
  --color-bg-lighter: #f8f9fa;
  --color-bg-table-even: #fafafa;
  --color-bg-highlight: #f0f8ff;
  --color-bg-hover: #f5f5f5;
  --color-bg-event: #f0f0f0;
  --color-bg-dropdown-hover: #e6e6e6;
  --color-bg-table-head: #f2f2f2;
  --color-border: #ccc;
  --color-border-light: #ddd;
  --color-border-lighter: #eee;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 2px 5px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 0 10px rgba(0, 0, 0, 0.1);
  --max-width: 1200px;
  --border-radius: 5px;
  --border-radius-lg: 8px;
}

/* ── Reset & Allgemein ─────────────────────────────────────── */
body {
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: var(--color-bg-body);
  color: var(--color-primary);
}

a {
  color: var(--color-secondary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h2,
h3 {
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 10px;
}

/* ── Header ────────────────────────────────────────────────── */
header {
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: 1rem;
}

.header-top {
  display: flex;
  align-items: center;
  padding: 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.header-top h1 {
  color: var(--color-white);
  margin: 0;
  font-size: 2.5em;
}

.logo {
  max-width: 100px;
  height: auto;
  margin-right: 1rem;
}

/* ── Navigation ────────────────────────────────────────────── */
nav {
  position: relative;
}

nav ul {
  list-style-type: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  margin: 0 auto;
  background-color: var(--color-bg-body);
  max-width: var(--max-width);
}

nav ul li {
  margin-right: 0.5rem;
}

nav ul li a {
  color: var(--color-primary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  display: inline-block;
}

nav ul li a:hover {
  background-color: var(--color-bg-body);
  color: var(--color-primary);
}

/* ── Hamburger-Menü-Button ─────────────────────────────────── */
.hamburger {
  display: none;
  font-size: 1.8em;
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  padding: 8px 16px;
  margin: 0;
  line-height: 1;
}

.hamburger:hover {
  background-color: var(--color-bg-body);
}

/* ── Dropdown ──────────────────────────────────────────────── */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--color-bg-light);
  min-width: 160px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 1;
  list-style-type: none;
  padding: 0;
}

.dropdown-content li {
  padding: 0.5rem 1rem;
}

.dropdown-content li:hover {
  background-color: var(--color-bg-dropdown-hover);
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* ── Layout (Content + Sidebar) ────────────────────────────── */
.content {
  display: flex;
  width: var(--max-width);
  max-width: 100%;
  margin: 0 auto;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  box-sizing: border-box;
}

main {
  flex: 3;
  padding: 20px;
  background-color: var(--color-white);
  box-shadow: var(--shadow-lg);
  overflow-x: hidden;
  box-sizing: border-box;
}

/* ── Bilder ────────────────────────────────────────────────── */
.featured-image {
  margin-top: 2rem;
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  overflow: hidden;
}

.responsive-image {
  width: 100%;
  height: auto;
  display: block;
}

.image-container {
  text-align: center;
  margin-bottom: 20px;
}

.vorstand-img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.parallax {
  background-image: url('chess-pieces2.jpg');
  height: 200px;
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* ── Tabellen ──────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

th,
td {
  padding: 8px;
  text-align: left;
  border: 1px solid var(--color-border-light);
}

th {
  background-color: var(--color-bg-table-head);
  font-weight: bold;
}

tr:nth-child(even) {
  background-color: var(--color-bg-light);
}

/* ── Sieger-Tabelle ────────────────────────────────────────── */
.sieger-tabelle {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background-color: var(--color-white);
  box-shadow: var(--shadow-md);
}

.sieger-tabelle th,
.sieger-tabelle td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

.sieger-tabelle th {
  background-color: var(--color-bg-lighter);
  font-weight: bold;
  color: var(--color-primary);
}

.sieger-tabelle tr:hover {
  background-color: var(--color-bg-hover);
}

.sieger-tabelle tr:nth-child(even) {
  background-color: var(--color-bg-table-even);
}

/* ── Events ────────────────────────────────────────────────── */
.event-category {
  background-color: var(--color-bg-event);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  margin-bottom: 30px;
}

.event-category h3 {
  color: var(--color-secondary);
  border-bottom: 2px solid var(--color-secondary);
  padding-bottom: 10px;
  margin-top: 0;
}

.event-list {
  list-style-type: none;
  padding-left: 0;
}

.event-item {
  background-color: var(--color-white);
  border-left: 4px solid var(--color-secondary);
  padding: 15px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.event-date {
  font-weight: bold;
  color: var(--color-secondary);
}

.event-name {
  margin-top: 5px;
}

/* ── Standings-Link & History-Link ─────────────────────────── */
.standings-link,
.history-link {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 15px;
  background-color: var(--color-secondary);
  color: var(--color-white);
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: background-color 0.3s;
}

.standings-link:hover,
.history-link:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
  text-decoration: none;
}

/* ── News-Bereich ──────────────────────────────────────────── */
.news-section {
  flex: 1;
  padding: 20px;
  background-color: var(--color-white);
  margin-left: 20px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  box-sizing: border-box;
}

.news-section h2 {
  color: var(--color-black);
}

.news-section ul {
  padding: 10px;
}

.news-section li {
  margin-bottom: 10px;
}

.news-section li strong {
  color: var(--color-secondary);
}

.news-item {
  border: 1px solid var(--color-border);
  padding: 10px;
  margin-bottom: 15px;
  border-radius: var(--border-radius);
  background-color: var(--color-bg-light);
}

/* ── Vorstand / Chairman ───────────────────────────────────── */
.chairman-info {
  display: flex;
  align-items: center;
  margin: 20px 0;
  padding: 20px;
  background-color: var(--color-bg-light);
  border-radius: var(--border-radius);
}

.chairman-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 20px;
}

.chairman-details {
  flex-grow: 1;
}

.chairman-details h3 {
  margin-top: 0;
  border-bottom: none;
}

/* ── Kontaktformular ───────────────────────────────────────── */
.contact-form {
  margin-top: 40px;
}

form {
  display: flex;
  flex-direction: column;
}

label {
  margin-top: 10px;
}

input,
textarea {
  padding: 5px;
  margin-top: 5px;
}

button {
  background-color: var(--color-primary);
  color: var(--color-white);
  border: none;
  padding: 10px;
  margin-top: 10px;
  cursor: pointer;
}

button:hover {
  background-color: var(--color-secondary);
}

/* ── Info-Box & Statistiken ────────────────────────────────── */
.info-box {
  background-color: var(--color-bg-lighter);
  padding: 20px;
  border-radius: var(--border-radius-lg);
  border-left: 4px solid var(--color-primary);
  margin: 20px 0;
}

.info-box p {
  margin: 15px 0;
  line-height: 1.6;
}

.stats-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 20px 0;
}

.stat-box {
  background-color: var(--color-white);
  padding: 20px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
}

.stat-box h4 {
  color: var(--color-primary);
  margin-bottom: 15px;
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 5px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-lighter);
}

.stat-item:last-child {
  border-bottom: none;
}

.stat-name {
  font-weight: 500;
}

.stat-count {
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: bold;
}

/* ── Vereinsturnier ────────────────────────────────────────── */
.tournament-info {
  margin: 20px 0;
}

.tournament-intro {
  background-color: var(--color-bg-lighter);
  padding: 25px;
  border-radius: var(--border-radius-lg);
  border-left: 4px solid var(--color-primary);
  margin: 25px 0;
}

.tournament-intro h3 {
  color: var(--color-primary);
  margin-top: 0;
  margin-bottom: 15px;
}

.tournament-intro p {
  line-height: 1.6;
  margin: 12px 0;
}

.participants-table {
  margin: 20px 0;
}

.round-schedule {
  margin: 20px 0;
}

.round {
  margin: 15px 0;
  padding: 10px;
  border-left: 3px solid var(--color-primary);
  background-color: var(--color-bg-light);
}

.round h4 {
  margin: 0 0 10px 0;
  color: var(--color-primary);
}

.pairing {
  margin: 5px 0;
  padding: 3px 0;
}

.spielfrei {
  font-style: italic;
  color: var(--color-muted);
}

/* ── Zitat ─────────────────────────────────────────────────── */
.quote {
  margin: 30px 0;
  padding: 20px;
  background-color: var(--color-bg-highlight);
  border-left: 4px solid var(--color-primary);
  font-style: italic;
  text-align: center;
}

.quote-author {
  font-weight: bold;
  margin-top: 10px;
}

/* ── Footer ────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1rem;
  background-color: var(--color-primary);
  color: var(--color-white);
}


/* ================================================================
   RESPONSIVE MEDIA QUERIES
   ================================================================ */

/* ── Tablet (≤ 768px) ──────────────────────────────────────── */
@media (max-width: 768px) {

  /* Content + Sidebar untereinander stapeln */
  .content {
    flex-direction: column;
    width: 100%;
    padding: 0 10px;
  }

  main {
    width: 100%;
    flex: none;
    overflow-x: auto;
  }

  /* News-Sidebar unter den Hauptinhalt */
  .news-section {
    margin-left: 0;
    margin-top: 20px;
    width: 100%;
    flex: none;
  }

  /* Tabellen horizontal scrollbar machen */
  table {
    min-width: 500px;
  }

  /* Parallax auf Mobile deaktivieren */
  .parallax {
    background-attachment: scroll;
    height: 120px;
  }

  /* Header-Titel kleiner */
  .header-top h1 {
    font-size: 1.5em;
    text-align: center;
  }

  /* Vorstandsbild volle Breite */
  .vorstand-img {
    width: 100% !important;
  }

  /* Stats-Grid einspaltig */
  .stats-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Sieger-Tabelle kompakter */
  .sieger-tabelle {
    font-size: 0.85em;
  }

  .sieger-tabelle th,
  .sieger-tabelle td {
    padding: 6px 4px;
  }

  /* Info-Box & Tournament-Intro enger */
  .info-box,
  .tournament-intro {
    padding: 15px;
  }

  /* Bilder in Inline-Flex-Containern (z.B. Online-Seite) */
  main img {
    max-width: 100%;
    height: auto !important;
  }
}

/* ── Mobil (≤ 600px) ───────────────────────────────────────── */
@media (max-width: 600px) {

  /* Header-Bereich */
  .header-top {
    flex-direction: column;
    padding: 10px;
  }

  .header-top h1 {
    font-size: 1.3em;
  }

  .logo {
    margin-bottom: 0.5rem;
    margin-right: 0;
  }

  /* Hamburger-Button anzeigen */
  .hamburger {
    display: block;
    background-color: var(--color-bg-body);
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border-light);
  }

  /* Navigation standardmäßig verstecken */
  nav ul {
    flex-direction: column;
    display: none;
  }

  /* Navigation anzeigen wenn offen */
  nav ul.open {
    display: flex;
  }

  nav ul li {
    margin: 0;
    border-bottom: 1px solid var(--color-border-light);
  }

  nav ul li a {
    padding: 12px 16px;
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  /* Dropdown auf Touch: per Klick statt Hover */
  .dropdown-content {
    position: static;
    box-shadow: none;
    display: none;
    background-color: var(--color-bg-body);
  }

  /* Hover-Dropdown auf Mobile deaktivieren */
  .dropdown:hover .dropdown-content {
    display: none;
  }

  /* Dropdown per Klick einblenden */
  .dropdown.active .dropdown-content {
    display: block;
  }

  .dropdown-content a {
    padding: 10px 24px;
    display: block;
    border-bottom: 1px solid var(--color-border-lighter);
  }

  /* Banner-Scroll kleiner */
  .banner-scroll {
    font-size: 0.8em;
  }

  /* Chairman-Info untereinander */
  .chairman-info {
    flex-direction: column;
    text-align: center;
  }

  .chairman-photo {
    margin-bottom: 1rem;
    margin-right: 0;
  }

  /* Inline-Flex-Container (z.B. Online-Seite Lichess/Chess.com) */
  [style*="display: flex"] {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  [style*="display: flex"] img {
    margin-bottom: 10px;
    margin-right: 0 !important;
  }

  /* Content ohne Abstand */
  .content {
    padding: 0 5px;
    gap: 10px;
  }

  main {
    padding: 15px;
  }

  .news-section {
    padding: 15px;
  }

  /* Tabellen noch kompakter */
  table {
    font-size: 0.85em;
  }

  th, td {
    padding: 6px 4px;
  }

  /* Runden-Schedule kompakter */
  .round {
    padding: 8px;
  }

  /* Zitat kompakter */
  .quote {
    padding: 15px;
    margin: 20px 0;
  }
}

/* ── Desktop (≥ 1200px) ────────────────────────────────────── */
@media (min-width: 1200px) {
  .featured-image {
    width: 100%;
    margin: auto;
  }

  .responsive-image {
    max-width: var(--max-width);
    margin: 0 auto;
  }
}

/* ── Laufband / Banner (aus header.html ausgelagert) ───────── */
@keyframes scroll-left {
    0%   { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}
.banner-container {
    background-color: var(--color-primary);
    overflow: hidden;
    padding: 8px 0;
    border-bottom: 2px solid var(--color-secondary);
}
.banner-scroll {
    display: inline-block;
    white-space: nowrap;
    animation: scroll-left 50s linear infinite;
    color: var(--color-white);
    font-size: 0.95em;
}
.banner-scroll a {
    color: var(--color-white);
    text-decoration: underline;
}
/* ── Online-Seite: Plattform-Icons (aus online.html ausgelagert) */
.platform-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}
.platform-icon {
    height: auto;
    margin-right: 15px;
}
