/* ============================================================
   DEAMBULANDO CON ARTABRIA — «Cuaderno de ruta»
   Дизайн-система восстановления сайта (этап 4)
   Палитра: бумага полевого блокнота, чернила, Атлантика Галисии,
   зелёный дорожного указателя, красный архивного штемпеля, гранит.
   Шрифты: Barlow Condensed (навигация/заголовки — ДНК дорожных
   знаков), Alegreya (испанская гуманистическая антиква — текст),
   IBM Plex Mono (даты, номера, цены — «полевые данные»).
   ============================================================ */

:root {
  --papel: #FAF9F5;
  --tinta: #22303A;
  --atlantico: #29565C;
  --senal: #15693C;
  --sello: #B0432F;
  --granito: #71766F;
  --linea: #DAD6CA;

  --f-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --f-body: 'Alegreya', Georgia, 'Times New Roman', serif;
  --f-mono: 'IBM Plex Mono', 'Consolas', monospace;

  --ancho: 1080px;
  --medida: 66ch;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--f-body);
  font-size: 1.125rem;
  line-height: 1.65;
}

a { color: var(--atlantico); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--tinta); }

:focus-visible {
  outline: 3px solid var(--atlantico);
  outline-offset: 2px;
}

/* ---------- шапка ---------- */

body {
  background: linear-gradient(180deg, #E9EFEA 0, var(--papel) 260px);
}

.site-header {
  padding: 2rem 0 0;
}

.site-header .inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem 2rem;
  flex-wrap: wrap;
  border-bottom: 3px solid;
  border-image: linear-gradient(90deg, var(--atlantico), var(--senal)) 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.brand-logo {
  flex: none;
  display: block;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(34, 48, 58, 0.25), 0 0 0 3px #FFFFFF;
}
/* зум внутри круглой маски: белые поля исходного PNG уходят за край */
.brand-logo img {
  width: 126%;
  height: 126%;
  margin: -13%;
  display: block;
}

.site-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 0;
}

.site-title a { color: var(--tinta); text-decoration: none; }
.site-title a:hover { color: var(--atlantico); }

.site-sub {
  font-family: var(--f-mono);
  font-size: 0.8rem;
  color: var(--granito);
  margin: 0.6rem 0 0;
}

.site-nav {
  margin-top: 0;
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

/* кнопки навигации — как плашка «Última etapa» */
.site-nav a {
  color: var(--papel);
  background: linear-gradient(90deg, var(--atlantico), var(--senal));
  padding: 0.5rem 1.1rem;
  border-radius: 4px;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(34, 48, 58, 0.25);
  transition: filter 0.15s ease, transform 0.15s ease;
}
.site-nav a:hover { filter: brightness(1.12); transform: translateY(-1px); }
.site-nav a[aria-current="page"] { filter: none; box-shadow: inset 0 0 0 2px rgba(250, 249, 245, 0.55); }

/* ---------- лента-маршрут ---------- */

.ruta {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 2.5rem 1.2rem 3rem;
}

/* дорога с разметкой — фирменная полоса под шапкой */
.road {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--tinta), var(--atlantico) 55%, var(--senal));
  position: relative;
  overflow: hidden;
  margin-bottom: 2.2rem;
  box-shadow: 0 3px 8px rgba(34, 48, 58, 0.25);
}
.road::after {
  content: "";
  position: absolute;
  inset: 5px 0;
  background: repeating-linear-gradient(90deg, var(--papel) 0 26px, transparent 26px 44px);
  opacity: 0.9;
}

