/*
Theme Name: Proderm Editorial
Theme URI: https://proderm.com.ua
Description: Светлая editorial/журнальная тема для блога о психологии отношений и совместном отдыхе. Чистый семантический SEO-HTML, один H1 на страницу, редакционная сетка, быстрая загрузка.
Author: Claude Dev
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: proderm
*/

/* ============================================================
   Design tokens — warm light editorial / magazine
   ============================================================ */
:root {
  --paper:        #f7f3ec;
  --paper-2:      #efe8da;
  --card:         #ffffff;
  --ink:          #211c16;
  --ink-soft:     #4d463c;
  --muted:        #837a6c;
  --rule:         #e3d9c8;
  --rule-strong:  #d2c4ac;
  --terra:        #c2502f;   /* terracotta accent */
  --terra-dark:   #a23f22;
  --sage:         #6f7d5e;   /* secondary        */

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --text-base: clamp(1rem, 0.96rem + 0.25vw, 1.08rem);
  --text-mast: clamp(2.6rem, 1.4rem + 5vw, 5.4rem);
  --text-lead: clamp(1.9rem, 1.2rem + 2.6vw, 3.1rem);
  --text-h2:   clamp(1.7rem, 1.2rem + 1.8vw, 2.4rem);
  --text-h3:   clamp(1.25rem, 1.05rem + 0.8vw, 1.55rem);

  --space-section: clamp(3.5rem, 2.5rem + 4vw, 6.5rem);
  --container:    1200px;
  --container-narrow: 720px;
  --radius:       4px;

  --duration: 260ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--terra); text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover { color: var(--terra-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  color: var(--ink);
  font-optical-sizing: auto;
}
p { margin: 0 0 1.2em; }

:focus-visible { outline: 2px solid var(--terra); outline-offset: 3px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.1rem, 0.5rem + 3vw, 2.6rem); }
.container--narrow { max-width: var(--container-narrow); }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: 0.75rem 1.25rem; z-index: 1000; font-weight: 600; }
.skip-link:focus { left: 0; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }

/* small-caps editorial label */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terra);
}

/* ============================================================
   Header
   ============================================================ */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  min-height: 84px;
}
.site-brand {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.site-brand:hover { color: var(--terra); }
.site-brand img { max-height: 48px; width: auto; }

.main-nav ul { list-style: none; display: flex; gap: clamp(1rem, 0.5rem + 1.6vw, 2.4rem); margin: 0; padding: 0; }
.main-nav a {
  color: var(--ink-soft);
  font-size: 0.9rem; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding-block: 0.3rem; border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--ink); border-color: var(--terra); }

.nav-toggle { display: none; background: none; border: 1px solid var(--rule-strong); color: var(--ink); width: 46px; height: 42px; border-radius: 3px; cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle svg { width: 22px; height: 22px; }

/* ============================================================
   Masthead hero (editorial — text-led, no full cover)
   ============================================================ */
.masthead {
  padding-block: clamp(3rem, 4vw, 5.5rem) clamp(2.5rem, 3vw, 4rem);
  border-bottom: 1px solid var(--rule);
}
.masthead__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: clamp(1.5rem, 3vw, 4rem);
  align-items: end;
}
.masthead h1 { font-size: var(--text-mast); margin: 0.6rem 0 0; text-wrap: balance; }
.masthead h1 em { font-style: italic; color: var(--terra); }
.masthead__lede { color: var(--ink-soft); font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem); border-top: 2px solid var(--ink); padding-top: 1rem; margin: 0; }

/* ============================================================
   Featured lead post
   ============================================================ */
.lead { padding-top: var(--space-section); }
.lead__inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(1.5rem, 3vw, 3.5rem);
  align-items: center;
}
.lead__media { overflow: hidden; border: 1px solid var(--rule); }
.lead__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 700ms var(--ease); }
.lead:hover .lead__media img { transform: scale(1.04); }
.lead__title { font-size: var(--text-lead); margin: 0.7rem 0 0.8rem; }
.lead__title a { color: var(--ink); }
.lead__title a:hover { color: var(--terra); }
.lead__excerpt { color: var(--ink-soft); font-size: 1.1rem; max-width: 46ch; }
.meta-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; color: var(--muted); font-size: 0.85rem; margin-top: 1rem; }
.meta-row .dot { width: 4px; height: 4px; background: var(--terra); border-radius: 50%; }

/* ============================================================
   Section head
   ============================================================ */
.section { padding-block: var(--space-section); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap; margin-bottom: clamp(1.8rem, 1.2rem + 2vw, 3rem); padding-bottom: 1rem; border-bottom: 2px solid var(--ink); }
.section-head h2, .section-head__title { font-size: var(--text-h2); margin: 0; }
.section-head__title { font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: -0.015em; color: var(--ink); }
.section-head__link { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }

/* ============================================================
   Editorial post grid + cards
   ============================================================ */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: clamp(1.6rem, 1rem + 2vw, 3rem) clamp(1.4rem, 1rem + 1.5vw, 2.4rem); }
.card { display: flex; flex-direction: column; }
.card__media { overflow: hidden; border: 1px solid var(--rule); background: var(--paper-2); aspect-ratio: 3 / 2; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.card:hover .card__media img { transform: scale(1.05); }
.card__media-fallback { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--paper-2), #e6dcc8); }
.card__body { padding-top: 1.1rem; }
.card__cat { display: inline-block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--terra); margin-bottom: 0.5rem; }
.card__title { font-size: var(--text-h3); line-height: 1.18; margin: 0 0 0.5rem; }
.card__title a { color: var(--ink); background-image: linear-gradient(var(--terra), var(--terra)); background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size var(--duration) var(--ease), color var(--duration) var(--ease); padding-bottom: 2px; }
.card__title a:hover { color: var(--terra); background-size: 100% 1px; }
.card__excerpt { color: var(--ink-soft); font-size: 0.96rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__meta { margin-top: 0.8rem; font-size: 0.8rem; color: var(--muted); display: flex; gap: 0.6rem; align-items: center; }
.card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }

/* ============================================================
   Single
   ============================================================ */
.breadcrumbs { font-size: 0.84rem; color: var(--muted); padding-block: 1.3rem; border-bottom: 1px solid var(--rule); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; align-items: center; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 0.5rem; }
.breadcrumbs li:not(:last-child)::after { content: "—"; color: var(--rule-strong); }
.breadcrumbs a { color: var(--ink-soft); }

.entry-header { padding-block: clamp(1.5rem, 3vw, 2.8rem) clamp(1rem, 2vw, 1.8rem); text-align: center; }
.entry-title { font-size: clamp(2.1rem, 1.3rem + 3.2vw, 3.9rem); margin: 0.7rem auto 1rem; max-width: 16ch; text-wrap: balance; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; justify-content: center; color: var(--muted); font-size: 0.9rem; }
.entry-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--terra); }

.entry-featured { margin: 0 0 clamp(1.8rem, 3vw, 3rem); border: 1px solid var(--rule); }
.entry-featured img { width: 100%; max-height: 580px; object-fit: cover; }

.entry-content { font-size: clamp(1.08rem, 1rem + 0.4vw, 1.22rem); line-height: 1.85; color: var(--ink-soft); }
.entry-content > p:first-of-type::first-letter {
  font-family: var(--font-display); font-weight: 600; float: left;
  font-size: 3.6em; line-height: 0.72; padding: 0.05em 0.12em 0 0; color: var(--terra);
}
.entry-content > * { margin-bottom: 1.4em; }
.entry-content h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); margin: 1.8em 0 0.5em; color: var(--ink); }
.entry-content h3 { font-size: var(--text-h3); margin: 1.5em 0 0.4em; color: var(--ink); }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content img { border: 1px solid var(--rule); }
.entry-content blockquote { border-left: 3px solid var(--terra); margin: 1.6em 0; padding: 0.2em 0 0.2em 1.6rem; font-family: var(--font-display); font-size: 1.5rem; font-style: italic; color: var(--ink); }
.entry-content ul, .entry-content ol { padding-left: 1.4rem; }
.entry-content li { margin-bottom: 0.4em; }
.entry-content figcaption { color: var(--muted); font-size: 0.86rem; text-align: center; margin-top: 0.5rem; }

.entry-tags { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 2.5rem; padding-top: 1.8rem; border-top: 1px solid var(--rule); }
.entry-tags a { font-size: 0.82rem; color: var(--ink-soft); border: 1px solid var(--rule-strong); padding: 0.35rem 0.9rem; border-radius: 999px; }
.entry-tags a:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.related { margin-top: var(--space-section); padding-top: var(--space-section); border-top: 1px solid var(--rule); }

/* ============================================================
   Archive / page hero
   ============================================================ */
.page-hero { padding-block: clamp(2.8rem, 4vw, 4.5rem) clamp(1.8rem, 2.5vw, 2.5rem); border-bottom: 2px solid var(--ink); }
.page-hero h1 { font-size: clamp(2.2rem, 1.4rem + 3vw, 4rem); margin: 0.4rem 0 0.5rem; }
.page-hero p { color: var(--ink-soft); max-width: 60ch; margin: 0; }

/* ============================================================
   Buttons + pagination
   ============================================================ */
.btn { display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.85rem 1.7rem; font-weight: 600; font-size: 0.9rem; letter-spacing: 0.04em; text-transform: uppercase; border-radius: 3px; transition: transform var(--duration) var(--ease), background var(--duration) var(--ease), color var(--duration) var(--ease); }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--terra); color: #fff; transform: translateY(-2px); }

.pagination { margin-top: clamp(2.5rem, 4vw, 4rem); }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.pagination .page-numbers { min-width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; padding-inline: 0.7rem; border: 1px solid var(--rule-strong); color: var(--ink-soft); font-weight: 600; }
.pagination .page-numbers:hover { border-color: var(--terra); color: var(--terra); }
.pagination .page-numbers.current { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { margin-top: var(--space-section); border-top: 2px solid var(--ink); background: var(--paper-2); padding-block: clamp(3rem, 5vw, 4.5rem) 2rem; }
.site-footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2.5rem; margin-bottom: 3rem; }
.site-footer__title { font-family: var(--font-body); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin: 0 0 1.1rem; }
.site-footer__about .site-footer__brand { font-family: var(--font-display); font-size: 1.6rem; color: var(--ink); display: block; margin-bottom: 0.6rem; }
.site-footer__about p { color: var(--ink-soft); max-width: 38ch; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.site-footer ul a { color: var(--ink-soft); font-size: 0.95rem; }
.site-footer ul a:hover { color: var(--terra); }
.site-footer__bottom { border-top: 1px solid var(--rule-strong); padding-top: 1.6rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: 0.84rem; color: var(--muted); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .main-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--rule); padding: 1rem clamp(1.1rem,0.5rem+3vw,2.6rem) 1.5rem; display: none; z-index: 50; }
  .site-header { position: relative; }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0.2rem; }
  .main-nav a { display: block; padding: 0.6rem 0; }
  .masthead__grid, .lead__inner { grid-template-columns: 1fr; }
  .masthead__lede { border-top: none; padding-top: 0; }
  .lead__media { order: -1; }
  .site-footer__grid { grid-template-columns: 1fr; gap: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
