/*
Theme Name: Ollie Alla Dmitrieva
Template: ollie
Text Domain: ollie-alla-dmitrieva
Description: Текстовый сайт Аллы Дмитриевой — дочерняя тема Ollie с центральным макетом, двумя колонками и без социальных иконок.
Version: 1.0.19
Requires at least: 6.6
Requires PHP: 7.4
License: GPL-2.0-or-later
WPVibe: yes
Update URI: false
*/

/* Палитра Agency (официальный пресет Ollie).
   Меняем только цвета, сохраняя шрифты и геометрию шаблона. */
body {
  --wp--preset--color--primary: #495148;
  --wp--preset--color--primary-accent: #e5f0e4;
  --wp--preset--color--primary-alt: #CEF453;
  --wp--preset--color--primary-alt-accent: #44473b;
  --wp--preset--color--main: #0E0E0E;
  --wp--preset--color--main-accent: #D0D1CD;
  --wp--preset--color--base: #fff;
  --wp--preset--color--secondary: #51524e;
  --wp--preset--color--tertiary: #F5F5F0;
  --wp--preset--color--border-light: #E2E2D9;
  --wp--preset--color--border-dark: #444B57;
}

/* Акценты Agency: тихий зелёный, тёплый почти белый фон. */
body {
  color: var(--wp--preset--color--main);
  background-color: var(--wp--preset--color--base);
}
.abd-header,
.abd-footer {
  background-color: var(--wp--preset--color--tertiary);
  border-color: var(--wp--preset--color--border-light);
}
.abd-header .wp-block-site-title,
.abd-header .wp-block-site-title a,
.abd-article .wp-block-post-title,
.abd-article .wp-block-post-content h2,
.abd-article .wp-block-post-content h3 {
  color: var(--wp--preset--color--main);
}
.abd-header .wp-block-site-tagline,
.abd-footer-description,
.abd-footer-copy {
  color: var(--wp--preset--color--secondary);
}
.abd-sidebar .wp-block-heading {
  color: var(--wp--preset--color--primary);
}
/* Активный пункт: тонкая линия Agency без смещения меню и подчёркивания. */
.abd-sidebar .current-menu-item > .wp-block-navigation-item__content {
  position: relative;
  color: var(--wp--preset--color--primary);
  box-shadow: none;
  font-weight: 650;
  text-decoration: none !important;
}
.abd-sidebar .current-menu-item > .wp-block-navigation-item__content::before {
  content: "";
  position: absolute;
  left: -9px;
  top: .1em;
  bottom: .1em;
  width: 3px;
  background-color: var(--wp--preset--color--primary);
}
.abd-article .wp-block-post-content a,
.abd-footer-contact a,
.abd-footer-legal a {
  color: var(--wp--preset--color--primary);
}
.abd-header .abd-top-nav a:hover,
.abd-sidebar .wp-block-navigation-item__content:hover,
.abd-footer a:hover {
  color: var(--wp--preset--color--primary);
}
.abd-footer-rule {
  border-color: var(--wp--preset--color--border-light) !important;
}

/* Основа Ollie: сохраняем исходные шрифты и размеры темы. */
.abd-shell {
  width: min(calc(100% - 48px), var(--wp--style--global--wide-size, 1240px));
  max-width: 1240px;
  margin-inline: auto !important;
}

/* Шапка: компактная вертикальная композиция. */
.abd-header {
  padding-block: 23px 18px;
  border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}
.abd-header .abd-brand {
  margin: 0;
  gap: 3px !important;
  row-gap: 3px !important;
}
.abd-header .abd-brand > * {
  margin-block: 0 !important;
}
.abd-header .wp-block-site-title {
  font-size: clamp(1.3rem, 1.85vw, 1.65rem);
  line-height: 1.22;
  font-weight: 600;
}
.abd-header .wp-block-site-tagline {
  font-size: 1.055rem;
  line-height: 1.35;
  opacity: .83;
}
.abd-header .abd-top-nav {
  margin-block-start: 13px !important;
  font-size: .92rem;
}
.abd-header .abd-top-nav .wp-block-navigation__container {
  column-gap: 15px !important;
  row-gap: 5px !important;
}
.abd-header .abd-top-nav .wp-block-navigation-item__content {
  line-height: 1.4;
}

