/*
Theme Name: Foma Authors
Theme URI: https://example.com/foma-authors
Author: Alexa
Author URI: https://example.com
Description: SEO-ориентированная тема для персональных страниц авторов православного журнала «Фома» и похожих изданий. Цветовая палитра и типографика вдохновлены сайтом foma.ru. Тема заточена под шаблон страницы автора (author.php) с полями «Образование», «Место работы», списком статей на foma.ru, списком публикаций из внешних источников и видео/интервью на YouTube. Поддерживает Rank Math SEO (расширение schema.org Person/ProfilePage, breadcrumbs, переменные тайтлов), выдаёт семантические JSON-LD триплеты для Google Knowledge Graph и AI-обзоров, использует неблокирующую (async/defer) загрузку стилей и скриптов.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: foma-authors
Tags: blog, one-column, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready, author-page
*/

/* -----------------------------------------------------------------------
   Дизайн-токены — палитра и типографика в стиле foma.ru
   ----------------------------------------------------------------------- */
:root{
  /* Основные цвета: гранатово-бордовый акцент (фирменный цвет "Фомы"),
     тёплый "бумажный" фон и графитовый текст — характерная стилистика
     православных культурно-просветительских изданий */
  --foma-color-primary:      #8E1B2C;
  --foma-color-primary-dark: #6B121F;
  --foma-color-primary-light:#B84152;
  --foma-color-accent:       #B4903E;
  --foma-color-accent-light: #E7D9B3;
  --foma-color-bg:           #FBF7EE;
  --foma-color-bg-alt:       #F2EADA;
  --foma-color-surface:      #FFFFFF;
  --foma-color-text:         #2B2420;
  --foma-color-text-muted:   #6E645A;
  --foma-color-border:       #E4D9C2;
  --foma-color-link:         #8E1B2C;
  --foma-color-link-hover:   #6B121F;

  --foma-font-heading: 'PT Serif', Georgia, 'Times New Roman', serif;
  --foma-font-body:    'PT Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;

  --foma-radius: 10px;
  --foma-shadow: 0 2px 18px rgba(43, 36, 32, 0.08);
  --foma-container: 1160px;
}

/* -----------------------------------------------------------------------
   Сброс и база
   ----------------------------------------------------------------------- */
*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--foma-color-bg);
  color: var(--foma-color-text);
  font-family: var(--foma-font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; height: auto; display: block; }
a{ color: var(--foma-color-link); text-decoration: none; }
a:hover, a:focus{ color: var(--foma-color-link-hover); text-decoration: underline; }
h1,h2,h3,h4{
  font-family: var(--foma-font-heading);
  color: var(--foma-color-text);
  line-height: 1.25;
  margin: 0 0 .6em;
}
h1{ font-size: clamp(28px, 4vw, 42px); }
h2{ font-size: clamp(22px, 3vw, 28px); border-bottom: 2px solid var(--foma-color-accent-light); padding-bottom: .35em; }
h3{ font-size: 19px; }
p{ margin: 0 0 1em; }
ul{ padding-left: 1.2em; }
.screen-reader-text{
  position:absolute !important; width:1px;height:1px;overflow:hidden;
  clip:rect(1px,1px,1px,1px); white-space:nowrap;
}
.skip-link{
  position:absolute; left:-9999px; top:0; z-index:10000;
  background:var(--foma-color-primary); color:#fff; padding:12px 18px;
}
.skip-link:focus{ left:10px; top:10px; }

.container{
  max-width: var(--foma-container);
  margin: 0 auto;
  padding: 0 20px;
}

/* -----------------------------------------------------------------------
   Шапка сайта
   ----------------------------------------------------------------------- */
.site-header{
  background: var(--foma-color-surface);
  border-bottom: 3px solid var(--foma-color-primary);
}
.site-header__inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
}
.site-branding{ display:flex; align-items:center; gap:12px; }
.site-branding img{ max-height: 46px; width:auto; }
.site-title{ font-family: var(--foma-font-heading); font-size: 24px; margin:0; }
.site-title a{ color: var(--foma-color-primary); }
.site-description{ font-size: 13px; color: var(--foma-color-text-muted); margin:0; }