/* последняя этапа — крупный блок с текстом поверх фото */
.featured {
  display: block;
  text-decoration: none;
  color: var(--tinta);
  margin-bottom: 2.6rem;
}
.featured-media {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--linea);
  box-shadow: 0 8px 24px rgba(34, 48, 58, 0.18);
}
.featured-media img {
  width: 100%;
  height: clamp(260px, 46vw, 470px);
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.featured:hover .featured-media img { transform: scale(1.025); }
.featured-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(34, 48, 58, 0) 38%, rgba(34, 48, 58, 0.42) 62%, rgba(34, 48, 58, 0.88) 100%);
}
.featured-title {
  position: absolute;
  left: 1.2rem;
  right: 1.2rem;
  bottom: 2rem;
  display: block;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 0.98;
  color: #FFFFFF;
  text-shadow: 0 2px 10px rgba(34, 48, 58, 0.55);
}
.featured:hover .featured-title { text-decoration: underline; text-decoration-color: var(--senal); text-decoration-thickness: 4px; text-underline-offset: 6px; }
.featured .item-meta {
  position: absolute;
  left: 1.25rem;
  bottom: 1rem;
  margin: 0;
  color: rgba(250, 249, 245, 0.85);
}
.featured .item-meta .pais { color: #FFFFFF; }
.featured-excerpt {
  display: block;
  max-width: 62ch;
  font-size: 1.08rem;
  color: var(--tinta);
  margin-top: 0.9rem;
}

.ruta-head {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--granito);
  margin: 0 0 1.6rem;
}

/* ---------- сетка карточек ---------- */

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 1.5rem;
}

.card {
  background: #FFFFFF;
  border: 1px solid var(--linea);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: aparecer 0.5s ease both;
}
.card:nth-child(2) { animation-delay: 0.06s; }
.card:nth-child(3) { animation-delay: 0.12s; }
.card:nth-child(n+4) { animation-delay: 0.18s; }

.card-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--atlantico) 0%, #1E6E52 60%, var(--senal) 100%);
  overflow: hidden;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* заглушка вместо фото: градиент + пункт назначения */
.card-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-ph::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 54%;
  border-top: 3px dashed rgba(250, 249, 245, 0.55);
}
.card-ph::after {
  content: "";
  position: absolute;
  right: 15%;
  top: 47%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--sello);
  border: 2.5px solid rgba(250, 249, 245, 0.9);
}
.card-ph-pais {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(250, 249, 245, 0.92);
  text-shadow: 0 1px 4px rgba(34, 48, 58, 0.35);
}

/* столбик-веха на карточке */
.card .hito {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 1;
}

.card-body {
  padding: 0.9rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}
