/*
Theme Name: ТОКМ Мінімал
Theme URI: https://tokm.com.ua
Author: Compas Agency
Description: Мінімалістична тема для Тернопільського обласного краєзнавчого музею
Version: 1.0
Text Domain: tokm
*/

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Raleway:wght@300;400;500;600;700;800&display=swap');

/* =============================================
   ЗМІННІ
   ============================================= */
:root {
  --cream:      #faf9f7;
  --beige:      #e8e0d5;
  --gold:       #c9b99a;
  --dark-gold:  #8a7a6a;
  --ink:        #2a2018;
  --ink-light:  #6a5a4a;
  --gray:       #aaa;
  --gray-light: #e8e4df;
  --white:      #ffffff;
  --blue:       #1a6ba0;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans:  'Raleway', sans-serif;
  --shadow-sm:  0 2px 10px rgba(0,0,0,.06);
  --shadow-md:  0 6px 24px rgba(0,0,0,.09);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.13);
  --radius:     4px;
  --transition: .3s ease;
}

/* =============================================
   RESET + BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--white);
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; transition: color var(--transition); }

ul, ol { list-style: none; }

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-serif);
  line-height: 1.25;
  font-weight: 600;
  color: var(--ink);
}

p { margin: 0; }

/* =============================================
   УТИЛІТИ
   ============================================= */
.container { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
.container--narrow { max-width: 860px; margin: 0 auto; padding: 0 40px; }

.label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--dark-gold);
}

.label--line {
  display: flex;
  align-items: center;
  gap: 16px;
}
.label--line::before {
  content: '';
  width: 36px;
  height: 1px;
  background: var(--gold);
}

.btn {
  display: inline-block;
  padding: 13px 36px;
  border: 1.5px solid var(--ink);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.btn:hover { background: var(--ink); color: var(--white); }

.btn--ghost {
  border-color: rgba(255,255,255,.5);
  color: var(--white);
}
.btn--ghost:hover { background: var(--white); color: var(--ink); }

/* =============================================
   ШАПКА
   ============================================= */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-light);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 20px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Логотип */
.site-logo { display: flex; align-items: center; gap: 16px; flex-shrink: 0; text-decoration: none; }
/* Якщо є зображення — текст і роздільник поруч */
.site-logo img { height: 64px; width: auto; }
.logo-divider { width: 1px; height: 52px; background: var(--gray-light); }
.logo-text-top {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gray);
  line-height: 2;
}
.logo-text-main {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink);
}
/* Якщо поруч є img — ховаємо текстову частину щоб не дублювалась */
.site-logo img ~ .logo-divider,
.site-logo img ~ div { display: none; }

/* Навігація */
.site-nav { margin-left: auto; min-width: 0; overflow: hidden; }
.site-nav ul { display: flex; gap: 0; flex-wrap: nowrap; }
.site-nav ul li { position: relative; }
.site-nav ul li > a {
  display: block;
  padding: 8px 10px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--gray);
  white-space: nowrap;
  transition: color var(--transition);
}
.site-nav ul li > a:hover,
.site-nav ul li.current-menu-item > a,
.site-nav ul li.current-menu-ancestor > a { color: var(--ink); }

/* Проміжний розмір 769–1300px */
@media (min-width: 769px) and (max-width: 1300px) {
  .header-inner { gap: 8px; padding: 12px 16px; }
  .site-nav ul li > a { padding: 8px 6px; font-size: 9px; letter-spacing: .02em; }
  .site-logo img { height: 48px; }
  .logo-divider { display: none; }
  .logo-text-top { display: none; }
  .logo-text-main { font-size: 20px; }
}

