/* ==========================================================================
   Исток — тема "вода / глубина"
   Палитра идёт от поверхности к глубине: пена → мелководье → тёмная бездна.
   ========================================================================== */

:root {
  --foam: #eef7f8;
  --shallow: #a9d6d9;
  --surface: #3aa6a8;
  --depth-1: #0d5d75;
  --depth-2: #0a3d5c;
  --depth-3: #062a44;
  --abyss: #041c2c;
  --gold: #e8b76a;
  --gold-soft: #f3d9a8;
  --ink: #eaf4f4;
  --ink-dim: #b9cdd2;

  --radius: 16px;
  --shadow-deep: 0 20px 50px -20px rgba(2, 12, 20, 0.6);
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(180deg, var(--abyss) 0%, var(--depth-3) 35%, var(--depth-2) 65%, var(--depth-1) 100%);
  background-attachment: fixed;
  line-height: 1.55;
  position: relative;
  overflow-x: hidden;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Subtle animated light rays / ripples in the background */
.ripple-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 15% 0%, rgba(58, 166, 168, 0.20), transparent 60%),
    radial-gradient(ellipse 50% 35% at 85% 15%, rgba(232, 183, 106, 0.10), transparent 60%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(13, 93, 117, 0.35), transparent 70%);
  animation: driftLight 18s ease-in-out infinite alternate;
}

@keyframes driftLight {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-2%) scale(1.03); }
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--foam);
  margin: 0 0 .5em;
  letter-spacing: .01em;
}

a { color: var(--gold-soft); text-decoration: none; }
a:hover { color: var(--gold); }

p { color: var(--ink-dim); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(4, 28, 44, 0.72);
  border-bottom: 1px solid rgba(233, 247, 248, 0.08);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--foam) !important;
}

.brand__drop { font-size: 1.3rem; filter: drop-shadow(0 0 6px rgba(58,166,168,.6)); }

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
}

.main-nav a {
  color: var(--ink-dim);
  font-size: .95rem;
  font-weight: 500;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--foam);
  border-bottom-color: var(--gold);
}

.account-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: .85rem;
}

.account-nav a { color: var(--gold-soft); }
.account-nav a:hover { color: var(--gold); }
.account-nav__email { color: var(--ink-dim); }
.account-nav__unconfirmed { font-size: .78rem; }

/* ---------- Hero ---------- */

.hero {
  padding: 90px 0 70px;
  text-align: center;
  position: relative;
}

.hero__eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .75rem;
  color: var(--gold-soft);
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  max-width: 820px;
  margin: 0 auto .4em;
}

.hero p.lead {
  max-width: 640px;
  margin: 0 auto;
  font-size: 1.15rem;
  color: var(--shallow);
}

.wave-divider {
  display: block;
  width: 100%;
  height: 64px;
  margin-top: 40px;
}

/* ---------- Sections & cards ---------- */

.section {
  padding: 56px 0;
}

.section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
  border-bottom: 1px solid rgba(233, 247, 248, 0.12);
  padding-bottom: 14px;
}

.section__header h2 { margin: 0; font-size: 1.7rem; }
.section__header .see-all { font-size: .9rem; font-weight: 600; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.card {
  background: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(233, 247, 248, 0.10);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow-deep);
  transition: transform .25s ease, border-color .25s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(232, 183, 106, 0.4);
}

.card h3 { font-size: 1.15rem; margin-bottom: 2px; }
.card h3 a { color: var(--foam); }
.card .meta { font-size: .82rem; color: var(--shallow); text-transform: uppercase; letter-spacing: .06em; }
.card p { font-size: .95rem; margin: 0; }

.card-photo {
  width: calc(100% + 44px);
  margin: -22px -22px 0;
  max-width: none;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  display: block;
}

.detail-photo {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 24px 0;
  display: block;
}

.comment-block {
  border-left: 3px solid var(--gold);
  padding-left: 18px;
  margin-top: 30px;
}
.comment-block h3 { font-size: 1rem; color: var(--gold-soft); }

.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 10px;
  border-radius: 100px;
  width: fit-content;
}
.badge--science { background: rgba(58, 166, 168, 0.22); color: #bdeef0; }
.badge--myth { background: rgba(232, 183, 106, 0.22); color: var(--gold-soft); }

/* ---------- Tables (catalog) ---------- */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid rgba(233, 247, 248, 0.10);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  background: rgba(255,255,255,0.03);
}

table.data-table th,
table.data-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid rgba(233, 247, 248, 0.08);
  font-size: .95rem;
}

table.data-table th {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--gold-soft);
  background: rgba(4, 28, 44, 0.5);
}

table.data-table tr:hover td { background: rgba(58, 166, 168, 0.08); }

.sort-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.sort-bar a {
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid rgba(233, 247, 248, 0.15);
  font-size: .85rem;
  color: var(--ink-dim);
}

.sort-bar a.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--abyss);
  font-weight: 700;
}

/* ---------- Detail pages ---------- */

.detail-hero {
  padding: 60px 0 30px;
}

