/* Σπίτια Ηρακλείου — ταυτότητα: πέτρα του Κούλε, βενετσιάνικο ναυτικό μπλε,
   μινωικό μπλε τοιχογραφίας, ώχρα και λάδι. GFS Didot (ελληνική παράδοση) + Commissioner. */
:root {
  /* Σκούρο ναυτικό μπλε πάντα, ανεξάρτητα από τη ρύθμιση της συσκευής */
  --paper: #0F1A28;
  --panel: #16233A;
  --ink: #E6ECF0;
  --ink-2: #9AA8B6;
  --line: #2A3A52;
  --sea: #7FA9E0;
  --ochre: #E2AC4A;
  --olive: #93B86A;
  --oxblood: #E07A70;
  --focus: #9CC0F0;
  --display: "GFS Didot", "Didot", Georgia, serif;
  --ui: "Commissioner", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.5 var(--ui); font-feature-settings: "tnum" 1;
}
a { color: var(--sea); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
img { display: block; max-width: 100%; }

/* ---------- Πλαίσιο ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px;
  max-width: 1240px; margin: 0 auto; padding: 40px 32px 80px; }
.rail { position: sticky; top: 32px; align-self: start; }
.brand { font: 400 30px/1.1 var(--display); margin: 0 0 6px; letter-spacing: .005em; }
.brand a { color: inherit; text-decoration: none; }
.criteria { color: var(--ink-2); font-size: 14px; margin: 0 0 28px; max-width: 30ch; }
.tabs { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 2px; }
.tabs a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 8px 12px; margin-left: -12px; color: var(--ink); text-decoration: none; border-radius: 6px; }
.tabs a:hover { background: color-mix(in srgb, var(--sea) 8%, transparent); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.tabs .n { font-size: 14px; color: inherit; opacity: .7; }
.scan { font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 16px; }
.scan p { margin: 0 0 6px; }
.scan a { color: var(--ink-2); }

/* ---------- Λίστα ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  flex-wrap: wrap; margin-bottom: 20px; }
.toolbar h2 { font: 400 26px/1.2 var(--display); margin: 0; }
.sort { display: flex; gap: 4px; font-size: 14px; flex-wrap: wrap; }
.sort a { padding: 4px 10px; border-radius: 999px; color: var(--ink-2); text-decoration: none; }
.sort a[aria-current="true"] { color: var(--ink); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }

.feed { display: grid; gap: 28px; }
.home { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px;
  padding-bottom: 28px; border-bottom: 1px solid var(--line); transition: opacity .25s, transform .25s; }
.home.leaving { opacity: 0; transform: translateX(24px); }
.home .ph { position: relative; aspect-ratio: 4 / 3; background: var(--line); border-radius: 4px; overflow: hidden; }
.home .ph img { width: 100%; height: 100%; object-fit: cover; }
.home .ph .count { position: absolute; right: 8px; bottom: 8px; background: rgb(20 38 61 / .78);
  color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.fresh { position: absolute; left: 8px; top: 8px; background: var(--ochre); color: #1a1406;
  font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }

.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.price { font: 400 40px/1 var(--display); margin: 0; letter-spacing: -.005em; }
.price small { font: 400 14px/1 var(--ui); color: var(--ink-2); margin-left: 6px; letter-spacing: 0; }
.score { text-align: right; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.score b { display: block; font: 400 26px/1 var(--display); color: var(--ink); }
.where { margin: 10px 0 4px; font-size: 20px; font-weight: 600; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.where .map { font-size: 14px; font-weight: 400; color: var(--sea); }
.where a { color: inherit; text-decoration: none; }
.where a:hover { text-decoration: underline; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 14px; color: var(--ink-2); font-size: 15px; }
.facts span { display: inline-flex; align-items: center; gap: 8px; }
.facts strong { color: var(--ink); font-weight: 600; }

/* Το χαρακτηριστικό στοιχείο: τομή πολυκατοικίας με τον όροφο του σπιτιού */
.storeys { display: inline-flex; flex-direction: column-reverse; gap: 2px; vertical-align: middle; }
.storeys i { display: block; width: 16px; height: 3px; background: var(--line); border-radius: 1px; }
.storeys i.on { background: var(--ochre); height: 5px; }
.storeys i.unk { background: repeating-linear-gradient(90deg, var(--line) 0 3px, transparent 3px 5px); }

.feat { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; font-size: 14px; }
.feat li { padding: 3px 10px 3px 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
.feat li::before { content: "?"; display: inline-block; width: 1.1em; font-weight: 600; }
.feat li.yes { color: var(--olive); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--olive) 45%, transparent); }
.feat li.yes::before { content: "✓"; }
.feat li.no { color: var(--ink-2); text-decoration: line-through; opacity: .7; }
.feat li.no::before { content: "×"; }
.feat li.must.unk { color: var(--ochre); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ochre) 50%, transparent); }