.primary-menu{ list-style:none; display:flex; gap:22px; margin:0; padding:0; flex-wrap:wrap; }
.primary-menu a{ color: var(--foma-color-text); font-weight:600; font-size:15px; }
.primary-menu a:hover{ color: var(--foma-color-primary); }

/* -----------------------------------------------------------------------
   Автор: hero-блок
   ----------------------------------------------------------------------- */
.author-hero{
  background: linear-gradient(135deg, var(--foma-color-primary) 0%, var(--foma-color-primary-dark) 100%);
  color: #fff;
  padding: 48px 0;
}
.author-hero__inner{
  display:flex; gap:32px; align-items:center; flex-wrap:wrap;
}
.author-hero__photo{
  flex: 0 0 auto;
  width: 168px; height: 168px; border-radius: 50%;
  overflow:hidden; border:4px solid rgba(255,255,255,.85);
  box-shadow: var(--foma-shadow);
  background: #fff;
}
.author-hero__photo img{ width:100%; height:100%; object-fit:cover; }
.author-hero__body{ flex: 1 1 380px; min-width: 260px; }
.author-hero__name{ color:#fff; margin-bottom:.2em; }
.author-hero__role{
  font-size: 18px; font-weight:700; color: var(--foma-color-accent-light);
  margin-bottom:.5em;
}
.author-hero__org{ font-size:15px; opacity:.9; margin-bottom:.8em; }
.author-hero__bio{ max-width: 70ch; opacity:.95; }
.author-hero__social{ list-style:none; display:flex; gap:12px; padding:0; margin:16px 0 0; flex-wrap:wrap; }
.author-hero__social a{
  display:inline-flex; align-items:center; gap:6px;
  background: rgba(255,255,255,.14); color:#fff; border-radius: 999px;
  padding: 7px 14px; font-size: 14px; font-weight:600;
}
.author-hero__social a:hover{ background: rgba(255,255,255,.26); text-decoration:none; }

/* Быстрые факты — карточка для сниппетов/AI-обзоров */
.author-facts{
  background: var(--foma-color-surface);
  border: 1px solid var(--foma-color-border);
  border-radius: var(--foma-radius);
  box-shadow: var(--foma-shadow);
  padding: 22px 26px;
  margin: -34px auto 40px;
  max-width: calc(var(--foma-container) - 40px);
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
  gap: 18px 26px;
  position: relative;
  z-index: 2;
}
.author-facts dt{ font-size:13px; text-transform:uppercase; letter-spacing:.04em; color:var(--foma-color-text-muted); font-weight:700; }
.author-facts dd{ margin:2px 0 0; font-weight:600; }

.author-content{ padding: 10px 0 60px; }
.author-section{ margin-bottom: 46px; }
.author-section__intro{ color: var(--foma-color-text-muted); margin-top:-6px; }

/* Образование / Место работы — таймлайн-список */
.timeline-list{ list-style:none; margin:0; padding:0; }
.timeline-list li{
  position: relative; padding: 4px 0 18px 26px; border-left: 2px solid var(--foma-color-accent-light);
}
.timeline-list li::before{
  content:""; position:absolute; left:-7px; top:8px; width:12px; height:12px;
  border-radius:50%; background: var(--foma-color-accent); border:2px solid #fff; box-shadow:0 0 0 2px var(--foma-color-accent);
}
.timeline-list li:last-child{ border-left-color: transparent; }
.timeline-list .item-title{ font-weight:700; }
.timeline-list .item-meta{ color: var(--foma-color-text-muted); font-size:14px; }

/* Списки статей / публикаций — карточки */
.card-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 20px; }
.card{
  background: var(--foma-color-surface); border:1px solid var(--foma-color-border);
  border-radius: var(--foma-radius); padding: 18px 20px; box-shadow: var(--foma-shadow);
  display:flex; flex-direction:column;
}
.card h3{ margin-bottom:.3em; font-size:17px; }
.card h3 a{ color: var(--foma-color-text); }
.card h3 a:hover{ color: var(--foma-color-primary); }
.card .card-meta{ font-size:13px; color:var(--foma-color-text-muted); margin-bottom:.5em; }
.card .card-excerpt{ font-size:15px; color:var(--foma-color-text-muted); flex:1; }
.card .card-source{
  display:inline-block; margin-top:10px; font-size:12px; font-weight:700; letter-spacing:.03em;
  color: var(--foma-color-primary); text-transform:uppercase;
}

