/* WayToHome — directions.css */

/* =====================
   Directions (Home)
   Match approved mockup layout
   ===================== */

/* Відступ до сітки карток — margin-top у col (4rem) */

.waytohome-direction{
  display: flex;
  flex-direction: column;
  height: 100%;
}

.waytohome-direction__actions a.waytohome-btn{
  position: relative;
  z-index: 2;
}

.waytohome-direction__actions .waytohome-btn:not(a){
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.waytohome-direction__title{
  font-size: 32px;
  line-height: 37.5px;
  font-weight: 700;
  margin: 0;
  color: var(--waytohome-text);
}

.waytohome-direction__label-en{
  margin-top: 20px;
  font-size: 22px;
  line-height: 25.78px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--waytohome-label-muted);
}

.waytohome-direction__excerpt{
  margin-top: 18px;
  font-size: 18px;
  line-height: 30px;
  color: var(--waytohome-text-muted);
  max-width: none;
}

/* Figma «Головна» / Frame 21 → Frame 7: 40px pills, 18px label, 20px gap */
.waytohome-direction__actions{
  margin-top: 20px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.waytohome-directions .waytohome-direction__actions .waytohome-btn{
  box-sizing: border-box;
  min-height: 40px;
  height: 40px;
  padding: 0 20px;
  font-size: 18px;
  line-height: 21px;
  font-weight: 700;
  border-radius: 32px;
}

/* Keep links in directions area neutral (override global .site-content link color). */
.waytohome-directions .waytohome-section-head__tagline a,
.waytohome-directions .waytohome-section-head__tagline a:hover,
.waytohome-directions .waytohome-section-head__tagline a:focus-visible,
.waytohome-directions .waytohome-direction__label-en a,
.waytohome-directions .waytohome-direction__label-en a:hover,
.waytohome-directions .waytohome-direction__label-en a:focus-visible,
.waytohome-directions .waytohome-direction__excerpt a,
.waytohome-directions .waytohome-direction__excerpt a:hover,
.waytohome-directions .waytohome-direction__excerpt a:focus-visible{
  color: inherit;
}

/* Напрямки: без padding у шапки; h2 без margin-bottom (відступ до сітки — margin-top колонок) */
.waytohome-directions .waytohome-section-head{
  padding-top: 0;
  padding-bottom: 0;
}
.waytohome-directions .waytohome-section-head .waytohome-section-head__title,
.waytohome-directions .waytohome-section-head h2.waytohome-h2--section{
  margin-bottom: 0;
}
/* Сітка карток — відступ зверху у кожної колонки (як у макеті) */
.waytohome-directions-grid{
  --bs-gutter-x: 1.25rem;
  --bs-gutter-y: 0;
}
.waytohome-directions-grid > [class*="col-"]{
  margin-top: 4rem;
}

/* Title link must not inherit global accent-link style. */
.waytohome-directions .waytohome-direction__title a{
  color: var(--waytohome-text);
  text-decoration: none;
  font: inherit;
}
.waytohome-directions .waytohome-direction__title a:hover{
  color: var(--waytohome-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 991.98px){
  .waytohome-directions .waytohome-section-head h2.waytohome-h2--section{
    margin-bottom: 0;
  }
  .waytohome-section-head--split-wide .waytohome-section-head__tagline{
    font-size: 16px;
    line-height: 1.45;
  }
  .waytohome-direction__title{
    font-size: 26px;
    line-height: 1.2;
  }
  .waytohome-direction__label-en{
    margin-top: 12px;
    font-size: 18px;
    line-height: 1.25;
  }
  .waytohome-direction__excerpt{
    margin-top: 12px;
    font-size: 16px;
    line-height: 1.55;
  }
  .waytohome-direction__actions{
    margin-top: 16px;
  }
}

/* =====================
   Direction landing page
   ===================== */

body.waytohome-page-direction-single .site-content{
  max-width: none;
}

.waytohome-direction-hero,
.waytohome-direction-programs,
.waytohome-direction-useful,
.waytohome-direction-page__extra{
  padding-block: var(--waytohome-page-padding-y, 3.5rem);
}

/* Карусель історій — без padding-block: вертикальний ритм через gap у .site-content */
.waytohome-direction-stories{
  padding: 0;
}

.waytohome-directions-page > .waytohome-direction-stories{
  margin-top: var(--waytohome-home-section-spacing);
}

.waytohome-direction-hero__grid{
  display: grid;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 992px){
  .waytohome-direction-hero__grid{
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 3rem;
  }
}

@media (max-width: 991.98px){
  .waytohome-direction-hero__grid{
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2rem;
  }
  .waytohome-direction-hero__content{
    display: contents;
  }
  .waytohome-direction-hero__content > .waytohome-section-head{
    order: 1;
    width: 100%;
  }
  .waytohome-direction-hero__media{
    order: 2;
    width: 100%;
    align-self: stretch;
  }
  .waytohome-direction-hero__media .waytohome-gallery-carousel{
    width: 100%;
  }
  .waytohome-direction-hero__text{
    order: 3;
    margin-top: 0;
    width: 100%;
    max-width: none;
  }
  .waytohome-direction-hero__actions{
    order: 4;
    margin-top: 0;
    width: 100%;
  }
  .waytohome-direction-hero__media .waytohome-gallery-carousel__frame{
    min-height: var(--waytohome-gallery-hero-frame-height-sm);
    height: var(--waytohome-gallery-hero-frame-height-sm);
    border-radius: var(--waytohome-gallery-hero-frame-radius-sm);
  }
  .waytohome-direction-hero__media .waytohome-gallery-carousel__controls{
    margin-top: 20px;
  }
}

.waytohome-direction-hero__text{
  margin-top: 1.25rem;
  font-size: 18px;
  line-height: 1.65;
  color: var(--waytohome-text-muted);
  max-width: 42rem;
}

.waytohome-direction-hero__actions{
  margin-top: 1.75rem;
}

.waytohome-direction-hero__media{
  min-width: 0;
}

.waytohome-direction-hero__media .waytohome-gallery-carousel__frame{
  min-height: 360px;
  height: 360px;
}

@media (min-width: 992px){
  .waytohome-direction-hero__media .waytohome-gallery-carousel__frame{
    min-height: 420px;
    height: 420px;
  }
}

.waytohome-direction-hero__media .waytohome-gallery-carousel__frame:has(> span:only-child){
  background: var(--waytohome-surface-card-media);
  border-color: var(--waytohome-border-muted);
}

.waytohome-direction-programs__body{
  margin-top: 1.5rem;
  font-size: 22px;
  line-height: 1.4;
  color: var(--waytohome-text);
  column-count: 1;
  column-gap: 2rem;
}

@media (min-width: 992px){
  .waytohome-direction-programs__body{
    column-count: 2;
  }
}

.waytohome-direction-programs__body ul{
  margin: 0;
  padding: 0;
  list-style: none;
}

.waytohome-direction-programs__body li{
  display: flex;
  gap: 13px;
  align-items: flex-start;
  break-inside: avoid;
  margin-bottom: 1rem;
}

.waytohome-direction-programs__body li::before{
  content: "";
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 5px;
  border-radius: 50%;
  background-color: var(--waytohome-header-border);
}

/* Історії успіху — Figma Group 54 / Frame 83 */
.waytohome-direction-stories__rail{
  margin-top: var(--waytohome-about-title-to-content-gap, 2rem);
  width: 100%;
}

@media (min-width: 992px){
  .waytohome-direction-stories__rail{
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    overflow-x: clip;
  }
}

.waytohome-direction-stories-carousel{
  --waytohome-direction-stories-slide-width: calc(100vw - 3rem);
  --waytohome-direction-stories-slide-gap: 24px;
  width: 100%;
}

@media (min-width: 992px){
  .waytohome-direction-stories-carousel{
    --waytohome-direction-stories-slide-width: min(960px, calc(100vw - 3rem));
  }
}

@media (min-width: 1200px){
  .waytohome-direction-stories-carousel{
    --waytohome-direction-stories-slide-width: min(1140px, calc(100vw - 3rem));
  }
}

@media (min-width: 1400px){
  .waytohome-direction-stories-carousel{
    --waytohome-direction-stories-slide-width: min(1320px, calc(100vw - 3rem));
  }
}

.waytohome-direction-stories-track{
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  cursor: grab;
}

.waytohome-direction-stories-track--hydrating,
.waytohome-direction-stories-track--dragging,
.waytohome-direction-stories-track--interacting{
  scroll-behavior: auto;
  scroll-snap-type: none;
}

.waytohome-direction-stories-track--dragging{
  cursor: grabbing;
  user-select: none;
}

.waytohome-direction-stories-track::-webkit-scrollbar{
  display: none;
}

.waytohome-direction-stories-track__inner{
  display: flex;
  align-items: flex-start;
  gap: var(--waytohome-direction-stories-slide-gap);
  padding-inline: max(1.5rem, calc((100vw - var(--waytohome-direction-stories-slide-width)) / 2));
  box-sizing: border-box;
}

.waytohome-direction-stories-track__slide{
  flex: 0 0 var(--waytohome-direction-stories-slide-width);
  min-width: 0;
}

.waytohome-direction-stories-track__slide[data-direction-stories-clone] > *{
  user-select: none;
}

.waytohome-direction-stories-carousel .waytohome-gallery-carousel__controls{
  margin-top: 40px;
}

.waytohome-direction-story-card{
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 20px;
  column-gap: 0;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 20px;
  min-height: 0;
  background: var(--waytohome-doc-download-surface);
  border: 1px solid var(--waytohome-header-border);
  border-radius: var(--waytohome-doc-download-radius);
  overflow: hidden;
}

/* stretched-link — лише для a11y/SEO; кліки й drag йдуть на трек каруселі */
.waytohome-direction-story-card > .stretched-link{
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.waytohome-direction-story-card__media,
.waytohome-direction-story-card__body{
  pointer-events: none;
}

/* Figma Frame 51: фото 511×502, cornerRadius 20 */
.waytohome-direction-story-card__media{
  position: relative;
  min-height: min(72vw, 320px);
  margin: 0;
  padding: 0;
  background: var(--waytohome-surface-card-media);
  border-radius: 20px;
  overflow: hidden;
}

.waytohome-direction-story-card__img,
.waytohome-direction-story-card__placeholder{
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border-radius: 20px;
  object-fit: cover;
  object-position: center;
  -webkit-user-drag: none;
  user-select: none;
}

.waytohome-direction-story-card__placeholder{
  background: var(--waytohome-surface-card-media);
}

.waytohome-direction-story-card__body{
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0;
  min-width: 0;
}

/* Figma Frame 54: заголовок — текст, не посилання; 46px / #000 */
.waytohome-direction-story-card__title{
  margin: 0;
  font-size: clamp(28px, 4.2vw, var(--waytohome-h2-section-size));
  line-height: var(--waytohome-h2-section-line-height);
  font-weight: var(--waytohome-h2-section-weight);
  color: var(--waytohome-text);
}

/* Story card meta row: label on left, stats on right */
.waytohome-direction-story-card__meta-row{
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5em 1em;
  font-size: 18px;
  line-height: 1.3;
  color: var(--waytohome-link);
}

/* Direction English label (e.g. "Child PROTECTION") — link color */
.waytohome-direction-story-card__label{
  color: var(--waytohome-link);
}

/* Story card stats row: views + likes */
.waytohome-direction-story-card__stats{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1em;
  color: var(--waytohome-link);
}

.waytohome-direction-story-card__stat{
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  color: var(--waytohome-link);
  text-decoration: none;
}

.waytohome-direction-story-card__stat i{
  font-size: 1.25em;
  color: var(--waytohome-link);
}

.waytohome-direction-story-card__stat--likes.is-liked i{
  color: #e74c3c;
}

/* Figma: excerpt — 18px, #727272 */
.waytohome-direction-story-card__excerpt{
  font-size: 18px;
  line-height: 25.2px;
  font-weight: 400;
  color: var(--waytohome-text-muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
}

/* Figma Frame 5: outline pill 131×40, radius 80px, #6c6c6c */
.waytohome-direction-story-card__cta.waytohome-btn{
  align-self: flex-start;
  box-sizing: border-box;
  min-width: 131px;
  height: 40px;
  margin: 0;
  padding: 0 20px;
  border-radius: 80px;
  border: 1px solid #6c6c6c;
  background: transparent;
  font-size: 16px;
  line-height: 18.75px;
  font-weight: 700;
  color: #6c6c6c;
  text-decoration: none;
}

.waytohome-direction-story-card__cta.waytohome-btn{
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

@media (max-width: 991.98px){
  .waytohome-direction-story-card{
    padding: 0;
    row-gap: 0;
  }

  .waytohome-direction-story-card__media{
    border-radius: 0;
  }

  .waytohome-direction-story-card__img,
  .waytohome-direction-story-card__placeholder{
    border-radius: 0;
  }

  .waytohome-direction-story-card__body{
    padding: 20px;
  }
}

@media (min-width: 992px){
  .waytohome-direction-story-card{
    grid-template-columns: minmax(0, 511fr) minmax(0, 530fr);
    align-items: start;
    row-gap: 0;
    column-gap: 59px;
    padding: 30px 28px 30px 30px;
    min-height: 0;
  }

  .waytohome-direction-story-card__media{
    min-height: 502px;
    height: 502px;
    border-radius: 20px;
  }

  .waytohome-direction-story-card__title{
    font-size: var(--waytohome-h2-section-size);
    line-height: var(--waytohome-h2-section-line-height);
  }

  .waytohome-direction-story-card__body{
    gap: 20px;
    padding: 7px 0 0;
    justify-content: flex-start;
  }
}

/* Корисна інформація: як блоки документів на «Про нас» — 1fr/1fr + gap з about-layout (Figma ~50/50) */
.waytohome-direction-useful__inner{
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: clamp(32px, 4.5vw, 64px);
  row-gap: 32px;
}

.waytohome-direction-useful__inner--content-only{
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 992px){
  .waytohome-direction-useful__inner{
    align-items: center;
  }

  .waytohome-direction-useful__content,
  .waytohome-direction-useful__downloads{
    align-self: center;
    width: 100%;
  }
}

@media (max-width: 991.98px){
  .waytohome-direction-useful__inner{
    grid-template-columns: 1fr;
    row-gap: 28px;
  }
}

.waytohome-direction-useful__content{
  min-width: 0;
}

.waytohome-direction-useful__intro{
  margin-top: 1rem;
  font-size: 18px;
  line-height: 1.6;
  color: var(--waytohome-text-muted);
  max-width: none;
}

.waytohome-direction-useful__intro.entry-content p:last-child{
  margin-bottom: 0;
}

.waytohome-direction-useful__downloads{
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  min-width: 0;
  justify-self: stretch;
}

.waytohome-direction-useful__pdfs,
.waytohome-direction-useful__links{
  width: 100%;
  max-width: 580px;
}

.waytohome-direction-useful__links{
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.waytohome-direction-resource{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--waytohome-border, #d8e3dd);
  border-radius: 16px;
  background: var(--waytohome-surface-card, #fff);
}

.waytohome-direction-resource__label{
  font-size: 16px;
  line-height: 1.4;
  color: var(--waytohome-text);
}

.waytohome-direction-empty{
  padding-block: var(--waytohome-page-padding-y, 3.5rem);
}

.waytohome-direction-empty__notice{
  margin: 0;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
}

.waytohome-direction-empty__title{
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.waytohome-direction-empty__text{
  margin: 0 0 1rem;
}

.waytohome-direction-empty__actions{
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}



