:root {
  --club-green: #11883a;
  --accent: #f77062;
  --accent-hover: #4837ff;
  --bg: #141414;
  --surface: #131313;
  --text: #ffffff;
  --muted: #e9e9e9;
  --border: #1e1e1e;
  --radius: 18px;
  --table-header: #1b1b1b;
  --card-bg: #151515;
}

/* Light Mode Theme */
[data-theme="light"] {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #555555;
  --border: #e0e0e0;
  --table-header: #e8e8e8;
  --card-bg: #fafafa;
}

/* System preference: light mode */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f5f5;
    --surface: #ffffff;
    --text: #1a1a1a;
    --muted: #555555;
    --border: #e0e0e0;
    --table-header: #e8e8e8;
    --card-bg: #fafafa;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Kumbh Sans', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

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

a:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

/* ---------------- NAVBAR ---------------- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border-bottom: 3px solid var(--border);
  padding: 8px 0;
}

/* Logo-Kreis mit Hintergrundbild */
.logo {
  width: 225px;
  height: 225px;
  border-radius: 50%;
  background: #0f2918 url('images/tus_logo2.png') center/cover no-repeat;
  border: 3px solid var(--club-green);
  flex-shrink: 0;
}

/* Hamburger Button */
.hamburger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.hamburger:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hamburger .bar {
  display: block;
  width: 22px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  transition: transform .2s ease, opacity .2s ease;
}

/* Hamburger -> X Animation */
.hamburger.is-active .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.is-active .bar:nth-child(2) {
  opacity: 0;
}

.hamburger.is-active .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Kollabierbares Menü */
.navbar__menu {
  display: none;
  /* mobil: versteckt */
  flex-direction: column;
  gap: 10px;
  padding: 12px 0 0;
}

.navbar__menu.active {
  display: flex;
}

.navlink {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 1.1rem;
  color: var(--muted);
  /* Inactive links are grey */
}

.navlink:hover {
  background: var(--card-bg);
  text-decoration: none;
  color: var(--text);
}

/* Ab mittleren Screens: Menü dauerhaft sichtbar, Button ausblenden */
@media (min-width: 900px) {
  .hamburger {
    display: none;
  }

  .navbar__menu {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 0;
  }
}

/* --------------- LAYOUT & CARDS --------------- */
.wrap {
  max-width: 1100px;
  margin: auto;
  padding: clamp(16px, 3vw, 28px);
}

.hero {
  display: flex;
  align-items: center;
  gap: 18px;
}

.titles main_title {
  margin: 0;
  font-size: 4.0rem;
  font-weight: 600;
}

.titles h1 {
  margin: 0;
  font-size: 2.3rem;
}

.titles h2 {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 1.8rem;
}

.titles p {
  margin: 6px 0 0;
  color: var(--muted);
}

main {
  padding-block: 18px;
}

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

