/* ==========================================================================
   Sandalo — reusable components
   Header · services panel · mobile menu · bottom bar · footer · buttons ·
   placeholders · cards · tiles · process · forms · motion helpers
   ========================================================================== */

/* ---- Buttons & links (spec section 3 "States", section 4) -------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px;
  font-family: var(--font-sans); font-size: var(--fs-button); font-weight: 500; letter-spacing: 0.01em;
  text-decoration: none; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.btn--primary { background: var(--olive-500); color: var(--white); }
.btn--primary:hover { background: var(--olive-700); }
.btn--primary:active { background: var(--olive-900); }
.btn--ghost { background: transparent; color: currentColor; border-color: currentColor; }
.btn--ghost:hover { background: rgba(255,255,255,0.12); }
.btn[disabled] { background: var(--sage-grey); color: var(--text-muted); cursor: not-allowed; }
.btn .arrow { transition: transform var(--dur-fast) var(--ease-out); }
.btn:hover .arrow, .link-arrow:hover .arrow { transform: translateX(4px); }

.link {
  color: var(--olive-500); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
  transition: text-decoration-thickness var(--dur-fast) var(--ease-out);
}
.link:hover { text-decoration-thickness: 2px; }
.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 400; color: var(--olive-500); text-decoration: none;
  border-bottom: 1px solid currentColor; padding-bottom: 2px;
}
.arrow { display: inline-block; }

/* ---- Content placeholders (no fabricated photos or facts) ---------------- */
.ph {
  position: relative; width: 100%; height: 100%;
  background-color: var(--stone);
  background-image: repeating-linear-gradient(135deg, rgba(98,98,75,0.07) 0 1px, transparent 1px 14px);
  border: 1px dashed rgba(98,98,75,0.45);
  display: flex; align-items: flex-end; justify-content: flex-start;
  overflow: hidden;
}
.ph--dark { background-color: var(--olive-900); border-color: rgba(245,242,235,0.35);
  background-image: repeating-linear-gradient(135deg, rgba(245,242,235,0.06) 0 1px, transparent 1px 14px); }
.ph__label, .todo {
  font-family: var(--font-sans); font-size: 11px; line-height: 1.35; letter-spacing: 0.02em; font-weight: 500;
  color: var(--olive-900); background: rgba(245,242,235,0.92); padding: 6px 8px; margin: 10px; max-width: calc(100% - 20px);
}
.ph--dark .ph__label { color: var(--cream); background: rgba(28,28,23,0.75); }
.todo { display: inline-block; margin: 0; background: var(--olive-100); border-left: 2px solid var(--olive-500); }
.todo-block { outline: 1px dashed rgba(98,98,75,0.5); outline-offset: 6px; }

/* ---- Header (spec section 4) ------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  color: var(--white);
  background: transparent;
  transition: transform var(--dur-base) var(--ease-out), background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), height var(--dur-fast) var(--ease-out);
}
.site-header__inner { height: 100%; display: flex; align-items: center; gap: var(--sp-8); }
.site-header__logo { display: block; width: 104px; flex: none; text-decoration: none; }
@media (min-width: 1024px) { .site-header__logo { width: 132px; } }
.site-header__logo img { width: 100%; height: auto; }
/* "BY DURAK" endorsement under the wordmark: a secondary brand line, not a slogan.
   Text element, so the logo artwork stays untouched. Colour = the logo's own tagline tone. */
.logo-endorse {
  display: block; margin-top: 5px; font-family: var(--font-sans); font-weight: 500;
  font-size: 8px; line-height: 1; letter-spacing: 0.26em; white-space: nowrap;
  color: rgba(245,242,235,0.72); transition: color var(--dur-fast);
}
.site-header.is-solid .logo-endorse { color: var(--text-muted); }
@media (min-width: 1024px) { .logo-endorse { font-size: 9px; margin-top: 6px; letter-spacing: 0.3em; } }
.site-header__logo .logo-olive { display: none; }
.site-header.is-solid { background: var(--cream); color: var(--text); border-bottom: var(--hairline); }
.site-header.is-solid .logo-white { display: none; }
.site-header.is-solid .logo-olive { display: block; }
@media (min-width: 1024px) { .site-header.is-solid { height: 68px; } }
.site-header.is-hidden { transform: translateY(-100%); }
.site-header.menu-open { transform: none; }

.nav-primary { display: none; margin-inline: auto; }
.nav-primary > ul { display: flex; gap: clamp(20px, 2.2vw, 40px); align-items: center; margin: 0; padding: 0; }
.nav-primary a, .nav-primary button {
  font-family: var(--font-sans); font-size: 15px; font-weight: 400; letter-spacing: 0.005em;
  color: inherit; text-decoration: none; background: none; border: 0; padding: 8px 0; cursor: pointer;
  border-bottom: 1px solid transparent;
}
.nav-primary a[aria-current="page"], .nav-primary a:hover, .nav-primary button:hover, .nav-primary button[aria-expanded="true"] { border-bottom-color: currentColor; }
.nav-primary .caret { display: inline-block; margin-left: 6px; font-size: 10px; transition: transform var(--dur-fast) var(--ease-out); }
.nav-primary button[aria-expanded="true"] .caret { transform: rotate(180deg); }

