/* ============================================================
   Mimaroğlu Yapı — custom styles
   Tailwind handles utility styling; this file covers things
   Tailwind can't do cleanly: keyframes, focus, image fallback
   placeholders, sticky WhatsApp button, form polish.
   ============================================================ */

:root {
  --brand-ink: #0F172A;
  --brand-steel: #1E293B;
  --brand-accent: #C9A227;
  --brand-accent-dark: #A6831A;
  --brand-sand: #F5F1EA;
  --brand-line: #E5E7EB;
  --brand-whatsapp: #25D366;
  --brand-whatsapp-dark: #1FB155;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--brand-ink);
  background: #ffffff;
}

h1, h2, h3, h4, h5 {
  font-family: 'Manrope', 'Inter', sans-serif;
  letter-spacing: -0.01em;
}

.eyebrow {
  display: inline-block;
  font-family: 'Manrope', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-accent);
}

:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Header */
.site-header {
  transition: box-shadow .25s ease, background-color .25s ease;
}
.site-header.is-scrolled {
  box-shadow: 0 4px 24px -12px rgba(15, 23, 42, .18);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(140%) blur(8px);
}

.nav-link {
  position: relative;
  padding: 0.25rem 0;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--brand-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

/* Hero */
.hero {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, .55) 0%, rgba(15, 23, 42, .85) 100%),
    radial-gradient(60% 60% at 30% 30%, #334155 0%, #0F172A 80%),
    #0F172A;
  background-size: cover;
  background-position: center;
}

/* Image-with-fallback wrapper.
   Markup pattern:
     <div class="img-frame aspect-[4/3] rounded-2xl">
       <img src="assets/img/<file>.jpg" alt="..." onerror="this.remove()">
     </div>
   If the image is missing or fails to load, the placeholder
   background shows; otherwise the image covers it cleanly. */
.img-frame {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, #1E293B 0%, #334155 100%);
}
.img-frame::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 2px, transparent 2px 18px);
  pointer-events: none;
}
.img-frame > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Legacy alias (kept for backwards compatibility with earlier template) */
.img-placeholder {
  background:
    linear-gradient(135deg, #1E293B 0%, #334155 100%);
  position: relative;
  overflow: hidden;
}
.img-placeholder::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 2px, transparent 2px 18px);
}

/* Reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
  will-change: opacity, transform;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.divider-accent {
  width: 56px; height: 3px; border-radius: 2px;
  background: var(--brand-accent);
}

/* Project cards */
.project-card .project-cover {
  transition: transform .6s ease;
}
.project-card:hover .project-cover {
  transform: scale(1.04);
}

/* Buttons */
.btn-primary {
  background: var(--brand-accent);
  color: #0F172A;
  font-weight: 600;
  transition: background .2s ease, color .2s ease;
}
.btn-primary:hover { background: var(--brand-accent-dark); color: #fff; }

.btn-ghost {
  border: 1px solid rgba(255,255,255,.4);
  color: #fff;
  transition: border-color .2s ease, color .2s ease;
}
.btn-ghost:hover { border-color: var(--brand-accent); color: var(--brand-accent); }

.btn-whatsapp {
  background: var(--brand-whatsapp);
  color: #fff;
  font-weight: 600;
  transition: background .2s ease;
}
.btn-whatsapp:hover { background: var(--brand-whatsapp-dark); color: #fff; }

/* Sticky WhatsApp floating button (FAB) */
.whatsapp-fab {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.1rem;
  background: var(--brand-whatsapp);
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 12px 28px -10px rgba(37, 211, 102, .55), 0 4px 10px rgba(15, 23, 42, .18);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.whatsapp-fab:hover {
  background: var(--brand-whatsapp-dark);
  transform: translateY(-1px);
  box-shadow: 0 16px 32px -8px rgba(37, 211, 102, .6), 0 6px 14px rgba(15, 23, 42, .22);
}
.whatsapp-fab svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
@media (max-width: 480px) {
  .whatsapp-fab { padding: 0.85rem; }
  .whatsapp-fab .whatsapp-fab-label { display: none; }
}

/* Form */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  font-size: 0.95rem;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 4px rgba(201, 162, 39, .15);
  outline: none;
}
.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
  border-color: #DC2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, .12);
}
.form-error {
  display: none;
  color: #DC2626;
  font-size: 0.8rem;
  margin-top: 0.35rem;
}
.form-error.is-visible { display: block; }

/* Mobile menu */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
}
.mobile-menu.is-open { max-height: 90vh; }

/* Dinamik Yapı Mahallesi galerisi
   ----------------------------------
   Galeri JS tarafından assets/img/yapi-mahallesi-*.jpg dosyaları taranarak
   inşa edilir. Resim bulunamazsa konteyner gizlenir; "is-empty" sınıfı
   eklenmesine gerek kalmadan inline style ile display:none uygulanır. */
.yapi-gallery > * { box-sizing: border-box; }
.yapi-gallery-main {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 1.25rem;
  overflow: hidden;
  background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
  isolation: isolate;
}
.yapi-gallery-main > button {
  display: block;
  width: 100%; height: 100%;
  padding: 0; margin: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.yapi-gallery-main img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}
.yapi-gallery-main > button:hover img,
.yapi-gallery-main > button:focus-visible img { transform: scale(1.03); }
.yapi-gallery-zoom-hint {
  position: absolute;
  top: 0.85rem; right: 0.85rem;
  background: rgba(15, 23, 42, .75);
  color: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  pointer-events: none;
  z-index: 2;
}
.yapi-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.yapi-gallery-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0.6rem;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  background: #1E293B;
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.yapi-gallery-thumb img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
}
.yapi-gallery-thumb:hover { transform: translateY(-1px); border-color: #C9A227; }
.yapi-gallery-thumb.is-active {
  border-color: #C9A227;
  box-shadow: 0 0 0 3px rgba(201,162,39,.18);
}
@media (max-width: 480px) {
  .yapi-gallery-thumbs { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 0.4rem; }
}

/* Lightbox modal (yeni-proje + ana sayfa galerileri) */
.lightbox-trigger { cursor: zoom-in; display: block; }
.lightbox {
  position: fixed; inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, .92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: lb-fade .25s ease;
}
.lightbox[hidden] { display: none; }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox-figure {
  position: relative;
  margin: 0;
  max-width: min(96vw, 1200px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 12px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.6);
  background: #1E293B;
}
.lightbox-caption {
  color: #E2E8F0;
  font-size: 0.875rem;
  text-align: center;
  max-width: 80ch;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s ease, transform .15s ease;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255,255,255,.2); }
.lightbox-close {
  top: 1rem; right: 1rem;
  font-size: 1.5rem;
  line-height: 1;
}
.lightbox-prev { top: 50%; left: 1rem; transform: translateY(-50%); }
.lightbox-next { top: 50%; right: 1rem; transform: translateY(-50%); }
.lightbox-prev:hover { transform: translateY(-50%) scale(1.05); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.05); }
@media (max-width: 640px) {
  .lightbox-prev, .lightbox-next { width: 38px; height: 38px; }
  .lightbox-close { top: 0.5rem; right: 0.5rem; }
}

/* FAQ accordion */
.faq-item summary {
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .faq-icon {
  transition: transform .2s ease;
}
.faq-item[open] summary .faq-icon {
  transform: rotate(45deg);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { transition: none; opacity: 1; transform: none; }
  .project-card .project-cover { transition: none; }
}
