/* Fuar haritası (page/map.php) · yalnızca bu sayfada yüklenir. Token'lar fk.css'ten.
   Masaüstü: harita tam genişlik, solda yüzen panel. Telefon: harita tam ekran, alttan açılan çekmece. */

.fmap {
  --fmap-h: max(560px, calc(100svh - var(--header-h)));
  --fmap-panel-w: 400px;
  --fmap-peek: 184px;
  position: relative;
  height: var(--fmap-h);
  overflow: hidden;
  background: #E9EEF4;
  isolation: isolate;
}
.fmap__map { position: absolute; inset: 0; }
.fmap__map:focus-visible { outline-offset: -3px; }
.fmap .maplibregl-canvas { outline: none; }

/* ------------------------------------------------------------------ Panel */
.fmap__panel {
  position: absolute; z-index: 5;
  display: flex; flex-direction: column;
  background: #fff; color: var(--color-text);
  box-shadow: var(--shadow-2);
}
.fmap__head { padding: var(--space-4) var(--space-4) var(--space-3); border-bottom: 1px solid var(--fk-gri-100); }
.fmap__crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--space-1); padding: 0; list-style: none; font-size: var(--text-label); color: var(--color-text-muted); }
.fmap__crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--fk-gri-300); }
.fmap__crumbs a { color: inherit; text-decoration: none; }
.fmap__crumbs a:hover { color: var(--color-link); text-decoration: underline; }
.fmap__title { font-size: 1.5rem; margin: 0 0 var(--space-3); letter-spacing: -.01em; }
.fmap__title span { color: var(--fk-turuncu-600); }

.fmap__search { position: relative; }
.fmap__search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); pointer-events: none; }
.fmap__input {
  width: 100%; min-height: 48px; padding: 10px 44px 10px 44px;
  border: 1.5px solid var(--fk-gri-200); border-radius: var(--radius-pill);
  background: var(--fk-gri-50); font-size: 1rem;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.fmap__input::placeholder { color: var(--fk-gri-500); }
.fmap__input:hover { border-color: var(--fk-gri-300); }
.fmap__input:focus { outline: none; background: #fff; border-color: var(--fk-lacivert-900); box-shadow: 0 0 0 4px var(--fk-mavi-100); }
.fmap__input::-webkit-search-cancel-button { display: none; }
.fmap__clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: transparent; color: var(--color-text-muted);
}
.fmap__clear:hover { background: var(--fk-gri-100); color: var(--color-text); }

.fmap__results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 10;
  max-height: min(60vh, 440px); overflow-y: auto; overscroll-behavior: contain;
  background: #fff; border: 1px solid var(--fk-gri-200); border-radius: var(--radius-md);
  box-shadow: var(--shadow-2); padding: 6px;
}
.fmap__group { padding: 10px 10px 4px; font-family: var(--font-mono); font-size: var(--text-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-text-muted); }
.fmap__option {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 10px;
  border-radius: var(--radius-sm); cursor: pointer; text-align: left;
}
.fmap__option[aria-selected="true"], .fmap__option:hover { background: var(--fk-turuncu-50); }
.fmap__option .i { color: var(--fk-gri-500); }
.fmap__option-main { flex: 1; min-width: 0; }
.fmap__option-title { display: block; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmap__option-title mark { background: none; color: var(--fk-turuncu-700); }
.fmap__option-sub { display: block; font-size: var(--text-small); color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmap__none { padding: 14px 10px; color: var(--color-text-muted); font-size: var(--text-small); }

.fmap__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--space-4); scrollbar-width: thin; }
.fmap__lead { color: var(--fk-gri-700); font-size: var(--text-small); margin-bottom: var(--space-3); }
.fmap__stats { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--text-small); color: var(--color-text-muted); margin-bottom: var(--space-4); }
.fmap__stats strong { font-family: var(--font-display); font-size: 1.125rem; color: var(--color-text); margin-right: 2px; }
.fmap__loading { display: flex; align-items: center; gap: 10px; color: var(--color-text-muted); font-size: var(--text-small); }
.fmap__spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--fk-gri-200); border-top-color: var(--color-primary); animation: fmap-spin .8s linear infinite; }
@keyframes fmap-spin { to { transform: rotate(360deg); } }

/* Seçili yer başlığı */
.fmap__back {
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 4px 10px 4px 6px; margin: 0 0 var(--space-2) -6px;
  border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--color-text-muted); font-size: var(--text-small); font-weight: 600;
}
.fmap__back:hover { background: var(--fk-gri-100); color: var(--color-text); }
.fmap__kind { display: inline-block; font-family: var(--font-mono); font-size: var(--text-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--fk-turuncu-700); margin-bottom: 2px; }
.fmap__place { font-size: 1.375rem; margin: 0 0 var(--space-1); }
.fmap__meta { color: var(--color-text-muted); font-size: var(--text-small); margin-bottom: var(--space-3); }
.fmap__links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--space-4); }

