/* ===== TripTea — Корисні статті block ====================================
   Figma desktop node: 710:42528 (1920 - Main)   →  section 1920×792
   Figma mobile  node: 744:49520 (390  - main)   →  section 390×754
*/

.tt-articles {
  position: relative;
  /* Same gradient as Figma fill_MIVVJI — cream → white. Sits visually next
     to tt_youtube (white above) and the footer (white below). */
  background: linear-gradient(0deg, #FAF7F2 0%, #FFFFFF 100%);
  padding: 80px 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "case", "cpsp";
  color: #2B2B2B;
  overflow: hidden; /* clip the decorative dragon watermark */
}

/* Decorative dragon watermark — Figma "image 5" (node 710:42529).
   Per Figma: x=796 y=-115 in a 1920 frame, w 958 h 1022. We anchor by the
   right edge so it stays in place across desktop widths and clips cleanly
   below tablet/mobile breakpoints.
   In Figma the layer is 100% opacity / Normal blend, but the image fill
   itself is set to 5% — that's what produces the faint sand wash. We
   replicate by setting the element opacity to 0.05. */
.tt-articles::before {
  content: "";
  position: absolute;
  top: -115px;
  right: calc(50% - 850px);  /* mirrors Figma x=796 in a 1920 viewport */
  width: 958px;
  height: 1022px;
  background-image: url('../image/articles/dragon-watermark.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

.tt-articles--breakout {
  width: 100vw;
  max-width: 100vw;
  left: 50%;
  transform: translateX(-50%);
}

.tt-articles__inner {
  width: min(1702px, 100% - 32px);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.tt-articles *, .tt-articles *::before, .tt-articles *::after { box-sizing: border-box; }

/* ===== Head ============================================================ */

.tt-articles__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 48px;
}

.tt-articles__title {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 36px;
  line-height: 120%;
  letter-spacing: 0;
  margin: 0;
  color: #4A3426;
}

.tt-articles__head-actions {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

/* Arrow buttons — same visual treatment as tt_reviews / tt_sets / tt_youtube
   (56×56 BR16, dark stroke #4A3426, transparent fill, lighter when disabled). */
.tt-articles__nav-btn {
  width: 56px;
  height: 56px;
  border: 1px solid #4A3426;
  border-radius: 16px;
  background: transparent;
  color: #4A3426;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.tt-articles__nav-btn:hover { background: #FFFFFF; }
.tt-articles__nav-btn--disabled,
.tt-articles__nav-btn:disabled {
  background: #FFFFFF;
  border-color: #F5EFE7;
  color: #E7D7C8;
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* «Всі статті» Secondary Button — Figma layout_SGZ79H + style_L4V452 */
.tt-articles__more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 24px;
  height: 56px;
  border: 1px solid #8B5E3C;
  background: transparent;
  color: #8B5E3C;
  border-radius: 16px;
  text-decoration: none;
  font-family: 'Chivo', 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 150%;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.tt-articles__more:hover,
.tt-articles__more:focus,
.tt-articles__more:active {
  background: #8B5E3C;
  color: #FFFFFF;
  text-decoration: none;
}
.tt-articles__more-icon { display: block; flex: 0 0 24px; }
.tt-articles__more--mobile { display: none; } /* mobile-only footer CTA */

/* ===== Strip =========================================================== */

.tt-articles__viewport { position: relative; }

.tt-articles__strip {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  align-items: stretch;
}
.tt-articles__strip::-webkit-scrollbar { display: none; }

.tt-articles__strip > .tt-article-card {
  flex: 0 0 calc((100% - 48px) / 3);  /* 3 cards visible, 2 gaps of 24 */
  scroll-snap-align: start;
}

/* ===== Card ============================================================ */

.tt-article-card {
  display: flex;
  flex-direction: column;
  /* Figma desktop: strip h=528 (= section 792 − 160 padding − 56 head − 48 gap),
     all cards alignSelf: stretch. Use min-height so longer content can still
     expand the card without breaking the layout. */
  min-height: 528px;
  background: #FFFFFF;
  border: 1px solid #EAEAEA;
  border-radius: 24px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  font-family: 'Poppins', sans-serif;
}
.tt-article-card:hover {
  box-shadow: 0px 4px 24px 0px rgba(63, 28, 4, 0.16);
  text-decoration: none;
  color: inherit;
}

/* Image area — fixed 319 height per Figma layout_2FB9FM */
.tt-article-card__image {
  position: relative;
  flex: 0 0 319px;
  height: 319px;
  padding: 16px;
  background-color: #4A3426;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: 1px solid #EAEAEA;
  display: flex;
  align-items: flex-start;
}

/* Tag — h32 BR8 padding 4 8, color per category */
.tt-article-card__tag {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 4px 8px;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 150%;
  white-space: nowrap;
}

/* Category palettes — straight from Figma component variants (Tag set 589:8628):
   brewing  (Red)    : bg #F9F0EF, text #B56357
   dishware (Yellow) : bg #FCF6EC, text #E3B153
   culture  (Blue)   : bg #F0F4F7, text #6C8299
*/
.tt-article-card--brewing  .tt-article-card__tag { background: #F9F0EF; color: #B56357; }
.tt-article-card--dishware .tt-article-card__tag { background: #FCF6EC; color: #E3B153; }
.tt-article-card--culture  .tt-article-card__tag { background: #F0F4F7; color: #6C8299; }

/* Content area — fills remaining card height; padding 16 + gap 16 between top group and CTA */
.tt-article-card__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  gap: 16px;
}

.tt-article-card__top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tt-article-card__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6B6B6B;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 140%;
}
.tt-article-card__meta svg { flex: 0 0 16px; }

.tt-article-card__title {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 130%;
  /* Default: Primary Colors/Dark Tea. On hover lighten to Tea Brown so the
     headline visually echoes the «Читати далі» CTA colour. */
  color: #4A3426;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tt-article-card:hover .tt-article-card__title { color: #8B5E3C; }

.tt-article-card__excerpt {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 150%;
  color: #6B6B6B;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* «Читати далі» Ghost Button */
.tt-article-card__cta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.tt-article-card__read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  color: #8B5E3C;
  font-family: 'Chivo', 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 150%;
  transition: background-color 0.15s ease;
}
.tt-article-card:hover .tt-article-card__read { background: #FAF7F2; }

/* ===== Bottom bar (mobile only) ======================================== */
.tt-articles__bottom { display: none; }

/* ===== Tablet / smaller desktop (1101..1735) ============================
   Inner shrinks; cards stay 3-up but body content scales naturally. */
@media (max-width: 1735px) and (min-width: 1101px) {
  .tt-article-card__image {
    flex: 0 0 280px;
    height: 280px;
  }
  .tt-articles__more { padding: 8px 20px; }
}

/* ===== Narrow desktop / large tablet (769..1100) ========================
   2 cards visible — strip still scrolls; head arrows compact, CTA fits. */
@media (max-width: 1100px) and (min-width: 769px) {
  .tt-articles__strip > .tt-article-card {
    flex: 0 0 calc((100% - 24px) / 2);
  }
  .tt-article-card__image {
    flex: 0 0 240px;
    height: 240px;
  }
}

/* ===== Mobile (Figma 390 - main, node 744:49520) ======================= */
@media (max-width: 768px) {
  .tt-articles {
    padding: 40px 0;
  }
  .tt-articles__inner {
    width: 100%;
    padding: 0;
  }

  .tt-articles__head {
    margin: 0 0 24px;
    padding: 0 24px;
  }
  .tt-articles__title {
    /* Figma mobile uses H3 (Poppins Bold 28/120) instead of desktop H2 (ExtraBold 36/120). */
    font-weight: 700;
    font-size: 28px;
    line-height: 120%;
  }
  /* Head arrows + CTA hidden — moved to bottom bar */
  .tt-articles__head-actions { display: none; }

  /* Strip: 1 card visible + peek of next per Figma (320 main + 320 peek) */
  .tt-articles__strip {
    gap: 16px;
    padding: 0 0 8px 24px;
    scroll-padding-left: 24px;
  }
  .tt-articles__strip > .tt-article-card {
    flex: 0 0 320px;
    width: 320px;
    height: 512px;
    min-height: 512px;
  }

  /* Image area mobile: h=270 fixed (Figma) */
  .tt-article-card__image {
    flex: 0 0 270px;
    height: 270px;
  }

  /* Content area: gap 16 between top group and CTA, padding 16 */
  .tt-article-card__body {
    padding: 16px;
    gap: 16px;
  }

  /* Bottom bar: «Всі статті» 48h CTA-left + 2 arrows-right (Figma 744:49747) */
  .tt-articles__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    margin-top: 40px;
  }
  /* Mobile «Всі статті» button — 48h instead of desktop 56 */
  .tt-articles__more--mobile {
    display: inline-flex;
    height: 48px;
    padding: 8px 24px;
  }
  /* If all_url isn't set, the bottom bar still has arrows but right-aligned */
  .tt-articles__bottom-arrows {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
  }
  /* Mobile arrow buttons — 48×48 (Figma layout_XS113F) */
  .tt-articles__bottom .tt-articles__nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }
}

/* Very narrow phones (<360) — slightly smaller card so peek stays visible */
@media (max-width: 359px) {
  .tt-articles__strip > .tt-article-card {
    flex: 0 0 280px;
    width: 280px;
    height: 480px;
  }
  .tt-article-card__image {
    flex: 0 0 240px;
    height: 240px;
  }
}
