/*
Theme Name: Two Fates One Route
Author: User
Version: 1.0
Description: Custom theme that reproduces the existing site 1:1 and adds WP admin control for travel cards + comments.
Text Domain: twofates
*/

/* ==============================
   Design tokens & base
   ============================== */

:root{
  --bg: #fffaf2;          /* светло-молочный фон */
  --ink: #222222;
  --ink-dim: #5e6166;
  --ink-soft:#8a8f96;
  --bar: #0b0f18;
  --accent: #e7796b;
  --accent-20: rgba(231,121,107,.2);
  --container: 1200px;
  --radius: 14px;
  --slant: 10deg;

  /* Доп. фиолет для подсветок карточек */
  --violet: #8b5cf6;
  --violet-rgb: 139, 92, 246;
}

*{ box-sizing: border-box; margin:0; padding:0; }
img{ max-width:100%; display:block; height:auto; }
a{ color:inherit; text-decoration:none; }
html{ scroll-behavior:smooth; }
html, body { overflow-x: hidden; }
body{
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

/* Доступность, WP утилиты */
.screen-reader-text{
  position:absolute !important; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0 0 0 0); clip-path: inset(50%); white-space:nowrap; border:0;
}
.screen-reader-text:focus{
  clip:auto; clip-path:none; width:auto; height:auto; padding:.5rem 1rem; margin:0;
  background:#fff; border:1px solid #e5e7eb; border-radius:8px; z-index:10000;
}
.wp-caption{ max-width:100%; }
.wp-caption img{ display:block; }
.wp-caption-text{ color:var(--ink-soft); font-size:.875rem; margin-top:.4rem; }

/* ==============================
   Topbar / Navigation
   ============================== */

.topbar{ background: var(--bar); color:#fff; }
.topbar__inner{
  max-width: var(--container);
  margin:0 auto;
  padding: 28px 24px;
  display:flex; align-items:center; gap:24px;
}
.brand{
  font-weight: 800;
  font-style: italic;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 28px;
}
.nav{ margin-left:auto; display:flex; gap:28px; align-items:center; flex-wrap:wrap; }
.nav a{
  font-weight:600; text-transform: uppercase; font-size: 14px;
  letter-spacing: .06em; opacity:.85;
}
.nav a:hover{ opacity:1; }

/* Пилюля и активная вкладка */
.nav a:not(.nav__dot){
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid transparent; /* предотвращает дёргание при активации */
  transition: .2s ease;
}
.nav a.is-active{
  border-color: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-20);
  opacity: 1;
  color: #fff;
}
.nav a:not(.nav__dot):focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

.nav__dot{
  width:34px; height:34px; border-radius:50%;
  background:#ff7f6f; display:grid; place-items:center;
  box-shadow: 0 0 0 3px rgba(255,255,255,.15) inset;
  font-weight:800;
}

/* ==============================
   Hero, типографика, кнопки
   ============================== */

.hero{
  max-width: var(--container);
  margin: 48px auto 36px;
  padding: 0 24px;
  display:grid;
  /* общий макет, близкий к index/map; на узких — одна колонка */
  grid-template-columns: 1.08fr 1fr;
  gap: 56px; align-items:center;
}
.hero__media{ overflow: visible; border-radius: 6px; background: none; }
.hero__media img{
  display:block;
  width:100%;
  height:auto;
  object-fit: cover;
  border-radius: 12px;
}

.eyebrow,
.display {
  font-family: "Bebas Neue", system-ui, -apple-system, sans-serif;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: .9;
  white-space: nowrap;
  max-width: 52ch;
}
.eyebrow {
  font-weight: 400; font-style: italic; color: var(--ink-soft);
  font-size: calc(clamp(20px, 4vw, 50px) + 2px);
  margin-bottom: 6px; display: inline-block;
}
.display { font-style: italic; font-size: clamp(20px, 4vw, 50px); margin-bottom: 18px; }

