/*
 * Базовий CSS-фундамент сайту (internal_docs/design.md).
 * Mobile-first від 320px, без залежностей (фреймворків, CDN).
 * Токени палітри й типографіки — design.md §2–3; компоненти карток/крихт/
 * кнопок готують розмітку для задачі 3.2 (навігація) і 3.4 (медіа).
 */

/* ===== 1. Шрифт (self-hosted, cyrillic + latin, ваги 400/500) ===== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/fonts/inter-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ===== 2. Токени палітри (design.md §2) ===== */

:root {
  --cream: #f7f1e3;
  --cream-2: #fbf7ec;
  --ink: #1b3a5b;
  --ink-soft: #3e5771;
  --petrol: #1e5c63;
  --petrol-tint: #ddecec;
  --amber: #b4740e;
  --amber-tint: #f7e7c8;
  --line: #e3d9c3;
  --ph: #e8e1d0;
  --ph-ink: #b3a88c;
}

/* ===== 3. Reset/normalize (мінімальний, свій) ===== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--petrol);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== 4. Типографіка (design.md §3) ===== */

h1 {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 12px;
}

h2 {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 8px;
}

h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 6px;
}

p {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

@media (min-width: 640px) {
  h1 {
    font-size: 26px;
  }

  h2 {
    font-size: 18px;
  }
}

/* ===== 5. Контейнер ===== */

.container {
  max-width: 960px;
  margin-inline: auto;
  padding: 16px;
}

/* ===== 6. Хлібні крихти ===== */

.breadcrumbs {
  font-size: 12px;
  color: var(--ph-ink);
  margin-bottom: 16px;
}

.breadcrumbs a {
  color: var(--petrol);
}

.breadcrumbs__current {
  color: var(--ink-soft);
}

/* ===== 7. Підпис секції (design.md §4.5) ===== */

.section-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 24px 0 10px;
}

/* ===== 8. Сітки карток ===== */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

/* Картка країни/міста — лише назва, без лічильників (design.md §4.3). */
.card {
  display: block;
  background: var(--cream-2);
  border: 0.5px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  min-height: 40px;
  font-weight: 500;
  color: var(--ink);
}

/* ===== 9. Фото-плейсхолдер (aspect-ratio, без CLS — задача 3.4) ===== */

.photo-placeholder {
  aspect-ratio: 16 / 10;
  background: var(--ph);
  border-radius: 12px 12px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ph-ink);
}

.photo-placeholder--detail {
  aspect-ratio: 16 / 8;
  border-radius: 12px;
}

.photo-placeholder svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

/* Реальне фото закладу (Place.PhotoURL заповнений) — той самий контейнер
   (aspect-ratio/border-radius), що й плейсхолдер, щоб підстановка фото не
   зсувала верстку (CLS); overflow: hidden + object-fit: cover обрізають
   зображення під фіксовану рамку. */
.photo {
  aspect-ratio: 16 / 10;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.photo--detail {
  aspect-ratio: 16 / 8;
  border-radius: 12px;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== 10. Картка заведення ===== */

.place-card {
  display: block;
  background: var(--cream-2);
  border: 0.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.place-card__body {
  padding: 12px 14px;
}

.place-card__name {
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 4px;
}

.place-card__type {
  font-size: 12px;
  color: var(--petrol);
  margin: 0 0 4px;
}

.place-card__address {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.place-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
}

/* ===== 11. Бейдж типу закладу (pill) ===== */

.badge {
  display: inline-block;
  background: var(--petrol-tint);
  color: var(--petrol);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
}

/* ===== 12. Кнопки-дії ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background: var(--petrol);
  color: #fff;
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

/* ===== 13. Посилання «вгору на рівень» (низ сторінки) ===== */

.back-link {
  display: block;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
