/* «Зільник» - постійна сторінка рослини (/herb/<slug>).
   Візуально дзеркалить модальну картку травника (app.css). */

.herb-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 26px clamp(18px, 4vw, 32px) 0;
}

/* ---- Хлібні крихти ---- */
.crumbs {
  font-size: 13.5px;
  color: var(--text-faint);
  margin-bottom: 24px;
}
.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--gold-soft); }
.crumbs-sep { margin: 0 8px; color: var(--line); }
.crumbs-here { color: var(--text-dim); }

/* ---- Двоколонковий каркас ---- */
.herb-layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 40px;
  align-items: start;
}

/* ---- Бічна панель ---- */
.herb-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 18px; }
.herb-photo {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}
.herb-photo img { width: 100%; height: 100%; object-fit: cover; }
.img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--line);
}
.img-placeholder svg { width: 72px; height: 72px; }

.herb-facts {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
}
.fact-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 14.5px;
}
.fact-row:last-child { border-bottom: 0; }
.fact-key { color: var(--text-faint); }
.fact-val { color: var(--text); text-align: right; }
a.fact-val:hover { color: var(--gold-soft); }
.fact-planet { color: var(--gold-soft); }
.fact-el[data-element="Вода"]    { color: var(--el-water); }
.fact-el[data-element="Вогонь"]  { color: var(--el-fire); }
.fact-el[data-element="Повітря"] { color: var(--el-air); }
.fact-el[data-element="Земля"]   { color: var(--el-earth); }
.fact-wiki a { margin-left: 10px; }
.fact-wiki a:first-child { margin-left: 0; }

.herb-actions { display: flex; flex-direction: column; gap: 8px; }
.herb-actions .btn { width: 100%; }
.herb-actions-hint {
  margin: 0; font-size: 12.5px; color: var(--text-faint);
  text-align: center; line-height: 1.45;
}

/* ---- Контент ---- */
.herb-head { margin-bottom: 6px; }
.herb-head h1 {
  font-size: clamp(38px, 5.4vw, 54px);
  margin: 0 0 10px;
  line-height: 1.05;
}
.herb-aliases { font-size: 15px; color: var(--text-dim); margin-bottom: 8px; }
.herb-sci { font-size: 15px; color: var(--text-dim); line-height: 1.7; }
.herb-sci em { color: var(--green-pale); }
.sci-sep { margin: 0 7px; color: var(--text-faint); }

/* Застереження про згоду з умовами (лише гостям; боти теж бачать) */
.herb-legal {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin: 16px 0 4px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
  background: rgba(201, 169, 97, .06);
  border: 1px solid rgba(201, 169, 97, .5);
  border-radius: 5px;
}
.herb-legal svg { width: 16px; height: 16px; flex: none; color: var(--gold); margin-top: 2px; }
.herb-legal a { color: var(--green-pale); text-decoration: underline; text-underline-offset: 2px; }
.herb-legal a:hover { color: var(--gold-soft); }

.h-section { margin-top: 22px; }
/* перша секція (зазвичай «Енергії») - окреме повітря під заголовком рослини */
.herb-content > .h-section:first-of-type { margin-top: 48px; }
.h-label {
  margin: 0 0 9px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.powers-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
a.badge-power:hover { border-color: var(--green-soft); color: var(--green-pale); background: rgba(87, 185, 129, .1); }

.deities-line {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold-soft);
}
.deities-line a { color: inherit; border-bottom: 1px dotted rgba(224, 201, 141, .45); }
.deities-line a:hover { color: var(--gold-soft); border-bottom-color: var(--gold-soft); }

.ritual-block {
  padding: 12px 16px;
  background: rgba(201, 169, 97, .07);
  border-left: 2px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 15px;
  color: var(--text);
}

.uses-list { margin: 0; padding: 0; list-style: none; }
.uses-list li {
  position: relative;
  padding: 7px 0 7px 22px;
  font-size: 15px;
  color: var(--text);
  border-bottom: 1px dashed var(--line-soft);
}
.uses-list li:last-child { border-bottom: 0; }
.uses-list li::before {
  content: '❧';
  position: absolute;
  left: 0; top: 6px;
  color: var(--gold);
}

/* ---- Застереження та безпека ---- */
.safety-groups { display: flex; flex-direction: column; gap: 13px; }
.safety-head {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 3px;
  font-size: 13px; font-weight: 600;
}
.safety-head svg { width: 14px; height: 14px; flex: 0 0 auto; }
.safety-body { font-size: 14.5px; line-height: 1.55; color: var(--text); }
.safety-line { margin-bottom: 3px; }
.safety-line:last-child { margin-bottom: 0; }
.safety-part { color: var(--gold-soft); font-weight: 600; }
.safety-dim { color: var(--text-faint); }
.safety-group[data-cat="danger"] .safety-head  { color: #e08a6a; }
.safety-group[data-cat="avoid"] .safety-head   { color: var(--gold-soft); }
.safety-group[data-cat="caution"] .safety-head { color: var(--text-dim); }
.safety-group[data-cat="safe"] .safety-head    { color: var(--green-soft); }
.safety-group[data-cat="safe"] .safety-body    { color: var(--green-pale); }

/* ---- Схожі рослини ---- */
.herb-related { margin-top: 80px; }
.herb-related + .herb-related { margin-top: 44px; }  /* два блоки підряд - тісніше */
.rel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.rel-head h2 { font-size: clamp(24px, 3vw, 30px); margin: 0; }
.rel-all { font-size: 14px; color: var(--green-pale); white-space: nowrap; }
.rel-all:hover { color: var(--gold-soft); }
.rel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.rel-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  color: var(--text);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.rel-card:hover {
  transform: translateY(-3px);
  border-color: var(--green);
  box-shadow: var(--shadow);
  color: var(--text);
}
.rel-img {
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  overflow: hidden;
}
.rel-img img { width: 100%; height: 100%; object-fit: cover; }
.rel-img .img-placeholder svg { width: 40px; height: 40px; }
.rel-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.rel-name { font-family: var(--font-display); font-size: 18px; font-weight: 600; line-height: 1.2; }
.rel-sub { font-size: 12.5px; color: var(--gold-soft); }
.rel-sub-el[data-element="Вода"]    { color: var(--el-water); }
.rel-sub-el[data-element="Вогонь"]  { color: var(--el-fire); }
.rel-sub-el[data-element="Повітря"] { color: var(--el-air); }
.rel-sub-el[data-element="Земля"]   { color: var(--el-earth); }

/* ---- CTA ---- */
.herb-cta { margin-top: 56px; }
.herb-cta-inner {
  position: relative; overflow: hidden;
  text-align: center;
  padding: clamp(34px, 5vw, 52px) clamp(22px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 90% 120% at 50% -10%, rgba(47, 157, 99, .16), transparent 60%),
    radial-gradient(ellipse 80% 110% at 50% 120%, rgba(201, 169, 97, .12), transparent 60%),
    var(--surface);
}
.herb-cta-inner h2 { font-size: clamp(26px, 3.6vw, 34px); margin: 0 0 10px; }
.herb-cta-inner p { margin: 0 0 22px; color: var(--text-dim); font-size: 15.5px; }
.herb-cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---- Адаптив ---- */
@media (max-width: 860px) {
  .herb-layout { grid-template-columns: 1fr; gap: 26px; }
  .herb-side { position: static; }
  .herb-photo { max-width: 480px; }
}
