/* ==========================================================================
   Tashkent City Tour — blog components.

   Loaded AFTER /css/style.css and adds nothing but new components. It never
   overrides an existing site rule, so the header, footer, buttons and modal
   keep rendering exactly as they do on the rest of the site.

   Every value below is taken from the production stylesheet, not invented:

     page background      #3a4257      (.page / .main)
     card / raised panel  #2b3141      (.header, .review-card, .lang menu)
     footer               #262b3b
     primary (red)        #ed1a20      (.button)
     text                 #ffffff
     dark text on light   #1c1c1c / #4a4e5c
     star / accent gold   #ffc107
     grey button          #d9d9d9 -> #c9c9c9 hover
     container            75rem, padding 0 0.625rem
     header height        5.625rem   (.main has padding-top 5.5rem)
     radius               10px buttons, 20px cards
     section texture      /img/bg-section.png
     transition           0.35s ease
     breakpoints          63.75rem / 62rem / 48rem / 35rem
   ========================================================================== */

/* --------------------------------------------------------------- hub hero */

.blog-hero {
  padding: 2rem 0 1.5rem;
}

/* The hub H1 scale of the PHP pages: 1.875rem on a phone, 2.5rem from 769 px, as
   /tashkent/, /tours/, /rent/ and the locations. A fluid clamp here made the blog
   the one hub at 44 px. */
.blog-hero__title {
  font-size: 1.875rem;
  font-weight: 600;
  line-height: 1.2;
  color: #ffffff;
  margin: 1rem 0 0.75rem;
}

.blog-hero__lead {
  max-width: 44rem;
  font-size: 1.125rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
}

.blog-hero__back {
  display: inline-flex;
  margin-top: 1.5rem;
  justify-content: center;
}

.blog-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.blog-hero__actions .button {
  text-decoration: none;
}

/* Red on the page background is too faint for a word that has to be read. */
.blog-hero__actions .button--ghost {
  color: #ffffff;
}

/* ---------------------------------------------------------- category tabs */

.blog-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.blog-filter__item {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background-color: #2b3141;
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    background-color 0.35s ease,
    border-color 0.35s ease,
    color 0.35s ease;
}

.blog-filter__item:hover,
.blog-filter__item:focus-visible {
  border-color: #ed1a20;
  color: #ed1a20;
}

.blog-filter__item--active {
  background-color: #ed1a20;
  border-color: #ed1a20;
  color: #ffffff;
}

.blog-filter__item--active:hover,
.blog-filter__item--active:focus-visible {
  color: #ffffff;
}

/* ------------------------------------------------------------- card grid */

.blog-list {
  padding: 0 0 4rem;
}

.blog-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background-color: #2b3141;
  border-radius: 20px;
  overflow: hidden;
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.blog-card:hover,
.blog-card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 1rem 2rem rgba(12, 16, 29, 0.35);
}

.blog-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #343b4f;
}

.blog-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.blog-card:hover .blog-card__image {
  transform: scale(1.04);
}

.blog-card__image--placeholder {
  background:
    linear-gradient(135deg, #343b4f 0%, #2b3141 100%);
}

.blog-card__badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.3125rem 0.625rem;
  border-radius: 10px;
  background-color: rgba(237, 26, 32, 0.92);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
}

.blog-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 1.25rem;
  flex: 1;
}

.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.55);
}

.blog-card__dot {
  color: rgba(255, 255, 255, 0.3);
}

.blog-card__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
}

.blog-card__title a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.35s ease;
}

.blog-card__title a:hover,
.blog-card__title a:focus-visible {
  color: #ed1a20;
}

/* ТЗ: сниппет ровно в 2 строки */
.blog-card__excerpt {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__more {
  margin-top: auto;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #ed1a20;
}

/* It is a link now — it used to be a <span> that looked like one. */
a.blog-card__more {
  align-self: flex-start;
  /* A tap target, not a word: WCAG 2.2 asks for 24×24 CSS px. */
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  text-decoration: none;
  transition: color 0.35s ease;
}

a.blog-card__more:hover {
  color: #ffffff;
}

.blog-empty {
  padding: 3rem 0;
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.7);
}

/* ------------------------------------------------------------- pagination */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 3rem;
}

.pagination__item,
.pagination__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.875rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background-color: #2b3141;
  color: #ffffff;
  font-weight: 500;
  text-decoration: none;
  transition:
    background-color 0.35s ease,
    border-color 0.35s ease,
    color 0.35s ease;
}

