/* ============================================================================
   НАПРЯМОК (#1370) — сторінка напрямку і сторінки його послуг.
   Вигляд: ліворуч вертикальний список послуг, праворуч контент.
   Використовується ТІЛЬКИ на сторінках з класом .dir-section — чинні 5 розділів
   послуг лишаються плиткою карток і цим файлом не зачіпаються.
   ========================================================================== */

.dir-layout {
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

/* Ліва колонка. Якщо список порожній — publisher нічого не рендерить між
   маркерами, .dir-aside у розмітці немає і flex сам віддає всю ширину контенту
   (дірки в макеті не лишається). */
.dir-aside {
  flex: 0 0 300px;
  max-width: 300px;
  position: sticky;
  top: 24px;
  background: var(--white, #fff);
  border: 1px solid rgba(30, 42, 58, .10);
  border-radius: var(--radius, 12px);
  box-shadow: 0 2px 6px rgba(22, 32, 44, .06);
  overflow: hidden;
}

/* Кнопка-акордеон — тільки для мобільного (на десктопі схована). */
.dir-aside-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy, #1e2a3a);
  text-align: left;
}

.dir-aside-toggle svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  transition: transform .2s ease;
}

.dir-aside.is-open .dir-aside-toggle svg { transform: rotate(180deg); }

.dir-list { display: block; }

.dir-list-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(30, 42, 58, .07);
  color: var(--navy, #1e2a3a);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.dir-list-item:last-child { border-bottom: none; }

.dir-list-item:hover { background: var(--primary-light, #fdede2); }

/* Поточна послуга — підсвічена смужкою зліва. */
.dir-list-item.is-current {
  background: var(--primary-light, #fdede2);
  box-shadow: inset 3px 0 0 var(--primary, #e8792b);
}

.dir-list-title {
  display: block;
  font-weight: 600;
  line-height: 1.3;
  /* довга назва переноситься, колонку не ламає */
  overflow-wrap: anywhere;
}

/* Короткий підпис — один рядок, задовгий обрізається трикрапкою. */
.dir-list-note {
  display: block;
  margin-top: 3px;
  font-size: .82rem;
  line-height: 1.35;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dir-main {
  flex: 1 1 420px;
  min-width: 0;
}

/* Шапка напрямку/послуги всередині правої колонки — в один стовпчик:
   місця тут менше, ніж у повноширинному hero. */
.dir-main .hero-content {
  display: block;
}

.dir-main .hero-content .hero-image {
  margin-top: 20px;
  max-width: 100%;
}

.dir-main .hero-content .hero-image img {
  max-width: 100%;
  height: auto;
}

.dir-pricing { margin-top: 32px; }
.dir-pricing h2 { margin-bottom: 16px; }
.dir-gallery { margin-top: 32px; }
.dir-gallery .gallery-grid:empty { display: none; }

/* --- Блок заявки/дзвінка (є на КОЖНІЙ сторінці напрямку) --- */
.dir-cta-section { background: var(--navy, #1e2a3a); color: #fff; }

.dir-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
}

.dir-cta-text h2 { color: #fff; margin-bottom: 12px; }
.dir-cta-text p { color: rgba(255, 255, 255, .78); margin-bottom: 20px; }
.dir-cta-phone { display: inline-flex; align-items: center; gap: 8px; }

.dir-cta-form {
  background: var(--white, #fff);
  border-radius: var(--radius, 12px);
  padding: 24px;
  box-shadow: var(--shadow-lg, 0 10px 15px rgba(0, 0, 0, .1));
}

.dir-cta-form .form-group label { color: var(--navy, #1e2a3a); }

/* --- Мобільний: список згортається у блок над контентом --- */
@media (max-width: 900px) {
  .dir-layout { display: block; }

  .dir-aside {
    position: static;
    flex: none;
    max-width: none;
    width: 100%;
    margin-bottom: 20px;
  }

  /* Кнопку і згортання вмикає JS (клас js-collapsible). Якщо скрипт не завантажився —
     список просто лишається розкритим, а не стає недоступним. */
  .dir-aside.js-collapsible .dir-aside-toggle { display: flex; }
  .dir-aside.js-collapsible .dir-list { display: none; }
  .dir-aside.js-collapsible.is-open .dir-list { display: block; }

  .dir-main { width: 100%; }

  .dir-cta { grid-template-columns: 1fr; }
}

/* ============================================================================
   Заглушка фото в картці послуги (.sc-media без <img>)
   Портал підставляє фото між маркерами SUBCARD_IMG. Поки фото немає — картка
   не має виглядати порожньою дірою, тому місце під фото займає напис W-Garage.
   ============================================================================ */
.sc-media-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--gray-100, #f1f5f9) 0%, var(--gray-200, #e2e8f0) 100%);
  border-radius: var(--radius-sm, 8px);
  font: 800 18px/1 'Saira', 'Inter', sans-serif;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400, #94a3b8);
  user-select: none;
  pointer-events: none;
}
