/* ===== LIGHT THEME (DEFAULT) ===== */
:root{
  /* Theme tokens (edit to match your brand) */
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: rgba(17,24,39,.04);

  --text: rgba(17,24,39,.92);
  --muted: rgba(17,24,39,.68);
  --faint: rgba(17,24,39,.48);

  --accent: #7c5cff;
  --ring: rgba(124, 92, 255, .26);

  --radius: 16px;
  --radius-lg: 22px;

  --stroke: rgba(17,24,39,.10);
  --stroke-2: rgba(17,24,39,.14);

  --shadow: 0 18px 48px rgba(17,24,39,.14);
  --shadow-soft: 0 10px 24px rgba(17,24,39,.10);

  --container: 1160px;
  --gap: 14px;

  --font-sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";

  /* Component tokens */
  --modal-backdrop: rgba(15, 23, 42, .55);
  --modal-bg: rgba(255,255,255,.92);
  --viewer-bg: rgba(2, 6, 23, .06);

  /* Badges / play icon (over media: readable) */
  --chip-bg: rgba(0,0,0,.55);
  --chip-border: rgba(255,255,255,.18);
  --chip-text: rgba(255,255,255,.92);
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  margin: 0;
  font-family: var(--font-sans);

  color: var(--text);
}

a{ color: inherit; }


.container{
  width: min(var(--container), calc(100% - 40px));
  margin-inline: auto;
}

.page{
  min-height: 60vh;
}

.page-hero{
  padding: 44px 0 16px;
}
.page-title{
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.page-subtitle{
  margin: 12px 0 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.page-body{
  padding: 18px 0 70px;
}

/* Masonry layout using CSS columns (fast + lightweight) */
.masonry{
  column-count: 1;
  column-gap: var(--gap);
}

@media (min-width: 560px){
  .masonry{ column-count: 2; }
}
@media (min-width: 900px){
  .masonry{ column-count: 3; }
}
@media (min-width: 1200px){
  .masonry{ column-count: 4; }
}

/* Each item must avoid splitting across columns */
.card{
  break-inside: avoid;
  margin: 0 0 var(--gap);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255,255,255,.08);
  position: relative;
  transform: translateZ(0);
}

.card__btn{
  all: unset;
  display: block;
  cursor: pointer;
  width: 100%;
  position: relative;
  user-select: none;
}

.card__media{
  width: 100%;
  display: block;
  height: auto; /* masonry will flow based on real image height */
  transform: scale(1);
  transition: transform 240ms ease, filter 240ms ease;
}

.card__overlay{
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(700px 220px at 50% 10%, rgba(255,255,255,.06), transparent 55%),
    linear-gradient(180deg, rgba(0,0,0,.0), rgba(0,0,0,.35));
  opacity: 0;
  transition: opacity 240ms ease;
}

.card__meta{
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.badge{
  font-size: 12px;
  line-height: 1;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.88);
  backdrop-filter: blur(8px);
}

.play{
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.58);
  border: 1px solid rgba(255,255,255,.18);
  opacity: 0;
  transform: translateY(6px) scale(.96);
  transition: opacity 240ms ease, transform 240ms ease;
}
.play svg{
  width: 18px;
  height: 18px;
  fill: rgba(255,255,255,.92);
  margin-left: 2px;
}

/* Hover / focus interactions */
.card__btn:hover .card__media{
  transform: scale(1.03);
  filter: saturate(1.05);
}
.card__btn:hover .card__overlay{
  opacity: 1;
}
.card__btn:hover .play{
  opacity: 1;
  transform: translateY(0) scale(1);
}
.card__btn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
  border-radius: var(--radius-lg);
}

/* Lightbox */
.lightbox{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}
.lightbox.is-open{ display: grid; }

.lightbox__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(10px);
}

.lightbox__dialog{
  position: relative;
  margin: auto;
  width: min(1100px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  border-radius: var(--radius-lg);
  background: rgba(16,19,26,.78);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto;
}

.lightbox__close{
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.45);
  color: rgba(255,255,255,.92);
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 2;
}
.lightbox__close:hover{
  background: rgba(0,0,0,.6);
}