/* Підменю */
.site-nav ul ul {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  min-width: 220px;
  box-shadow: var(--shadow-md);
  border-top: 2px solid var(--gold);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--transition);
  z-index: 100;
}
.site-nav ul li:hover > ul {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.site-nav ul ul li { border-bottom: 1px solid var(--gray-light); }
.site-nav ul ul li:last-child { border-bottom: none; }
.site-nav ul ul li a {
  padding: 12px 20px;
  font-size: 12px;
  text-transform: none;
  letter-spacing: .02em;
  color: var(--ink-light);
}
.site-nav ul ul li a:hover { color: var(--ink); padding-left: 26px; }

/* Кнопка мобільного меню */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  margin-left: auto;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--ink);
  transition: transform var(--transition), opacity var(--transition);
}

/* =============================================
   ГОЛОВНА СТОРІНКА — HERO + АНОНСИ
   ============================================= */
.front-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  min-height: 540px;
  border-bottom: 1px solid var(--gray-light);
}

/* Головний банер */
.hero-main {
  background: linear-gradient(160deg, var(--beige) 0%, #c9b99a 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 56px;
}
.hero-main .hero-bg-text {
  position: absolute;
  right: -20px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-serif);
  font-size: 220px;
  font-weight: 700;
  color: rgba(42,32,24,.06);
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.hero-content { position: relative; z-index: 2; }
.hero-content .label { margin-bottom: 20px; }
.hero-content h1 {
  font-size: clamp(36px, 4vw, 56px);
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 16px;
  line-height: 1.1;
}
.hero-content p {
  font-size: 15px;
  color: var(--ink-light);
  line-height: 1.8;
  margin-bottom: 32px;
  max-width: 460px;
}

/* Панель анонсів */
.events-panel {
  background: var(--cream);
  border-left: 1px solid var(--gray-light);
  display: flex;
  flex-direction: column;
}
.events-panel-header {
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--gray-light);
}
.events-panel-header .label { margin-bottom: 0; }

.event-item {
  display: flex;
  gap: 20px;
  padding: 22px 32px;
  border-bottom: 1px solid var(--gray-light);
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  color: inherit;
}
.event-item:last-child { border-bottom: none; }
.event-item:hover { background: rgba(201,185,154,.12); }

.event-date {
  text-align: center;
  min-width: 44px;
  flex-shrink: 0;
}
.event-date .day {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 400;
  color: var(--gold);
  line-height: 1;
  display: block;
}
.event-date .mon {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gray);
  display: block;
  margin-top: 4px;
}

.event-info { flex: 1; }
.event-info .event-cat {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 6px;
}
.event-info h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 4px;
}
.event-info p {
  font-size: 12px;
  color: var(--gray);
  line-height: 1.5;
}

.events-panel-footer {
  margin-top: auto;
  padding: 20px 32px;
  border-top: 1px solid var(--gray-light);
}
.events-panel-footer a {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dark-gold);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: gap var(--transition), color var(--transition);
}
.events-panel-footer a:hover { gap: 16px; color: var(--ink); }
.events-panel-footer a::after { content: '→'; }

/* =============================================
   СЕКЦІЇ
   ============================================= */
.section { padding: 72px 0; }
.section--cream { background: var(--cream); }
.section--border { border-top: 1px solid var(--gray-light); }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 48px;
}
.section-header h2 {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
}
.section-header .label--link {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dark-gold);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: gap var(--transition), color var(--transition);
}
.section-header .label--link:hover { gap: 14px; color: var(--ink); }
.section-header .label--link::after { content: '→'; }

/* =============================================
   КАРТКИ ПОСТІВ
   ============================================= */
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.posts-grid--2 { grid-template-columns: repeat(2, 1fr); }
.posts-grid--4 { grid-template-columns: repeat(4, 1fr); }

.post-card {
  cursor: pointer;
  transition: transform var(--transition);
}
.post-card:hover { transform: translateY(-4px); }

.post-card__img {
  aspect-ratio: 4/3;
  overflow: hidden;
  margin-bottom: 20px;
  background: var(--beige);
}
.post-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.post-card:hover .post-card__img img { transform: scale(1.04); }