.pagination__item:hover,
.pagination__item:focus-visible,
.pagination__arrow:hover,
.pagination__arrow:focus-visible {
  border-color: #ed1a20;
  color: #ed1a20;
}

.pagination__item--active {
  background-color: #ed1a20;
  border-color: #ed1a20;
  color: #ffffff;
  cursor: default;
}

.pagination__item--active:hover {
  color: #ffffff;
}

.pagination__gap {
  color: rgba(255, 255, 255, 0.4);
  padding: 0 0.25rem;
}

/* ============================================================ article page */

/* ТЗ: hero 1920x1080 с затемнением overlay 30% */
.post-hero {
  position: relative;
  padding: 3rem 0 2.5rem;
  background-color: #2b3141;
}

.post-hero--image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 3.5rem 0 2.5rem;
}

.post-hero__overlay {
  display: none;
}

.post-hero--image .post-hero__overlay {
  display: block;
  position: absolute;
  inset: 0;
  /* 30% overlay, deepened at the bottom so the H1 always has contrast */
  background:
    linear-gradient(
      180deg,
      rgba(43, 49, 65, 0.3) 0%,
      rgba(43, 49, 65, 0.55) 55%,
      rgba(58, 66, 87, 0.92) 100%
    );
}

.post-hero .container {
  position: relative;
  z-index: 1;
}

.post-hero__inner {
  max-width: 52rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-hero__badge {
  align-self: flex-start;
  padding: 0.375rem 0.75rem;
  border-radius: 10px;
  background-color: #ed1a20;
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
}

.post-hero__badge:hover,
.post-hero__badge:focus-visible {
  text-decoration: underline;
}

.post-hero__title {
  margin: 0;
  font-size: clamp(1.75rem, 3vw + 1rem, 3rem);
  font-weight: 600;
  line-height: 1.2;
  color: #ffffff;
}

.post-hero__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.7);
}

.post-hero__dot {
  color: rgba(255, 255, 255, 0.35);
}

/* ------------------------------------------------- body: 2 columns (ТЗ §2) */

/* Full width at the top, as the site's own .about-overview lays the texture
   over a tall block. `cover` stretched the 1200×722 picture over the height of
   the whole article, 4–5 times its size against 1.6 on the home page sections,
   and its lines turned into wide blurred bands behind the text.
   Laid once, the picture ends in the middle of a long article, and its edge was
   a hard line across the text; the first layer fades its lower half into the
   page colour. 60.2vw is the picture's height at full width (722/1200): a
   percentage height would be a share of the article, not of the picture. */
.post-body {
  padding: 2rem 0 3rem;
  background-image:
    linear-gradient(rgba(58, 66, 87, 0) 50%, #3a4257),
    url("/img/bg-section.png");
  background-repeat: no-repeat;
  background-position: top center;
  background-size: 100% 60.2vw, 100% auto;
}

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

/* ------------------------------------------------------- article typography */

.post-content {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.88);
}

.post-content > * + * {
  margin-top: 1.25rem;
}

.post-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  color: #ffffff;
  margin-top: 2.5rem;
}

.post-content h3 {
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.35;
  color: #ffffff;
  margin-top: 2rem;
}

/* The resets below are wrapped in :where() so they weigh as much as a bare
   tag. Written as `.post-content p` they outranked the flow rule above
   (0,1,1 against 0,1,0) and every paragraph, quote and figure lost its top
   margin: articles read as one block of text, a heading stuck to its
   paragraph. Now the flow rule spaces them, and the reset only removes the
   browser's own margins (a <p> inside a list item or a quote stays at 0). */
:where(.post-content) p {
  margin: 0;
}

/* A heading belongs to the text under it: closer to it than to the text above. */
.post-content h2 + *,
.post-content h3 + * {
  margin-top: 0.75rem;
}

