/* =========================================================
   EXPAT TURKEY — listings, detail pages, gallery (add-on)
   Uses the design tokens from styles.css (--navy --gold ...)
   ========================================================= */

/* ensure real images cover their media frame */
.media img { object-fit: cover; }
.hero-img { position: absolute; inset: -10% 0; height: 120%; width: 100%; object-fit: cover; }

/* ---------- Property grid ---------- */
.plist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: clamp(26px, 3vw, 44px);
}
.pcard {
  display: block;
  background: #fff;
  border: 1px solid var(--line, #e7e3da);
  border-radius: 2px;
  overflow: hidden;
  transition: transform .5s var(--ease, cubic-bezier(.22,1,.36,1)), box-shadow .5s, border-color .5s;
}
.pcard:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 60px -28px rgba(15,34,51,0.45);
  border-color: var(--gold);
}
.pcard-media {
  aspect-ratio: 4/3;
  display: block;
}
.pcard-badge {
  position: absolute; z-index: 2; top: 14px; left: 14px;
  background: var(--gold); color: var(--navy);
  font-family: var(--sans); font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 2px;
}
.pcard-count {
  position: absolute; z-index: 2; bottom: 14px; right: 14px;
  background: rgba(15,34,51,0.72); color: #fff; backdrop-filter: blur(4px);
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.08em;
  padding: 5px 11px; border-radius: 2px;
}
.pcard-body { padding: 22px 24px 26px; }
.pcard-tag {
  font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold-deep); font-weight: 700;
}
.pcard h3 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(20px, 1.5vw, 24px); line-height: 1.18;
  margin-top: 10px; color: var(--navy);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pcard-meta {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px;
}
.pcard-meta span {
  font-family: var(--sans); font-size: 12.5px; color: var(--ink-soft);
  background: var(--cream, #f6f2ea); border: 1px solid var(--line, #e7e3da);
  padding: 5px 11px; border-radius: 2px;
}
.pcard-price {
  font-family: var(--serif); font-style: italic; font-size: 21px;
  color: var(--navy); margin-top: 18px;
}
.pcard-price small { font-style: normal; font-family: var(--sans); font-size: 12.5px; color: var(--ink-soft); letter-spacing: 0.04em; }

/* ---------- Detail page ---------- */
.detail-wrap .crumb { font-size: 13px; letter-spacing: 0.08em; color: var(--ink-soft); margin-bottom: clamp(26px,4vw,44px); }
.detail-wrap .crumb a { color: var(--gold-deep); border: 0; }
.detail-top {
  display: grid; grid-template-columns: 1.5fr 1fr;
  gap: clamp(28px, 4vw, 56px); align-items: start;
}
.gallery-main {
  aspect-ratio: 3/2; border-radius: 2px; cursor: zoom-in; background: var(--navy);
}
.gallery-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gallery-zoom {
  position: absolute; z-index: 2; bottom: 16px; right: 16px;
  background: rgba(15,34,51,0.72); color: #fff; backdrop-filter: blur(4px);
  font-family: var(--sans); font-size: 12.5px; letter-spacing: 0.06em;
  padding: 7px 14px; border-radius: 2px; pointer-events: none;
}
.gallery-thumbs {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 8px;
}
.gthumb {
  position: relative; aspect-ratio: 4/3; padding: 0; border: 1px solid var(--line, #e7e3da);
  background: none; cursor: pointer; overflow: hidden; border-radius: 2px;
  opacity: 0.72; transition: opacity .3s, border-color .3s;
}
.gthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gthumb:hover { opacity: 1; }
.gthumb.active { opacity: 1; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }

.detail-info .prop-tag { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-deep); font-weight: 700; }
.detail-info h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(28px, 3vw, 40px); line-height: 1.12; margin-top: 14px; color: var(--navy); }
.detail-loc { color: var(--ink-soft); margin-top: 12px; font-size: 15.5px; }
.detail-price { font-family: var(--serif); font-style: italic; font-size: 30px; color: var(--navy); margin-top: 20px; }
.detail-price small { font-style: normal; font-family: var(--sans); font-size: 13px; color: var(--ink-soft); letter-spacing: 0.04em; }
.quickspecs { display: flex; flex-wrap: wrap; gap: 0; margin-top: 26px; border-top: 1px solid var(--line, #e7e3da); }
.quickspecs > div { padding: 16px 22px 16px 0; margin-right: 22px; border-right: 1px solid var(--line, #e7e3da); }
.quickspecs > div:last-child { border-right: 0; margin-right: 0; }
.quickspecs .k { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--navy-300); font-weight: 700; }
.quickspecs .v { font-family: var(--serif); font-size: 22px; margin-top: 4px; color: var(--navy); }
.detail-ref { margin-top: 22px; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy-300); }

.detail-lower {
  display: grid; grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 5vw, 72px); margin-top: clamp(48px, 6vw, 84px);
  padding-top: clamp(40px, 5vw, 64px); border-top: 1px solid var(--line, #e7e3da);
}
.detail-desc p { color: var(--ink-soft); font-size: 16px; line-height: 1.75; margin-bottom: 16px; }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table tr { border-bottom: 1px solid var(--line, #e7e3da); }
.spec-table th { text-align: left; font-family: var(--sans); font-weight: 600; font-size: 13px; letter-spacing: 0.04em; color: var(--navy-300); padding: 13px 0; width: 46%; }
.spec-table td { text-align: right; font-family: var(--serif); font-size: 16px; color: var(--navy); padding: 13px 0; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(8,18,28,0.94); align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lb-img { max-width: 90vw; max-height: 86vh; object-fit: contain; box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6); }
.lightbox button {
  position: absolute; background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer; font-size: 30px; line-height: 1; width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; transition: background .25s;
}
.lightbox button:hover { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.lb-close { top: 24px; right: 24px; font-size: 26px; }
.lb-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 24px; top: 50%; transform: translateY(-50%); }
.lb-counter { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); color: #fff; font-family: var(--sans); font-size: 13px; letter-spacing: 0.1em; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .detail-top { grid-template-columns: 1fr; }
  .detail-lower { grid-template-columns: 1fr; }
  .gallery-thumbs { grid-template-columns: repeat(4, 1fr); }
  .lb-prev { left: 10px; } .lb-next { right: 10px; }
}
@media (max-width: 520px) {
  .plist { grid-template-columns: 1fr; }
  .gallery-thumbs { grid-template-columns: repeat(3, 1fr); }
}