@media (min-width: 900px) {
  .grid {
    grid-template-columns: 2fr 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}

.card h2 {
  margin: 0 0 12px;
  font-size: clamp(28px, 3vw, 36px);
}

/* --------------- TEAM --------------- */
.team {
  display: grid;
  gap: 50px;
}

.person {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
}

.role {
  font-weight: 600;
  font-size: 1.7rem;
}

.email {
  font-size: 1.3rem;
}

.name {
  font-size: 1.3rem;
}

/* --------------- TABELLEN --------------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.95rem;
}

/* Prevent time from wrapping */
td:nth-child(2) {
  white-space: nowrap;
}

th {
  background: var(--table-header);
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* First column (day) - fixed width */
th:first-child,
td:first-child {
  width: 35%;
}

/* Second column (time) - fixed width */
th:nth-child(2),
td:nth-child(2) {
  width: 35%;
}

/* Third column (location) - remaining space */
th:nth-child(3),
td:nth-child(3) {
  width: 30%;
}

/* Location badge styling */
td:nth-child(3) {
  font-weight: 500;
}

caption {
  caption-side: top;
  text-align: left;
  margin-bottom: 10px;
  margin-top: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

/* Mobile table adjustments */
@media (max-width: 500px) {

  th,
  td {
    padding: 10px 6px;
    font-size: 0.85rem;
  }

  th {
    font-size: 0.75rem;
  }

  caption {
    font-size: 1rem;
  }

  /* Reduce column widths for mobile */
  th:first-child,
  td:first-child {
    width: 32%;
  }

  th:nth-child(2),
  td:nth-child(2) {
    width: 38%;
  }

  th:nth-child(3),
  td:nth-child(3) {
    width: 30%;
  }
}

/* --------------- FOTO --------------- */
.photo {
  aspect-ratio: 16/9;
  border-radius: 14px;
  overflow: hidden;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* füllt den Rahmen, schneidet ggf. minimal */
  display: block;
}

/* --------------- ORT --------------- */
.place {
  display: grid;
  gap: 16px;
}

/* Specific override for team panel photos to prevent cropping */
/* Specific override for team panel photos */
.team-panel .photo {
  aspect-ratio: 3/2;
  width: 100%;
  background: var(--table-header);
  border-radius: 14px;
  overflow: hidden;
}

.team-panel .photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.locations-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 700px) {
  .locations-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.location {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.location p {
  margin: 0;
}

.map {
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-bg);
}

/* --------------- FOOTER --------------- */
footer {
  margin-top: 24px;
  padding: 18px 0;
  color: #d8d8d8;
}

/* --------------- TEAMS PAGE --------------- */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.team-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.team-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.team-image-placeholder {
  aspect-ratio: 16/10;
  background: var(--table-header);
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-text {
  font-size: 3rem;
  opacity: 0.5;
}

.team-info {
  padding: 16px;
}

.team-info h3 {
  margin: 0 0 6px;
  font-size: 1.3rem;
  font-weight: 700;
}

.team-info .league {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s ease;
}

.btn:hover {
  background: var(--accent-hover);
  color: white;
  text-decoration: none;
}

/* Active nav link */
.navlink.active {
  color: var(--accent);
  font-weight: 600;
}

.navlink.active:hover {
  color: var(--accent);
}

/* =========================================
   MANNSCHAFTEN TABBED INTERFACE
   ========================================= */

.team-tabs-container {
  margin-bottom: 20px;
}

/* Category Tabs (Herren / Jugend) */
.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 12px;
}

.category-tab {
  padding: 10px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-tab:hover {
  background: var(--table-header);
  color: var(--text);
}

.category-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Team Tabs (Herren I, II, III, etc.) */
.team-tabs {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
}

.team-tabs.active {
  display: flex;
}

.team-tab {
  padding: 8px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.team-tab:hover {
  background: var(--table-header);
  color: var(--text);
}

.team-tab.active {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* Team Content Panel */
.team-content {
  margin-top: 20px;
}

.team-panel {
  display: none;
}

.team-panel.active {
  display: block;
}

.team-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.team-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.league-badge {
  background: var(--accent);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Team Photo Placeholder */
.team-photo-placeholder {
  aspect-ratio: 16/9;
  max-height: 300px;
  background: var(--table-header);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 1.2rem;
  color: var(--muted);
}

/* Content Tabs (Bilanzen / Tabelle / Spielplan) */
.content-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: var(--card-bg);
  padding: 4px;
  border-radius: 10px;
  width: fit-content;
}

.content-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.content-tab:hover {
  color: var(--text);
}

.content-tab.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Team Links */
.team-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.team-links .btn {
  flex: 1;
  min-width: 120px;
  text-align: center;
}

/* Team Roster */
.team-roster {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--table-header);
  border-radius: 10px;
}

.team-roster h4 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--muted);
  font-weight: 600;
}

.player-list {
  margin: 0;
  padding-left: 24px;
  columns: 2;
  column-gap: 24px;
}

.player-list li {
  padding: 4px 0;
  font-size: 0.95rem;
  break-inside: avoid;
}

.roster-note {
  margin: 0;
  font-style: italic;
  color: var(--muted);
}

@media (max-width: 480px) {
  .player-list {
    columns: 1;
  }
}

/* =========================================
   NEWS FEED (Aktuelles)
   ========================================= */

.news-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.news-item:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.news-header {
  width: 100%;
  padding: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  color: var(--text);
  font-family: inherit;
}

.news-header:hover {
  background: var(--table-header);
}

.news-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.news-date {
  font-size: 0.85rem;
  color: var(--muted);
}

.news-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--accent);
  color: white;
}

.news-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  padding-right: 40px;
}

.news-teaser {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  padding-right: 40px;
}

.news-toggle {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  transition: transform 0.3s ease;
}

.news-item.expanded .news-toggle {
  transform: translateY(-50%) rotate(180deg);
}

.news-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 20px;
}

.news-item.expanded .news-content {
  max-height: 1000px;
  padding: 0 20px 20px;
}

.news-content p {
  margin: 0 0 12px;
  line-height: 1.7;
}

.news-content p:last-child {
  margin-bottom: 0;
}

.news-content h4 {
  margin: 16px 0 8px;
  font-size: 1rem;
  color: var(--accent);
}

.news-content ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.news-content li {
  margin: 4px 0;
}

/* Mobile adjustments for news */
@media (max-width: 600px) {
  .news-header {
    padding: 16px;
  }

  .news-title {
    font-size: 1.1rem;
  }

  .news-teaser {
    font-size: 0.9rem;
  }

  .news-toggle {
    right: 16px;
  }

  .news-content {
    padding: 0 16px;
  }

  .news-item.expanded .news-content {
    padding: 0 16px 16px;
  }
}