.post-card__cat {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gray);
  display: block;
  margin-bottom: 10px;
}

.post-card__title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 10px;
  transition: color var(--transition);
}
.post-card:hover .post-card__title { color: var(--dark-gold); }

.post-card__excerpt {
  font-size: 14px;
  color: var(--ink-light);
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__meta {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--gray);
  padding-top: 16px;
  border-top: 1px solid var(--gray-light);
}

/* =============================================
   СТОРІНКА СТАТТІ
   ============================================= */
.single-wrap { padding: 56px 0 80px; }

.breadcrumbs {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--gray);
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.breadcrumbs a { color: var(--gold); transition: color var(--transition); }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs span { color: var(--gray-light); }

.single-cover {
  width: 100%;
  aspect-ratio: 16/7;
  object-fit: cover;
  margin-bottom: 40px;
  border-radius: var(--radius);
}

.single-header { margin-bottom: 32px; }
.single-header .label { margin-bottom: 16px; }
.single-header h1 {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 600;
  font-style: italic;
  line-height: 1.15;
  margin-bottom: 20px;
}

.single-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid var(--gray-light);
  border-bottom: 1px solid var(--gray-light);
  font-size: 13px;
  color: var(--gray);
}
.single-meta .author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.single-socials { margin-left: auto; display: flex; gap: 10px; }
.single-socials a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--gray);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.single-socials a:hover { border-color: var(--ink); background: var(--ink); color: var(--white); }

/* Контент статті */
.single-content {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.85;
  color: var(--ink-light);
  margin: 36px 0;
}
.single-content p { margin-bottom: 24px; }
.single-content h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--ink);
  margin: 40px 0 16px;
}
.single-content h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--ink);
  margin: 32px 0 12px;
}
.single-content img {
  width: 100%;
  border-radius: var(--radius);
  margin: 32px 0;
}
.single-content blockquote {
  border-left: 3px solid var(--gold);
  padding: 4px 0 4px 28px;
  margin: 32px 0;
  font-style: italic;
  font-size: 19px;
  color: var(--ink);
}
.single-content ul, .single-content ol {
  margin: 16px 0 24px 24px;
}
.single-content li { margin-bottom: 8px; }
.single-content a { color: var(--dark-gold); border-bottom: 1px solid var(--gold); }
.single-content a:hover { color: var(--ink); border-color: var(--ink); }

/* Теги */
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 40px 0; }
.post-tags a {
  display: inline-block;
  padding: 5px 16px;
  border: 1px solid var(--gray-light);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray);
  transition: all var(--transition);
}
.post-tags a:hover { border-color: var(--ink); color: var(--ink); }

/* Навігація пост */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 48px;
  padding-top: 48px;
  border-top: 1px solid var(--gray-light);
}
.post-nav-item {
  padding: 24px;
  background: var(--cream);
  transition: background var(--transition);
  text-decoration: none;
  color: inherit;
}
.post-nav-item:hover { background: var(--beige); }
.post-nav-item .label { margin-bottom: 10px; }
.post-nav-item h3 {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.35;
  color: var(--ink);
}
.post-nav-item--next { text-align: right; }

/* =============================================
   АРХІВ / КАТЕГОРІЯ
   ============================================= */
.archive-header {
  background: var(--cream);
  padding: 48px 0;
  border-bottom: 1px solid var(--gray-light);
  margin-bottom: 56px;
}
.archive-header .label { margin-bottom: 12px; }
.archive-header h1 {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 600;
  font-style: italic;
}

.archive-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 56px;
}

/* =============================================
   САЙДБАР
   ============================================= */
.sidebar { }
.widget { margin-bottom: 48px; }
.widget-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-light);
  position: relative;
}
.widget-title::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 32px;
  height: 1px;
  background: var(--gold);
}