.detail-hero .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  color: var(--shallow);
  font-size: .9rem;
  margin-bottom: 18px;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.fact-card {
  background: rgba(255,255,255,0.04);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 18px 20px;
}

.fact-card h4 { font-size: .95rem; color: var(--gold-soft); margin-bottom: 8px; }
.fact-card.forbidden { border-left-color: #d97878; }
.fact-card.forbidden h4 { color: #f0a5a5; }

.prose {
  max-width: 760px;
  font-size: 1.05rem;
  color: var(--ink-dim);
}
.prose p { margin: 0 0 1.1em; }

/* ---------- Map ---------- */

.map-block {
  margin: 34px 0;
}

.map-block__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.map-block__header h3 { margin: 0; font-size: 1.15rem; }
.map-block__header a { font-size: .88rem; font-weight: 600; }

#source-map,
#suppliers-map {
  height: 340px;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid rgba(233, 247, 248, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

/* Leaflet renders its own tiles/controls; keep the popup readable on the dark theme. */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--depth-2);
  color: var(--foam);
}
.leaflet-container a.leaflet-popup-close-button { color: var(--ink-dim); }

/* ---------- Pagination ---------- */

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination a, .pagination span {
  min-width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(233, 247, 248, 0.14);
  font-size: .9rem;
  color: var(--ink-dim);
}

.pagination a:hover { border-color: var(--gold); color: var(--foam); }
.pagination .current { background: var(--gold); color: var(--abyss); font-weight: 700; border-color: var(--gold); }
.pagination .disabled { opacity: .35; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid rgba(233, 247, 248, 0.08);
  padding: 40px 0;
  margin-top: 60px;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.site-footer__brand { font-family: var(--font-display); color: var(--foam); }
.site-footer__note { color: var(--ink-dim); font-style: italic; margin: 0; font-size: .9rem; }

/* ---------- Misc ---------- */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-dim);
}

.flash-messages {
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.flash {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: .92rem;
  border: 1px solid transparent;
}
.flash--success { background: rgba(58, 166, 168, 0.16); border-color: rgba(58, 166, 168, 0.4); color: var(--foam); }
.flash--error { background: rgba(217, 120, 120, 0.16); border-color: rgba(217, 120, 120, 0.4); color: #f0a5a5; }
.flash--info { background: rgba(232, 183, 106, 0.12); border-color: rgba(232, 183, 106, 0.35); color: var(--gold-soft); }

/* ---------- Forms (предложить правку / админка) ---------- */

.form-block {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid rgba(233, 247, 248, 0.12);
}

.form-block summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold-soft);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0;
}

.field label { font-size: .85rem; color: var(--shallow); }

.field input[type="text"],
.field select,
.field textarea,
.field input[type="password"] {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(233, 247, 248, 0.18);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .95rem;
  resize: vertical;
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.honeypot-field { position: absolute; left: -9999px; top: -9999px; }

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 100px;
  border: none;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  font-family: var(--font-body);
}
.btn--primary { background: var(--gold); color: var(--abyss); }
.btn--approve { background: #3aa6a8; color: var(--abyss); }
.btn--reject { background: rgba(217, 120, 120, 0.85); color: var(--abyss); }
.btn:hover { filter: brightness(1.08); }

.admin-list { display: flex; flex-direction: column; gap: 18px; }

.admin-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(233, 247, 248, 0.12);
  border-radius: var(--radius);
  padding: 20px;
}

.admin-item__meta { font-size: .85rem; color: var(--shallow); margin-bottom: 10px; }

.admin-item__diff {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 12px 0;
}
.admin-item__old { color: var(--ink-dim); font-size: .9rem; }
.admin-item__old del { color: #d97878; text-decoration: line-through; }
.admin-item__new { color: var(--foam); font-size: .95rem; }

.admin-item__actions { display: flex; gap: 10px; margin-top: 14px; }

.breadcrumb {
  font-size: .85rem;
  color: var(--shallow);
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--shallow); }

.search-bar {
  display: flex;
  gap: 10px;
  margin: 18px 0;
}
.search-bar input[type="text"] {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(233, 247, 248, 0.18);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .95rem;
}
.search-bar input[type="text"]:focus { outline: none; border-color: var(--gold); }

.reviews-block { margin-top: 34px; }

.stars { color: var(--gold); letter-spacing: 1px; white-space: nowrap; }
.stars--summary { font-size: 1rem; }
.stars__value { color: var(--ink-dim); font-size: .85rem; margin-left: 6px; letter-spacing: normal; }

.review-list { display: flex; flex-direction: column; gap: 16px; margin: 16px 0; }

.review {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(233, 247, 248, 0.12);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.review__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: .85rem;
}
.review__author { color: var(--foam); font-weight: 600; }
.review__date { color: var(--shallow); }
.review__body { margin: 0; font-size: .95rem; }
.review__photo {
  display: block;
  max-width: 220px;
  max-height: 160px;
  object-fit: cover;
  border-radius: 10px;
  margin-top: 10px;
}

@media (max-width: 640px) {
  .site-header__inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero { padding: 60px 0 40px; }
}