.card .item-title { font-size: 1.42rem; margin: 0; }
.card .item-excerpt {
  color: var(--granito);
  font-size: 0.98rem;
  margin: 0.15rem 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .item-meta { margin: 0; }

.card-more {
  margin-top: auto;
  align-self: flex-start;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #FFFFFF;
  background: #FF4F4F;
  border-radius: 4px;
  padding: 0.45rem 1rem;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
}
.card-more:hover { background: var(--tinta); color: #FFFFFF; transform: translateY(-1px); }
.card-more:focus-visible { outline: 3px solid var(--atlantico); outline-offset: 2px; }

.mas {
  text-align: center;
  margin: 2.4rem 0 0;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 1.35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.mas a {
  color: var(--atlantico);
  text-decoration: none;
  border-bottom: 3px solid var(--senal);
  padding-bottom: 2px;
}
.mas a:hover { color: var(--tinta); }

/* ---------- сайдбар главной ---------- */

.ruta.con-sidebar {
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 2.6rem;
  align-items: start;
}
@media (max-width: 1099px) {
  .ruta.con-sidebar { grid-template-columns: 1fr; }
  .side { position: static; }
}

.side {
  position: static;
}

.side-box {
  background: #FFFFFF;
  border: 1px solid var(--linea);
  border-radius: 12px;
  padding: 1.1rem 1.2rem 1.2rem;
  margin-bottom: 1.4rem;
  box-shadow: 0 2px 8px rgba(34, 48, 58, 0.05);
}

.side-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.7rem;
  padding-bottom: 0.35rem;
  border-bottom: 3px solid;
  border-image: linear-gradient(90deg, var(--atlantico), var(--senal)) 1;
}

.side-recent {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* облако направлений — красные плашки «страна (количество)» */
.side-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.side-tags a {
  font-size: 0.98rem;
  line-height: 1.2;
  color: #FFFFFF;
  background: #FF4F4F;
  padding: 0.32rem 0.62rem;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.15s ease;
}
.side-tags a:hover { background: var(--tinta); color: #FFFFFF; }

/* карточка «No te pierdas» — фото с отступом по краям, текст в паддинге бокса */
.side-box .cards { grid-template-columns: 1fr; }
.side-box .card {
  border: none;
  border-radius: 8px;
  overflow: hidden;
  margin: 0;
}
.side-box .card-media { border-radius: 0; }
.side-box .card-body { padding: 0.9rem 0 0; }

.side-recent li { margin: 0 0 0.65rem; font-size: 1.02rem; }
.side-recent a { color: var(--tinta); text-decoration: none; }
.side-recent a:hover { color: var(--atlantico); }

@keyframes aparecer {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* веха — испанский километровый столбик: белое верх, зелёная полоса, номер */
.hito {
  position: absolute;
  left: -27px;
  top: 1.9rem;
  width: 24px;
  height: 38px;
  border: 2px solid var(--tinta);
  border-radius: 9px 9px 3px 3px;
  background: linear-gradient(to bottom, #FFFFFF 0 56%, var(--senal) 56% 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-mono);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--tinta);
  line-height: 1;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.ruta-item:hover .hito {
  transform: rotate(-5deg) translateY(-2px);
  border-color: var(--senal);
}

.hito span { background: #FFFFFF; padding: 1px 2px 0; border-radius: 2px; }

/* безномерная точка маршрута */
.hito.punto {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--atlantico);
  border: 2px solid var(--papel);
  box-shadow: 0 0 0 2px var(--atlantico);
  left: -20px;
  top: 2.2rem;
}
.ruta-item:hover .hito.punto { transform: scale(1.25); border-color: var(--atlantico); }

/* миниатюра сбоку на широких экранах */
.item-thumb {
  display: block;
  margin: 0.7rem 0 0;
}
.item-thumb img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--linea);
  transition: box-shadow 0.25s ease;
}
@media (min-width: 720px) {
  .ruta-item.con-foto {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 0 1.4rem;
    align-items: start;
  }
  .ruta-item.con-foto .item-thumb { margin: 0.2rem 0 0; grid-row: 1 / span 2; }
  .ruta-item.con-foto .item-thumb img { height: 128px; object-fit: cover; }
  .ruta-item.con-foto .item-body { grid-column: 2; }
  .ruta-item.con-foto .hito { top: 2rem; }
}
.ruta-item:hover .item-thumb img { box-shadow: 0 6px 16px rgba(34, 48, 58, 0.18); }

.item-meta {
  font-family: var(--f-mono);
  font-size: 0.76rem;
  color: var(--granito);
  letter-spacing: 0.04em;
  margin: 0 0 0.35rem;
}
.item-meta .pais { color: var(--atlantico); text-transform: uppercase; }

/* рубрика на карточке — яркая, как кнопки и облако тегов */
.card .item-meta .pais {
  color: #FF4F4F;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.item-title {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 1.9rem;
  line-height: 1.05;
  margin: 0 0 0.5rem;
}

.item-title a {
  color: var(--tinta);
  text-decoration: none;
  background-image: linear-gradient(var(--senal), var(--senal));
  background-repeat: no-repeat;
  background-size: 0% 3px;
  background-position: 0 100%;
  transition: background-size 0.25s ease, color 0.2s ease;
  padding-bottom: 2px;
}
.item-title a:hover { color: var(--atlantico); background-size: 100% 3px; }

.item-excerpt { margin: 0.4rem 0 0; color: var(--tinta); }

.ruta-item.sin-foto .item-title { font-size: 1.5rem; }
.ruta-item.sin-foto .item-excerpt { color: var(--granito); font-size: 1rem; }

/* ---------- статья ---------- */

.page {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 2.2rem 1.2rem 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1080px);
  justify-content: center;
  gap: 2.5rem;
}

/* статья + правый сайдбар — по ширине контейнера шапки */
.page.con-sidebar {
  max-width: 1360px;
  grid-template-columns: minmax(0, 1fr) 292px;
  justify-content: start;
  align-items: start;
}
.page-main { min-width: 0; }
@media (max-width: 1299px) {
  .page.con-sidebar { grid-template-columns: 1fr; max-width: var(--ancho); }
}

.page-head { grid-column: 1 / -1; }

.page-head .hito { position: static; display: inline-flex; vertical-align: -12px; margin-right: 0.6rem; }
.page-head .hito.punto { vertical-align: -2px; }
.page-head .item-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem; }

.page-head h1 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
  margin: 0.4rem 0 0.6rem;
}

.entry {
  font-size: 1.14rem;
}

.entry h2, .entry h3 {
  font-family: var(--f-display);
  font-weight: 600;
  line-height: 1.1;
  margin: 2.2em 0 0.5em;
  scroll-margin-top: 1rem;
}
.entry h2 { font-size: 1.85rem; text-transform: uppercase; letter-spacing: 0.02em; }
.entry h3 { font-size: 1.5rem; }

.entry p { margin: 0 0 1.1em; }

.entry a { color: var(--atlantico); }

.entry img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--linea);
}

