/* ===========================
   Base font – local fonts
   =========================== */

@font-face {
  font-family: 'GrundschriftRegular';
  src: url('fonts/Grundschrift-Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'GrundschriftRegular';
  src: url('fonts/Grundschrift-Bold.otf') format('opentype');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'GrundschriftRegular';
  src: url('fonts/Grundschrift-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
}

/* ===========================
   Responsive breakpoints (concept)
   <  480px : small phones
   480–767 : normal phones
   768–1023: tablets
   1024–1279: tablets / small laptops
   1280–1919: standard / large desktops
   >= 1920 : Full HD & larger
   =========================== */

/* === Global settings === */
:root{
  --gruen:#006600;
}

*{
  box-sizing:border-box;
}

/* Force Grundschrift globally */
body{
  background-color:#c80404;
  padding:0 1.2rem 1.2rem;        /* top 0, sides + bottom 1.2rem */
  margin:0;
  font-family:'GrundschriftRegular',"Segoe UI",Arial,sans-serif;
  font-size:18px;
  line-height:1.6;
  color:#111;
}

body,
p,
li,
h1, h2, h3, h4, h5, h6,
summary,
details,
button,
input,
textarea {
  font-family:'GrundschriftRegular',"Segoe UI",Arial,sans-serif;
}

/* Optional main container – base width */
main{
  max-width:1200px;
  margin:0 auto;
}

/* Elements that should visually align with the grid */
.top-nav,
.start-hinweis,
#einzelansicht{
  max-width:1200px;
  margin-left:auto;
  margin-right:auto;
}

/* ===========================
   Back-to-top button
   =========================== */

.back-to-top {
  display: block;
  width: 60px;
  height: 60px;
  background: #ffffff;
  color: #005000;
  font-size: 2rem;
  font-weight: bold;
  line-height: 60px;
  text-align: center;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
  text-decoration: none;
  margin: 2rem auto;
  transition: transform 0.2s, background-color 0.2s;
}

.back-to-top:hover {
  transform: translateY(-4px);
  background: #f2f2f2;
}

/* Smaller button on very narrow screens */
@media (max-width: 600px){
  .back-to-top{
    width:48px;
    height:48px;
    line-height:48px;
    font-size:1.5rem;
    margin:1.5rem auto;
  }
}

/* ===========================
   Header & snowfall
   =========================== */

.page-header{
  margin-top:0;
  position: relative;
  padding: 1.5rem 0 0.5rem;
  overflow: visible;
}

/* Snow area: uses the --snow-depth variable */
.snow-container{
  position:absolute;
  left:0;
  top:-80px;            /* Snow starts above the visible area */
  width:100%;
  height:var(--snow-depth);
  pointer-events:none;
  overflow:hidden;
  z-index:0;
}

/* Individual snowflake */
.snowflake{
  position:absolute;
  background-color:#ffffff;
  border-radius:50%;
  opacity:0.9;
  pointer-events:none;
  will-change: transform;
}

/* Vertical fall – smooth fade-out at the bottom edge */
@keyframes fall {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  10% {
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  /* Fade out exactly at the bottom limit */
  90% {
    opacity: 0;
    transform: translateY(var(--snow-depth));
  }
  100% {
    opacity: 0;
    transform: translateY(calc(var(--snow-depth) + 40px));
  }
}

/* Diagonal fall – same logic with horizontal movement */
@keyframes diagonal-fall {
  0% {
    opacity: 0;
    transform: translate(0, 0);
  }
  10% {
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  90% {
    opacity: 0;
    transform: translate(10vw, var(--snow-depth));
  }
  100% {
    opacity: 0;
    transform: translate(10vw, calc(var(--snow-depth) + 40px));
  }
}

/* ===========================
   Snow toggle button
   =========================== */

.snow-toggle {
    position: absolute;
    top: 30px;
    right: 0px;

    display: flex;
    align-items: center;
    gap: 4px;

    padding: 4px 10px;
    font-size: 0.8rem;

    background: rgba(255, 255, 255, 0.35);
    color: #222;

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.4);

    cursor: pointer;
    z-index: 40;
    transition: all 0.18s ease;
}

/* Hover (Desktop only) */
@media (hover:hover) {
    .snow-toggle:hover {
        background: rgba(255, 255, 255, 0.55);
        box-shadow: 0 2px 6px rgba(0,0,0,0.15);
        transform: translateY(-1px);
    }
}

/* Icon */
.snow-toggle-icon {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Text */
.snow-toggle-label {
    opacity: 0.9;
}

/* ▼ Mobile */
@media (max-width: 1280px) {
    .snow-toggle {
        top: 20px;
        right: 0px;
        }
}

/* ▼ Mobile */
@media (max-width: 600px) {
    .snow-toggle {
        top: 15px;
        right: 0px;

        padding: 2px 6px;
        font-size: 0.65rem;
        border-radius: 5px;

        background: rgba(255, 255, 255, 0.28);  /* noch transparenter */
    }

    .snow-toggle-icon {
        font-size: 0.75rem;
    }
}

/* ===========================
   Links
   =========================== */
a{
  text-decoration:none;
  color:#005000;
  font-weight:700;
}
a:hover,
a:focus{
  text-decoration:underline;
}

/* ===========================
   Header + SVG heading
   =========================== */

header{
  padding:1.5rem 0 0.5rem;
}

header svg{
  max-width:1200px;
  width:100%;
  height:auto;
  margin:0 auto;
  display:block;
}

/* Copy icon button */
.copy-btn {
  margin-left: 0.8rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  opacity: 0.6;
}
.copy-btn:hover {
  opacity: 1;
}

/* Text inside the SVG title */
header svg .svg-title-text{
  font-family:'GrundschriftRegular';
  font-weight:bold;
  font-size:clamp(5rem, 5.5vw, 8.5rem);
  stroke:black;
  stroke-width:1;
}

/* Larger title on narrow portrait mobile screens */
@media (max-width:600px){
  body{
    padding:0 1.0rem 1.0rem;
  }

  header svg .svg-title-text{
    font-size:clamp(6.5rem, 9vw, 9.5rem);
  }
}

/* ===========================
   Material list (2-column layout)
   =========================== */
.material-liste {
  columns: 2;
  column-gap: 3rem;
}

/* Back to single column on mobile */
@media (max-width: 600px) {
  .material-liste {
    columns: 1;
  }
}

/* ---------------------------------------------------
   Top navigation
--------------------------------------------------- */
.top-nav{
  margin:0 auto 1.5rem;
  padding:0.4rem 0.8rem;
  display:flex;
  justify-content:center;
}

.top-nav ul{
  list-style:none;
  display:flex;
  flex-wrap:wrap;
  gap:0.75rem;
  margin:0;
  padding:0;
}

.top-nav li{
  margin:0;
}

.nav-link{
  display:inline-block;
  padding:0.45rem 1.2rem;
  border-radius:12px;
  background:#ffffff;
  color:#005000;
  font-weight:700;
  text-decoration:none;
  box-shadow:0 2px 4px rgba(0,0,0,0.25);
  font-size:0.98rem;
}

.nav-link:hover,
.nav-link:focus{
  background:#f0f0f0;
}

/* Mobile navigation: stacked */
@media (max-width:600px){

  .top-nav ul{
    flex-direction:column;
    align-items:stretch;
    gap:0.5rem;
  }

  .top-nav li{
    width:100%;
  }

  .nav-link{
    display:block;
    width:100%;
    text-align:center;
    padding:0.6rem 1rem;
    font-size:0.95rem;
  }
}

/* ---------------------------------------------------
   Tile grid – basic hover
--------------------------------------------------- */
.square-container > *:hover,
.square-container > *:focus{
  background-color:#006600;
  opacity:0.8;
}

/* Three-image layout */
.dreierbild{
  margin-left:1em;
  width:300px;
}

@media (min-width:70em){
  .dreispalter{ flex-direction:row; }
  .dreierbild{ height:300px; }
}

/* ===========================
   Very large desktop tuning (1600px+)
   =========================== */

@media (min-width: 1600px) {

  body{
    font-size: 20px;
    padding:0 1.8rem 1.8rem;
  }

  main,
  .start-hinweis,
  #einzelansicht,
  .top-nav{
    max-width:1400px;
  }

  header svg{
    max-width: 1400px;
  }

  .start-hinweis{
    font-size: 1.3rem;
    line-height: 1.7;
    padding: 1.6rem 2.2rem;
  }

  .start-hinweis-inner p{
    font-size: 1.25rem;
  }

  .start-hinweis-toggle{
    font-size: 1.05rem;
    padding: 0.45rem 1.1rem;
  }

  .nav-link,
  .btn-link{
    font-size: 1.05rem;
    padding: 0.55rem 1.5rem;
  }
}

/* ===========================
   Extra large desktop (1920px+)
   =========================== */

@media (min-width:1920px){

  body{
    font-size:22px;
    padding:0 2rem 2rem;
  }

  main,
  .start-hinweis,
  #einzelansicht,
  .top-nav{
    max-width:1600px;
  }

  header svg{
    max-width:1600px;
  }

  .start-hinweis{
    font-size: 1.4rem;
  }

  .start-hinweis-inner p{
    font-size: 1.35rem;
  }
}

/* Center box (calendar tiles) */
.zentrierer{
  display:flex;
  align-items:center;
  justify-content:center;
  background-color:#147800;
  border-style:dotted;
  border-left-style:none;
  border-color:#ccc;
}
.zentrierer p{
  margin:0;
  margin-left:0.8em;
  font-size:xx-large;
  font-weight:700;
  color:#ffffff;
}

/* ===========================
   Typography
   =========================== */
h1{
  font-size:40px;
  color:var(--gruen);
}
ol,ul{
  font-size:125%;
}
li{
  margin-bottom:0.5em;
}

/* ===========================
   Buttons (general)
   =========================== */
.start-links{ margin-top:1rem; }
.btn-link{
  display:inline-block;
  padding:0.6rem 1.4rem;
  border-radius:12px;
  background:#ffffff;
  color:#005000;
  font-weight:700;
  text-decoration:none;
  box-shadow:0 2px 6px rgba(0,0,0,0.2);
}
.btn-link:hover,
.btn-link:focus{
  background:#f0f0f0;
}

/* ---------------------------------------------------
   Notice box (intro + read more)
--------------------------------------------------- */
.start-hinweis{
  background:#2B2B2B;
  padding:1.2rem 1.6rem;
  margin:1.5rem auto 2rem;
  border-radius:18px;
  box-shadow:0 3px 8px rgba(0,0,0,0.15);
  font-size:1.1rem;
  line-height:1.7;
  position:relative;
}

.start-hinweis-inner{
  position:relative;
  overflow:hidden;
  margin-bottom:0.8rem;
}

/* Collapsed state: fixed number of lines */
.start-hinweis--collapsed .start-hinweis-inner{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:6; /* number of visible lines */
}

/* Expanded state: full height */
.start-hinweis--expanded .start-hinweis-inner{
  display:block;
}

.start-hinweis-inner p{
  margin:0 0 0.9rem;
  color:#FFFFFF;
}
.start-hinweis-inner p:last-child{
  margin-bottom:0;
}

/* Fade-out gradient at bottom when collapsed */
.start-hinweis--collapsed .start-hinweis-inner::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:3.2rem;
  background:linear-gradient(
    to bottom,
    rgba(43,43,43,0) 0%,
    rgba(43,43,43,0.45) 20%,
    rgba(43,43,43,0.85) 55%,
    rgba(43,43,43,1) 100%
  );
  pointer-events:none;
}

.start-hinweis-more{
  display:none;
}

.start-hinweis--expanded .start-hinweis-more{
  display:block;
}

.start-hinweis--expanded .start-hinweis-inner::after{
  display:none;
}

.start-hinweis-toggle{
  margin-top:0.4rem;
  padding:0.35rem 0.9rem;
  border-radius:12px;
  border:none;
  background:#ffffff;
  color:#111;
  font-weight:600;
  cursor:pointer;
  font-size:0.95rem;
}
.start-hinweis-toggle:hover,
.start-hinweis-toggle:focus{
  background:#f0f0f0;
}

/* ===========================
   Footer
   =========================== */
footer{
  margin-top:3em;
  padding:1.5em 0;
  text-align:center;
  color:#fff;
  font-size:0.95rem;
}
footer a{
  color:#fff;
  margin:0 0.5em;
  text-decoration:none;
}
footer a:hover{
  text-decoration:underline;
}

.inactive{ opacity:0.5; }

/* ===========================
   Detail view
   =========================== */
#einzelansicht{
  background-color:#e3f3fb;
  padding:2rem;
  margin:0 auto 1em;
  border-radius:25px;
  box-shadow:0 4px 10px rgba(0,0,0,0.15);
}

/* Single image */
.einzelbild img{
  width:100%;
}
@media (min-width:50em){
  .einzelbild img{ width:70%; }
}
@media (min-width:80em){
  .einzelbild img{ width:50%; }
}

/* ===== Experiment card layout ===== */

.experiment-card{
  background:#ffffff;
  border-radius:25px;
  padding:2rem 2.5rem;
  margin-top:2rem;
  box-shadow:0 4px 10px rgba(0,0,0,0.15);
  position:relative;
}

.experiment-layout{
  display:flex;
  gap:2rem;
  align-items:flex-start;
  justify-content:space-between;
}

.experiment-text{ flex:2; }

.experiment-image{
  flex:0 0 auto;
  text-align:right;
}
.experiment-image img{
  max-width:300px;
  height:auto;
}

/* Text inside cards */
.experiment-card p,
.experiment-card li{
  font-size:1.1rem;
}

.experiment-card p.kleines_impressum{
  font-size:0.70rem;
  color:#444;
  font-style:italic;
  margin-top:0.5em;
}

/* Step-by-step list – stable numbering */
.experiment-steps{
  margin:0 0 1rem 0;
  padding:0;
  list-style:none;
  counter-reset: step;
}

.experiment-steps li{
  counter-increment: step;
  margin:0.35rem 0;
  padding-left:1.4rem;
  position:relative;
}

.experiment-steps li::before{
  content: counter(step) ".";
  position:absolute;
  left:0;
  top:0;
  width:2.2rem;
}

/* Research questions */
.forscherfragen{
  margin-top:1rem;
}

/* Expert box */
.expertenkasten{
  margin-top:1.5rem;
  font-size:0.95rem;
  font-style:normal;
}

/* Make summary / explanation clickable */
details summary{
  cursor:pointer;
}

/* Badge */
.experiment-badge{
  position:absolute;
  top:-35px;
  right:-35px;
  width:180px;
  height:160px;
  pointer-events:none;
}

.badge-circle{
  width:110px;
  height:110px;
  background:white;
  border-radius:50%;
  border:4px solid #b7d6e8;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:48px;
  font-weight:700;
  color:#222;
  position:absolute;
  top:0;
  right:10px;
  z-index:5;
}

/* Star picture position */
.badge-stars{
  position:absolute;
  right: 10px;
  bottom:-10px;
  width:90px;
  height:auto;
  z-index:6;
}

/* Imprint/cc-logo */
.cc-logo{
  height:25px;
  width:auto;
  vertical-align:middle;
  margin-right:0.4rem;
}

/* Display URLs in neutral font */
.url-text {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.95em;
  word-break: break-all;
}

/* ===== Mobile card + badge tuning ===== */
@media (max-width:600px){

  #einzelansicht{
    padding:1.2rem;
    margin:0;
    border-radius:18px;
  }

  .experiment-card{
    padding:1.4rem 1.2rem;
    border-radius:20px;
    margin-top:3.5rem;
  }

  .experiment-card p,
  .experiment-card li{
    font-size:1rem;
  }

  .experiment-layout{
    flex-direction:column;
    gap:1rem;
  }

  .experiment-image{
    text-align:center;
  }

  .experiment-image img{
    max-width:70%;
  }

  .experiment-badge{
    top:-25px;
    right:-5px;
    width:110px;
    height:95px;
  }

  .badge-circle{
    width:75px;
    height:75px;
    font-size:32px;
    border-width:3px;
    right:0px;
  }

  .badge-stars{
    width:55px;
    bottom:-10px;
    right:-10px;
  }
}

/* =========================================
   Advent calendar grid – stable from 300–4K
   ========================================= */

/* Grid container: full width of main */
.square-container{
  display: grid;
  width: 100%;
  margin: 0 auto;
  gap: 1rem;
  /* Fallback: 3 columns */
  grid-template-columns: repeat(3, 1fr);
}

/* <= 599 px: 2 columns (phones) */
@media (max-width: 599px){
  .square-container{
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

/* 600–767 px: 3 columns (bigger phones / small tablets) */
@media (min-width: 600px) and (max-width: 767px){
  .square-container{
    grid-template-columns: repeat(3, 1fr);
    gap: 0.9rem;
  }
}

/* 768–1279 px: 4 columns (tablets + small laptops) */
@media (min-width: 768px) and (max-width: 1279px){
  .square-container{
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 1280–1919 px: 6 columns */
@media (min-width: 1280px) and (max-width: 1919px){
  .square-container{
    grid-template-columns: repeat(6, 1fr);
  }
}

/* >= 1920 px: 8 columns */
@media (min-width: 1920px){
  .square-container{
    grid-template-columns: repeat(8, 1fr);
  }
}