.header-actions { display: none; align-items: center; gap: 24px; }
.header-phone { font-size: 15px; font-weight: 400; text-decoration: none; color: inherit; white-space: nowrap; }
@media (max-width: 1199px) { .header-phone { display: none; } }  /* keeps 6 nav items + CTA on one line at 1024–1199 */
.header-cart { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; font-size: 15px; }
.header-cart svg { width: 20px; height: 20px; }
.site-header:not(.is-solid) .btn--primary { background: var(--white); color: var(--olive-900); }
.site-header:not(.is-solid) .btn--primary:hover { background: var(--cream); }

.menu-toggle {
  margin-left: auto; width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; color: inherit; cursor: pointer;
}
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
  display: block; width: 24px; height: 1.5px; background: currentColor; position: relative; content: ""; transition: transform var(--dur-fast) var(--ease-out);
}
.menu-toggle span::before { position: absolute; top: -7px; }
.menu-toggle span::after { position: absolute; top: 7px; }
.menu-open .menu-toggle span { background: transparent; }
.menu-open .menu-toggle span::before { transform: translateY(7px) rotate(45deg); }
.menu-open .menu-toggle span::after { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 1024px) {
  .nav-primary { display: block; }
  .header-actions { display: flex; }
  .menu-toggle { display: none; }
}

/* ---- Services panel (desktop "Hizmetler ▾") ----------------------------- */
.services-panel {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--cream); color: var(--text); border-top: var(--hairline); border-bottom: var(--hairline);
  padding-block: var(--sp-12);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), visibility var(--dur-base);
}
.services-panel.is-open { opacity: 1; visibility: visible; transform: none; }
.services-panel__grid { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: var(--sp-12); }
.services-panel h3 { margin-bottom: var(--sp-4); }
.services-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.services-panel ul a { text-decoration: none; font-size: 16px; display: inline-block; padding: 4px 0; border-bottom: 1px solid transparent; }
.services-panel ul a:hover { border-bottom-color: var(--olive-500); color: var(--olive-500); }
.panel-feature { display: grid; grid-template-columns: 140px 1fr; gap: var(--sp-6); align-items: start; text-decoration: none; }
.panel-feature .ph { aspect-ratio: 1; height: auto; }
.panel-feature p { margin-top: 6px; color: var(--text-muted); font-size: 15px; }

/* ---- Mobile menu --------------------------------------------------------- */
.mobile-menu {
  position: fixed; inset: 0; z-index: 45; background: var(--cream); color: var(--text);
  padding: calc(var(--header-h) + 24px) var(--margin) 32px;
  display: flex; flex-direction: column; overflow-y: auto;
  opacity: 0; visibility: hidden; transition: opacity var(--dur-base) var(--ease-in-out), visibility var(--dur-base);
}
.mobile-menu.is-open { opacity: 1; visibility: visible; }
.mobile-menu > ul { list-style: none; margin: 0; padding: 0; }
.mobile-menu > ul > li { border-bottom: var(--hairline); }
.mobile-menu > ul > li > a, .mobile-menu .accordion-toggle {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  font-family: var(--font-serif); font-size: 28px; line-height: 1.2; padding: 14px 0;
  text-decoration: none; background: none; border: 0; text-align: left; cursor: pointer; color: inherit;
}
.accordion-panel { padding: 0 0 16px; display: grid; gap: 12px; }
.accordion-panel[hidden] { display: none; }
.accordion-panel h4 { margin-top: 8px; }
.accordion-panel a { text-decoration: none; font-size: 17px; padding: 4px 0; display: block; }
.mobile-menu__contact { margin-top: auto; padding-top: 32px; display: grid; gap: 10px; font-size: 16px; }
.mobile-menu__contact a { text-decoration: none; }
@media (min-width: 1024px) { .mobile-menu { display: none; } }

/* ---- Mobile bottom action bar (spec section 11) ------------------------- */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--olive-700); color: var(--cream);
  transform: translateY(100%); transition: transform var(--dur-base) var(--ease-out);
}
.action-bar.is-visible { transform: none; }
.action-bar.is-suppressed { transform: translateY(100%); }
.action-bar a {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: inherit; text-decoration: none; font-weight: 400; font-size: 15px; min-height: 48px;
}
.action-bar a + a { border-left: 1px solid rgba(245,242,235,0.18); }
.action-bar svg { width: 18px; height: 18px; }
@media (min-width: 1024px) { .action-bar { display: none; } }
body.has-action-bar { padding-bottom: 64px; }
@media (min-width: 1024px) { body.has-action-bar { padding-bottom: 0; } }

