
  /* CSS-Variablen und globales Styling */
  :root {
    --schrift: #bbbbbb;
    --underline: tomato;
    --hg: #0a0a0a;
    --boxen: #1f1d1d;
    --tabelle: #2b2b2b;
    --pfeil: #9c9292; 
    --error: #d33030;
    --raleway: "Raleway", sans-serif;
    --playfair: "Playfair Display", serif;
    --display: "DM Serif Display", serif;
    --grechen-fuemen: "Grechen Fuemen", serif;
  }

  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  body {
    background-color: var(--hg);
    color: var(--schrift);
    font-family: var(--raleway);
    font-size: 15px;
    letter-spacing: 1px;
    padding: 0.2rem;
  }

  .abstand {
    height: clamp(1.25rem, 4vw, 4.5rem);
  }

  .textbox {
    max-width: 85rem;
    height: auto;
    margin: auto;
    padding: 1rem;
  }   
    
  /* --- ÜBERSCHRIFTEN --- */
  h1, h2, h3, h4, h5 {
    font-family: var(--raleway);
    letter-spacing: 0.125rem;
    line-height: 1.3;
  }

  h1, h2 {
    color: var(--pfeil);
  }

  h3, h4, h5 {
    color: var(--schrift);
  }

  h1 {
    font-size: clamp(1.25rem, 1.25rem + 0.9375vw, 2.375rem);
    font-weight: 500;
    line-height: 1.1;
    margin-bottom: 1rem;
  }

  h2 {
    font-size: 25px;
    font-weight: 600;
  }

  h3 {
    font-size: 18px;
    font-weight: 500;
  }

  h4 {
    font-size: 18px;
    font-weight: 400;
  }

  /* --- TEXT --- */
  p, li, a {
    color: var(--schrift);
    font-family: var(--raleway);
    font-size: clamp(0.938rem, 0.725rem + 0.5vw, 1.063rem);
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 1px;
    text-align: justify;
    text-decoration: none;
    hyphens: auto;
    overflow-wrap: break-word;
  }

  /* Galerie-Grid für die Foto-Karten */
  .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 8px;
    width: 100%; 
    max-width: 1300px;
    margin: 0 auto;
    padding: 8px;
  }

  .photo-card {
    position: relative;
    background-color: var(--boxen);
    padding: 8px;
    overflow: hidden;
    transition: transform 0.2s ease;
  }

  .photo-card:hover {
    transform: translateY(-2px);
  }

  .photo-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
  }

  .photo-select {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    cursor: pointer;
    user-select: none;
  }

  .photo-select input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--pfeil);
  }

  .photo-title {
    font-size: 0.9rem;
    color: var(--schrift);
  }

  /* Hervorhebung ausgewählter Foto-Karten */
  .photo-card:has(input[type="checkbox"]:checked) {
    outline: 3px solid var(--pfeil);
  }

  /* Container für die Aktions-Buttons */
  .controls-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 1rem;
  }

  .button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
  }

  .btn {
    background-color: var(--boxen);
    color: var(--schrift);
    font-family: var(--raleway);
    font-size: 15px;
    font-weight: 300;
    padding: 12px;
    border: thin solid transparent;
    border-radius: 2px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease-in-out;
  }

  .btn:hover {
    background-color: var(--tabelle);
    color: var(--pfeil);
    border: thin solid var(--pfeil);
  }

  .btn-download:hover {
    color: var(--error);
  }

  .btn:active {
    transform: translateY(0);
  }

  .btn:disabled {
    background-color: var(--pfeil);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
  }

  /* Styling für das Größen-Dropdown */
  .size-select {
    background-color: var(--boxen);
    color: var(--schrift);
    font-family: var(--raleway);
    font-size: 15px;
    font-weight: 300;
    padding: 12px;
    border: thin solid transparent;
    border-radius: 2px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease-in-out;
  }

  .size-select:hover, .size-select:focus {
    background-color: var(--tabelle);
    color: var(--pfeil);
    border: thin solid var(--pfeil);
  }

  .size-select option {
    background-color: var(--boxen);
    color: var(--schrift);
  }

  /* Button unten rechts zum Schließen der Seite */
  .btn-bottom-right {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--schrift);
    background-color: var(--boxen);
    padding: 10px 18px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
  }

  .btn-bottom-right:hover {
    background-color: var(--tabelle);
  } 
  
  /* --- LADE-OVERLAY FÜR ERSTE VORSCHAUBILD-GENERIERUNG --- */
  #thumb-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 10, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    transition: opacity 0.4s ease;
  }

  .thumb-loading-content {
    background-color: var(--boxen);
    border: thin solid var(--pfeil);
    padding: 2.5rem;
    border-radius: 4px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    max-width: 90%;
  }

  .thumb-loading-content p {
    color: var(--schrift);
    font-size: 1rem;
    text-align: center;
    line-height: 1.5;
  }

  /* --- LOADING OVERLAY FÜR DEN ZIP-DOWNLOAD --- */
  #zip-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 10, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
  }

  .zip-loading-content {
    background-color: var(--boxen);
    border: thin solid var(--pfeil);
    padding: 2rem;
    border-radius: 4px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 90%;
  }

  .zip-loading-content p {
    color: var(--schrift);
    font-size: 1rem;
    text-align: center;
  }

  .zip-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--tabelle);
    border-top: 3px solid var(--underline);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }

  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
