/*
Theme Name: Saltsymphony
Theme URI: https://saltsymphony.com.ua
Description: Арт-редакционная тема для блога о психологии любви: тёплая слоновая кость, кобальтовый акцент с коралловыми вкраплениями, ступенчатая галерея-каталог с порядковыми номерами. Чистый семантический 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: saltsymphony
*/

/* ============================================================
   Tokens — art editorial: warm ivory + cobalt + coral
   ============================================================ */
:root {
  --paper:     #f6f1e8;
  --paper-2:   #ece3d4;
  --card:      #fffdf8;
  --ink:       #181511;
  --ink-soft:  #4b443a;
  --muted:     #8c8273;
  --line:      #e0d6c4;
  --line-2:    #cdbfa6;
  --cobalt:    #2438d4;
  --cobalt-dk: #1a29a8;
  --coral:     #ff6f5e;

  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --text-base: clamp(1rem, 0.96rem + 0.25vw, 1.08rem);
  --text-hero: clamp(2.8rem, 1.4rem + 6.5vw, 7rem);
  --text-h2:   clamp(1.8rem, 1.3rem + 2vw, 2.7rem);
  --text-lead: clamp(2rem, 1.3rem + 3vw, 3.8rem);
  --text-h3:   clamp(1.35rem, 1.1rem + 1vw, 1.85rem);

  --space-section: clamp(3.2rem, 2.3rem + 4vw, 6rem);
  --container:  1220px;
  --container-narrow: 720px;
  --radius:     6px;

  --duration: 280ms;
  --ease: cubic-bezier(0.16, 1, 0.3, 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(--cobalt); text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover { color: var(--coral); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.05; letter-spacing: -0.01em; margin: 0 0 0.5em; color: var(--ink); }
p { margin: 0 0 1.2em; }

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

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

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--cobalt); color: #fff; 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; }

.eyebrow { font-family: var(--font-body); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; color: var(--cobalt); }
.pill { display: inline-flex; font-family: var(--font-body); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cobalt); }
.pill::before { content: "—"; margin-right: 0.4rem; color: var(--coral); }

/* ============================================================
   Header
   ============================================================ */
.site-header { background: var(--paper); border-bottom: 1px solid var(--ink); }
.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-weight: 700; font-size: 1.7rem; font-style: italic; color: var(--ink); display: inline-flex; align-items: center; gap: 0.5rem; }
.site-brand:hover { color: var(--cobalt); }
.site-brand__heart { width: 20px; height: 20px; color: var(--coral); flex: none; }
.site-brand img { max-height: 48px; width: auto; }
.main-nav ul { list-style: none; display: flex; gap: clamp(0.9rem, 0.4rem + 1.5vw, 2.2rem); margin: 0; padding: 0; }
.main-nav a { color: var(--ink-soft); font-size: 0.84rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--cobalt); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-2); color: var(--ink); width: 46px; height: 42px; border-radius: 4px; cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle svg { width: 22px; height: 22px; }

/* ============================================================
   Hero (art-magazine masthead)
   ============================================================ */
.hero { padding-block: clamp(3rem, 5vw, 6rem) clamp(2rem, 3vw, 3rem); text-align: center; position: relative; }
.hero__issue { display: inline-flex; align-items: center; gap: 0.8rem; font-family: var(--font-body); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--cobalt); margin-bottom: 1.4rem; }
.hero__issue::before, .hero__issue::after { content: ""; width: clamp(28px, 6vw, 70px); height: 1px; background: var(--line-2); }
.hero h1 { font-size: var(--text-hero); margin: 0 auto; max-width: 16ch; }
.hero h1 em { color: var(--cobalt); }
.hero__lede { color: var(--ink-soft); font-size: clamp(1.05rem, 1rem + 0.5vw, 1.3rem); max-width: 60ch; margin: 1.6rem auto 0; }
.hero__rule { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 2.4rem; color: var(--coral); }
.hero__rule::before, .hero__rule::after { content: ""; height: 1px; width: min(120px, 22vw); background: var(--line-2); }
.hero__rule span { width: 8px; height: 8px; background: var(--coral); transform: rotate(45deg); }

/* ============================================================
   Gallery (staggered catalogue with index numbers)
   ============================================================ */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(2rem, 1.4rem + 2.5vw, 4rem) clamp(1.6rem, 1rem + 2vw, 3.2rem); align-items: start; counter-reset: gx; }