.fmap__section { margin-top: var(--space-6); }
.fmap__section:first-child { margin-top: 0; }
.fmap__h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-family: var(--font-mono); font-size: var(--text-label); font-weight: 500; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--color-text-muted); margin: 0 0 var(--space-2); }

/* Ülke / şehir / alan satırları */
.fmap__rows { list-style: none; margin: 0; padding: 0; }
.fmap__row {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 8px 8px 10px;
  border: 0; border-radius: var(--radius-sm); background: transparent; text-align: left; color: inherit;
}
.fmap__row:hover, .fmap__row.is-hover { background: var(--fk-gri-50); }
.fmap__row-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmap__row-sub { display: block; font-weight: 400; font-size: var(--text-small); color: var(--color-text-muted); }
.fmap__count {
  flex: none; min-width: 36px; padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--fk-lacivert-900); color: #fff; font-family: var(--font-display); font-weight: 600; font-size: var(--text-small); text-align: center;
}
.fmap__count--city { background: var(--color-primary); color: var(--color-on-primary); }
.fmap__count--venue { background: #fff; color: var(--fk-lacivert-900); box-shadow: inset 0 0 0 2px var(--fk-lacivert-900); }
.fmap__row .i { color: var(--fk-gri-300); }
.fmap__more {
  display: block; width: 100%; min-height: 44px; margin-top: 4px; border: 1px dashed var(--fk-gri-300); border-radius: var(--radius-sm);
  background: transparent; color: var(--color-text); font-weight: 600; font-size: var(--text-small);
}
.fmap__more:hover { border-style: solid; background: var(--fk-gri-50); }

/* Fuar satırı */
.fmap__fairs { list-style: none; margin: 0; padding: 0; }
.fmap__fair { display: flex; gap: 12px; padding: 10px 8px; border-radius: var(--radius-sm); text-decoration: none; color: inherit; }
.fmap__fair:hover { background: var(--fk-turuncu-50); color: inherit; }
.fmap__fair.is-flash { animation: fmap-flash 1.6s var(--ease-out); }
@keyframes fmap-flash { 0%, 40% { background: var(--fk-turuncu-100); } 100% { background: transparent; } }
.fmap__date {
  flex: none; width: 58px; padding: 6px 0 5px; border-radius: var(--radius-sm); text-align: center;
  background: var(--fk-kraft-100); line-height: 1.1;
}
.fmap__date b { display: block; font-family: var(--font-display); font-size: 1rem; font-weight: 700; }
.fmap__date small { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--fk-gri-700); }
.fmap__fair-main { min-width: 0; }
.fmap__fair-title { display: block; font-weight: 600; line-height: 1.3; }
.fmap__fair-sub { display: block; font-size: var(--text-small); color: var(--color-text-muted); }
.fmap__badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: var(--radius-xs); font-size: 11px; font-weight: 600; vertical-align: 1px; }
.fmap__badge--ertelendi { background: #FDF3DC; color: #7A5200; }
.fmap__badge--iptal { background: #FBE6E6; color: var(--fk-hata); }

/* ------------------------------------------------------------------ Lejant, harita içi öğeler */
.fmap__legend {
  position: absolute; z-index: 4; top: 12px; right: 12px;
  display: flex; gap: 4px; padding: 4px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,.92); box-shadow: var(--shadow-1); font-size: var(--text-label); font-weight: 600;
}
@supports (backdrop-filter: blur(1px)) { .fmap__legend { background: rgba(255,255,255,.78); backdrop-filter: blur(10px); } }
.fmap__legend-item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill); color: var(--color-text-muted); transition: background-color .2s, color .2s; }
.fmap__legend-item.is-active { background: var(--fk-lacivert-900); color: #fff; }
.fmap__dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.fmap__dot--country { background: var(--fk-lacivert-900); box-shadow: 0 0 0 2px #fff; }
.fmap__dot--city { background: var(--color-primary); box-shadow: 0 0 0 2px #fff; }
.fmap__dot--venue { background: #fff; box-shadow: inset 0 0 0 2.5px var(--fk-lacivert-900); }

.fmap__error {
  position: absolute; z-index: 6; left: 50%; top: 40%; transform: translate(-50%, -50%); max-width: 360px; margin: 0;
  padding: var(--space-4); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-2); text-align: center;
}

.fmap .maplibregl-popup-content { padding: 12px 14px; border-radius: var(--radius-md); box-shadow: var(--shadow-2); font-family: var(--font-body); }
.fmap .maplibregl-popup-close-button { width: 32px; height: 32px; font-size: 20px; border-radius: 50%; }
.fmap__pop { min-width: 200px; max-width: 260px; }
.fmap__pop-kind { font-family: var(--font-mono); font-size: 10px; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--fk-turuncu-700); }
.fmap__pop-title { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1rem; line-height: 1.25; margin: 2px 24px 2px 0; }
.fmap__pop-sub { display: block; font-size: var(--text-small); color: var(--color-text-muted); }
.fmap__fair.is-active { background: var(--fk-turuncu-50); box-shadow: inset 3px 0 0 var(--color-primary); }

/* Fuar kartı: listeden bir fuar seçilince haritada açılır */
.fmap__fairpop .maplibregl-popup-content { padding: 16px 16px 14px; }
.fmap__card { display: flex; flex-direction: column; gap: 6px; min-width: 220px; max-width: 268px; }
.fmap__card-title { display: block; font-family: var(--font-display); font-size: 1.0625rem; font-weight: 600; line-height: 1.25; margin: 0 22px 2px 0; }
.fmap__card-line { display: flex; align-items: flex-start; gap: 8px; font-size: var(--text-small); color: var(--fk-gri-700); line-height: 1.4; }
.fmap__card-line .i { margin-top: 2px; color: var(--fk-turuncu-600); }
.fmap__card-go { align-self: flex-start; margin-top: 6px; gap: 6px; }
.fmap__card-go:focus-visible { outline-offset: 3px; }
.fmap__float {
  position: absolute; z-index: 6; top: 64px; left: 50%; transform: translateX(-50%);
  padding: 16px 16px 14px; border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-2);
}
@media (min-width: 1024px) { .fmap__float { left: calc(var(--fmap-panel-w) + 32px); transform: none; top: 16px; } }
.fmap__float-close {
  position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: 50%; background: transparent; color: var(--color-text-muted);
}
.fmap__float-close:hover { background: var(--fk-gri-100); color: var(--color-text); }
.fmap__tip .maplibregl-popup-content { padding: 6px 10px; border-radius: var(--radius-sm); font-size: var(--text-small); font-weight: 600; pointer-events: none; }
.fmap__tip .maplibregl-popup-tip { display: none; }
.fmap .maplibregl-ctrl-group { border-radius: var(--radius-sm); box-shadow: var(--shadow-1); }
.fmap .maplibregl-ctrl-group button { width: 36px; height: 36px; }
.fmap__reset svg { width: 18px; height: 18px; margin: auto; display: block; color: var(--fk-lacivert-900); }

/* ------------------------------------------------------------------ Telefon: alttan çekmece */
.fmap__grab { display: none; }
@media (max-width: 1023.98px) {
  .fmap { --fmap-h: calc(100svh - var(--header-h)); min-height: 520px; }
  .fmap__panel {
    left: 0; right: 0; bottom: 0; height: calc(var(--fmap-h) - 56px);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(calc(100% - var(--fmap-peek)));
    transition: transform .32s var(--ease-out);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .fmap__panel[data-state="half"] { transform: translateY(45%); }
  .fmap__panel[data-state="open"] { transform: translateY(0); }
  .fmap__grab {
    display: grid; place-items: center; width: 100%; height: 28px; flex: none;
    border: 0; background: transparent; touch-action: none; cursor: grab;
  }
  .fmap__grab-bar { width: 44px; height: 5px; border-radius: 3px; background: var(--fk-gri-300); }
  .fmap__head { padding-top: 0; }
  .fmap__crumbs { display: none; }
  .fmap__title { font-size: 1.25rem; margin-bottom: var(--space-2); }
  .fmap__panel[data-state="peek"] .fmap__body { overflow: hidden; }
  .fmap__results { max-height: calc(var(--fmap-h) - 220px); }
  .fmap__legend { top: 10px; right: 10px; left: auto; }
  .fmap .maplibregl-ctrl-bottom-right { bottom: calc(var(--fmap-peek) - 8px); }
  .fmap .maplibregl-ctrl-bottom-left { bottom: calc(var(--fmap-peek) - 8px); }
}
@media (max-width: 420px) { .fmap__legend-item { padding: 4px 8px; } }
@media (min-width: 1024px) {
  .fmap__panel {
    top: 16px; left: 16px; bottom: 16px; width: var(--fmap-panel-w);
    border-radius: var(--radius-lg);
  }
  .fmap .maplibregl-ctrl-bottom-left { left: calc(var(--fmap-panel-w) + 24px); }
}
@media (prefers-reduced-motion: reduce) { .fmap__panel { transition: none; } .fmap__spinner { animation: none; } }

/* ------------------------------------------------------------------ Liste (JS'siz ve arama motorları için) */
.fmap-seo h2 { margin-bottom: var(--space-2); }
.fmap-seo__lead { color: var(--fk-gri-700); max-width: 72ch; }
.fmap-seo__cols { display: grid; gap: var(--space-8); margin-top: var(--space-6); }
@media (min-width: 768px) { .fmap-seo__cols { grid-template-columns: 1fr 1fr; } }
.fmap-seo h3 { font-size: var(--text-h4); }
.fmap-seo__list { columns: 2 180px; column-gap: var(--space-6); list-style: none; padding: 0; margin: 0; }
.fmap-seo__list li { break-inside: avoid; display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--fk-gri-100); font-size: var(--text-small); }
.fmap-seo__list span { font-family: var(--font-mono); color: var(--color-text-muted); }
.fmap-seo__prose { margin-top: var(--space-12); }
