/* ============================================================
   komfortneo.ru - Apple-style design (light)
   Системные цвета iOS, типографика Apple HIG.
   Внешних подключений нет. Утилиты has-* сохранены.
   ============================================================ */

:root {
  /* Apple system colors - light */
  --blue:            #007AFF;
  --blue-hover:      #0062CC;
  --green:           #34C759;
  --red:             #FF3B30;
  --orange:          #FF9500;

  --gray-1:          #8E8E93;
  --gray-2:          #AEAEB2;
  --gray-3:          #C7C7CC;
  --gray-4:          #D1D1D6;
  --gray-5:          #E5E5EA;
  --gray-6:          #F2F2F7;

  --label:           #000000;
  --secondary-label: rgba(60, 60, 67, 0.60);
  --tertiary-label:  rgba(60, 60, 67, 0.30);

  --bg:              #FFFFFF;
  --bg-secondary:    #F2F2F7;

  /* Типографика Apple HIG (iOS) */
  --font-stack: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display',
                'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
                'Helvetica Neue', Arial, sans-serif;

  /* Радиусы */
  --radius-sm:   10px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-pill: 980px;

  /* Тени (мягкие, Apple-style) */
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(0, 0, 0, 0.06);

  /* Ширина контента */
  --container-max: 1200px;
  --container-pad: 20px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure, blockquote {
  margin: 0; padding: 0;
}
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* --- Ссылки --- */
a { color: var(--blue); text-decoration: none; }
a:hover, a:focus { color: var(--blue-hover); text-decoration: underline; }

/* --- Базовая типографика (Apple Body 17/22) --- */
body {
  font-family: var(--font-stack);
  font-size: 17px;
  line-height: 1.47059;   /* Apple Body 22/17 */
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Apple HIG headings */
h1 {
  font-size: 34px; line-height: 1.20588;   /* Large Title 34/41 */
  font-weight: 700; letter-spacing: 0.011em;
  margin: 0 0 0.6em; color: var(--label);
}
h2 {
  font-size: 28px; line-height: 1.21429;   /* Title 1 */
  font-weight: 700; letter-spacing: 0.007em;
  margin: 1.6em 0 0.5em; color: var(--label);
}
h3 {
  font-size: 22px; line-height: 1.27273;   /* Title 2 */
  font-weight: 600; letter-spacing: -0.008em;
  margin: 1.4em 0 0.4em; color: var(--label);
}
h4 {
  font-size: 20px; line-height: 1.25;      /* Title 3 */
  font-weight: 600; letter-spacing: -0.012em;
  margin: 1.2em 0 0.4em; color: var(--label);
}
h5 { font-size: 17px; line-height: 1.29412; font-weight: 600; margin: 1em 0 0.4em; }
h6 { font-size: 15px; line-height: 1.33333; font-weight: 600; margin: 1em 0 0.4em; }

p { margin: 0 0 1em; }

/* --- Container --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* ============================================================
   ШАПКА - Apple-style: fixed, blur backdrop, тонкая граница
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--gray-5);
  color: var(--label);
  padding: 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 52px;
  padding-top: 6px;
  padding-bottom: 6px;
}
.site-title {
  color: var(--label);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.site-title:hover, .site-title:focus { color: var(--blue); text-decoration: none; }

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}
.main-nav a {
  color: var(--label);
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.main-nav a:hover, .main-nav a:focus {
  color: var(--blue);
  border-bottom-color: var(--blue);
  text-decoration: none;
}

/* Кнопка-гамбургер (появится в CHANGE-3; здесь - базовый стиль) */
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 8px;
  cursor: pointer;
  color: var(--label);
  -webkit-appearance: none;
  appearance: none;
}
.nav-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ============================================================
   ОСНОВНОЙ КОНТЕНТ
   ============================================================ */
.site-main { padding: 40px 0; min-height: 50vh; }
.page { max-width: 100%; }
.page-title {
  margin-top: 0;
  margin-bottom: 1em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--gray-5);
  font-size: 34px;
  line-height: 1.20588;
  font-weight: 700;
  letter-spacing: 0.011em;
}
.page-content img {
  border-radius: var(--radius-sm);
  margin: 1em 0;
}
.page-content figure { margin: 1.5em 0; max-width: 100%; }
.page-content figcaption {
  font-size: 13px;
  line-height: 1.38462;
  color: var(--gray-1);
  text-align: center;
  margin-top: 0.5em;
}
.page-content ul, .page-content ol { margin: 1em 0 1em 1.5em; }
.page-content ul li { list-style: disc; margin-bottom: 0.4em; }
.page-content ol li { list-style: decimal; margin-bottom: 0.4em; }