/* Верхнее меню: фиксированная ширина ссылок при смене активной страницы.
   Лёгкая тень добавляет акцент без изменения метрик шрифта и сдвига пунктов. */
.abd-header nav.abd-top-nav .wp-block-navigation__container > .wp-block-navigation-item:not(:last-child) > a.wp-block-navigation-item__content {
  font-weight: 400 !important;
}
.abd-header nav.abd-top-nav .wp-block-navigation__container > .current-menu-item:not(:last-child) > a.wp-block-navigation-item__content {
  color: var(--wp--preset--color--primary) !important;
  font-weight: 400 !important;
  text-shadow: .3px 0 0 currentColor, -.3px 0 0 currentColor;
  text-decoration: none !important;
  box-shadow: none !important;
}
.abd-header nav.abd-top-nav .wp-block-navigation__container > .current-menu-item:not(:last-child) > a.wp-block-navigation-item__content:hover {
  text-decoration: none !important;
}

/* Кнопка записи не увеличивает высоту строки навигации.
   Рамка нарисована outline за пределами обычного размера ссылки. */
.abd-header nav.abd-top-nav .wp-block-navigation__container > .wp-block-navigation-item:last-child > a.wp-block-navigation-item__content {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 2px;
  outline: 1px solid #495148;
  outline-offset: 5px;
  background: transparent !important;
  color: #495148 !important;
  font-weight: 600 !important;
  line-height: 1.4;
  white-space: nowrap;
  text-decoration: none !important;
}
.abd-header nav.abd-top-nav .wp-block-navigation__container > .wp-block-navigation-item:last-child > a.wp-block-navigation-item__content:hover {
  box-shadow: 0 0 0 5px #e5f0e4;
  background: #e5f0e4 !important;
  text-decoration: none !important;
}
.abd-header nav.abd-top-nav .wp-block-navigation__container > .wp-block-navigation-item:last-child > a.wp-block-navigation-item__content:focus-visible {
  outline: 2px solid #495148;
  outline-offset: 5px;
}

/* Центральная двухколоночная область, читабельная ширина статьи. */
/* Убираем автоматический отступ WordPress между шапкой и основным контентом. */
.wp-site-blocks > .abd-main {
  margin-block-start: 0 !important;
}
.abd-main {
  padding-block: clamp(20px, 2.1vw, 30px) clamp(56px, 6vw, 80px);
}
.abd-main-columns {
  gap: clamp(28px, 3.5vw, 56px) !important;
  align-items: flex-start !important;
  margin-top: 0;
}
.abd-sidebar-column {
  flex: 0 0 clamp(195px, 21%, 246px) !important;
  min-width: 0;
}
.abd-content-column {
  flex: 1 1 0 !important;
  min-width: 0;
}

/* Левое меню: минимальный зазор после заголовка рубрики. */
.abd-sidebar {
  font-size: .93rem;
  line-height: 1.45;
}
.abd-sidebar .wp-block-heading {
  font-size: .88rem;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: .01em;
  margin: 0 0 6px !important;
}
.abd-sidebar .wp-block-heading:not(:first-child) {
  margin: 27px 0 6px !important;
}
.abd-sidebar > .wp-block-navigation {
  margin-block: 0 !important;
}
.abd-sidebar .wp-block-navigation__container {
  gap: 7px !important;
  align-items: flex-start;
}
.abd-sidebar .wp-block-navigation-item {
  margin: 0 !important;
}
.abd-sidebar .wp-block-navigation-item__content {
  text-decoration: none;
  padding: 0;
  line-height: 1.4;
}
/* Наведение мягче, чем состояние активной страницы. */
.abd-sidebar .wp-block-navigation-item__content:hover {
  color: var(--wp--preset--color--primary);
  text-decoration: none !important;
}
.abd-sidebar .wp-block-navigation-item__content:focus-visible {
  outline: 2px solid var(--wp--preset--color--primary);
  outline-offset: 3px;
}