.sidebar-post {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-light);
  text-decoration: none;
  color: inherit;
  transition: opacity var(--transition);
}
.sidebar-post:hover { opacity: .75; }
.sidebar-post-img {
  width: 68px;
  height: 52px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--beige);
}
.sidebar-post h4 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 5px;
  color: var(--ink);
}
.sidebar-post p {
  font-size: 11px;
  color: var(--gray);
}

/* Фільтр по року */
.year-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-light);
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink);
  background: var(--white);
  cursor: pointer;
  margin-bottom: 12px;
  transition: border-color var(--transition);
}
.year-select:focus { outline: none; border-color: var(--gold); }

/* =============================================
   ПАГІНАЦІЯ
   ============================================= */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 56px 0 0;
}
.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-light);
  border: 1px solid var(--gray-light);
  transition: all var(--transition);
}
.pagination a:hover { border-color: var(--ink); color: var(--ink); }
.pagination .current { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* =============================================
   ПОШУК
   ============================================= */
.search-form {
  display: flex;
  gap: 0;
  border: 1px solid var(--gray-light);
  max-width: 480px;
}
.search-form input[type="search"] {
  flex: 1;
  border: none;
  padding: 12px 20px;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  background: var(--cream);
}
.search-form button {
  padding: 12px 24px;
  background: var(--ink);
  color: var(--white);
  border: none;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition);
}
.search-form button:hover { background: var(--dark-gold); }

/* =============================================
   ХЛІБНІ КРИХТИ
   ============================================= */
.kama_breadcrumbs {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--gray);
  padding: 12px 0;
  margin-bottom: 8px;
}
.kama_breadcrumbs a { color: var(--gold); }
.kama_breadcrumbs a:hover { color: var(--ink); }

/* =============================================
   ФУТЕР
   ============================================= */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,.5);
}

.footer-body {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 48px;
  padding: 64px 0 48px;
}

.footer-brand .footer-logo {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: .05em;
  margin-bottom: 12px;
}
.footer-brand p {
  font-size: 13px;
  line-height: 1.8;
}

