/* Карточка агентства, Т43 (#85): цена «от», описание, вкладки, похожие агентства, FAQ.
   Подключается из web/templates/agency_detail.html (head_extra) только там, где есть хоть
   один из блоков, — у остальных карточек страница прежняя. Формы — по драфту
   docs/agency_card_mockups.html и комментарию маркетинга в #58 (02.11 08:08). */

/* Цена «от» в ряду чисел: заявленная агентством — тем же весом, что слоты, без акцента. */
.agency-proof > div.agency-price b { white-space:nowrap; }
.agency-proof > div.agency-price span::first-letter { text-transform:none; }

/* Описание «о компании»: текст карточки; подписи под блоком нет (DK 07.11). На десктопе текст
   целиком, шеврона нет. */
.agency-about p.agency-about-text { margin:0 0 6px; font-size:0.95rem; color:#4a5666; line-height:1.6; }
.agency-about-more { display:none; }
.agency-about-note { margin:0; font-size:0.75rem; color:#98a2b3; }

/* Вкладки «Кейсы · Услуги и цены · Контакты» (драфт: .tabs). */
.agency-tabs {
  display:flex; gap:4px; margin:22px 0 14px; border-bottom:1px solid #e6eaf0;
  overflow-x:auto; scrollbar-width:none;
}
.agency-tabs::-webkit-scrollbar { display:none; }
.agency-tabs a {
  flex:none; padding:9px 13px; font-size:0.9rem; color:#7a8699; text-decoration:none;
  border-bottom:2px solid transparent; margin-bottom:-1px; white-space:nowrap;
}
.agency-tabs a span { color:#98a2b3; font-variant-numeric:tabular-nums; }
.agency-tabs a.on { color:#18202b; font-weight:600; border-bottom-color:#18202b; }
.agency-tabs-on .agency-tab-panel:not(.on) { display:none; }
.agency-tabs-on .agency-tab-panel > .entity-cases-head { display:none; }
.agency-tabs-on .agency-tab-panel > h2.entity-cases-title { display:none; }
.agency-prices, .agency-contacts-tab { margin:0 0 24px; }

.agency-price-table { border-collapse:collapse; width:100%; max-width:560px; font-size:0.92rem; color:#4a5666; }
.agency-price-table td { padding:9px 0; border-bottom:1px solid #eef1f5; vertical-align:top; }
.agency-price-table td.agency-price-val { text-align:right; white-space:nowrap; color:#18202b; font-weight:600; padding-left:16px; font-variant-numeric:tabular-nums; }
.agency-claimed { margin:12px 0 0; max-width:560px; font-size:0.78rem; color:#7a8699; line-height:1.5; }
.agency-claimed-pill {
  display:inline-block; margin-right:4px; padding:1px 8px; border-radius:99px;
  background:#fffbeb; border:1px solid #fde68a; color:#92400e; font-size:0.72rem; font-weight:600;
}
.agency-contacts-tab .agency-kv a { color:#41506a; text-decoration:none; border-bottom:1px solid #cfd8e3; }

/* Похожие агентства: 4–6 карточек в ряд, на телефоне — горизонтальная прокрутка. */
.agency-similar { margin:28px 0 8px; }
/* Отступ заголовка от ряда — 12 px, как у FAQ (padding-top вопроса): замечание DK 08.11 (#85), заголовок был прижат. */
.agency-similar-row { display:grid; grid-template-columns:repeat(auto-fill, minmax(170px, 1fr)); gap:12px; margin-top:12px; }
.agency-similar-card {
  position:relative; display:flex; flex-direction:column; gap:4px;
  border:1px solid #e6eaf0; border-radius:10px; padding:12px 14px; background:#fff;
}
.agency-similar-name { font-size:0.95rem; font-weight:600; color:#18202b; text-decoration:none; }
.agency-similar-name::after { content:""; position:absolute; inset:0; }
.agency-similar-card:hover { border-color:#cfd8e3; }
.agency-similar-city, .agency-similar-cases { font-size:0.8rem; color:#7a8699; }
.agency-similar-why { font-size:0.8rem; color:#41506a; line-height:1.45; }

/* FAQ: аккордеон на <details>, первый раскрыт. */
.agency-faq { margin:28px 0 8px; max-width:760px; }
.agency-faq-item { border-bottom:1px solid #e6eaf0; }
.agency-faq-item summary {
  cursor:pointer; list-style:none; padding:12px 28px 12px 0; position:relative;
  font-size:0.97rem; font-weight:600; color:#18202b;
}
.agency-faq-item summary::-webkit-details-marker { display:none; }
.agency-faq-item summary::after { content:"+"; position:absolute; right:4px; top:10px; font-size:1.2rem; color:#98a2b3; font-weight:400; }
.agency-faq-item[open] summary::after { content:"−"; }
.agency-faq-item p { margin:0 0 14px; font-size:0.92rem; color:#4a5666; line-height:1.6; }
.agency-faq-item p a { color:#41506a; text-decoration:none; border-bottom:1px solid #cfd8e3; }

@media (max-width:599px) {
  /* Цена — в том же ряду, что числа (DK 07.11): четыре слота — предел (cases.css), поэтому при цене
     «клиентов» на телефоне нет — клиенты есть ниже списком. Цену не переносим. */
  .agency-proof > div.agency-clients-opt { display:none; }
  .agency-proof > div.agency-price { min-width:0; }
  /* Замер 07.11 (Playwright, AGIMA с парой «наград · золотых»): самая длинная цена «от 350 тыс. ₽»
     при прежних 16px уходила на вторую строку уже на 360px; при 10px — в ряд до 360px. */
  .agency-proof:has(> .agency-price) { column-gap:10px; }
  .agency-proof:has(> .agency-price) .agency-pair { gap:0 10px; }
  /* Описание: весь текст в DOM (DK 03.11 п. 1), свёрнут до 3 строк с многоточием; шеврон ⌄ —
     справа в третьей строке (DK 07.11). Шеврон держит плавающая распорка высотой «всё, кроме
     последней строки» — текст обтекает его, и многоточие встаёт перед шевроном, а не под ним. */
  .agency-about-box { display:flex; }
  .agency-about p.agency-about-text {
    display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; line-clamp:3; overflow:hidden;
    margin:0 0 6px; cursor:pointer;
  }
  .agency-about p.agency-about-text::before { content:""; float:right; height:calc(100% - 1.6em); }
  .agency-about-more {
    display:block; float:right; clear:both; width:1.6em; height:1.6em; margin-left:6px; padding:0;
    border:0; background:none; cursor:pointer; color:#41506a; position:relative;
  }
  .agency-about-more::after {
    content:""; position:absolute; left:50%; top:42%; width:7px; height:7px;
    border-right:2px solid currentColor; border-bottom:2px solid currentColor;
    transform:translate(-50%, -50%) rotate(45deg); transition:transform .15s;
  }
  .agency-about.open p.agency-about-text { display:block; -webkit-line-clamp:unset; line-clamp:none; overflow:visible; }
  .agency-about.open .agency-about-more::after { top:58%; transform:translate(-50%, -50%) rotate(-135deg); }
  .agency-about.agency-about-fit .agency-about-more { display:none; }
  .agency-about.agency-about-fit p.agency-about-text { cursor:auto; }
  .agency-similar-row {
    display:flex; overflow-x:auto; scroll-snap-type:x mandatory; gap:10px;
    margin:12px -16px 0; padding:0 16px 6px; scrollbar-width:thin;
  }
  .agency-similar-card { flex:0 0 72%; scroll-snap-align:start; }
}