/* --- Alignment utility --- */
.aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.alignleft { float: left; margin-right: 1.5em; }
.alignright { float: right; margin-left: 1.5em; }

/* --- WP text-align utility --- */
.has-text-align-center { text-align: center; }
.has-text-align-left   { text-align: left; }
.has-text-align-right  { text-align: right; }

/* --- WP background utility --- */
.has-very-light-gray-background-color {
  background-color: var(--gray-6);
  padding: 1.25em 1.5em;
  border-radius: var(--radius-md);
}

/* --- WP text-color utility (пр??ведены к Apple system colors) --- */
.has-luminous-vivid-orange-color { color: var(--orange); }
.has-vivid-red-color             { color: var(--red); }
.has-vivid-green-cyan-color      { color: var(--green); }
.has-vivid-cyan-blue-color       { color: var(--blue); }

/* --- WP button --- */
.wp-block-button { margin: 1em 0; }
.wp-block-button__link {
  display: inline-block;
  padding: 12px 24px;
  color: #fff !important;
  background: var(--blue);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.29412;
  text-decoration: none;
  transition: background 0.15s ease, opacity 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
  border: 0;
}
.wp-block-button__link:hover,
.wp-block-button__link:focus {
  background: var(--blue-hover);
  color: #fff !important;
  text-decoration: none;
}
.has-midnight-gradient-background {
  background: var(--blue);
}
.no-border-radius { border-radius: 0; }

/* --- Таблицы --- */
.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 15px;
  line-height: 1.4;
}
.page-content table td,
.page-content table th {
  border: 1px solid var(--gray-5);
  padding: 10px 12px;
  text-align: left;
}
.page-content table tr:nth-child(even) { background: var(--gray-6); }

/* --- Embed (YouTube 16:9) --- */
.wp-block-embed { margin: 1.5em 0; }
.wp-block-embed__wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
}
.wp-block-embed__wrapper iframe {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ============================================================
   ФУТЕР
   ============================================================ */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--gray-5);
  padding: 32px 0;
  color: var(--secondary-label);
  font-size: 13px;
  line-height: 1.38462;
  margin-top: 48px;
}
.site-footer p { margin: 0.3em 0; }
.site-footer strong { color: var(--label); font-weight: 600; }

/* ============================================================
   БЛОКИ ГЛАВНОЙ
   ============================================================ */
.page-block {
  margin-bottom: 28px;
  padding: 28px;
  background: var(--bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}
.page-block:last-child { margin-bottom: 0; }

/* ============================================================
   CTA на главной
   ============================================================ */
.home-cta { text-align: center; margin: 40px 0 8px; }

/* ============================================================
   КОММЕНТАРИИ
   ============================================================ */
.comments { margin-top: 40px; }
.comments__title {
  font-size: 22px;
  line-height: 1.27273;
  font-weight: 600;
  letter-spacing: -0.008em;
  margin-bottom: 20px;
}
.comments__list, .comment__replies { list-style: none; padding: 0; margin: 0; }
.comment {
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-5);
}
.comment__replies {
  margin-top: 12px;
  padding-left: 24px;
  border-left: 2px solid var(--gray-5);
}
.comment__meta {
  font-size: 13px;
  line-height: 1.38462;
  color: var(--gray-1);
  margin-bottom: 6px;
}
.comment__author { color: var(--label); font-weight: 600; }
.comment__date   { margin-left: 8px; }
.comment__content { line-height: 1.5; }
.comment__content p { margin: 0.4em 0; }

/* --- Форма комментария --- */
.comment-form {
  margin-top: 40px;
  padding: 28px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}
.comment-form__title {
  font-size: 20px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin-bottom: 16px;
}
.comment-form__field { margin-bottom: 16px; }
.comment-form__field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 15px;
  color: var(--label);
}
.comment-form__input,
.comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--gray-4);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 17px;
  line-height: 1.29412;
  color: var(--label);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.comment-form__input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}