.footer-col h4 {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 20px;
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a {
  font-size: 13px;
  color: rgba(255,255,255,.45);
  transition: color var(--transition);
}
.footer-col ul li a:hover { color: var(--white); }

.footer-socials { display: flex; gap: 10px; margin-top: 20px; }
.footer-socials a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: rgba(255,255,255,.45);
  transition: all var(--transition);
}
.footer-socials a:hover { border-color: var(--gold); color: var(--gold); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.footer-bottom a { color: var(--gold); }

/* =============================================
   PRELOADER
   ============================================= */
.preloader {
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .5s, visibility .5s;
}
.preloader.hidden { opacity: 0; visibility: hidden; }
.preloader-inner {
  text-align: center;
}
.preloader-logo {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .1em;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp .6s .2s forwards;
}
.preloader-bar {
  width: 80px;
  height: 1px;
  background: var(--gray-light);
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}
.preloader-bar::after {
  content: '';
  position: absolute;
  left: -100%;
  top: 0;
  width: 100%;
  height: 100%;
  background: var(--gold);
  animation: slide 1s .4s ease forwards;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slide {
  from { left: -100%; }
  to { left: 100%; }
}

/* =============================================
   МОБІЛЬНА АДАПТАЦІЯ
   ============================================= */
@media (max-width: 1024px) {
  .front-grid { grid-template-columns: 1fr; }
  .events-panel { border-left: none; border-top: 1px solid var(--gray-light); }
  .archive-layout { grid-template-columns: 1fr; }
  .footer-body { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .container, .container--narrow { padding: 0 20px; }
  .header-inner { padding: 14px 20px; gap: 12px; }

  /* ВИПРАВЛЕНО: мобільне меню — фіксоване, з прокруткою */
  .site-nav { display: none; }
  .site-nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    z-index: 999;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 70px 0 40px;
  }
  .site-nav.open ul {
    flex-direction: column;
    padding: 0 24px;
  }
  .site-nav.open ul li {
    border-bottom: 1px solid var(--gray-light);
  }
  .site-nav.open ul li > a {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .05em;
    padding: 16px 0;
    color: var(--ink);
  }
  /* Підменю на мобільному */
  .site-nav.open ul ul {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border-top: none;
    border-left: 2px solid var(--gold);
    margin-left: 16px;
    padding: 0;
    min-width: unset;
    display: block;
  }
  .site-nav.open ul ul li {
    border-bottom: none;
  }
  .site-nav.open ul ul li a {
    font-size: 14px;
    padding: 10px 0;
    color: var(--ink-light);
  }

  /* Бургер поверх меню */
  .menu-toggle {
    display: flex;
    position: relative;
    z-index: 1000;
  }

  .logo-text-main { font-size: 20px; }
  .logo-divider { display: none; }
  .logo-text-top { display: none; }
  .site-logo img { height: 44px; }
  .hero-main { padding: 36px 24px; }
  .hero-content h1 { font-size: 32px; }
  .front-grid { grid-template-columns: 1fr; }
  .events-panel { display: none; }
  .posts-grid, .posts-grid--4 { grid-template-columns: 1fr; }
  .posts-grid--2 { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .footer-body { grid-template-columns: 1fr; gap: 32px; padding: 40px 0 32px; }
  .section { padding: 48px 0; }
  .archive-layout { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; gap: 12px; align-items: flex-start; }
}

/* =============================================
   СТОРІНКА БЛОГУ (якщо головна = список постів)
   ============================================= */
.blog-header {
  background: var(--cream);
  border-bottom: 1px solid var(--gray-light);
  padding: 48px 0 40px;
  margin-bottom: 56px;
}
.blog-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 600;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 8px;
}
.blog-header p {
  font-size: 15px;
  color: var(--ink-light);
}

/* Покращені картки — більше повітря між елементами */
.post-card__title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 10px;
  display: block;
  transition: color var(--transition);
}
.post-card__title a { color: inherit; }
.post-card:hover .post-card__title,
.post-card__title a:hover { color: var(--dark-gold); }

/* =============================================
   ДОДАТКОВІ ВИПРАВЛЕННЯ
   ============================================= */

/* Placeholder якщо немає зображення */
.post-card__img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--beige);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

/* Hero з фото — текст завжди читабельний */
.hero-main {
  background-color: var(--ink); /* fallback якщо немає фото */
}
.hero-main .hero-content .label { color: var(--gold); }
.hero-main .hero-content h1 { color: var(--white); text-shadow: 0 2px 16px rgba(0,0,0,.5); }
.hero-main .hero-content p  { color: rgba(255,255,255,.8); }

/* Виправлення: панель подій — не ховаємо на головній мобільній */
@media (max-width: 768px) {
  .events-panel { display: flex !important; }
  .front-grid { grid-template-columns: 1fr; }
  .hero-main { min-height: 320px; }
}

/* Іконка компаса (залишок старої теми) — ховаємо */
#wpadminbar + .site-header .dashicons,
.site-header svg[data-icon],
.site-header .wp-block-navigation__responsive-container-open,
a[href*="compas"],
img[src*="compass"],
.compass-icon { display: none !important; }

/* =============================================
   КОМПАКТНИЙ ФУТЕР
   ============================================= */

/* Менше padding зверху/знизу */
.footer-body {
  padding: 44px 0 36px !important;
  gap: 40px !important;
}

/* Меню у 2 колонки */
.footer-menu-2col {
  columns: 2;
  column-gap: 20px;
}
.footer-menu-2col li {
  break-inside: avoid;
  margin-bottom: 7px;
}
.footer-menu-2col li a {
  font-size: 12px !important;
  color: rgba(255,255,255,.4) !important;
  transition: color var(--transition);
  line-height: 1.5;
}
.footer-menu-2col li a:hover { color: var(--white) !important; }