/* Mobile adjustments for tabs */
@media (max-width: 600px) {
  .category-tabs {
    flex-wrap: wrap;
  }

  .category-tab {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .team-tab {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .team-header h3 {
    font-size: 1.3rem;
  }

  .league-badge {
    font-size: 0.75rem;
    padding: 3px 10px;
  }

  .content-tabs {
    width: 100%;
  }

  .content-tab {
    flex: 1;
    padding: 6px 8px;
    font-size: 0.8rem;
    text-align: center;
  }

  .team-links .btn {
    min-width: 100%;
  }
}

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

/* =========================================
   RESPONSIVE DESIGN - MOBILE FIRST APPROACH
   ========================================= */

/* Extra Small Devices (small smartphones, 320px - 374px) */
@media (max-width: 374px) {
  .wrap {
    padding: 12px;
  }

  /* Smaller logo for tiny screens */
  .logo {
    width: 100px;
    height: 100px;
  }

  /* Navbar stacks vertically */
  .navbar {
    flex-wrap: wrap;
    padding: 8px;
    gap: 8px;
  }

  /* Smaller main title on tiny screens */
  .titles main_title {
    font-size: 1.8rem;
    line-height: 1.2;
  }

  .titles h2 {
    font-size: 1rem;
  }

  /* Smaller cards */
  .card {
    padding: 12px;
    border-radius: 12px;
  }

  .card h2 {
    font-size: 1.4rem;
    margin-bottom: 10px;
  }

  /* Team person cards */
  .person {
    padding: 10px;
  }

  .role {
    font-size: 1rem;
  }

  .name,
  .email {
    font-size: 0.9rem;
  }

  /* Tables - minimal padding */
  th,
  td {
    padding: 8px 4px;
    font-size: 0.75rem;
  }

  th {
    font-size: 0.65rem;
  }

  caption {
    font-size: 0.9rem;
  }

  /* Team cards on mannschaften page */
  .team-info {
    padding: 12px;
  }

  .team-info h3 {
    font-size: 1.1rem;
  }

  .team-info .league {
    font-size: 0.8rem;
  }

  .btn {
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  /* Footer */
  footer small {
    font-size: 0.75rem;
  }

  /* Location section */
  .location p {
    font-size: 0.85rem;
  }

  .map iframe {
    height: 160px !important;
  }
}

/* Small Smartphones (375px - 480px) */
@media (min-width: 375px) and (max-width: 480px) {
  .wrap {
    padding: 14px;
  }

  /* Moderate logo size */
  .logo {
    width: 120px;
    height: 120px;
  }

  .navbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .titles main_title {
    font-size: 2.2rem;
    line-height: 1.2;
  }

  .titles h2 {
    font-size: 1.2rem;
  }

  .card {
    padding: 14px;
  }

  .card h2 {
    font-size: 1.6rem;
  }

  .role {
    font-size: 1.2rem;
  }

  .name,
  .email {
    font-size: 1rem;
  }

  /* Team grid gap reduced */
  .team {
    gap: 24px;
  }

  .map iframe {
    height: 180px !important;
  }
}

/* Medium Smartphones / Large Phones (481px - 599px) */
@media (min-width: 481px) and (max-width: 599px) {
  .logo {
    width: 150px;
    height: 150px;
  }

  .titles main_title {
    font-size: 2.6rem;
  }

  .titles h2 {
    font-size: 1.4rem;
  }

  .card h2 {
    font-size: 1.8rem;
  }

  .role {
    font-size: 1.4rem;
  }
}

/* Tablets (600px - 899px) */
@media (min-width: 600px) and (max-width: 899px) {
  .logo {
    width: 180px;
    height: 180px;
  }

  .titles main_title {
    font-size: 3rem;
  }

  .titles h2 {
    font-size: 1.5rem;
  }

  /* Two column grid for teams on tablets */
  .teams-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Main grid stays single column until 900px to avoid the training schedule getting too cramped */
}

/* Landscape phone orientation improvements */
@media (max-height: 500px) and (orientation: landscape) {
  .logo {
    width: 80px;
    height: 80px;
  }

  .titles main_title {
    font-size: 1.8rem;
  }

  .titles h2 {
    font-size: 1rem;
  }

  .hero {
    gap: 12px;
  }

  .card {
    padding: 12px;
  }

  .navbar__menu.active {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* Touch-friendly improvements for all mobile devices */
@media (max-width: 899px) {

  /* Larger tap targets for links and buttons */
  .navlink {
    padding: 12px 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Email links - easier to tap */
  .email {
    display: inline-block;
    padding: 4px 0;
  }

  /* Improved mobile menu spacing */
  .navbar__menu.active {
    padding: 16px 0;
    gap: 4px;
  }

  .navbar__menu.active .navlink {
    width: 100%;
    border-radius: 10px;
    background: var(--card-bg);
  }
}

/* Ensure smooth transitions and prevent layout shifts */
.logo,
.titles main_title,
.titles h2,
.card,
.card h2,
.role,
.name,
.email {
  transition: font-size 0.2s ease;
}