/* =========================================================
   assets/css/instagram.css
   Instagram-Sidebar, Grid & "Mehr laden"
   ========================================================= */

/* --- Sidebar / Card ------------------------------------------------------ */

.sidebar {
  width: 100%;
  position: relative;
  z-index: 40;              /* vor Nachbarn halten */
}

.insta-card {
  background: rgba(34, 34, 34, 0.7);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(0,0,0,.2);
  /* Standard: kein extra Offset (mobil / schmale Screens) */
  margin-top: 0;
}

.insta-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.insta-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

/* --- Grid / Tiles -------------------------------------------------------- */

.ig-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  position: relative;
  z-index: 46;
}

.ig-tile {
  display: block;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #f2f2f2;
  line-height: 0;
  cursor: zoom-in;          /* visuelles Feedback für Lightbox */
  position: relative;
}

/* Bilder und Videos gleich behandeln */
.ig-tile img,
.ig-tile video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* Videos dürfen im Grid keine Klicks fressen – Klick geht an Wrapper/Lightbox */
.ig-tile video {
  pointer-events: none;
}

/* Fehlertext (wird per JS eingefügt) */
.ig-error {
  grid-column: 1 / -1;
  color: #a00;
  font-size: .95rem;
  padding: 6px 2px;
}

/* --- Actions (Mehr laden / Profil öffnen) -------------------------------- */

.insta-actions {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 8px;
  position: relative;
  z-index: 60;             /* über Grid-Content */
}

/* Mehr-laden-Button */
.ig-loadmore {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  color: #222;
  cursor: pointer;
  pointer-events: auto;    /* Sicherheitsnetz */
  user-select: none;
  transition: background-color .15s ease, transform .06s ease;
}

.ig-loadmore:hover { background: #fafafa; }
.ig-loadmore:active { transform: translateY(1px); }
.ig-loadmore:disabled { opacity: .6; cursor: default; }

/* Fallback-Style, falls keine globale .btn-ghost vorhanden ist */
.btn-ghost {
  display: inline-block;
  border: 1px solid #ddd;
  color: #222;
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  text-decoration: none;
  transition: background-color .15s ease;
}
.btn-ghost:hover { background: #fafafa; }

/* --- Z-Index-Sicherheit gegenüber dem Slider (Splide) -------------------- */
/* Falls Splide-Overlays in die Sidebar „ragen“, halten wir sie tiefer.     */
.splide,
.splide__track,
.splide__slide,
.splide__arrows,
.splide__pagination {
  position: relative;
  z-index: 1 !important;
}

/* --- Responsive / Offsets ------------------------------------------------ */

/* Desktop: Instagram beginnt auf Höhe der ersten Projektkarte */
@media (min-width: 1121px) {
  .insta-card {
    /* Offset ≈ Titel + Untertitel; skaliert weich, springt nicht beim Zoomen */
    margin-top: clamp(64px, 7vw, 120px);
  }
}

/* Auf kleineren Viewports (Stack unter den Projekten) nur kleiner Abstand */
@media (max-width: 1120px) {
  .insta-card { margin-top: 8px; }
}

/* Feinanpassungen fürs Grid */
@media (max-width: 992px) {
  .insta-card { position: static; }
}

@media (max-width: 768px) {
  .ig-grid { grid-template-columns: 1fr; }
}