.lightbox__content{
  padding: 18px;
  display: grid;
  place-items: center;
}

/* Media wrapper enforces aspect ratio in modal */
.viewer{
  width: 100%;
  max-height: calc(90vh - 120px);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.35);
  display: grid;
  place-items: center;
}

/* default landscape */
.viewer.is-landscape{ aspect-ratio: 16 / 9; max-width: 100%; }
.viewer.is-portrait{
  aspect-ratio: 9 / 16;
  /* keep shorts from becoming too wide on desktop */
  width: min(520px, 100%);
}

/* Video: iframe tam doldursun */
.viewer iframe{
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #000;
}

/* Foto: doğal oranı koru, ekrana sığdır (portraitlerde kesilme biter) */
.viewer img{
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(90vh - 120px);
  display: block;
  object-fit: contain;
  background: transparent;
}


.lightbox__meta{
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255,255,255,.10);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.lightbox__title{
  font-size: 14px;
  color: rgba(255,255,255,.82);
}
.lightbox__hint{
  font-size: 12px;
  color: var(--faint);
}
kbd{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(0,0,0,.35);
}

/* Motion safety */
@media (prefers-reduced-motion: reduce){
  .card__media, .card__overlay, .play{
    transition: none !important;
  }
}
/* --- THUMB WRAPPER (NEW) --- */
.card__thumb{
  position: relative;
  width: 100%;
  overflow: hidden;
  /* card zaten radius'lu ama overlay düzgün çalışsın diye burada da tutuyoruz */
}

/* Video kartlarda sabit oran: */
.card.is-video .card__thumb{ aspect-ratio: 16 / 9; }
.card.is-video.is-portrait .card__thumb{ aspect-ratio: 9 / 16; }

/* Video thumb: alanı doldursun (blur yok) */
.card.is-video .card__media{
  width: 100%;
  height: 100%;
  object-fit: cover;       /* dikey görünüm için en iyi default */
  object-position: center;
  display: block;
  background: #000;        /* contain modunda temiz görünür */
}

/* İstersen bazı videolarda kırpma olmasın: item.thumbFit:'contain' */
.card.fit-contain.is-video .card__media{
  object-fit: contain;     /* blur yerine temiz letterbox */
}

/* Fotoğraflar: doğal oranıyla aksın (masonry daha iyi) */
.card.is-photo .card__media{
  width: 100%;
  height: auto;
  display: block;
}

/* Overlay + meta artık thumb içine oturacak */
.card__overlay,
.card__meta{
  position: absolute;
  inset: 0;
}
.card__meta{
  inset: auto 12px 12px 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}
/* ===== LIGHT THEME OVERRIDES ===== */

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.74));
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-soft);
}

.page-subtitle{ color: var(--muted); }

/* overlay biraz daha “soft” olsun */
.card__overlay{
  background:
    radial-gradient(700px 220px at 50% 10%, rgba(255,255,255,.22), transparent 55%),
    linear-gradient(180deg, rgba(0,0,0,.0), rgba(0,0,0,.28));
}

/* Chips (badges) + play icon */
.badge{
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--chip-text);
}

.play{
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
}
.play svg{ fill: var(--chip-text); }

/* Lightbox */
.lightbox__backdrop{
  background: var(--modal-backdrop);
}

.lightbox__dialog{
  background: var(--modal-bg);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.lightbox__close{
  background: rgba(255,255,255,.78);
  border: 1px solid var(--stroke-2);
  color: rgba(17,24,39,.90);
}
.lightbox__close:hover{
  background: rgba(255,255,255,.92);
}

.viewer{
  border: 1px solid var(--stroke);
  background: var(--viewer-bg);
}

/* iframe yine siyah kalsın (video için iyi) */
.viewer iframe{ background: #000; }

.lightbox__meta{
  border-top: 1px solid var(--stroke);
}

.lightbox__title{
  color: var(--text);
}

kbd{
  border: 1px solid var(--stroke-2);
  background: rgba(255,255,255,.75);
  color: rgba(17,24,39,.86);
}