/* ---- Footer (spec section 4) -------------------------------------------- */
.site-footer { background: var(--olive-700); color: var(--cream); padding-block: var(--sp-24) var(--sp-8); }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-brand { display: grid; gap: var(--sp-4); padding-bottom: var(--sp-12); border-bottom: 1px solid rgba(245,242,235,0.2); }
.footer-brand img { width: 220px; }
.footer-brand p { font-family: var(--font-serif); font-size: var(--fs-h3); }
.footer-cols { display: grid; grid-template-columns: 1fr; gap: var(--sp-8); padding-block: var(--sp-12); }
@media (min-width: 768px) { .footer-cols { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-cols { grid-template-columns: repeat(4, 1fr); } }
.footer-cols h3 { font-family: var(--font-sans); font-size: var(--fs-eyebrow); letter-spacing: 0.01em; font-weight: 500; margin-bottom: var(--sp-4); color: var(--sage-grey); }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: var(--sp-8); border-top: 1px solid rgba(245,242,235,0.2); font-size: var(--fs-small); color: var(--sage-grey); }
.site-footer .todo { color: var(--olive-900); }

/* ---- Project card (spec section 7) -------------------------------------- */
.project-card { display: block; text-decoration: none; color: inherit; }
.project-card__media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; }
.project-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-base) var(--ease-out); }
.project-card:hover .project-card__media img { transform: scale(1.02); }
.tag-3d {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-size: 12px; font-weight: 500; letter-spacing: 0.04em; color: var(--cream); background: var(--olive-500); padding: 3px 8px;
}
.project-card__title { font-weight: 400; color: var(--text-strong); font-family: var(--font-serif); font-size: 24px; line-height: 1.25; margin-top: var(--sp-4); }
.project-card__title span { background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size var(--dur-base) var(--ease-out); }
.project-card:hover .project-card__title span { background-size: 100% 1px; }
.project-card__meta { margin-top: 4px; }

/* ---- Category tile / material index (spec sections 1, 5) ---------------- */
.cat-tile { display: block; text-decoration: none; color: inherit; }
.cat-tile__media { aspect-ratio: 1 / 1; overflow: hidden; }
.cat-tile__name { margin-top: var(--sp-3); font-family: var(--font-sans); font-weight: 400; font-size: 17px; color: var(--text-strong); display: flex; justify-content: space-between; gap: 8px; }
.cat-tile__count { color: var(--text-muted); font-weight: 400; font-size: var(--fs-small); }
.cat-tile:hover .cat-tile__name { color: var(--olive-500); }

/* ---- Segmented switch (Konut / Ticari) ---------------------------------- */
.switch { display: inline-flex; gap: 28px; border-bottom: var(--hairline); }
.switch button {
  background: none; border: 0; padding: 10px 0; cursor: pointer; font-family: var(--font-sans);
  font-size: 17px; font-weight: 400; color: var(--text-muted); border-bottom: 1px solid transparent; margin-bottom: -1px;
}
.switch button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--olive-500); }

/* ---- Forms (spec section 10) -------------------------------------------- */
.field { display: grid; gap: 6px; }
.field label { font-size: var(--fs-small); font-weight: 400; color: var(--text); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 0; background: transparent;
  border: 0; border-bottom: 1px solid var(--sage-grey); border-radius: 0; font-size: 16px;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-bottom-color: var(--olive-500); background: var(--olive-100); }
.field--check { grid-template-columns: 20px 1fr; align-items: start; gap: 10px; }
.field--check input { width: 20px; min-height: 20px; height: 20px; margin-top: 3px; accent-color: var(--olive-500); }
.field--check label { font-weight: 400; }
.field-error { color: var(--error); font-size: var(--fs-small); }
.form-status { font-size: var(--fs-small); }

/* ---- Motion helpers (spec section 12) ----------------------------------- */
/* Only applied after JS confirms support; content is visible without JS. */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .unmask { clip-path: inset(100% 0 0 0); transition: clip-path var(--dur-slow) var(--ease-out); }
.js .unmask.is-in { clip-path: inset(0 0 0 0); }
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .unmask { transform: none; clip-path: none; transition: opacity 150ms linear; }
}

/* ---- Preview banner (development only; disappears when PREVIEW = false) -- */
.preview-banner {
  position: fixed; left: 12px; bottom: 76px; z-index: 60; max-width: min(92vw, 520px);
  font-size: 12px; line-height: 1.4; font-weight: 500; letter-spacing: 0.02em;
  background: var(--olive-900); color: var(--cream); padding: 8px 12px; border-left: 3px solid var(--olive-100);
}
@media (min-width: 1024px) { .preview-banner { bottom: 12px; } }