.comment-form textarea { resize: vertical; min-height: 120px; }
.comment-form__error {
  color: var(--red);
  font-size: 13px;
  line-height: 1.38462;
  margin-top: 6px;
}
.comment-form__submit {
  background: var(--blue);
  color: #fff;
  border: 0;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  transition: background 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.comment-form__submit:hover { background: var(--blue-hover); }
.comment-form__note {
  font-size: 13px;
  line-height: 1.38462;
  color: var(--gray-1);
  margin-top: 10px;
}

/* ============================================================
   FLASH-СООБЩЕНИЯ
   ============================================================ */
.messages { margin: 0 0 24px; }
.message {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.4;
}
.message--success {
  background: rgba(52, 199, 89, 0.12);
  color: #1B6B33;
  border: 1px solid rgba(52, 199, 89, 0.30);
}
.message--error {
  background: rgba(255, 59, 48, 0.10);
  color: #8A1F1F;
  border: 1px solid rgba(255, 59, 48, 0.30);
}
.message--info {
  background: rgba(0, 122, 255, 0.10);
  color: #0A4A8A;
  border: 1px solid rgba(0, 122, 255, 0.28);
}

/* ============================================================
   КВИЗ
   ============================================================ */
.quiz { margin-top: 16px; }
.quiz__title {
  font-size: 34px;
  line-height: 1.20588;
  font-weight: 700;
  letter-spacing: 0.011em;
  margin-bottom: 16px;
}
.quiz__intro {
  margin-bottom: 24px;
  color: var(--secondary-label);
  line-height: 1.5;
  font-size: 17px;
}
.quiz__form { margin-top: 20px; }
.quiz__question {
  border: 1px solid var(--gray-5);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 20px;
  background: var(--bg);
}
.quiz__question-title {
  font-weight: 600;
  font-size: 17px;
  line-height: 1.29412;
  padding: 0 6px;
  color: var(--label);
}
.quiz__answer {
  display: block;
  padding: 10px 0;
  cursor: pointer;
  line-height: 1.47059;
  font-size: 17px;
}
.quiz__answer input[type="radio"] {
  margin-right: 12px;
  accent-color: var(--blue);
}
.quiz__submit {
  background: var(--blue);
  color: #fff;
  border: 0;
  padding: 14px 32px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  margin-top: 10px;
  transition: background 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.quiz__submit:hover { background: var(--blue-hover); }
a.quiz__submit { display: inline-block; text-decoration: none; }
a.quiz__submit:hover { color: #fff; text-decoration: none; }

/* ============================================================
   РЕЗУЛЬТАТ КВИЗА
   ============================================================ */
.quiz-result { margin-top: 16px; }
.quiz-result__title {
  font-size: 34px;
  line-height: 1.20588;
  font-weight: 700;
  letter-spacing: 0.011em;
  margin-bottom: 16px;
}
.quiz-result__score {
  font-size: 17px;
  color: var(--secondary-label);
  margin-bottom: 20px;
}
.quiz-result__content { line-height: 1.5; }
.quiz-result--positive {
  border-left: 4px solid var(--green);
  padding-left: 20px;
}
.quiz-result--negative {
  border-left: 4px solid var(--red);
  padding-left: 20px;
}
.quiz-result__retake { margin-top: 28px; }

/* ============================================================
   Утилиты (замены inline-стилей из WP)
   ============================================================ */
.underline { text-decoration: underline; }

.text-green  { color: #017A4E; }
.text-purple { color: #881C8E; }
.text-blue   { color: #044F7A; }

.text-lg  { font-size: 24px; line-height: 1.33333; }
.text-xl  { font-size: 28px; line-height: 1.28571; }
.text-2xl { font-size: 32px; line-height: 1.25; }

.flex-basis-100 { flex-basis: 100%; }

/* ============================================================
   АДАПТИВ - mobile-first breakpoints: 480 / 768 / 1024+
   ============================================================ */

/* <=1024px - планшет */
@media (max-width: 1024px) {
  :root { --container-pad: 18px; }
  h1, .page-title, .quiz__title, .quiz-result__title { font-size: 30px; line-height: 1.2; }
  h2 { font-size: 24px; line-height: 1.25; }
  h3 { font-size: 20px; line-height: 1.3; }
  h4 { font-size: 18px; }
  .main-nav ul { gap: 18px; }
  .page-block { padding: 24px; }
}

/* <=768px - маленький планшет / большой телефон */
@media (max-width: 768px) {
  body { font-size: 16px; line-height: 1.5; }
  h1, .page-title, .quiz__title, .quiz-result__title { font-size: 26px; line-height: 1.23; }
  h2 { font-size: 22px; }
  h3 { font-size: 19px; }
  h4 { font-size: 17px; }

  .header-inner {
    flex-wrap: nowrap;
    align-items: center;
  }
  /* гамбургер показываем на <=768px (когда появится в CHANGE-3) */
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .main-nav {
    /* до CHANGE-3 меню - flex-wrap: wrap; после - переопределится в шаблоне */
    width: 100%;
  }
  .main-nav ul { gap: 14px; }

  .alignleft, .alignright { float: none; margin: 1em auto; }

  .page-block { padding: 20px; margin-bottom: 20px; }
  .site-main { padding: 28px 0; }
  .comment-form { padding: 20px; }
  .quiz__question { padding: 16px 18px; }
}

/* <=480px - телефон */
@media (max-width: 480px) {
  :root { --container-pad: 16px; }
  body { font-size: 16px; line-height: 1.47059; }

  h1, .page-title, .quiz__title, .quiz-result__title { font-size: 24px; line-height: 1.20833; }
  h2 { font-size: 20px; line-height: 1.25; }
  h3 { font-size: 18px; line-height: 1.3; }
  h4 { font-size: 17px; }

  .site-header { padding: 0; }
  .header-inner { min-height: 48px; }
  .site-title { font-size: 16px; }

  .main-nav ul { gap: 12px; }
  .main-nav a { font-size: 14px; }

  .site-main { padding: 24px 0; }
  .page-block { padding: 16px; border-radius: var(--radius-sm); }
  .comments__title { font-size: 20px; }
  .comment__replies { padding-left: 16px; }
  .comment-form { padding: 16px; }

  .quiz__question { padding: 14px 16px; }
  .quiz__submit { padding: 12px 24px; font-size: 16px; }
  .comment-form__submit { padding: 12px 22px; font-size: 16px; }
  .wp-block-button__link { padding: 11px 20px; font-size: 16px; }

  .wp-block-embed__wrapper { border-radius: var(--radius-sm); }

  .page-content table { font-size: 14px; }
  .page-content table td,
  .page-content table th { padding: 8px 10px; }
}


/* === MOBILE NAV (CHANGE-4) === */

/* Desktop >= 769px: nav visible, toggle hidden. */

@media (max-width: 768px) {
  /* Mobile: nav hidden until body gets .nav-open. */
  .main-nav {
    display: none;
    width: 100%;
  }

  /* Open state: sheet under header. */
  body.nav-open .main-nav {
    display: block;
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    z-index: 99;
    background: #FFFFFF;
    border-bottom: 1px solid var(--gray-5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    padding: 12px 0 16px;
    max-height: calc(100vh - 52px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.nav-open .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0 16px;
  }

  body.nav-open .main-nav li {
    border-bottom: 1px solid var(--gray-5);
  }
  body.nav-open .main-nav li:last-child {
    border-bottom: 0;
  }

  body.nav-open .main-nav a {
    display: block;
    padding: 14px 8px;
    font-size: 17px;
    font-weight: 400;
    color: var(--label);
    border-bottom: 0;
  }
  body.nav-open .main-nav a:hover,
  body.nav-open .main-nav a:focus {
    color: var(--blue);
    border-bottom: 0;
    background: transparent;
  }

  /* Toggle visible when nav available. */
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* <=480px: slightly tighter. */
@media (max-width: 480px) {
  body.nav-open .main-nav {
    top: 48px;
    max-height: calc(100vh - 48px);
  }
  body.nav-open .main-nav a {
    padding: 12px 6px;
    font-size: 16px;
  }
}


/* === UTILITY (CHANGE-6) === */

/* Apple Title 3 - for WP has-large-font-size */
.has-large-font-size {
  font-size: 20px;
  line-height: 1.25;
  font-weight: 600;
}

/* Apple Body - for WP has-normal-font-size */
.has-normal-font-size {
  font-size: 17px;
  line-height: 1.47059;
  font-weight: 400;
}

/* Apple gray-1 - for WP has-very-light-gray-color */
.has-very-light-gray-color {
  color: #8E8E93;
}

/* Marker: actual text color comes from sibling has-*-color. */
.has-text-color {
  /* no-op */
}

/* Marker: aspect-ratio is handled by parent figure. */
.has-aspect-ratio {
  /* no-op */
}


/* === QUIZ RESULT CONTENT (CHANGE-7) === */

/* Images inside quiz result content. */
.quiz-result__content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 1em 0;
}

/* Paragraphs. */
.quiz-result__content p {
  margin: 0 0 1em;
}

/* Figures. */
.quiz-result__content figure {
  margin: 1.5em 0;
  max-width: 100%;
}

.quiz-result__content figcaption {
  font-size: 13px;
  line-height: 1.38462;
  color: var(--gray-1);
  text-align: center;
  margin-top: 0.5em;
}

/* Lists. */
.quiz-result__content ul,
.quiz-result__content ol {
  margin: 1em 0 1em 1.5em;
}

.quiz-result__content ul li {
  list-style: disc;
  margin-bottom: 0.4em;
}

.quiz-result__content ol li {
  list-style: decimal;
  margin-bottom: 0.4em;
}

/* WP alignnone utility. */
.alignnone {
  margin: 1em 0;
  max-width: 100%;
  height: auto;
}

/* WP image size utilities. */
.size-medium,
.size-thumbnail {
  max-width: 100%;
  height: auto;
}


/* === TABLE SCROLL (CHANGE-10) === */

.page-content table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 100%;
}