/* Заголовки: сдержанная иерархия для длинных статей. */
.abd-article {
  max-width: 815px;
  margin-left: 0 !important;
  margin-right: auto !important;
  min-width: 0;
}
.abd-article .wp-block-post-title {
  font-size: clamp(1.75rem, 1.9vw, 2rem);
  line-height: 1.23;
  font-weight: 550;
  margin-top: 0 !important;
  margin-bottom: 17px !important;
}
/* Устраняем двойные отступы между H1, Post Content и первым блоком статьи. */
.abd-article > .wp-block-post-content {
  margin-block-start: 0 !important;
}
.abd-article .wp-block-post-content > :first-child {
  margin-block-start: 0 !important;
}
.abd-article .wp-block-post-content {
  line-height: 1.68;
  overflow-wrap: break-word;
}
.abd-article .wp-block-post-content > * {
  max-width: 100%;
}
.abd-article .wp-block-post-content h2 {
  font-size: clamp(1.4rem, 1.7vw, 1.62rem);
  font-weight: 600;
  line-height: 1.33;
  margin-block: 1.65em .6em;
}
.abd-article .wp-block-post-content h3 {
  font-size: clamp(1.2rem, 1.4vw, 1.35rem);
  line-height: 1.35;
  margin-block: 1.45em .55em;
}
.abd-article .wp-block-post-content p {
  margin-block: 0 1.25em;
}
/* Когда за абзацем сразу идёт список, не суммируем его нижний
   отступ со стандартным интервалом Gutenberg/Ollie. */
.abd-article .wp-block-post-content p:has(+ :is(ul, ol)) {
  margin-block-end: 0 !important;
}
.abd-article .wp-block-post-content p + :is(ul, ol) {
  margin-block-start: 10px !important;
}
/* Списки в статьях: короткий отступ сверху и плотный ритм пунктов. */
.abd-article .wp-block-post-content :is(ul, ol) {
  padding-inline-start: 1.4em;
  margin-block-start: .45em !important;
  margin-block-end: 1em !important;
  row-gap: .38em !important;
}
.abd-article .wp-block-post-content :is(ul, ol) > li {
  margin-block: 0 !important;
  padding-block: 0;
  line-height: 1.5;
}
.abd-article .wp-block-post-content :is(ul, ol) > li + li {
  margin-block-start: .4em !important;
}
.abd-article .wp-block-post-content li > p {
  margin-block: 0 !important;
}

/* Завершение типографики статей: сохраняем существующие размеры и интервалы. */
.abd-article .wp-block-post-title,
.abd-article .wp-block-post-content :is(h2, h3) {
  text-wrap: balance;
}
.abd-article .wp-block-post-content :is(ul, ol) > li::marker {
  color: var(--wp--preset--color--primary);
  font-weight: 600;
}
.abd-article .wp-block-post-content a {
  color: var(--wp--preset--color--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
  text-decoration-color: color-mix(in srgb, currentColor 55%, transparent);
}
.abd-article .wp-block-post-content a:hover {
  text-decoration-color: currentColor;
}
.abd-article .wp-block-post-content a:focus-visible {
  outline: 2px solid var(--wp--preset--color--primary);
  outline-offset: 3px;
}
.abd-article .wp-block-post-content blockquote.wp-block-quote {
  margin-block: 1.55em !important;
  padding: 1em 1.15em;
  border-left: 3px solid var(--wp--preset--color--primary);
  background: var(--wp--preset--color--tertiary);
}
.abd-article .wp-block-post-content blockquote.wp-block-quote p:last-child {
  margin-block-end: 0 !important;
}
.abd-article .wp-block-post-content blockquote.wp-block-quote cite {
  display: block;
  margin-top: .6em;
  color: var(--wp--preset--color--secondary);
  font-size: .9em;
  font-style: normal;
}
.abd-article .wp-block-post-content > :last-child {
  margin-block-end: 0 !important;
}

/* Компактный подвал: меньше пустоты при сохранении читабельности. */
.abd-footer {
  border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
  padding-block: 24px 20px;
}
.abd-footer .abd-footer-layout {
  max-width: 1240px;
}
.abd-footer .abd-footer-top {
  align-items: start;
  gap: 32px !important;
  margin-bottom: 18px !important;
}
.abd-footer .abd-footer-name {
  font-size: 1.23rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 6px !important;
}
.abd-footer .abd-footer-description {
  max-width: 490px;
  font-size: .92rem;
  line-height: 1.5;
  opacity: .8;
  margin: 0 !important;
}
.abd-footer .abd-footer-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 11px;
}
.abd-footer .abd-footer-contact p {
  margin: 0 !important;
}
.abd-footer .abd-footer-action {
  font-size: .96rem;
  font-weight: 600;
}
.abd-footer .abd-footer-secondary {
  font-size: .9rem;
  opacity: .8;
}
.abd-footer .abd-footer-contact a {
  text-decoration: none;
}
.abd-footer .abd-footer-contact a:hover {
  text-decoration: underline;
  text-underline-offset: .2em;
}
.abd-footer .abd-footer-rule {
  border: 0;
  border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
  opacity: 1;
  width: 100%;
  max-width: none;
  margin: 0 0 12px !important;
}
.abd-footer .abd-footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
}
.abd-footer .abd-footer-copy {
  font-size: .78rem;
  line-height: 1.6;
  opacity: .7;
  margin: 0 !important;
}
.abd-footer .abd-footer-legal {
  font-size: .78rem;
  line-height: 1.5;
  width: 100%;
  margin: 0 !important;
  justify-content: flex-start !important;
}
.abd-footer .abd-footer-legal .wp-block-navigation__container {
  column-gap: 19px !important;
  row-gap: 9px !important;
  align-items: flex-start;
  justify-content: flex-start !important;
}
.abd-footer .abd-footer-legal .wp-block-navigation-item__content {
  text-decoration: none;
}
.abd-footer .abd-footer-legal .wp-block-navigation-item__content:hover {
  text-decoration: underline;
  text-underline-offset: .2em;
}