.post-content a {
  color: #ed1a20;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content a:hover,
.post-content a:focus-visible {
  text-decoration: none;
}

.post-content ul,
.post-content ol {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-content ul {
  list-style: none;
  padding-left: 0;
}

.post-content ul li {
  position: relative;
  padding-left: 1.5rem;
}

.post-content ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6875rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: #ed1a20;
}

:where(.post-content) blockquote {
  margin: 0;
}

.post-content blockquote {
  padding: 1.25rem 1.5rem;
  border-left: 3px solid #ed1a20;
  border-radius: 0 10px 10px 0;
  background-color: #2b3141;
  color: #ffffff;
  font-size: 1.0625rem;
}

.post-content img,
.post-content video,
.post-content iframe {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 20px;
}

:where(.post-content) figure {
  margin: 0;
}

/* 0.6, not 0.55: 4.3:1 on the page colour, below AA for 14 px text. */
.post-content figcaption {
  margin-top: 0.625rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.post-content th,
.post-content td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
}

.post-content th {
  font-weight: 600;
  color: #ffffff;
}

/* Wide content must scroll inside itself, never the page. */
.post-content .table-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

/* The scroll used to have no sign at all: a phone's scrollbar is 0 px until
   touched, so a table simply ended mid-word at the edge of the screen. blog.js
   puts the scroller into .table-wrap and says which edges still hide columns;
   a fade on that edge and a line above the table say the rest is to the side. */
.post-content .table-wrap {
  position: relative;
}

.post-content .table-wrap::before,
.post-content .table-wrap::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 2.5rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

/* Below the hint line, so the words of the hint are never faded. */
.post-content .table-wrap::before {
  top: 1.75rem;
  left: 0;
  background: linear-gradient(to left, rgba(58, 66, 87, 0), #3a4257);
}

.post-content .table-wrap::after {
  top: 1.75rem;
  right: 0;
  background: linear-gradient(to right, rgba(58, 66, 87, 0), #3a4257);
}

.post-content .table-wrap--more-start::before,
.post-content .table-wrap--more-end::after {
  opacity: 1;
}

.post-content .table-wrap__hint {
  display: none;
  height: 1.75rem;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.post-content .table-wrap--scrolls .table-wrap__hint {
  display: block;
}

.post-content .table-scroll:focus-visible {
  outline: 2px solid #ed1a20;
  outline-offset: 2px;
}

/* Phones: a column as wide as its text needs, up to most of the screen. At
   width:100% a long column was squeezed to ~110 px, two words a line, and a
   three-row table stood 1 200 px tall. Wider than the screen it scrolls, which
   is said above; no column is wider than the screen, so a line is never cut. */
@media (max-width: 35rem) {
  .post-content table {
    width: max-content;
    min-width: 100%;
  }

  .post-content th,
  .post-content td {
    min-width: 6rem;
    max-width: min(15rem, 72vw);
  }
}

/* ------------------------------------------------ info panel (right column) */

.post-aside {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: static;
  top: auto; /* header 5.625rem + breathing room */
}

.post-aside__card,
.post-aside__share {
  background-color: #2b3141;
  border-radius: 20px;
  padding: 1.5rem;
}

/* 0.6: at 0.5 a 13 px label on the panel came out at 4.49:1, just under AA. */
.post-aside__label {
  margin: 0;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.6);
}

.post-aside__value {
  margin: 0.25rem 0 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
}

.post-aside__value:last-of-type {
  margin-bottom: 1.5rem;
}

.post-aside__buy {
  width: 100%;
  justify-content: center;
}

.post-share {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.post-share__link {
  display: inline-flex;
  align-items: center;
  padding: 0.4375rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 0.8125rem;
  text-decoration: none;
  transition:
    border-color 0.35s ease,
    color 0.35s ease;
}

.post-share__link:hover,
.post-share__link:focus-visible {
  border-color: #ed1a20;
  color: #ed1a20;
}

/* ---------------------------------------------------------------- CTA block */

.blog-cta {
  padding: 0 0 4rem;
}

.blog-cta__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.5rem;
  border-radius: 20px;
  background-color: #2b3141;
}

.blog-cta__title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff;
}

.blog-cta__lead {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  max-width: 34rem;
}

.blog-cta__button {
  flex-shrink: 0;
  justify-content: center;
}

/* --------------------------------------------- request modal and its contacts
   Here and not in rent.css: the same modal (views/partials/lead-modal.php) is on
   the tour hub, which does not load rent.css, and there the thanks came out in the
   colour of an error, and an invalid field was not marked at all.

   Scoped to [data-modal="rent"] rather than .modal-request__form: that class also
   exists on cooperation.html and prices.html, and a rule that can reach them is
   exactly what fidelity_check.py refuses to allow. */
[data-modal="rent"] .is-invalid {
  border-color: #ed1a20;
  background-color: rgba(237, 26, 32, 0.06);
}

/* The green of the site's own request window: 4.6:1 on its grey, where the
   green of the dark tour form was 2:1. */
[data-modal="rent"] .modal-request__message.is-ok {
  color: #15803d;
}

/* Phones next to a lead form, views/partials/lead-contacts.php. */
.lead-contacts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  margin: 1rem 0 0;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.72);
}

