/* ============================================================
   Datei: /toolbox-video/assets/css/toolbox-video.css
   Zweck: Frontend-Styles – angepasst an Divi Breakpoints
   ============================================================ */

/* Container-Layout */
.video-card {
  display: flex;
  flex-direction: column;
  margin-bottom: 2em;
  border: 1px solid #e0e0e0;
  border-radius: 0;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease-in-out;
}

.video-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Wrapper für Video */
.video-wrapper {
  position: relative;
  overflow: hidden;
  background: #000;
  border-radius: 0;
}

.video-wrapper iframe,
.video-wrapper video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: none;
  background: #000;
}

/* Header unterhalb des Videos */
.video-header {
  padding: 1em;
  text-align: center;
  background: #fafafa;
  border-top: 1px solid #eee;
}

.video-title {
  margin: 0 0 0.4em;
  font-size: 1.25rem;
  font-weight: 600;
  color: #222;
}

.video-excerpt {
  margin: 0;
  color: #555;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ============================================================
   GRID Layout
   ============================================================ */
.toolbox-video-grid {
  display: grid;
  gap: 1.5em;
  margin: 20px 0;
}

/* Desktop-Grids */
.toolbox-video-grid.grid-1 {
  grid-template-columns: 1fr;
}

.toolbox-video-grid.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.toolbox-video-grid.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.toolbox-video-grid.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ============================================================
   RESPONSIVE – Divi-kompatible Breakpoints
   ============================================================ */

/* Tablet (max 980px):
   - grid-4 → 1 Spalte
   - grid-3 → 1 Spalte
   - grid-2 → bleibt zweispaltig */
@media (max-width: 980px) {
  .toolbox-video-grid.grid-4,
  .toolbox-video-grid.grid-3 {
    grid-template-columns: 1fr !important;
  }

  .toolbox-video-grid.grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile (max 768px):
   - alles wird einspaltig */
@media (max-width: 768px) {
  .toolbox-video-grid.grid-4,
  .toolbox-video-grid.grid-3,
  .toolbox-video-grid.grid-2 {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   Template-Layouts
   ============================================================ */
.video-template-top .video-header {
  order: -1;
}

.video-template-bottom .video-header {
  order: 2;
}

.video-template-none .video-header {
  display: none;
}

/* ============================================================
   Barrierefreiheit
   ============================================================ */
button:focus,
.a11y-button:focus {
  outline: 3px solid #333;
  outline-offset: 2px;
}

.youtube-player iframe {
  border: none;
}
