/* ==========================================================================
   Doç. Dr. Çağlar Helvacıoğlu — statik HTML önizleme
   ROASEO · tasarım onayı için; PHP sürümüne temel olacak dosyalar
   ========================================================================== */

/* DİKKAT: Tasarım dosyalarındaki satır içi ölçüler tarayıcının varsayılan
   content-box kutu modeline göre yazıldı. Buraya genel bir
   `* { box-sizing: border-box }` eklenirse kenarlıklı/dolgulu kutular küçülür
   ve sayfa yükseklikleri tasarımdan sapar. Kendi sınıflarımızda
   box-sizing'i tek tek belirtiyoruz. */

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;   /* yapışkan menünün altında kalmasın */
}

body { overflow-x: clip; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Klavyeyle gezinenler için görünür odak halkası */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #B23A48;
  outline-offset: 3px;
  border-radius: 6px;
}

/* Gizleme: satır içi display: flex/grid değerlerini ezmek için gerekli */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: #FBF5F1;   /* sahneyle aynı ton: çok geniş ekranda kenar bandı belli olmasın */
  font-family: 'Figtree', system-ui, -apple-system, sans-serif;
  color: #2E1218;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: #2E1218; }
a:hover { color: #B23A48; }

img { max-width: 100%; display: block; }

/* Tasarımdan gelen kâğıt dokusu ------------------------------------------ */
[data-grain]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Form öğeleri ----------------------------------------------------------- */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 99px;
  background: rgba(46, 18, 24, .14);
  outline: none;
  accent-color: #2E1218;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #2E1218;
  border: 3px solid #FBF7F4;
  box-shadow: 0 2px 10px rgba(46, 18, 24, .25);
  cursor: pointer;
}
input[type=range]::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #2E1218;
  border: 3px solid #FBF7F4;
  cursor: pointer;
}
input[type=number] { font-family: inherit; }
input[type=number]::-webkit-inner-spin-button { opacity: .4; }
textarea, input, button { font-family: inherit; }

/* ==========================================================================
   Görünüm sistemi: masaüstü 1440 / mobil 390 tasarımları
   ========================================================================== */

.view { display: none; }
body[data-view="desktop"] .view-desktop { display: block; }
body[data-view="mobile"]  .view-mobile  { display: block; }

.stage {
  position: relative;
  margin: 0 auto;
  overflow-x: clip;          /* hidden DEĞİL: yapışkan menüyü bozar */
  zoom: var(--z, 1);
}

/* 1440'tan geniş ekranlarda tasarım tüm genişliği kaplar; dar ekranlarda
   site.js `--z` ile ölçekler, sahne o zaman tasarım genişliğinde kalır. */
.stage-desktop { width: 100%; max-width: 1920px; }
body[data-fit="scale"] .stage-desktop { width: 1440px; max-width: none; }

.stage-mobile { width: 390px; min-height: 100vh; }