.copy{
  font-size: clamp(16px, .95rem + .2vw, 18px);
  line-height: 1.9;
  color: var(--ink-dim);
  max-width: 52ch;
}
.rule{
  width: 70px; height: 4px; background: var(--accent);
  margin: 18px 0 22px; border-radius: 2px;
}
.cta{
  display:inline-block; margin-top: 26px;
  border: 2px solid var(--accent); color: var(--accent);
  padding: 14px 22px; border-radius: 8px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  transition: box-shadow .2s ease, transform .2s ease;
}
.cta:hover{ box-shadow: 0 8px 26px var(--accent-20); transform: translateY(-1px); }
.cta:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

/* ==============================
   Соцкнопки + подсветка
   ============================== */

.social{
  max-width: var(--container); margin: 28px auto 64px; padding: 0 24px;
  display:grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap:14px;
}
.sbtn{
  display:flex; align-items:center; justify-content:center; gap:10px;
  padding:12px 16px; border:1px solid #e5e7eb; border-radius:12px; background:#fff;
  transition:.2s ease; font-weight:700;
  -webkit-tap-highlight-color: transparent;
}
.sbtn:hover{ border-color:#cfd4db; box-shadow: 0 6px 16px rgba(17,24,39,.06); transform: translateY(-1px); }
.sbtn:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
.sbtn img{ width:20px; height:20px; }

footer{ color:#9aa0a6; text-align:center; padding:18px 24px 38px; font-size:14px; }

/* Highlight overlay */
.backdrop{
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
  z-index: 1000;
}
body.highlight-social .backdrop{ opacity:1; pointer-events:auto; }
body.highlight-social #social{ position: relative; z-index: 1001; }

@keyframes pop {
  0%{ transform: scale(1); box-shadow:none; }
  30%{ transform: scale(1.06); }
  60%{ transform: scale(1); }
  100%{ transform: scale(1); }
}
body.highlight-social .sbtn{
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 8px var(--accent-20);
  animation: pop .6s ease var(--i,0s) 3;
}
/* Stagger */
#social .sbtn:nth-child(1){ --i: .0s; }
#social .sbtn:nth-child(2){ --i: .1s; }
#social .sbtn:nth-child(3){ --i: .2s; }
#social .sbtn:nth-child(4){ --i: .3s; }
   
/* ==============================
   Секции / сетки / карточки
   ============================== */

.section{max-width: var(--container); margin: 24px auto 60px; padding:0 24px;}


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

.card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius: var(--radius);
  overflow: hidden;
  display:flex;
  flex-direction: column;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
  cursor: pointer;
  position: relative; /* для подсветки и уголка */
  will-change: transform, box-shadow;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.card > img{
  width:100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.card__body{ padding: 14px 16px 18px; }
.card__title{
  font-family: "Bebas Neue", system-ui, -apple-system, sans-serif;
  font-size: 28px;
  letter-spacing: .02em;
  margin-bottom: 6px;
}
.card__meta{
  color: var(--ink-soft);
  font-size: 14px;
  margin-bottom: 8px;
}
.card__body p{
  color: var(--ink-dim);
  line-height: 1.7;
}

/* Hover/Focus подсветка фиолетовым ореолом */
.card::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius: inherit;
  pointer-events:none;
  box-shadow:
    inset 0 0 0 0 rgba(var(--violet-rgb), 0),
    inset 0 0 0 0 rgba(var(--violet-rgb), 0);
  transition: box-shadow .25s ease;
}
.card:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(17,24,39,.08);
  border-color:#d9dde5;
}
.card:hover::after{
  box-shadow:
    inset 0 0 0 1px rgba(var(--violet-rgb), .40),
    inset 0 0 18px 8px rgba(var(--violet-rgb), .18);
}
.card:focus-visible{ outline: none; }
.card:focus-visible::after{
  box-shadow:
    inset 0 0 0 1.5px rgba(var(--violet-rgb), .50),
    inset 0 0 22px 10px rgba(var(--violet-rgb), .22);
}
.card:active{
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(17,24,39,.08);
}
.card:active::after{
  box-shadow:
    inset 0 0 0 1.5px rgba(var(--violet-rgb), .50),
    inset 0 0 22px 10px rgba(var(--violet-rgb), .22);
}
@media (hover: none){
  .card:hover{ transform:none; box-shadow: 0 6px 16px rgba(17,24,39,.06); border-color:#e5e7eb; }
  .card:hover::after{ box-shadow:none; }
}

/* кнопка-метка внутри карточки (не ссылка) */
.card__btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 14px;
  border-radius: 999px;
  border:1px solid #e5e7eb;
  font-weight:600;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
  white-space: nowrap;
}
.card__btn:hover{ background:#f9fafb; border-color:#d1d5db; }
.card__btn:active{ transform: translateY(1px); }

/* Уголок с номером (увеличенный) */
.card__corner {
  position: absolute;
  top: 0; right: 0;
  width: 90px; height: 90px;
  pointer-events: none;
}
.card__corner::before {
  content: "";
  position: absolute;
  top: -32px; right: -32px;
  width: 126px; height: 126px;
  background: linear-gradient(135deg, #8a2be2, #1e90ff); /* фиолет → синий */
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.35) inset;
}
.card__corner > span {
  position: absolute;
  top: 15px; right: 20px;
  font-family: "Bebas Neue", system-ui, -apple-system, sans-serif;
  font-size: 30px;
  letter-spacing: .04em;
  color: #fff;
  transform: rotate(-6deg);
  text-shadow: 0 2px 3px rgba(0,0,0,0.45);
  user-select: none;
}

/* ДЕЙСТВИЯ: «Читать» + «Комментарии» в одной строке */
.card__actions{
  display:grid;
  grid-template-columns: auto 1fr; /* слева — «читать», справа — свободное поле */
  align-items:center;
  column-gap:12px;
  margin-top:12px;
}
.card__commentsBtn{
  justify-self: center;
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#fff;
  font-weight:600; font-size:14px;
  user-select:none;
}
.card__commentsBtn:hover{ background:#f9fafb; border-color:#d1d5db; }
.card__commentsBtn:active{ transform: translateY(1px); }
.card__commentsBtn:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
.card__commentsBtn svg{ width:18px; height:18px; flex:0 0 18px; }
.card__commentsCount{
  display:inline-grid; place-items:center;
  min-width:18px; height:18px; padding:0 6px;
  border-radius:999px; border:1px solid #e5e7eb;
  font-size:12px; line-height:1;
}

/* ==============================
   Scroll-to-top
   ============================== */

.scroll-top{
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(17,24,39,.12);
  opacity: 0;
  transform: translateY(8px);
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease, box-shadow .2s ease;
  z-index: 1100;
  -webkit-tap-highlight-color: transparent;
}
.scroll-top.is-visible{
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}
.scroll-top:focus-visible{
  outline: 2px solid var(--accent); /* FIX: было --var(accent) */
  outline-offset: 2px;
}
.scroll-top__icon{ font-size: 16px; }
@media (hover:hover){
  .scroll-top:hover{
    box-shadow: 0 12px 26px rgba(17,24,39,.16);
    transform: translateY(-1px);
  }
  .scroll-top:active{ transform: translateY(0); }
}
@media (max-width: 980px){
  .scroll-top{
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0));
    padding: 12px 14px;
    font-size: 15px;
  }
  .scroll-top__icon{ font-size: 18px; }
}
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  .cta, .sbtn, .scroll-top{ transition:none; transform:none !important; box-shadow:none !important; }
  .backdrop{ transition:none; }
  body.highlight-social .sbtn{ animation:none; }
}

