* {
  box-sizing: border-box;
}

:root {
  --content-width: 92%;
  --content-max: 2190px;
  --green-base: #658754;
  --green-dark: #4a6340;
  --green-darker: #3a4f32;
  --glass-border: rgba(255, 255, 255, 0.13);
  --glass-bg: rgba(101, 135, 84, 0.22);
  --card-bg: rgba(60, 85, 48, 0.38);
  --card-hover: rgba(60, 85, 48, 0.52);
  --text-main: rgba(255, 255, 255, 0.90);
  --text-muted: rgba(255, 255, 255, 0.55);
}

body {
  margin: 0;
  background: linear-gradient(to bottom, #8db57a, #3a5232);
  background-attachment: fixed;
  min-height: 100vh;
  font-family: Verdana, Arial, sans-serif;
}

/* =========================
   PAGE WRAPPER
========================= */

#page {
  width: 100%;
  margin: 0;
  padding: 0;
  padding-top: 0;
}

/* =========================
   DET-NAV (grüne Pfeile)
========================= */
.det-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(32px, 6vw, 64px);
  width: 100%;
  height: 100%;
}

.det-nav-link {
  color: #2e3d28;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.det-nav-link:hover {
  color: #fff;
}


/* =========================
   GRID-HEADER (Headline + TitleBox)
========================= */

.grid-header {
  width: 100%;
  background: transparent;
  margin-top: 0;
}

.headline {
  display: flex;
  justify-content: center;
  background: #3a4f32;
  border-top: 1px solid var(--glass-border);
  align-items: center;
  padding-top: 6px;
  padding-bottom: 10px;
    
}

.titleBox {
  display: flex;
  justify-content: center;
  background: rgba(91, 122, 76, 0.55);
}

.headline h1,
.titleBox p {
  margin: 0;
  width: var(--content-width);
  max-width: var(--content-max);
  color: var(--text-main);
}

.headline h1 {
  font-size: clamp(22.54px, 1.771vw, 38.64px);
  text-align: center;
  line-height: 1.2;
}

.titleBox p {
  font-size: clamp(13.16px, 1.128vw, 20.68px);
  padding: 10px 0;
  text-align: center;
}

/* =========================
   GRID
========================= */

#grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: clamp(33.40px, 2.78vw, 61.21px);
  row-gap: clamp(10.47px, 0.87vw, 19.2px);
  width: var(--content-width);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(10px, 1vw, 20px) clamp(29px, 2.42vw, 53px) clamp(11px, 0.97vw, 21px) clamp(29px, 2.42vw, 53px);
}

#grid:has(.card:nth-child(5)) {
  justify-content: flex-start;
}

#grid:has(.card:nth-child(2)):not(:has(.card:nth-child(3))) {
  column-gap: clamp(40px, 4vw, 80px);
}

/* =========================
   CARDS
========================= */

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  scroll-margin-top: 160px;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 18px;
  width: calc(25% - 32px);
  max-width: 280px;
  margin: 0;
  transition: background 0.2s;
}

.card:hover {
  background: var(--card-hover);
}

.card img {
  width: 100%;
  height: auto;
  aspect-ratio: 280 / 180;
  object-fit: cover;
  border-radius: 5px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 4px 18px rgba(0,0,0,0.35),
    inset 0 -1px 0 rgba(0,0,0,0.15);
  display: block;
}

.card:hover img {
  border-color: rgba(255, 255, 255, 0.48);
}

/* =========================
   FOOTER
========================= */

#footer {
  display: flex;
  height: clamp(35px, 2.92vw, 64px);
  width: 100%;
  background: #3a4f32;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  margin-top: 6px;
}

#footer a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #dfdfdf;
  transition: color 0.2s;
  max-width: 50%;
  margin: 0 auto;
}

#footer a:first-child {
  border-right: 2px solid rgba(120, 156, 97, 0.9);
}

#footer a:hover {
  color: var(--text-main);
  background: rgba(58, 79, 50, 0.35);
}

/* =========================
   DESKTOP
========================= */

@media (min-width: 1200px) {

  #page {
    padding-top: 0;
  }

  #grid {
    padding: clamp(13.2px, 1.164vw, 25.2px) clamp(29px, 2.42vw, 53px) clamp(10.23px, 0.902vw, 19.53px) clamp(29px, 2.42vw, 53px);
  }

  .grid-header {
    margin-top: 0;
  }
  
   .titleBox {
    height: 51px;
    align-items: center;
    padding-top: 2px;
    padding-bottom: 4px;
  }

  .card:hover {
    background: rgba(58, 79, 50, 0.55);
  }

 }