.meta { font-size: 14px; color: var(--ink-2); margin: 0 0 14px; }
.meta .also { color: var(--ink); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { font: 500 14px/1 var(--ui); padding: 10px 14px; border-radius: 6px; border: 0; cursor: pointer;
  background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.btn:hover { box-shadow: inset 0 0 0 1px var(--ink-2); }
.btn.primary { background: var(--ink); color: var(--paper); box-shadow: none; }
.btn.keep[aria-pressed="true"] { background: var(--ochre); color: #1a1406; box-shadow: none; }
.btn.reject { color: var(--oxblood); }
.btn.reject:hover { box-shadow: inset 0 0 0 1px var(--oxblood); }

.empty { padding: 48px 0; max-width: 46ch; }
.empty h3 { font: 400 26px/1.2 var(--display); margin: 0 0 8px; }
.empty p { color: var(--ink-2); margin: 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120%); background: var(--ink);
  color: var(--paper); padding: 12px 16px; border-radius: 8px; display: flex; gap: 16px; align-items: center;
  font-size: 15px; transition: transform .25s; z-index: 20; max-width: calc(100vw - 32px); }
.toast.show { transform: translate(-50%, 0); }
.toast button { background: none; border: 0; color: var(--ochre); font: 600 15px var(--ui); cursor: pointer; padding: 4px; }

/* ---------- Σελίδα ακινήτου ---------- */
.back { display: inline-block; margin-bottom: 18px; font-size: 14px; color: var(--ink-2); }
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: min(78%, 640px); gap: 8px;
  overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -32px 28px; padding: 0 32px 6px; overscroll-behavior-x: contain; }
.gallery a { scroll-snap-align: start; aspect-ratio: 4 / 3; background: var(--line); border-radius: 4px; overflow: hidden; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; }
.detail h1 { font: 400 44px/1.05 var(--display); margin: 0 0 6px; }
.detail .title { font-size: 18px; color: var(--ink-2); margin: 0 0 20px; max-width: 60ch; }
.desc { white-space: pre-line; max-width: 68ch; line-height: 1.6; }
.video { aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: 4px; margin: 8px 0 28px; background: #000; }
.side h3, .detail h2 { font: 400 22px/1.2 var(--display); margin: 28px 0 10px; }
.side h3:first-child { margin-top: 0; }
.contact { background: var(--panel); border-radius: 8px; padding: 18px; box-shadow: inset 0 0 0 1px var(--line); }
.contact p { margin: 0 0 8px; }
.contact .tel { font: 400 24px/1.2 var(--display); }
.sources { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.sources li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.sources .gone { color: var(--ink-2); text-decoration: line-through; }
dl.spec { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 15px; }
dl.spec dt { color: var(--ink-2); }
dl.spec dd { margin: 0; }

/* ---------- Κατάσταση πηγών ---------- */
table.runs { border-collapse: collapse; width: 100%; font-size: 14px; }
table.runs th, table.runs td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.runs th { font-weight: 600; color: var(--ink-2); }
.bad { color: var(--oxblood); }

/* ---------- Είσοδος ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: min(360px, 100%); }
.login h1 { font: 400 36px/1.1 var(--display); margin: 0 0 8px; }
.login p { color: var(--ink-2); margin: 0 0 20px; }
.login input { width: 100%; font: 16px var(--ui); padding: 12px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); margin-bottom: 12px; }
.login .err { color: var(--oxblood); }

/* ---------- Κινητό ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; gap: 20px; padding: 20px 16px 72px; }
  .rail { position: static; }
  .criteria { margin-bottom: 16px; max-width: none; }
  .tabs { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; margin: 0 -16px 0; padding: 0 16px 4px; }
  .tabs a { margin-left: 0; gap: 8px; }
  .scan { display: none; }
  .home { grid-template-columns: 1fr; gap: 14px; }
  .price { font-size: 34px; }
  .gallery { margin: 0 -16px 20px; padding: 0 16px 6px; grid-auto-columns: 88%; }
  .detail { grid-template-columns: 1fr; gap: 8px; }
  .detail h1 { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.spaced { margin-top: 32px; }
.facts.spaced { margin-top: 14px; }
.detail .actions { margin-bottom: 8px; }
.side .meta { margin-top: 12px; }

/* ---------- Φωτογραφίες σε πλήρη οθόνη ---------- */
.gallery a { cursor: zoom-in; }
body.lb-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 30; background: rgb(8 14 24 / .97);
  display: grid; place-items: center; padding: 56px 72px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; user-select: none; }
.lightbox button { position: absolute; background: rgb(255 255 255 / .12); color: #fff; border: 0; cursor: pointer;
  font: 500 15px var(--ui); border-radius: 999px; }
.lightbox button:hover { background: rgb(255 255 255 / .24); }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 32px; line-height: 1; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-close { top: 12px; right: 12px; padding: 10px 16px; }
.lb-count { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); margin: 0;
  color: rgb(255 255 255 / .8); font-size: 14px; }
@media (max-width: 700px) {
  .lightbox { padding: 56px 0; }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; width: 44px; height: 44px; }
}

/* ---------- Κοινοποίηση ---------- */
.share-menu { position: fixed; z-index: 25; background: var(--panel); color: var(--ink); border-radius: 10px;
  box-shadow: 0 8px 28px rgb(0 0 0 / .18), inset 0 0 0 1px var(--line); padding: 6px; display: grid; min-width: 220px; }
.share-menu[hidden] { display: none; }
.share-menu a, .share-menu button { font: 500 15px var(--ui); color: inherit; text-decoration: none; text-align: left;
  background: none; border: 0; padding: 11px 12px; border-radius: 6px; cursor: pointer; }
.share-menu a:hover, .share-menu button:hover { background: color-mix(in srgb, var(--sea) 10%, transparent); }
.share-menu .note { font-size: 13px; color: var(--ink-2); padding: 6px 12px 8px; margin: 0; max-width: 30ch; }

.btn.wa { color: #7FD6A4; }
.btn.wa::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #25D366; }

.where .low { font-size: 13px; font-weight: 500; color: var(--oxblood); }