/* ==============================
   Комментарии (WP) — светлые карточки
   ============================== */

.comments-area{
  max-width: var(--container);
  margin: 24px auto 60px;
  padding: 0 24px;
}
.comments-title{
  font-size: clamp(18px, 2.2vw, 24px);
  margin: 0 0 12px;
}

/* Отключаем нумерацию у любых списков комментариев */
ol.comment-list,
ul.comment-list,
ol.commentlist,
ul.commentlist{
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Сам комментарий */
.comment-list > li.comment > .comment-body,
.commentlist > li.comment > .comment-body{
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  padding: 16px !important;
  color: var(--ink-dim);
}
.comment-list > li.comment,
.commentlist > li.comment{
  margin-bottom: 14px;
}

/* Вложенные ответы */
.comment .children{
  list-style: none;
  margin: 12px 0 0 18px;
  padding: 0;
  display: grid;
  gap: 12px;
}

.comment-meta{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 13px;
}
.comment-author .fn{ font-weight: 700; color: var(--ink); font-size: 15px; }
.comment-metadata time{ color: var(--ink-soft); }

.comment-content{ color: var(--ink-dim); line-height: 1.7; }
.comment-content p{ margin: 8px 0 0; }

.comment-reply-link{
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-weight: 600;
  font-size: 14px;
}
.comment-reply-link:hover{ background:#f9fafb; border-color:#d1d5db; }

.comment-awaiting-moderation{
  display: inline-block;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(231,121,107,.08);
  color: var(--ink-soft);
  font-size: 13px;
}

/* Форма */
.comment-respond{
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-top: 18px;
}
.comment-respond h3{ font-size: 18px; margin: 0 0 10px; }
.comment-form{ display: grid; gap: 10px; }
.comment-form p{ margin: 0; }

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea{
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
}
.comment-form textarea{ min-height: 120px; }

/* Прячем e-mail и сайт, даже если шаблон их внезапно выведет */
.comment-form-email,
.comment-form-url{ display: none !important; }

/* Кнопка отправки — фикс на мобилках: белая, читаемая */
/* (в исходнике был незакрытый комментарий — исправлено) */
.comments-area input[type="submit"],
.comments-area button[type="submit"],
.comments-area .submit,
#respond input[type="submit"]{
  appearance: none;
  -webkit-appearance: none;
  background: #fff !important;
  color: var(--ink) !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  text-shadow: none !important;
  cursor:pointer;
}
.comments-area input[type="submit"]:hover,
.comments-area button[type="submit"]:hover,
.comments-area .submit:hover{
  background:#f9fafb !important;
  border-color:#d1d5db !important;
}
.comments-area input[type="submit"]:active,
.comments-area button[type="submit"]:active,
.comments-area .submit:active{ transform: translateY(1px); }
.comments-area input[type="submit"]:focus-visible,
.comments-area button[type="submit"]:focus-visible,
.comments-area .submit:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Исправление: форма ответа на комментарий во вложениях тоже с фоном */
.comment .comment-respond {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-top: 18px;
}
/* Вложенные комментарии тоже в блоках */
.comments-area .children li.comment > article,
.comments-area .children li.comment > div {
  background: #fff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  padding: 16px !important;
  margin-bottom: 14px !important;
}

/* ==============================
   Travels grid дополнительные отступы
   ============================== */

.travels-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding-left: 24px;
  padding-right: 24px;
}
@media (min-width: 1400px){
  .travels-grid{ padding-left: 40px; padding-right: 40px; }
}
@media (max-width: 980px){
  .travels-grid{
    grid-template-columns: 1fr;
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ==============================
   Gutenberg / Classic Editor alignment helpers
   ============================== */

.single-content .aligncenter,
.entry-content .aligncenter,
.post-content .aligncenter {
  display:block;
  margin-left:auto;
  margin-right:auto;
  text-align:center;
}
.single-content .alignleft,
.entry-content .alignleft,
.post-content .alignleft {
  float:left;
  margin: .3rem 1rem .8rem 0;
}
.single-content .alignright,
.entry-content .alignright,
.post-content .alignright {
  float:right;
  margin: .3rem 0 .8rem 1rem;
}

/* чтобы картинка не вылезала за блок */
.single-content img,
.single-content figure {
  max-width: 100%;
  height: auto;
}

/* На мобилке отменяем обтекание для читабельности */
@media (max-width: 740px){
  .single-content .alignleft,
  .single-content .alignright {
    float:none;
    margin: .8rem auto;
    display:block;
    text-align:center;
  }
}

/* ==============================
   Single пост: контент как «карточка»
   ============================== */

.single-content{
  max-width: var(--container);
  margin: 0 auto 28px;
  padding: 20px 22px;        /* внутренние отступы */
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(17,24,39,.06);
}
.single-content > *:first-child{ margin-top: 0; }

/* Обложка */
.single-thumb{
  margin: -12px -12px 12px;
  overflow: hidden;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}
.single-thumb img{ width:100%; height:auto; display:block; }

/* Текст */

/* Soft text block for readability on image backgrounds */
.text-block{
  background: var(--bg);
  border-radius: var(--radius, 14px);
  padding: 16px 18px;
  box-shadow: 0 6px 16px rgba(17,24,39,.06);
}
.text-block .display{ margin-top: 4px; }
.text-block .copy{ margin-bottom: 2px; }


.single-content p{ color: var(--ink-dim); line-height:1.85; margin: 0 0 1.05rem; }
.single-content h2, .single-content h3{ margin:1.2rem 0 .6rem; }

/* Комментарии на сингле — тоже «карточка» */
.single-comments{
  max-width: var(--container);
  margin: 0 auto 40px;
  padding: 0 24px;
}
.single-comments .comments-area{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:16px;
  padding:18px 20px;
  box-shadow: 0 6px 16px rgba(17,24,39,.06);
}

/* ==============================
   Адаптив для крупноблочных элементов
   ============================== */

@media (max-width: 980px){
  .hero{ grid-template-columns: 1fr; gap: 28px; }
  .hero__media{ order:-1; }
  .hero__media img{
    width: 90%;
    max-width: 360px;
    margin-inline: auto;
  }
  .topbar__inner{
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .brand{
    font-size: 20px;
    text-align: center;
    white-space: nowrap;
    width: 100%;
  }
  .nav{
    justify-content: center;
    gap: 12px;
    margin-left: 0;
    width: 100%;
  }
  .nav a{
    display: inline-block;
    text-align: center;
    font-size: 14px;
  }
}

/* ============= page-travels.php — LEAD (чистый, единый блок) ============= */
/* Работает только на странице этого шаблона. Не трогает остальные страницы.
   Добавлено:
   • Комментарии к правилам
   • Переменная --lead-gap для удобной настройки "отступа в 1 абзац"
   • Резервный селектор на случай, если класс body шаблона поменяется
*/

/* Локальная "переменная" с отступом между LEAD и карточками */
:is(body.page-template-page-travels-php, body.page-template-page-travels){
  --lead-gap: 1.1rem; /* меняется в одном месте */
}

/* DESKTOP */
@media (min-width: 981px){
  /* LEAD сразу после HERO: отдельный абзац и центрирование */
  :is(body.page-template-page-travels-php, body.page-template-page-travels) main.hero + section.lead{
    margin-top: 28px;              /* "с нового абзаца" после HERO */
    margin-bottom: var(--lead-gap);/* отступ до карточек ≈ 1 абзац */
    text-align: center;
  }

  /* заголовок читаемее на широких */
  :is(body.page-template-page-travels-php, body.page-template-page-travels) main.hero + section.lead .display{
    text-wrap: balance;
  }

  /* описание растягиваем на ширину контейнера страницы */
  :is(body.page-template-page-travels-php, body.page-template-page-travels) main.hero + section.lead .copy{
    max-width: none;  /* убираем ограничение 52ch ровно тут */
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    text-wrap: balance;
  }

  /* второе предложение (в span.nowrap) держим в одну строку */
  :is(body.page-template-page-travels-php, body.page-template-page-travels) main.hero + section.lead .copy .nowrap{
    white-space: nowrap;
  }

  /* полоска ровно под заголовком */
  :is(body.page-template-page-travels-php, body.page-template-page-travels) main.hero + section.lead .rule{
    margin-left: auto;
    margin-right: auto;
  }
}

/* MOBILE */
@media (max-width: 980px){
  /* мягкие поля, отступы и центрирование */
  :is(body.page-template-page-travels-php, body.page-template-page-travels) main.hero + section.lead{
    text-align: center;
    padding: 0 16px;
    margin-top: 18px;                /* чуть отрываем от HERO */
    margin-bottom: var(--lead-gap);  /* тот же единый отступ */
  }

  /* полоска по центру */
  :is(body.page-template-page-travels-php, body.page-template-page-travels) main.hero + section.lead .rule{
    margin-left: auto;
    margin-right: auto;
  }

  /* на мобилке переносы обычные, чтобы не было горизонтального скролла */
  :is(body.page-template-page-travels-php, body.page-template-page-travels) main.hero + section.lead .copy .nowrap{
    white-space: normal;
  }
}

/* --- Fallback: если вдруг поменяется класс body шаблона ---
   Активируется только если браузер поддерживает :has().
   Бьём по очень специфическому паттерну: <main.hero> + <section.lead>
   с внутренними элементами h2.display + .rule + p.copy
   и применяем те же стили. */
@supports selector(main.hero + section.lead:has(> h2.display)){
  @media (min-width: 981px){
    body:not(.page-template-page-travels-php):not(.page-template-page-travels)
    main.hero + section.lead:has(> h2.display):has(> .rule):has(> p.copy){
      margin-top: 28px;
      margin-bottom: var(--lead-gap, 1.1rem); /* дефолт, если переменная не задана */
      text-align: center;
    }

    body:not(.page-template-page-travels-php):not(.page-template-page-travels)
    main.hero + section.lead:has(> h2.display):has(> .rule):has(> p.copy) .copy{
      max-width: none;
      width: 100%;
      margin-left: auto;
      margin-right: auto;
      text-align: center;
      text-wrap: balance;
    }

    body:not(.page-template-page-travels-php):not(.page-template-page-travels)
    main.hero + section.lead:has(> h2.display):has(> .rule):has(> p.copy) .rule{
      margin-left: auto;
      margin-right: auto;
    }

    body:not(.page-template-page-travels-php):not(.page-template-page-travels)
    main.hero + section.lead:has(> h2.display):has(> .rule):has(> p.copy) .copy .nowrap{
      white-space: nowrap;
    }
  }

  @media (max-width: 980px){
    body:not(.page-template-page-travels-php):not(.page-template-page-travels)
    main.hero + section.lead:has(> h2.display):has(> .rule):has(> p.copy){
      text-align: center;
      padding: 0 16px;
      margin-top: 18px;
      margin-bottom: var(--lead-gap, 1.1rem);
    }

    body:not(.page-template-page-travels-php):not(.page-template-page-travels)
    main.hero + section.lead:has(> h2.display):has(> .rule):has(> p.copy) .rule{
      margin-left: auto;
      margin-right: auto;
    }

    body:not(.page-template-page-travels-php):not(.page-template-page-travels)
    main.hero + section.lead:has(> h2.display):has(> .rule):has(> p.copy) .copy .nowrap{
      white-space: normal;
    }
  }
}

/* --- page-travels.php: локальные правки расстояния между строками и зазора --- */
/* Только для шаблона page-travels.php, чтобы не затронуть другие страницы */
:is(body.page-template-page-travels-php, body.page-template-page-travels) .hero .text-block .copy,
:is(body.page-template-page-travels-php, body.page-template-page-travels) .lead .text-block .copy{
  line-height: 1.28;   /* уплотняем строки */
  margin-bottom: 0;    /* не добавляем лишний зазор под абзацем */
}

/* Сжимаем зазор между HERO и LEAD (было ~28px) */
:is(body.page-template-page-travels-php, body.page-template-page-travels) main.hero + section.lead{
  margin-top: 10px;
}
/* --- /page-travels.php overrides --- */
/* ======================================================================== */
/* ============= page-about.php — ABOUT page (локальные правки) ============= */
/* Работает только на странице шаблона "О нас". Не влияет на другие страницы. */
:is(body.page-template-page-about-php, body.page-template-page-about) .hero .text-block > p.copy{
  line-height: 1.28;
  margin-bottom: 0;
}

/* Соседний за HERO раздел "Кто мы" — только первый абзац после заголовка */
:is(body.page-template-page-about-php, body.page-template-page-about) .section .text-block > h2.display + p.copy{
  line-height: 1.28;
  margin-bottom: 0;
}

/* Сжимаем зазор между HERO и первым разделом страницы "О нас" */
:is(body.page-template-page-about-php, body.page-template-page-about) main.hero + section.section{
  margin-top: 10px;
}

/* Немного уплотняем декоративную линию в HERO, если она присутствует */
:is(body.page-template-page-about-php, body.page-template-page-about) .hero .rule{
  margin-top: 6px;
  margin-bottom: 10px;
}

/* Половинный зазор между "Кто мы" и следующим разделом */
:is(body.page-template-page-about-php, body.page-template-page-about) main.hero + section.section{
  margin-bottom: 30px; /* было 60px (у .section), теперь ровно в 2 раза меньше */
}
/* ======================================================================== */





/* Single travel: spacing between auto-wrapped text cards */
.single-content .text-block{ margin: 14px 0; }


/* === Single travel — compact header card so title/date/excerpt don't blend with background === */
.post-header{
  max-width: 56ch;
  margin-top: 6px;
}
.post-header .post-meta{
  color: var(--ink-soft);
  font-size: 14px;
  margin: 6px 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.post-header .post-meta time{
  white-space: nowrap;
}
.post-excerpt{
  color: var(--ink-dim);
  line-height: 1.75;
  margin-top: 6px;
}
@media (max-width: 980px){
  .post-header{ max-width: none; }
}


/* Keep subtitle (eyebrow) below the title and contained within the header card */
.post-header .eyebrow{
  display: block;
  max-width: 52ch;
  margin: 8px 0 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ==== Лайки (сердце) ================================================== */
:root{ --twr-violet-rgb: 124,58,237; } /* запасной фиолетовый, если нет переменных темы */

.twr-like{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 12px;
  border-radius:999px; border:1px solid #e5e7eb;
  background:#fff; font-weight:700; font-size:14px;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow .2s ease, border-color .2s ease, background .15s ease, transform .05s ease;
}
.twr-like:hover{ background:#f9fafb; border-color:#d1d5db; }
.twr-like:active{ transform: translateY(1px); }
.twr-like.is-busy{ opacity:.65; pointer-events:none; }

.twr-like__icon{ width:20px; height:20px; flex:0 0 20px; }
.twr-like__count{ line-height:1; }

.twr-like .twr-like__icon path{
  fill: none;
  stroke: #fca5a5;          /* бледно-красный контур, когда не нажато */
}
.twr-like.is-liked{
  border-color: rgba(var(--twr-violet-rgb), .50);
  box-shadow:
    0 0 0 5px rgba(var(--twr-violet-rgb), .12),
    inset 0 0 18px 6px rgba(var(--twr-violet-rgb), .18); /* фиолетовый «ореол» */
}
.twr-like.is-liked .twr-like__icon path{
  fill: #ef4444;            /* красная заливка при нажатии */
  stroke: #ef4444;          /* и контур */
}

/* Размещение в карточке между «Читать далее» и «Комментарии» */
.card__actions{
  display:grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  column-gap:12px;
}
.card__actions .twr-like{ justify-self:center; }

/* Размещение в single (между описанием и комментариями) */
.single-like{
  max-width: min(1100px, 92vw);
  margin: 8px auto 18px;
  padding: 0 24px;
  display:flex; justify-content:center;
}


/* Views monitor on travel cards */
.card__views {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .75rem;
  font-size: 0.95rem;
  opacity: .85;
}
.card__viewsIcon {
  display: inline-flex;
  line-height: 0;
}
.card__viewsLabel {
  margin-right: .25rem;
}
.card__viewsCount {
  font-weight: 600;
}



/* Share button on travel cards */
.card__shareBtn{
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#fff;
  font-weight:600; font-size:14px;
  user-select:none;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
  cursor:pointer;
  margin-top:8px;
}
.card__shareBtn:hover{ background:#f9fafb; border-color:#d1d5db; }
.card__shareBtn:active{ transform: translateY(1px); }
.card__shareBtn:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
.card__shareBtn.is-success{ background:#ecfdf5; border-color:#a7f3d0; }



/* Engagement row: views + share */
.card__engagement{
  display:flex; align-items:center; gap:12px;
  margin-top:.75rem;
}
.card__engagement .card__shareBtn{ margin-top:0; }



/* Single: engagement row with views (left), like (center), share (right) */
.single-engagement{
  display:flex; align-items:center; justify-content:center; gap:14px;
  margin-top: 12px;
}
.single-pill{
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  background:#fff;
  font-weight:600; font-size:14px;
  user-select:none;
  box-shadow: 0 1px 2px rgba(17,24,39,.04);
}
.single-pill:hover{ background:#f9fafb; border-color:#d1d5db; }
.single-pill:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
.single-shareBtn{ cursor:pointer; transition: background .15s ease, border-color .15s ease, transform .05s ease; }
.single-shareBtn:active{ transform: translateY(1px); }
.single-shareBtn.is-success{ background:#ecfdf5; border-color:#a7f3d0; }
.single-viewsCount{ font-weight:700; }
.single-viewsIcon{ line-height:0; display:inline-flex; }