.lead-contacts__link {
  color: #ffffff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color 0.35s ease;
}

.lead-contacts__link:hover,
.lead-contacts__link:focus-visible {
  color: #ed1a20;
}

[data-modal="rent"] .lead-contacts {
  justify-content: center;
  color: #4a4e5c;
}

[data-modal="rent"] .lead-contacts__link {
  color: #1c1c1c;
}

[data-modal="rent"] .lead-contacts__link:hover,
[data-modal="rent"] .lead-contacts__link:focus-visible {
  color: #ed1a20;
}

@media (max-width: 48rem) {
  .lead-contacts__link {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
  }
}

/* ------------------------------------------------------- related carousel */

.post-related {
  padding: 0 0 4rem;
}

.post-related__title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 1.5rem;
}

.post-related__track {
  display: flex;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.blog-card--compact .blog-card__body {
  padding: 1rem 1.25rem 1.25rem;
}

.blog-card--compact .blog-card__title {
  font-size: 1rem;
}

/* ==========================================================================
   Responsive — same breakpoints the production stylesheet already uses.
   ========================================================================== */



/* Осталось max-width: у этих свойств нет базового значения,
   и «вернуть как было» на широком экране было бы догадкой. */
@media (max-width: 63.75rem) {
  .post-aside__card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem 1.5rem;
  }

  .post-aside__buy {
    grid-column: 1 / -1;
    margin-top: 0.75rem;
  }
}







/* Осталось max-width: у этих свойств нет базового значения,
   и «вернуть как было» на широком экране было бы догадкой. */
@media (max-width: 48rem) {
  .blog-cta__inner {
    flex-direction: column;
  }

  .blog-cta__button {
    width: 100%;
  }

  .post-related__track {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
  }

  .post-related__track .blog-card {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }
}




/* Осталось max-width: у этих свойств нет базового значения,
   и «вернуть как было» на широком экране было бы догадкой. */
@media (max-width: 35rem) {
  .post-aside__card {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-related__track .blog-card {
    flex-basis: 86%;
  }

  .blog-filter {
    /* Keep the tabs on one scrollable row instead of a tall stack. */
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.375rem;
  }

  .blog-filter__item {
    flex: 0 0 auto;
    min-height: 2.75rem;
  }

  .post-share__link {
    min-height: 2.75rem;
  }

  /* 44px under a thumb. The negative margin takes it back from the card's own
     padding, so the card stays the height it was. */
  a.blog-card__more {
    min-height: 2.75rem;
    margin-bottom: -0.625rem;
  }
}


/* Respect the user's motion preference. */
@media (prefers-reduced-motion: reduce) {
  .blog-card,
  .blog-card__image {
    transition: none;
  }

  .blog-card:hover {
    transform: none;
  }

  .blog-card:hover .blog-card__image {
    transform: none;
  }
}

/* 35.0625rem — точное дополнение к 35rem, которым пользуется
   этот же файл до перестановки: нет ширины, где сработали бы
   оба правила или ни одного. */
@media (min-width: 35.0625rem) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-related__track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-content {
    font-size: 1.0625rem;
  }
}

/* 48.0625rem — точное дополнение к 48rem, которым пользуется
   этот же файл до перестановки: нет ширины, где сработали бы
   оба правила или ни одного. */
@media (min-width: 48.0625rem) {
  .blog-hero {
    padding: 3rem 0 2rem;
  }

  .blog-hero__title {
    font-size: 2.5rem;
  }

  .post-hero--image {
    padding: 5rem 0 3.5rem;
  }

  .post-body {
    padding: 3rem 0 4rem;
  }

  .blog-cta__inner {
    align-items: center;
    padding: 2rem;
  }

  .post-related__track {
    display: grid;
    gap: 1.5rem;
  }
}

/* 62.0625rem — точное дополнение к 62rem, которым пользуется
   этот же файл до перестановки: нет ширины, где сработали бы
   оба правила или ни одного. */
@media (min-width: 62.0625rem) {
  .blog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .post-related__track {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 63.8125rem — точное дополнение к 63.75rem, которым пользуется
   этот же файл до перестановки: нет ширины, где сработали бы
   оба правила или ни одного. */
@media (min-width: 63.8125rem) {
  .post-layout {
    grid-template-columns: minmax(0, 1fr) 20rem;
    gap: 2.5rem;
  }

  .post-aside {
    position: sticky;
    top: 7rem;
  }
}