/* Geniş ekranda mobil tasarımı telefon çerçevesiyle göster */
@media (min-width: 900px) {
  body[data-view="mobile"] { background: #E4DAD4; padding: 32px 0 48px; }
  body[data-view="mobile"] .stage-mobile {
    min-height: 0;
    border: 10px solid #2A1A1E;
    border-radius: 48px;
    box-shadow: 0 30px 80px rgba(90, 30, 45, .22);
  }
}

/* Hero: masaüstünde video solda, metin sağda */
[data-hero-split] { position: relative; }
@media (max-width: 1100px) {
  [data-hero-split] { grid-template-columns: 1fr !important; gap: 36px !important; }
}

/* ==========================================================================
   Üst menü — sayfa kaydıkça üstte kalır
   ========================================================================== */

[data-site-header] {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Tepedeyken menü saydam. Kaydırınca arkasında yüzen bir kapsül belirir:
   kutu ölçüleri değişmediği için hiçbir kayma/zıplama olmaz. */
[data-site-header]::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: max(16px, calc(50% - 622px));
  right: max(16px, calc(50% - 622px));
  border-radius: 999px;
  background: rgba(253, 249, 246, .82);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 1px 1px rgba(46, 18, 24, .04), 0 12px 34px rgba(90, 30, 45, .11);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .28s ease, transform .28s ease;
  pointer-events: none;
  z-index: -1;
}
body.is-scrolled [data-site-header]::before {
  opacity: 1;
  transform: none;
}

.stage-mobile [data-site-header]::before {
  top: 6px;
  bottom: 6px;
  left: 8px;
  right: 8px;
  border-radius: 26px;
}

/* ==========================================================================
   Alt bilgi — köşeler yumuşatıldı
   ========================================================================== */

.stage footer {
  border-radius: 36px 36px 0 0;
  position: relative;
  z-index: 1;
}
.stage-mobile footer { border-radius: 26px 26px 0 0; }

/* ==========================================================================
   Üzerine gelme (hover) durumları — tasarım dosyasındaki style-hover karşılığı
   ========================================================================== */

.hv-bg:hover      { background: #B23A48 !important; }
.hv-bg-ink:hover  { background: #B23A48 !important; color: #F8EDE7 !important; }
.hv-border:hover  { border-color: rgba(178, 58, 72, .5) !important; }
.hv-outline:hover { border-color: #B23A48 !important; color: #B23A48 !important; }

/* ==========================================================================
   Görsel alanları (fotoğraf gelecek yerler)
   ========================================================================== */

.imgslot {
  box-sizing: border-box;
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 2;        /* yüksekliği belirsiz kaplarda tasarımdaki oran */
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  text-align: center;
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg, rgba(178,58,72,.07) 0 10px, rgba(178,58,72,.02) 10px 20px),
    #F4DED7;
  box-shadow: inset 0 0 0 1px rgba(178, 58, 72, .22);
}
/* Gerçek fotoğraf yerleştirilmiş yuvalar */
.imgslot.has-img {
  padding: 0;
  background: none;
  box-shadow: none;
}
.imgslot.has-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
/* Arka planı silinmiş portre: kırpılmadan, zeminde "ayakta" durur */
.imgslot.has-img[data-fit="contain"] {
  background: linear-gradient(170deg, #FDF3EF 0%, #F6E2DB 55%, #F0D2CB 100%);
}
.imgslot.has-img[data-fit="contain"] img {
  object-fit: contain;
  object-position: center bottom;
}

/* Gömülü video: alanı tamamen kaplar, sağlayıcı arayüzü görünmez.
   iframe'de pointer-events kapalı; tüm tıklamaları üstteki kalkan karşılar. */
.imgslot.has-video {
  padding: 0;
  background: #2E1218;
  box-shadow: none;
  overflow: hidden;
}
.imgslot.has-video .vid-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  background: #2E1218;
  pointer-events: none;
}
.imgslot.has-video .vid-shield {
  position: absolute;
  inset: 0;
  cursor: pointer;
}
.vid-ctrl {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  gap: 8px;
  z-index: 2;
}
.stage-mobile .vid-ctrl { right: 10px; bottom: 10px; }
.vid-ctrl button {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(251, 245, 241, .85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #2E1218;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(46, 18, 24, .22);
  transition: background .2s ease, transform .2s ease;
}
.vid-ctrl button:hover { background: #FFFDFB; transform: translateY(-1px); }
.stage-mobile .vid-ctrl button { width: 36px; height: 36px; }

.imgslot[data-shape="circle"] { border-radius: 50%; }
.imgslot[data-shape="pill"]   { border-radius: 9999px; }
.imgslot[data-shape="rect"]   { border-radius: 0; }

.imgslot-cap {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: .01em;
  color: #9A5560;
  max-width: 260px;
}
.stage-mobile .imgslot-cap { font-size: 10px; max-width: 200px; }

/* ==========================================================================
   Mobil sabit alt çubuk (tasarımda ekran altına sabit duran şerit)
   ========================================================================== */

.m-dock {
  box-sizing: border-box;
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: 14px !important;
  width: 366px;
  max-width: calc(100vw - 24px);
  transform: translateX(-50%);
  z-index: 60;
}

/* ==========================================================================
   Mobil alttan açılan bilgi sayfası (şikâyet seçimi)
   ========================================================================== */

.m-sheet-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 70;
}
.m-sheet {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  top: auto !important;
  bottom: 0 !important;
  width: 390px;
  max-width: 100vw;
  transform: translateX(-50%);
  z-index: 80;
}

/* ==========================================================================
   Önizleme çubuğu — canlıya geçerken bu blok ve site.js'teki karşılığı silinir
   ========================================================================== */

.pv-bar {
  box-sizing: border-box;
  position: fixed;
  left: 14px; bottom: 14px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 6px 12px;
  border-radius: 999px;
  background: rgba(46, 18, 24, .88);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(46, 18, 24, .28);
  font-size: 12px;
  color: #F8EDE7;
  transition: opacity .25s;
}
.pv-bar:hover { opacity: 1; }
.pv-bar.is-dim { opacity: .28; }
.pv-label { letter-spacing: .08em; text-transform: uppercase; font-size: 10px; opacity: .7; }
.pv-bar button {
  padding: 7px 13px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #F8EDE7;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s;
}
.pv-bar button:hover { background: rgba(255, 255, 255, .22); }
.pv-bar button[aria-pressed="true"] { background: #B23A48; }

/* Mobil görünümde alttaki sabit şeridin üstünde dursun */
body[data-view="mobile"] .pv-bar { bottom: 82px; }
@media (min-width: 900px) { body[data-view="mobile"] .pv-bar { bottom: 14px; } }

/* Alt sayfa açıkken önizleme çubuğu görünmesin */
body[data-sheet-open] .pv-bar { display: none; }

@media print { .pv-bar { display: none; } }