.g-card { position: relative; counter-increment: gx; }
.gallery .g-card:not(.g-card--lead):nth-child(even) { margin-top: clamp(0px, -2rem + 6vw, 4rem); }
.g-card__media { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: var(--paper-2); border: 1px solid var(--line); }
.g-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease); }
.g-card:hover .g-card__media img { transform: scale(1.05); }
.g-card__media-fallback { display: block; width: 100%; height: 100%; background: linear-gradient(140deg, #e7ddcb, #d8ccb4); }
.g-card__num { position: absolute; top: -0.4em; left: -0.1em; font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: clamp(2.4rem, 1.5rem + 3vw, 4rem); color: var(--coral); line-height: 1; z-index: 2; pointer-events: none; }
.g-card__num::before { content: counter(gx, decimal-leading-zero); }
.g-card__body { padding-top: 1.1rem; }
.g-card__title { font-size: var(--text-h3); line-height: 1.12; margin: 0.5rem 0 0.5rem; }
.g-card__title a { color: var(--ink); }
.g-card__title a:hover { color: var(--cobalt); }
.g-card__excerpt { color: var(--ink-soft); font-size: 0.98rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.g-card__meta { margin-top: 0.7rem; font-size: 0.8rem; color: var(--muted); display: flex; gap: 0.6rem; align-items: center; }
.g-card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--coral); }

/* lead (overture) — full width */
.g-card--lead { grid-column: 1 / -1; display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(1.4rem, 1rem + 2vw, 3rem); align-items: center; border-bottom: 1px solid var(--line); padding-bottom: clamp(2rem, 1.4rem + 2vw, 3.4rem); }
.g-card--lead .g-card__media { aspect-ratio: 16 / 11; }
.g-card--lead .g-card__num { position: static; display: inline-block; margin-bottom: 0.4rem; }
.g-card--lead .g-card__title { font-size: var(--text-lead); margin: 0.4rem 0 0.8rem; }
.g-card--lead .g-card__excerpt { font-size: 1.1rem; -webkit-line-clamp: 3; }

/* ============================================================
   Section head
   ============================================================ */
.section { padding-block: var(--space-section); }
.section--tight { padding-top: clamp(2rem, 3vw, 3rem); }
.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, 2.8rem); }
.section-head h2, .section-head__title { font-size: var(--text-h2); margin: 0; }
.section-head__title { font-family: var(--font-display); font-weight: 700; line-height: 1.05; color: var(--ink); }
.section-head .eyebrow { display: block; margin-bottom: 0.4rem; }

/* ============================================================
   Single
   ============================================================ */
.breadcrumbs { font-size: 0.84rem; color: var(--muted); padding-block: 1.3rem; }
.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(--coral); }
.breadcrumbs a { color: var(--ink-soft); }

.entry-header { padding-block: clamp(1rem, 2vw, 2rem) clamp(1.2rem, 2vw, 2rem); text-align: center; }
.entry-title { font-size: clamp(2.2rem, 1.4rem + 3.4vw, 4.4rem); margin: 0.8rem auto 1rem; max-width: 18ch; }
.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(--coral); }

.entry-featured { margin: 0 0 clamp(1.8rem, 3vw, 2.8rem); border: 1px solid var(--line); }
.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.9; color: var(--ink-soft); }
.entry-content > p:first-of-type::first-letter { font-family: var(--font-display); font-weight: 700; float: left; font-size: 3.8em; line-height: 0.74; padding: 0.06em 0.14em 0 0; color: var(--cobalt); }
.entry-content > * { margin-bottom: 1.4em; }
.entry-content h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); 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(--line); }
.entry-content blockquote { border: none; margin: 1.8em 0; padding: 0; font-family: var(--font-display); font-style: italic; font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); line-height: 1.3; color: var(--cobalt); text-align: center; }
.entry-content ul, .entry-content ol { padding-left: 1.4rem; }
.entry-content li { margin-bottom: 0.4em; }
.entry-content li::marker { color: var(--coral); }
.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(--line); }
.entry-tags a { font-size: 0.82rem; color: var(--ink); border: 1px solid var(--line-2); padding: 0.4rem 0.9rem; border-radius: 999px; }
.entry-tags a:hover { background: var(--cobalt); color: #fff; border-color: var(--cobalt); }

.related { margin-top: var(--space-section); padding-top: clamp(2rem, 3vw, 3rem); border-top: 1px solid var(--ink); }

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

/* ============================================================
   Buttons + pagination
   ============================================================ */
.btn { display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.9rem 1.8rem; font-family: var(--font-body); font-weight: 600; font-size: 0.9rem; letter-spacing: 0.04em; text-transform: uppercase; }
.btn--primary { background: var(--cobalt); color: #fff; }
.btn--primary:hover { background: var(--coral); color: #fff; }

.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(--line-2); color: var(--ink-soft); font-weight: 600; }
.pagination .page-numbers:hover { border-color: var(--cobalt); color: var(--cobalt); }
.pagination .page-numbers.current { background: var(--cobalt); color: #fff; border-color: var(--cobalt); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { margin-top: var(--space-section); border-top: 1px 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-style: italic; font-size: 1.8rem; 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(--cobalt); }
.site-footer__bottom { border-top: 1px solid var(--line-2); 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(--ink); padding: 1rem clamp(1.1rem,0.5rem+3vw,2.8rem) 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; }
  .g-card--lead { grid-template-columns: 1fr; }
  .g-card--lead .g-card__media { order: -1; }
  .site-footer__grid { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 600px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery .g-card:not(.g-card--lead):nth-child(even) { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