/* =========================
   TABLET
========================= */

@media (max-width: 1199px) {

  #page {
    width: 100%;
    margin: 0;
    padding-top: 0;
  }

  #grid {
    column-gap: 16px;
    row-gap: 13px;
    width: 100%;
    max-width: 100%;
    padding: 11px 12px 5px 12px;
  }

  #grid:has(.card:nth-child(4)) {
    justify-content: flex-start;
  }

  #grid:has(.card:nth-child(2)):not(:has(.card:nth-child(3))) {
    column-gap: 40px;
  }

  #grid:has(.card:nth-child(2)):not(:has(.card:nth-child(3))) .card {
    width: calc(50% - 28px);
    max-width: 280px;
  }

  .grid-header {
    margin-top: 0;
  }

  .headline {
    height: auto;
    padding-top: 9px;
    padding-bottom: 13px;
    align-items: center;
  }

  .headline h1 {
    width: 100%;
    font-size: 18px;
    text-align: center;
    padding: 0 16px;
    font-weight: bold;
    line-height: 1.2;
  }

  .titleBox {
    height: 50px;
    align-items: center;
    display: flex;
    padding-top: 2px;
    padding-bottom: 4px;
  }

  .titleBox p {
    width: 100%;
    font-size: 15px;
    padding: 10px 16px;
    text-align: center;
  }

  .card {
    width: calc(33.333% - 12px);
    max-width: 280px;
    margin: 0;
    padding: 12px;
  }

  .card:hover img {
    border-color: rgba(255, 255, 255, 0.12);
  }

  .card:hover {
    background: var(--card-bg);
  }

  #footer {
  background: #3a4f32;
}

  #footer a:first-child {
  border-right: 2px solid #527b5b;
}
  #footer a:hover {
  background: none;
  color: #dfdfdf;
}

.det-nav-link:hover {
  color: #2e3d28;
}
}
/* =========================
   MOBILE
========================= */

@media (max-width: 600px) {

  #page {
    margin: 0;
    padding-top: 0;
  }

  .grid-header {
    margin-top: 0;
  }

  .headline {
    height: auto;
    padding-top: 7px;
    padding-bottom: 9px;
    align-items: center;
  }

  .headline h1 {
    width: 100%;
    font-size: 17px;
    text-align: center;
    font-weight: bold;
  }

  .titleBox {
    height: 46px;
    padding-top: 0;
    padding-bottom: 3px;
    display: flex;
    align-items: center;
  }

  .titleBox p {
    width: 100%;
    font-size: 14px;
    padding: 10px 0;
    text-align: center;
    line-height: 1;
  }

  #grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 10px;
    row-gap: 12px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 10px 10px 5px 10px;
  }

  .card {
    padding: 13px;
    width: auto;
    max-width: 280px;
    margin: 0;
  }

  #grid:has(.card:nth-child(2)):not(:has(.card:nth-child(3))) {
    column-gap: 7px;
  }

  #grid:has(.card:nth-child(2)):not(:has(.card:nth-child(3))) .card {
    width: auto;
  }

  #footer {
  background: #3a4f32;
}

  #footer a:first-child {
  border-right: 2px solid #527b5b;
}

  #footer a:hover {
  background: none;
  color: #dfdfdf;
}

.det-nav-link:hover {
  color: #2e3d28;
}
}

/* =========================
   GROSSBILDSCHIRM
========================= */

@media (min-width: 2190px) {

  #grid {
    grid-template-columns: repeat(8, 1fr);
  }

  .card {
    max-width: 320px;
  }

  /* Weniger als 8 Cards: zentriert */
  #grid:not(:has(.card:nth-child(8))) {
    justify-content: center;
  }

  /* 8 oder mehr: linksbündig */
  #grid:has(.card:nth-child(8)) {
    justify-content: flex-start;
  }

  .det-nav-link svg {
    width: 70px;
    height: 70px;
  }

  #footer a {
    font-size: 26px;
  }

  .headline {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .titleBox {
    height: auto;
    min-height: 80px;
    align-items: center;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .titleBox p {
    font-size: clamp(24px, 1.2vw, 32px);
  }
}


@media (min-width: 1200px) {
  #footer a:hover {
    background: #6e8e5a;
  }
}

