/* ---------------------------------------------------
   Theme Variables (Twenty Twenty-Four inspired)
--------------------------------------------------- */

:root{
  --wrap: 1100px;
  --text: 68ch;

  --bg: #FDFDFD;
  --fg: #111111;
  --muted: rgba(17,17,17,0.72);
  --border: rgba(17,17,17,0.14);
  --border-hover: rgba(17,17,17,0.30);
  --subtle: #F5F5F5;
}

/* ---------------------------------------------------
   Base
--------------------------------------------------- */

*{
  box-sizing: border-box;
}

body{
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
}

.wrap{
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 64px 20px 80px;
}

/* ---------------------------------------------------
   Header
--------------------------------------------------- */

.header{
  text-align: center;
  margin-bottom: 40px;
}

.backlink{
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.backlink a{
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.backlink a:hover{
  text-decoration: underline;
}

.header h1{
  font-family: "Cardo", serif;
  margin: 0 0 22px;
  font-size: clamp(48px, 6vw, 76px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-weight: 400;
}

.lede{
  margin: 0 auto 14px;
  max-width: var(--text);
  text-align: left;
  color: var(--muted);
}

.meta{
  margin: 0 auto;
  max-width: var(--text);
  text-align: left;
}

a{
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------------------------------------------
   Grid
--------------------------------------------------- */

.grid{
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

/* ---------------------------------------------------
   Card
--------------------------------------------------- */

.card{ cursor: pointer; }

.card:hover{
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.card:hover img{
  filter: brightness(0.96);
}

/* 1:1 Quadratische Bilder */

.card img{
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.card__body{
  padding: 14px 16px 16px;
  text-align: center;
}

.card__title{
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  line-height: 1.25;
  color: var(--fg);
}

.card__mini{
  font-size: 0.72rem;     /* kleiner */
  line-height: 1.2;
  color: var(--muted);    /* nicht Haupttextfarbe */
  opacity: 0.65;          /* visuell zurücknehmen */
  margin-top: 4px;
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------
   Overlay
--------------------------------------------------- */

.overlay{
  position: fixed;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.overlay__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.92);
}

.overlay__panel{
  position: relative;
  max-width: 1100px;
  margin: 4vh auto;
  background: var(--subtle);
  border-radius: 18px;
  overflow: hidden;              /* darf wieder hidden sein */
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  padding: 0;
}

.overlay__close{
  position: absolute;
  top: 14px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(0,0,0,0.6);
  color: #ffffff;
  font-size: 24px;
  line-height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail{
  margin: 0;
}

.detail img{
  width: 100%;
  height: min(72vh, 760px);
  object-fit: contain;
  background: var(--subtle);
  display: block;
  margin-top: 12px;
}

.detail video{
  width: 100%;
  height: min(72vh, 760px);
  object-fit: contain;
  background: var(--subtle);
  display: block;
  margin-top: 12px;
  border-radius: 0; /* falls Bilder keinen Radius haben */
}

.detail__continuation{
  margin-left: var(--img-left);
  width: var(--img-width);
  padding-top: 14px;
}
.detail__continuation video{
  width: 100%;
}

.detail__continuationLabel{
  font-size: 0.8rem;
  line-height: 1.3;
  color: var(--muted);
  margin-bottom: 8px;
}

.detail__caption{
  width: 100%;
  max-width: 100%;
  padding: 16px 0 22px;   /* kein seitliches Padding */
}

.detail__meta{
  position: relative;
  margin-left: var(--img-left);
  width: var(--img-width);
}

.detail__meta p{
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.detail__meta strong{
  font-weight: 600;
}

.detail__credit{
  margin-top: 14px;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
}

@media (max-width: 768px) {
  .detail__imgwrap{
    padding: 0 12px 8px;  /* links/rechts knapp, unten minimal */
    box-sizing: border-box;
  }

  .detail img{
    width: 100%;
    height: auto;
    max-height: 60vh;
    display: block;
    border-radius: 12px;  /* optional, wirkt sehr stimmig */
  }

  .detail__videowrap{
    padding: 8px 12px 0;
  }

  .detail__videowrap video{
    width: 100%;
    margin-left: 0;
    max-height: 40vh;
  }
}