/* Менший логотип у футері */
.footer-logo {
  font-family: var(--font-serif);
  font-size: 20px !important;
  font-weight: 600;
  color: var(--white);
  letter-spacing: .06em;
  margin-bottom: 10px;
}

.footer-brand p {
  font-size: 12px;
  line-height: 1.7;
}

/* Колонка контактів — компактніша */
.footer-col h4 {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: 14px;
}
.footer-col ul li {
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 6px;
}
.footer-col ul li a {
  color: rgba(255,255,255,.4);
  transition: color var(--transition);
}
.footer-col ul li a:hover { color: var(--white); }

/* Нижній рядок */
.footer-bottom {
  padding: 16px 0 !important;
}
.footer-bottom p {
  font-size: 11px;
  color: rgba(255,255,255,.25);
}

@media (max-width: 768px) {
  .footer-menu-2col { columns: 1; }
  .footer-body { grid-template-columns: 1fr !important; gap: 28px !important; padding: 32px 0 24px !important; }
}

/* =============================================
   ПОБАЖАННЯ — ДОДАТКОВІ ПОКРАЩЕННЯ
   ============================================= */

/* 1. Плавна поява сторінки при завантаженні */
body { animation: pageFadeIn .4s ease; }
@keyframes pageFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 2. Виділення активного пункту меню рискою знизу */
.site-nav ul li.current-menu-item > a,
.site-nav ul li.current-menu-ancestor > a {
  color: var(--ink) !important;
  position: relative;
}
.site-nav ul li.current-menu-item > a::after,
.site-nav ul li.current-menu-ancestor > a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 10px;
  right: 10px;
  height: 1.5px;
  background: var(--gold);
}

/* 3. Зображення в картці — плавніший zoom */
.post-card__img { border-radius: 2px; }
.post-card__img img { transition: transform .6s cubic-bezier(.25,.46,.45,.94); }
.post-card:hover .post-card__img img { transform: scale(1.06); }

/* 4. Тінь на картках при наведенні — м'якша */
.post-card {
  transition: transform .35s cubic-bezier(.25,.46,.45,.94),
              box-shadow .35s ease;
}
.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(42,32,24,.1);
}

/* 5. Категорія поста — тонка лінія зліва замість просто тексту */
.post-card__cat {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.post-card__cat::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--gold);
  flex-shrink: 0;
}

/* 6. Посилання "Читати далі" у картці */
.post-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.post-card__meta::after {
  content: 'Читати →';
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dark-gold);
  transition: letter-spacing .3s, color .3s;
}
.post-card:hover .post-card__meta::after {
  letter-spacing: .12em;
  color: var(--ink);
}

/* 7. Панель подій — hover ефект з рискою зліва */
.event-item {
  border-left: 2px solid transparent;
  transition: background .25s, border-color .25s, padding-left .25s;
}
.event-item:hover {
  background: rgba(201,185,154,.14);
  border-left-color: var(--gold);
  padding-left: 34px;
}