.entry iframe {
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  border: 0;
  border-radius: 8px;
  margin: 1.4rem 0;
}


.entry figure {
  margin: 1.6rem 0;
}
.entry figure.blogger-image img { margin: 0 auto; }

.entry figcaption, .wp-caption-text {
  font-family: var(--f-mono);
  font-size: 0.74rem;
  color: var(--granito);
  padding-top: 0.4rem;
}

.entry table { border-collapse: collapse; font-size: 0.95em; }
.entry th, .entry td { border: 1px solid var(--linea); padding: 0.35em 0.7em; text-align: left; }

.entry blockquote {
  margin: 1.4em 0;
  padding-left: 1em;
  border-left: 3px solid var(--atlantico);
  color: var(--granito);
}

/* плейсхолдер недоступного фото */
.ph {
  display: block;
  border: 2px dashed var(--granito);
  border-radius: 3px;
  background: repeating-linear-gradient(45deg, transparent 0 12px, rgba(113, 118, 111, 0.06) 12px 24px);
  color: var(--granito);
  font-family: var(--f-mono);
  font-size: 0.72rem;
  text-align: center;
  padding: 2.2rem 1rem;
  margin: 1.4rem 0;
}

/* ---------- штемпель архива ---------- */

.stamp {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sello);
  border: 2px solid var(--sello);
  border-radius: 3px;
  padding: 0.3rem 0.6rem;
  transform: rotate(-1.5deg);
  opacity: 0.85;
}

/* ---------- хаб стран ---------- */

.hub-group { margin-bottom: 2.2rem; break-inside: avoid; }

/* страны в две колонки на широких экранах */
@media (min-width: 900px) {
  .hub-cols { column-count: 2; column-gap: 3rem; }
}
.hub-pais {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--tinta);
  padding-bottom: 0.2rem;
  margin: 0 0 0.7rem;
}
.hub-list { list-style: none; margin: 0; padding: 0; font-size: 1.05rem; }
.hub-list li { margin: 0 0 0.35rem; padding-left: 1.1em; text-indent: -1.1em; }
.hub-list li::before { content: "— "; color: var(--granito); }


/* ---------- подвал ---------- */

.site-footer {
  margin-top: 2rem;
  padding: 0 0 2.6rem;
}
.site-footer .inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.8rem 1.2rem 0;
  border-top: 3px solid;
  border-image: linear-gradient(90deg, var(--atlantico), var(--senal)) 1;
  font-family: var(--f-mono);
  font-size: 0.74rem;
  color: var(--granito);
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.6rem;
  align-items: center;
  justify-content: space-between;
}
.site-footer a { color: var(--granito); }

/* ---------- скроллбар в палитре блокнота ---------- */

/* WebKit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: var(--papel);
  border-left: 1px solid var(--linea);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--atlantico), var(--senal));
  border-radius: 6px;
  border: 3px solid var(--papel);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--tinta), var(--atlantico));
}
::-webkit-scrollbar-corner { background: var(--papel); }

/* Firefox и остальные — тонкий тил-скроллбар */
@supports (-moz-appearance: none) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--atlantico) var(--papel);
  }
}