/* Раскрывающееся меню тем только для небольших экранов. */
.abd-sidebar .abd-mobile-topics {
  display: none;
}

/* На смартфонах вместо длинного списка показываем компактный аккордеон. */
@media (max-width: 781px) {
  .abd-shell {
    width: min(calc(100% - 32px), 1240px);
  }
  .abd-header {
    padding-block: 18px 17px;
  }
  .abd-header .wp-block-site-tagline {
    font-size: 1rem;
  }
  .abd-header .abd-top-nav {
    margin-block-start: 11px !important;
  }
  .abd-main-columns {
    flex-direction: column;
    gap: 18px !important;
  }
  .abd-sidebar-column,
  .abd-content-column {
    flex-basis: auto !important;
    width: 100%;
  }
  .abd-sidebar {
    padding-bottom: 0;
    border-bottom: none;
  }
  .abd-sidebar > .wp-block-heading,
  .abd-sidebar > .wp-block-navigation {
    display: none !important;
  }
  .abd-sidebar .abd-mobile-topics {
    display: block;
    width: 100%;
    margin: 0 !important;
    padding: 0 14px;
    background: var(--wp--preset--color--tertiary);
    border: 1px solid var(--wp--preset--color--border-light);
    border-radius: 8px;
  }
  .abd-sidebar .abd-mobile-topics > summary {
    cursor: pointer;
    padding: 12px 0;
    font-size: .95rem;
    line-height: 1.4;
    font-weight: 600;
    color: var(--wp--preset--color--main);
  }
  .abd-sidebar .abd-mobile-topics > summary:focus-visible {
    outline: 2px solid var(--wp--preset--color--primary);
    outline-offset: 3px;
  }
  .abd-sidebar .abd-mobile-topics[open] {
    padding-bottom: 15px;
  }
  .abd-sidebar .abd-mobile-topics .wp-block-heading {
    font-size: .88rem;
    margin: 14px 0 7px !important;
  }
  .abd-sidebar .abd-mobile-topics .wp-block-heading:not(:first-child) {
    margin: 18px 0 7px !important;
  }
  .abd-sidebar .abd-mobile-topics > summary + .wp-block-heading {
    margin-top: 6px !important;
  }
  .abd-sidebar .wp-block-navigation__container {
    gap: 7px !important;
  }
  .abd-article .wp-block-post-title {
    font-size: clamp(1.75rem, 5vw, 2rem);
  }
  .abd-footer {
    padding-block: 20px 18px;
  }
  .abd-footer .abd-footer-top {
    gap: 20px !important;
    margin-bottom: 16px !important;
  }
  .abd-footer .abd-footer-bottom {
    flex-direction: column;
  }
  .abd-footer .abd-footer-legal .wp-block-navigation__container {
    column-gap: 16px !important;
  }
}
