/* ===== Тест «Какой формат подойдёт» — общие стили =====
   Используется на /podbor/ (тест на странице) и на главной (первый вопрос + окно).
   Цвета и шрифты — из переменных :root страницы. Логика — /quiz.js */

/* карточка теста */
.quiz { background: var(--white); border: 1px solid var(--border-light); border-radius: var(--radius-lg); box-shadow: var(--card-shadow); padding: 32px; }
.quiz__top { display: flex; align-items: center; gap: 16px; min-height: 28px; margin-bottom: 22px; }
.quiz__back { background: none; border: none; font: inherit; font-size: 0.88rem; color: var(--brown-light); cursor: pointer; padding: 4px 0; flex-shrink: 0; }
.quiz__back:hover { color: var(--terracotta); }
.quiz__bar { flex: 1; height: 6px; background: var(--cream-dark); border-radius: 99px; overflow: hidden; }
.quiz__bar span { display: block; height: 100%; width: 0; background: var(--terracotta); border-radius: 99px; transition: width 0.35s ease; }
.quiz__q { font-family: var(--font-heading); font-size: clamp(1.25rem, 3.8vw, 1.5rem); color: var(--brown); line-height: 1.35; margin-bottom: 20px; outline: none; }
.quiz__lead { color: var(--brown-mid); margin-bottom: 22px; }
.quiz__options { display: grid; gap: 10px; }
.quiz__opt { display: block; width: 100%; text-align: left; background: var(--cream); border: 1.5px solid var(--border-light); border-radius: var(--radius-md); padding: 15px 18px; font: inherit; font-size: 1rem; line-height: 1.4; color: var(--brown); cursor: pointer; transition: border-color var(--transition), background var(--transition); touch-action: manipulation; }
.quiz__opt:hover { border-color: var(--terra-light); }
.quiz__opt[aria-pressed="true"] { border-color: var(--terracotta); background: #F7EDE4; }

/* результат: одна карточка с иллюстрацией подходящей страницы */
.res-title { font-family: var(--font-heading); font-size: clamp(1.3rem, 4vw, 1.6rem); color: var(--brown); margin-bottom: 16px; outline: none; }
.res-card { border: 2px solid var(--terracotta); border-radius: var(--radius-md); background: #FBF4EE; padding: 22px; }
/* шапка карточки: название и описание слева, иллюстрация страницы справа — в рамке, как на страницах сайта */
.res-card__head { display: grid; grid-template-columns: 1fr 148px; grid-template-rows: auto 1fr; grid-template-areas: "title img" "why img"; column-gap: 22px; align-items: start; }
.res-card__titles { grid-area: title; }
.res-card__why { grid-area: why; }
.res-card__img { grid-area: img; background: var(--cream-dark); border-radius: 16px; padding: 8px; box-shadow: var(--card-shadow); }
.res-card__img img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; }
.res-card__name { font-family: var(--font-heading); font-size: 1.3rem; color: var(--brown); line-height: 1.3; }
.res-card__meta { font-size: 0.92rem; font-weight: 700; color: var(--brown-mid); margin: 2px 0 12px; }
.res-card p { color: var(--brown-mid); font-size: 0.97rem; line-height: 1.65; }
.res-row { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 14px; }
.res-row__label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--terracotta); margin-bottom: 4px; }
.res-row__value { font-weight: 700; color: var(--brown); margin-bottom: 4px; }
.res-link { color: var(--terracotta); font-weight: 700; text-decoration: underline; text-decoration-color: rgba(150,91,53,0.35); text-underline-offset: 2px; }
.res-link:hover { text-decoration-color: var(--terracotta); }
.res-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.res-tools { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 0.88rem; }
.res-tools button { background: none; border: none; font: inherit; color: var(--brown-light); text-decoration: underline; cursor: pointer; padding: 2px 0; }
.res-tools button:hover { color: var(--terracotta); }
.res-copied { font-size: 0.85rem; color: var(--sage-dark); font-weight: 700; min-height: 1.3em; margin-top: 4px; }
.res-foot { font-size: 0.8rem; color: var(--brown-light); line-height: 1.6; margin-top: 18px; }
.res-foot a { color: var(--brown-mid); font-weight: 700; white-space: nowrap; }
.crisis { border: 2px solid #B4432F; background: #FDF1EE; border-radius: var(--radius-md); padding: 18px 20px; margin-bottom: 18px; }
.crisis__title { font-family: var(--font-heading); font-size: 1.1rem; color: #7E2C1E; margin-bottom: 8px; }
.crisis p, .crisis li { color: var(--brown); font-size: 0.95rem; line-height: 1.6; }
.crisis ul { list-style: none; display: grid; gap: 6px; margin: 10px 0; }
.crisis a { color: #9A3826; font-weight: 700; text-decoration: underline; white-space: nowrap; }

@media (max-width: 600px) {
  .quiz { padding: 22px 18px; border-radius: var(--radius-md); }
  .res-card { padding: 18px; }
  .res-card__head { grid-template-columns: 1fr 96px; grid-template-areas: "title img" "why why"; column-gap: 14px; }
  .res-card__img { padding: 5px; border-radius: 12px; }
  .res-card__img img { border-radius: 8px; }
  .res-card__why { margin-top: 12px; }
  .res-actions .btn { width: 100%; }
}

/* окно поверх страницы */
.qmodal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.qmodal[hidden] { display: none; }
.qmodal__backdrop { position: absolute; inset: 0; background: rgba(44,31,18,0.55); animation: qfade 0.2s ease; }
.qmodal__panel { position: relative; width: 100%; max-width: 640px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; border-radius: var(--radius-lg); animation: qrise 0.25s ease; }
.qmodal__panel .quiz { border: none; box-shadow: 0 20px 60px rgba(44,31,18,0.3); padding-top: 52px; }
.qmodal__close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border: none; border-radius: 50%; background: var(--cream-dark); color: var(--brown-mid); font-size: 1.5rem; line-height: 1; cursor: pointer; transition: background var(--transition), color var(--transition); }
.qmodal__close:hover { background: var(--border-light); color: var(--terracotta); }
html.quiz-open, html.quiz-open body { overflow: hidden; }
html.quiz-open .rbz-tab { display: none; }
@keyframes qfade { from { opacity: 0; } }
@keyframes qrise { from { opacity: 0; transform: translateY(16px); } }
@media (max-width: 600px) {
  .qmodal { padding: 0; align-items: stretch; }
  .qmodal__panel { max-width: none; max-height: none; height: 100%; border-radius: 0; }
  .qmodal__panel .quiz { min-height: 100%; border-radius: 0; box-shadow: none; }
}

/* первый вопрос прямо в странице (главная) */
.quiz-start { margin-top: 28px; padding: 24px 26px; background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--card-shadow); display: grid; grid-template-columns: 1fr 1.25fr; gap: 20px 32px; align-items: center; }
.quiz-start__title { font-family: var(--font-heading); font-size: 1.2rem; color: var(--brown); margin-bottom: 4px; }
.quiz-start__sub { font-size: 0.92rem; color: var(--brown-mid); line-height: 1.6; }
.quiz-start__q { font-weight: 700; color: var(--brown); margin-bottom: 10px; }
.quiz-start__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quiz-start__opt { display: block; text-align: center; background: var(--cream); border: 1.5px solid var(--border-light); border-radius: var(--radius-md); padding: 12px 10px; font-size: 0.95rem; font-weight: 600; color: var(--brown); transition: border-color var(--transition), background var(--transition), color var(--transition); }
.quiz-start__opt:hover { border-color: var(--terracotta); background: #F7EDE4; color: var(--terracotta); }
@media (max-width: 900px) { .quiz-start { grid-template-columns: 1fr; } }