/* 8. Секції — плавна поява при скролі (через JS IntersectionObserver) */
.section { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.section.visible { opacity: 1; transform: translateY(0); }

/* 9. Шапка — тонка золота лінія знизу замість сірої */
.site-header { border-bottom: 1px solid var(--beige); }

/* 10. Футер — тонка золота лінія зверху */
.site-footer { border-top: 1px solid rgba(201,185,154,.2); }

/* 11. Виділення цитат у статтях — красивіше */
.single-content blockquote {
  font-family: var(--font-serif);
  font-size: 22px;
  font-style: italic;
  line-height: 1.5;
  color: var(--ink);
  border-left: 2px solid var(--gold);
  padding: 8px 0 8px 28px;
  margin: 36px 0;
}

/* 12. Пошук у шапці — з'являється при фокусі ширший */
.search-form input[type="search"] {
  width: 200px;
  transition: width .4s ease, background .3s;
}
.search-form input[type="search"]:focus { width: 300px; }

/* =============================================
   ВИПРАВЛЕННЯ МОБІЛЬНОГО ВІДОБРАЖЕННЯ
   ============================================= */

/* Запобігаємо горизонтальному скролу */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* Всі блоки не виходять за межі екрану */
* { max-width: 100%; }
img, video, iframe, table { max-width: 100%; }

/* Меню на весь екран — виправлення */
.site-nav.open {
  left: 0 !important;
  right: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
}

/* Виправлення для старих стилів що могли залишитись */
.container, .container--narrow {
  width: 100%;
  max-width: 100%;
  padding-left: 20px !important;
  padding-right: 20px !important;
}

@media (min-width: 769px) {
  .container { max-width: 1200px; padding: 0 40px !important; }
  .container--narrow { max-width: 860px; padding: 0 40px !important; }
}

/* Текст не обрізається */
.single-content, .post-card__excerpt, .post-card__title,
.single-header h1, .archive-header h1 {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Фіксуємо шапку на мобільному */
@media (max-width: 768px) {
  .site-header {
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
  }
  .header-inner {
    width: 100%;
    padding: 14px 16px !important;
  }
  /* Меню відкривається на весь екран */
  .site-nav.open {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    z-index: 9999 !important;
    overflow-y: auto !important;
    padding-top: 64px !important;
  }
  /* Кнопка бургера поверх меню */
  .menu-toggle {
    position: relative;
    z-index: 10000 !important;
  }
}

/* =============================================
   ВИПРАВЛЕННЯ СТОРІНКИ АРХІВУ / БЛОГУ
   ============================================= */
@media (max-width: 768px) {

  /* Архів — одна колонка */
  .archive-layout {
    display: block !important;
    width: 100% !important;
  }
  .archive-layout main,
  .archive-layout .sidebar {
    width: 100% !important;
    max-width: 100% !important;
  }
  .sidebar { margin-top: 40px; }

  /* Сітка постів — одна колонка */
  .posts-grid,
  .posts-grid--2,
  .posts-grid--3,
  .posts-grid--4 {
    display: block !important;
    width: 100% !important;
  }
  .post-card {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 32px;
  }
  .post-card__img {
    width: 100% !important;
  }

  /* Секції — повна ширина */
  .section {
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .section > .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Archive header */
  .archive-header {
    padding: 28px 0 !important;
  }
  .archive-header .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Сайдбар — компактний */
  .widget { margin-bottom: 28px; }
  .year-select { font-size: 16px; } /* 16px щоб iOS не зумував */

  /* Пошук */
  .search-form { width: 100% !important; }
  .search-form input { width: 100% !important; font-size: 16px; }

  /* Пагінація */
  .pagination { gap: 6px; padding: 32px 0; }
  .pagination a,
  .pagination span { width: 38px; height: 38px; font-size: 13px; }

  /* Сторінка статті */
  .single-wrap { padding: 32px 0 48px; }
  .single-wrap .container--narrow {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .single-cover { aspect-ratio: 16/9 !important; }
  .single-content { font-size: 16px !important; }
  .single-content blockquote { font-size: 18px; padding-left: 20px; }
  .post-nav { gap: 12px; }
  .post-nav-item { padding: 16px; }

  /* Футер */
  .footer-body {
    grid-template-columns: 1fr !important;
    padding: 36px 16px 28px !important;
    gap: 28px !important;
  }
  .footer-bottom {
    padding: 16px !important;
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* Планшет */
@media (min-width: 769px) and (max-width: 1024px) {
  .archive-layout {
    grid-template-columns: 1fr !important;
  }
  .sidebar { margin-top: 48px; }
  .posts-grid--2 { grid-template-columns: 1fr 1fr !important; }
  .posts-grid { grid-template-columns: 1fr 1fr !important; }
}