/* Видео — превью с "ленивым" воспроизведением (facade) */
.video-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap:20px; }
.video-card{ background:#000; border-radius: var(--foma-radius); overflow:hidden; box-shadow: var(--foma-shadow); }
.lite-yt{ position:relative; width:100%; aspect-ratio:16/9; background-size:cover; background-position:center; cursor:pointer; }
.lite-yt::before{
  content:""; position:absolute; inset:0; background: rgba(0,0,0,.25);
  transition: background .2s;
}
.lite-yt:hover::before{ background: rgba(0,0,0,.4); }
.lite-yt .play-btn{
  position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:64px; height:64px; border-radius:50%;
  background: var(--foma-color-primary); display:flex; align-items:center; justify-content:center;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.lite-yt .play-btn::after{
  content:""; border-style:solid; border-width:11px 0 11px 18px;
  border-color: transparent transparent transparent #fff; margin-left:4px;
}
.lite-yt iframe{ position:absolute; inset:0; width:100%; height:100%; border:0; }
.video-card__title{ color:#fff; background:#111; padding:12px 14px; font-size:14px; font-weight:600; }
.video-card__title a{ color:#fff; }

/* «Показать ещё» для длинных списков статей/видео */
.card-grid.js-reveal .card:nth-child(n+7){ display:none; }
.card-grid.js-reveal.is-expanded .card{ display:flex; }
.video-grid.js-reveal .video-card:nth-child(n+7){ display:none; }
.video-grid.js-reveal.is-expanded .video-card{ display:block; }
.reveal-toggle{ margin-top:16px; }

/* Полная биография (шаблон страницы «Author») */
.author-bio-full p{ margin-bottom:1em; max-width:75ch; }

/* Блок «В Википедии» */
.wikipedia-card{
	background: var(--foma-color-surface); border:1px solid var(--foma-color-border);
	border-left:4px solid var(--foma-color-accent); border-radius: var(--foma-radius);
	padding:18px 22px; box-shadow: var(--foma-shadow); max-width:70ch;
}

/* FAQ (структурировано для FAQPage / AI-ответов) */
.faq-list{ display:flex; flex-direction:column; gap:10px; }
.faq-item{
  background: var(--foma-color-surface); border:1px solid var(--foma-color-border);
  border-radius: var(--foma-radius);
}
.faq-item summary{
  cursor:pointer; padding:14px 18px; font-weight:700; font-family: var(--foma-font-heading); font-size:17px;
  list-style:none;
}
.faq-item summary::-webkit-details-marker{ display:none; }
.faq-item summary::after{ content:"+"; float:right; color: var(--foma-color-primary); font-size:20px; }
.faq-item[open] summary::after{ content:"–"; }
.faq-item .faq-answer{ padding: 0 18px 16px; color: var(--foma-color-text); }

/* Хлебные крошки (дополняют вывод Rank Math при необходимости) */
.foma-breadcrumbs{ font-size:13px; color:var(--foma-color-text-muted); margin: 14px 0; }
.foma-breadcrumbs a{ color: var(--foma-color-text-muted); text-decoration:underline; }

/* Подвал */
.site-footer{
  background: var(--foma-color-text); color: #EFE7D6; padding: 36px 0; margin-top: 40px;
}
.site-footer a{ color: #EFE7D6; }
.site-footer .container{ display:flex; justify-content:space-between; flex-wrap:wrap; gap:16px; font-size:14px; }

/* Утилиты */
.badge{
  display:inline-block; background: var(--foma-color-accent-light); color: var(--foma-color-primary-dark);
  border-radius:999px; padding:2px 10px; font-size:12px; font-weight:700; margin-right:6px;
}
.button{
  display:inline-block; background: var(--foma-color-primary); color:#fff; padding:10px 18px;
  border-radius:8px; font-weight:700;
}
.button:hover{ background: var(--foma-color-primary-dark); color:#fff; text-decoration:none; }

@media (max-width: 640px){
  .author-hero__inner{ text-align:center; justify-content:center; }
  .author-hero__social{ justify-content:center; }
  .author-facts{ margin-top: 20px; }
}
