/*
Theme Name: Otkrytki Pastel Catalog
Theme URI: https://otkrytki-online.ru/
Author: ChatGPT
Description: Светлая каталожная тема для сайта открыток: папки-категории, календарные карточки, стопки новых открыток и аккуратная страница открытки.
Version: 37.0
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: otkrytki-pastel-catalog
*/

:root {
  --bg: #fffafc;
  --bg-soft: #fff4f8;
  --surface: #ffffff;
  --surface-2: #fff8fb;
  --text: #263047;
  --muted: #7a8194;
  --line: #eadfe7;
  --pink: #e95d8f;
  --pink-2: #f7b9cf;
  --pink-soft: #ffe3ed;
  --blue-soft: #e6f2ff;
  --lavender: #eee7ff;
  --mint: #e9f8ee;
  --cream: #fff3d6;
  --shadow: 0 16px 42px rgba(72, 54, 75, .10);
  --shadow-soft: 0 8px 22px rgba(72, 54, 75, .08);
  --radius: 22px;
  --content: 1220px;
  --sidebar: 250px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background:
    radial-gradient(circle at 8px 8px, rgba(233, 93, 143, .10) 1px, transparent 1.8px) 0 0 / 28px 28px,
    linear-gradient(180deg, #fff 0%, #fff7fb 46%, #f9fbff 100%);
}

body.admin-bar .site-header { top: 32px; }

a { color: #2f4c78; text-decoration: none; }
a:hover { color: var(--pink); }

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 252, 254, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(234, 223, 231, .85);
}

.header-inner {
  max-width: var(--content);
  margin: 0 auto;
  padding: 22px 22px 16px;
  display: grid;
  grid-template-columns: 260px minmax(260px, 1fr) auto;
  gap: 24px;
  align-items: center;
}

.site-branding { min-width: 0; }

.site-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 34px;
  line-height: 1;
  color: var(--pink);
  letter-spacing: .2px;
}

.site-title a { color: inherit; }

.site-description {
  margin: 7px 0 0;
  color: #4f5568;
  font-size: 14px;
}

.header-search form,
.search-form {
  display: flex;
  width: 100%;
  border: 1px solid #e6dce5;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 7px 18px rgba(76, 61, 84, .06);
}

.header-search input[type="search"],
.search-form input[type="search"] {
  width: 100%;
  border: 0;
  outline: none;
  padding: 14px 16px;
  font-size: 15px;
  background: #fff;
  color: var(--text);
}

.header-search button,
.search-form button {
  border: 0;
  min-width: 56px;
  background: var(--pink);
  color: #fff;
  cursor: pointer;
  font-size: 19px;
  font-weight: 700;
}

.header-favorite {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #5d6071;
  font-size: 15px;
  white-space: nowrap;
}

.header-favorite .heart { color: var(--pink); font-size: 20px; }

.quick-nav {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 22px 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: thin;
}

.quick-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 23px;
  border: 1px solid #eadde5;
  border-radius: 999px;
  background: #fff;
  color: #31364b;
  font-weight: 600;
  box-shadow: 0 9px 22px rgba(72, 54, 75, .06);
}

.quick-pill:hover { color: var(--pink); transform: translateY(-1px); }
.quick-pill.all { margin-left: auto; background: var(--pink); color: #fff; border-color: var(--pink); }
.quick-pill.all:hover { color: #fff; background: #db4c80; }

.page-wrap {
  max-width: var(--content);
  margin: 0 auto;
  padding: 30px 22px 54px;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.no-sidebar .page-wrap {
  grid-template-columns: minmax(0, 1fr);
}

.site-sidebar {
  position: sticky;
  top: 125px;
  align-self: start;
}

.sidebar-card {
  margin-bottom: 18px;
  padding: 18px;
  background: rgba(255,255,255,.9);
  border: 1px solid #eee4ec;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}

.sidebar-title {
  margin: 0 0 14px;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 700;
  color: #2b3043;
}

.sidebar-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-cat-list li { border-bottom: 1px solid #f0e8ef; }
.sidebar-cat-list li:last-child { border-bottom: 0; }

.sidebar-cat-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  color: #303548;
  font-size: 15px;
}

.sidebar-cat-list .count {
  min-width: 25px;
  height: 25px;
  border-radius: 999px;
  background: #f5f1f4;
  color: #6f7588;
  text-align: center;
  line-height: 25px;
  font-size: 12px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud a {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f7f2f5;
  color: #555c70;
  font-size: 13px;
}

.help-card {
  text-align: center;
  background: linear-gradient(180deg, #fff 0%, #fff1f6 100%);
}

.help-icon { font-size: 38px; margin-bottom: 8px; }
.help-card p { margin: 8px 0 15px; color: var(--muted); font-size: 14px; }

.btn,
.wp-block-button__link,
.post-card-button,
.share-button,
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid #d9dfe9;
  background: #fff;
  color: #2f4c78;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(71, 65, 79, .06);
}

.btn:hover,
.post-card-button:hover,
.share-button:hover {
  color: var(--pink);
  transform: translateY(-1px);
}

.btn-primary,
.download-button {
  background: var(--pink);
  color: #fff;
  border-color: var(--pink);
}

.btn-primary:hover,
.download-button:hover { color: #fff; background: #db4c80; }

.section {
  margin-bottom: 48px;
}

.section-head {
  margin: 0 0 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.section-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  color: #2b3043;
  letter-spacing: -.2px;
}

.section-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.section-more {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid #f3b3c8;
  border-radius: 999px;
  color: var(--pink);
  font-weight: 600;
  font-size: 14px;
  background: #fff;
}

.hero-box {
  margin: 0 0 34px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(255, 241, 247, .94), rgba(255,255,255,.94)),
    radial-gradient(circle at 92% 14%, rgba(233,93,143,.22), transparent 28%);
  border: 1px solid #f2dfea;
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}

.hero-box h1 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 700;
  color: #2b3043;
}

.hero-box p { margin: 0; color: #687087; max-width: 760px; }

.folder-grid,
.calendar-grid,
.post-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.folder-card {
  position: relative;
  display: block;
  padding: 18px 14px 19px;
  min-height: 268px;
  border: 1px solid #eadddf;
  border-radius: 0 17px 17px 17px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.folder-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: -18px;
  width: 96px;
  height: 35px;
  border-radius: 16px 16px 0 0;
  background: var(--tab, #ffd7e4);
  border: 1px solid #eadddf;
  border-bottom: 0;
}

.folder-card::after {
  content: "";
  position: absolute;
  inset: 7px -7px -7px 7px;
  z-index: -1;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(234, 221, 223, .8);
  box-shadow: 0 9px 18px rgba(70, 50, 75, .05);
}

.folder-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: #f0bfd1;
}

.folder-media {
  position: relative;
  height: 132px;
  overflow: hidden;
  border-radius: 12px;
  background: #fff6fa;
  border: 1px solid #eee1e8;
}

.folder-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.folder-title {
  display: block;
  margin: 16px 0 3px;
  text-align: center;
  color: #2d3146;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 650;
}

.folder-count {
  display: block;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.calendar-card {
  position: relative;
  display: block;
  overflow: hidden;
  min-height: 214px;
  border-radius: 16px;
  border: 1px solid #eadfe8;
  background: #fff;
  box-shadow: var(--shadow-soft);
  color: var(--text);
  transition: transform .18s ease, box-shadow .18s ease;
}

.calendar-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.calendar-top {
  height: 46px;
  background: var(--cal, #ffd3df);
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.calendar-card::before,
.calendar-card::after {
  content: "";
  position: absolute;
  top: 14px;
  width: 7px;
  height: 24px;
  border-radius: 6px;
  background: #746878;
  box-shadow: inset 0 2px 2px rgba(255,255,255,.5);
}

.calendar-card::before { left: 24px; }
.calendar-card::after { right: 24px; }

.calendar-media {
  height: 86px;
  margin: 14px 16px 8px;
  overflow: hidden;
  border-radius: 12px;
  background: #fff8fb;
}

.calendar-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.calendar-title {
  display: block;
  padding: 0 14px;
  text-align: center;
  color: #2c3145;
  font-size: 19px;
  line-height: 1.15;
  font-weight: 700;
}

.calendar-count {
  display: block;
  margin-top: 7px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.post-card {
  position: relative;
  background: #fff;
  border: 1px solid #ecdee7;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 14px 14px 16px;
  text-align: center;
  transition: transform .18s ease, box-shadow .18s ease;
}

.post-card.stack::before,
.post-card.stack::after {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: -1;
  border-radius: 17px;
  background: #fff;
  border: 1px solid rgba(236,222,231,.8);
  transform: rotate(-3deg);
  box-shadow: 0 8px 18px rgba(70, 50, 75, .05);
}

.post-card.stack::after { transform: rotate(3deg); }

.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.post-thumb {
  display: block;
  height: 182px;
  margin-bottom: 13px;
  border-radius: 13px;
  overflow: hidden;
  background: #fff8fb;
  border: 1px solid #efe3eb;
}

.post-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff8fb;
}

.post-title {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.28;
  font-weight: 600;
  color: #30364d;
}

.post-title a { color: inherit; }
.post-title a:hover { color: var(--pink); }

.post-date { color: var(--muted); font-size: 13px; }
.post-actions { margin-top: 12px; display: flex; justify-content: center; gap: 8px; }
.post-card-button.icon { min-width: 40px; padding: 0; color: var(--pink); }

.category-top-note {
  margin: -6px 0 24px;
  color: #6d7486;
  font-size: 16px;
}

.category-description-bottom {
  margin-top: 40px;
  padding: 24px;
  border-radius: 22px;
  border: 1px solid #efe2ea;
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow-soft);
  color: #626b80;
}

.category-description-bottom h2,
.category-description-bottom h3 { color: #30364d; }
.category-description-bottom p:first-child { margin-top: 0; }
.category-description-bottom p:last-child { margin-bottom: 0; }

.breadcrumbs {
  margin-bottom: 12px;
  color: #7b8291;
  font-size: 14px;
}
.breadcrumbs a { color: #587097; }

.single-layout {
  max-width: 860px;
  margin: 0 auto;
}

.single-card-main {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid #eadfe8;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.single-card-main img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  margin: 0 auto;
  border-radius: 14px;
  object-fit: contain;
}

.single-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 16px 0 0;
}

.entry-title {
  margin: 0 0 15px;
  font-size: 32px;
  line-height: 1.18;
  font-weight: 700;
  color: #2b3043;
}

.entry-content {
  margin-top: 24px;
  color: #5f687e;
  font-size: 17px;
}

.entry-content img { display: none !important; }

.related-section { margin-top: 44px; }

.empty-state {
  padding: 32px;
  border: 1px solid #eee2e9;
  border-radius: 20px;
  background: #fff;
  color: var(--muted);
}

.pagination {
  margin: 30px 0 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination .page-numbers {
  display: inline-flex;
  min-width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #eadfe7;
  background: #fff;
  color: #4e5a70;
}

.pagination .current {
  background: var(--pink);
  color: #fff;
  border-color: var(--pink);
}

.site-footer {
  border-top: 1px solid #eadfe8;
  background: rgba(255,255,255,.7);
}

.footer-inner {
  max-width: var(--content);
  margin: 0 auto;
  padding: 28px 22px;
  color: #7b8291;
  font-size: 14px;
  text-align: center;
}

@media (max-width: 1180px) {
  .folder-grid,
  .calendar-grid,
  .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  body.admin-bar .site-header { top: 46px; }
  .header-inner { grid-template-columns: 1fr; gap: 14px; }
  .header-favorite { display: none; }
  .quick-pill.all { margin-left: 0; }
  .page-wrap { grid-template-columns: 1fr; }
  .site-sidebar { position: static; order: 2; }
  .site-main { order: 1; }
  .folder-grid,
  .calendar-grid,
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-title { font-size: 26px; }
  .hero-box h1 { font-size: 28px; }
}

@media (max-width: 560px) {
  .header-inner { padding: 18px 15px 12px; }
  .quick-nav { padding: 0 15px 14px; }
  .page-wrap { padding: 24px 15px 42px; }
  .site-title { font-size: 29px; }
  .folder-grid,
  .calendar-grid,
  .post-grid { gap: 16px; }
  .folder-card { padding: 14px 10px 16px; min-height: 236px; }
  .folder-media { height: 112px; }
  .folder-title { font-size: 16px; }
  .post-thumb { height: 154px; }
  .calendar-title { font-size: 16px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .single-card-main { padding: 10px; }
}

/* === v1.1: аккуратные папки, календари и исправление растянутости === */
body {
  overflow-x: hidden;
}

.site-header {
  position: relative;
  top: auto;
}

body.admin-bar .site-header {
  top: auto;
}

.header-inner {
  max-width: 1240px;
  padding: 24px 20px 14px;
  grid-template-columns: 250px minmax(320px, 1fr) auto;
}

.site-title {
  font-size: 32px;
}

.site-description {
  max-width: 220px;
}

.quick-nav {
  max-width: 1240px;
  padding: 0 20px 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  overflow: visible;
  scrollbar-width: none;
}

.quick-nav::-webkit-scrollbar {
  display: none;
}

.quick-pill {
  min-height: 38px;
  padding: 0 20px;
  font-size: 15px;
  box-shadow: 0 8px 20px rgba(84, 65, 79, .055);
}

.quick-pill.all {
  margin-left: 0;
}

.page-wrap {
  max-width: 1240px;
  padding-top: 24px;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 34px;
}

.site-sidebar {
  position: static;
}

.section {
  margin-bottom: 48px;
  clear: both;
}

.section-head {
  margin-bottom: 22px;
  align-items: center;
}

.section-title {
  font-size: 29px;
  font-weight: 650;
  letter-spacing: 0;
}

.section-subtitle {
  font-size: 15px;
}

.hero-box {
  display: none;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

.folder-card {
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 248px;
  padding: 18px 14px 16px;
  border-radius: 0 18px 18px 18px;
  background: linear-gradient(180deg, #fff 0%, #fffdfd 100%);
  border: 1px solid #eadfe7;
  box-shadow: 0 12px 26px rgba(70, 55, 76, .085);
}

.folder-card::before {
  left: -1px;
  top: -18px;
  width: 108px;
  height: 34px;
  border-radius: 17px 17px 0 0;
  background: var(--tab, #ffd7e4);
  border-color: #eadfe7;
}

.folder-card::after {
  inset: 9px -8px -8px 9px;
  border-radius: 18px;
  transform: rotate(1.2deg);
  box-shadow: 0 10px 20px rgba(70, 55, 76, .06);
}

.folder-card:hover {
  transform: translateY(-3px);
}

.folder-media {
  display: block;
  width: 100%;
  height: 128px;
  flex: 0 0 128px;
  overflow: hidden;
  border-radius: 13px;
  background: linear-gradient(180deg, #fff8fb 0%, #fff 100%);
  border: 1px solid #eee1e8;
}

.folder-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.folder-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
  margin: 13px 0 2px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.22;
  color: #2f3548;
}

.folder-count {
  margin-top: auto;
  font-size: 14px;
  color: #777f92;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.calendar-card {
  display: flex;
  flex-direction: column;
  min-height: 214px;
  height: 214px;
  overflow: hidden;
  border-radius: 15px;
  background: #fff;
  border: 1px solid #eadfe8;
  box-shadow: 0 11px 24px rgba(70, 55, 76, .075);
}

.calendar-top {
  display: block;
  flex: 0 0 42px;
  height: 42px;
  background: var(--cal, #ffd3df);
}

.calendar-card::before,
.calendar-card::after {
  top: 9px;
  width: 8px;
  height: 25px;
  background: #7b7481;
  z-index: 2;
}

.calendar-card::before {
  left: 18px;
}

.calendar-card::after {
  right: 18px;
}

.calendar-media {
  display: block;
  flex: 0 0 76px;
  height: 76px;
  margin: 12px 12px 8px;
  overflow: hidden;
  border-radius: 11px;
  background: #fff8fb;
}

.calendar-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.calendar-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
  padding: 0 10px;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.22;
}

.calendar-count {
  margin: auto 0 10px;
  font-size: 12.5px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 22px;
  align-items: stretch;
}

.post-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 13px 13px 15px;
  border-radius: 18px;
  box-shadow: 0 11px 24px rgba(70, 55, 76, .075);
}

.post-thumb {
  display: block;
  height: 178px;
  flex: 0 0 178px;
  margin-bottom: 12px;
  border-radius: 14px;
}

.post-thumb img {
  object-fit: contain;
}

.post-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.3;
}

.post-date {
  display: none;
}

.post-actions {
  margin-top: auto;
}

.sidebar-title {
  font-weight: 650;
}

.sidebar-cat-list a {
  font-size: 15px;
  font-weight: 400;
}

.single-layout {
  max-width: 780px;
}

.entry-title {
  font-size: 30px;
  font-weight: 650;
}

.single-card-main img {
  max-height: 72vh;
}

@media (max-width: 1180px) {
  .folder-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .calendar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .header-inner {
    grid-template-columns: 1fr;
  }
  .page-wrap {
    grid-template-columns: 1fr;
  }
  .site-sidebar {
    order: 2;
  }
  .site-main {
    order: 1;
  }
  .folder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .section-title {
    font-size: 25px;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .quick-nav,
  .page-wrap {
    padding-left: 14px;
    padding-right: 14px;
  }
  .quick-nav {
    justify-content: flex-start;
  }
  .quick-pill {
    min-height: 36px;
    padding: 0 14px;
    font-size: 14px;
  }
  .folder-grid,
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .folder-card {
    height: 220px;
    padding: 14px 10px 13px;
  }
  .folder-card::before {
    top: -15px;
    width: 84px;
    height: 28px;
  }
  .folder-media {
    height: 104px;
    flex-basis: 104px;
  }
  .folder-title {
    font-size: 15px;
    min-height: 38px;
  }
  .folder-count {
    font-size: 12.5px;
  }
  .post-thumb {
    height: 145px;
    flex-basis: 145px;
  }
  .post-title {
    font-size: 14px;
  }
  .calendar-card {
    height: 198px;
  }
  .calendar-media {
    height: 66px;
    flex-basis: 66px;
  }
}


/* === v1.2: closer to approved mockup === */
.folder-grid {
  gap: 26px;
}

.folder-card {
  overflow: visible;
  height: 262px;
  padding: 20px 16px 18px;
  border-radius: 0 20px 20px 20px;
  background: linear-gradient(180deg, #fff 0%, #fffefe 100%);
  border: 1px solid #e8dde5;
  box-shadow: 0 10px 28px rgba(79, 62, 83, .075);
}

.folder-card::before {
  left: -1px;
  top: -20px;
  width: 112px;
  height: 38px;
  border-radius: 18px 18px 0 0;
  border: 1px solid #e8dde5;
  border-bottom: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}

.folder-card::after {
  inset: 10px -6px -6px 10px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(232,221,229,.9);
  transform: none;
  box-shadow: 0 6px 16px rgba(79, 62, 83, .045);
}

.folder-media {
  height: 126px;
  flex: 0 0 126px;
  border-radius: 14px;
  background: linear-gradient(180deg,#fffafc 0%,#fff 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}

.folder-title {
  min-height: 44px;
  margin: 15px 0 6px;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.24;
}

.folder-count {
  font-size: 13.5px;
}

.calendar-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
}

.calendar-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 246px;
  min-height: 246px;
  padding-bottom: 12px;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #eadfe8;
  box-shadow: 0 10px 26px rgba(79, 62, 83, .07);
}

.calendar-top {
  flex: 0 0 44px;
  height: 44px;
  border-bottom: 1px solid rgba(0,0,0,.05);
}

.calendar-card::before,
.calendar-card::after {
  display: none;
}

.calendar-rings {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 3;
}

.calendar-rings span {
  display: block;
  width: 8px;
  height: 24px;
  border-radius: 8px;
  background: linear-gradient(180deg, #6e6875 0%, #8e8897 100%);
  box-shadow: inset 0 2px 2px rgba(255,255,255,.4);
}

.calendar-title {
  order: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 62px;
  margin: 14px 0 8px;
  padding: 0 12px;
  text-align: center;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.15;
  color: #2c3145;
}

.calendar-media {
  order: 3;
  flex: 0 0 80px;
  height: 80px;
  margin: auto 12px 10px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff8fb;
}

.calendar-count {
  order: 4;
  margin: 0;
  text-align: center;
  font-size: 12.5px;
  color: #777f92;
}

@media (max-width: 1180px) {
  .calendar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .folder-grid {
    gap: 20px;
  }
  .folder-card {
    height: 248px;
  }
  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .folder-card {
    height: 228px;
    padding: 15px 11px 14px;
  }
  .folder-card::before {
    width: 88px;
    height: 30px;
    top: -16px;
  }
  .folder-media {
    height: 106px;
    flex-basis: 106px;
  }
  .folder-title {
    font-size: 15px;
    min-height: 40px;
  }
  .calendar-card {
    height: 218px;
    min-height: 218px;
  }
  .calendar-title {
    min-height: 52px;
    font-size: 16px;
  }
  .calendar-media {
    height: 68px;
    flex-basis: 68px;
  }
}


/* === v1.3: папки без двойного слоя + календари ближе к макету === */

/* Убираем старый эффект второй папки/стопки */
.folder-card::after {
  content: none !important;
  display: none !important;
}

/* Папка-альбом: один аккуратный лист, как в макете */
.folder-grid {
  gap: 26px 24px;
}

.folder-card {
  position: relative;
  overflow: visible;
  height: 252px;
  min-height: 252px;
  padding: 19px 16px 17px;
  border-radius: 0 19px 19px 19px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(255,253,254,.98) 100%);
  border: 1px solid #e9dde6;
  box-shadow:
    0 16px 30px rgba(73, 57, 80, .075),
    0 2px 0 rgba(255,255,255,.75) inset;
}

/* Цветной язычок без "второй папки" */
.folder-card::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: -1px;
  top: -18px;
  width: 108px;
  height: 36px;
  border-radius: 18px 18px 0 0;
  background: var(--tab, #ffd7e4);
  border: 1px solid #e9dde6;
  border-bottom: 0;
  box-shadow: none;
}

/* Небольшая светлая кромка, чтобы папка была похожа на альбом */
.folder-card .folder-media,
.folder-card .folder-title,
.folder-card .folder-count {
  position: relative;
  z-index: 1;
}

.folder-card {
  outline: 1px solid rgba(255,255,255,.65);
  outline-offset: -5px;
}

.folder-media {
  height: 126px;
  flex: 0 0 126px;
  border-radius: 13px;
  background: #fff9fc;
  border: 1px solid #eee2ea;
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset;
}

.folder-media img {
  object-fit: cover;
}

.folder-title {
  margin: 15px 0 5px;
  min-height: 43px;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.24;
  color: #2c3045;
}

.folder-count {
  margin-top: auto;
  font-size: 13.5px;
  color: #788094;
}

/* Календари: отдельные карточки с шапкой, кольцами и более похожей композицией */
.calendar-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
}

.calendar-card {
  position: relative;
  height: 235px;
  min-height: 235px;
  padding: 0 0 10px;
  border-radius: 17px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #eadfe8;
  box-shadow: 0 14px 28px rgba(73, 57, 80, .07);
}

.calendar-top {
  height: 43px;
  flex: 0 0 43px;
  background: var(--cal, #ffd3df);
  border-bottom: 1px solid rgba(0,0,0,.045);
}

.calendar-rings {
  position: absolute;
  top: 9px;
  left: 0;
  right: 0;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  z-index: 4;
}

.calendar-rings span {
  width: 8px;
  height: 25px;
  border-radius: 8px;
  background: linear-gradient(180deg, #746f7c 0%, #9993a2 100%);
  box-shadow: inset 0 2px 2px rgba(255,255,255,.45);
}

.calendar-title {
  order: 2;
  min-height: 48px;
  margin: 13px 0 8px;
  padding: 0 10px;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.15;
  color: #2c3145;
  text-align: center;
}

.calendar-media {
  order: 3;
  height: 83px;
  flex: 0 0 83px;
  margin: auto 12px 8px;
  border-radius: 12px;
  background: #fff8fb;
  border: 1px solid rgba(234,223,232,.7);
}

.calendar-media img {
  object-fit: cover;
}

.calendar-count {
  order: 4;
  margin: 0;
  font-size: 12.5px;
  color: #7a8194;
}

/* На узких экранах сохраняем форму, но делаем компактнее */
@media (max-width: 1180px) {
  .calendar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .folder-card {
    height: 242px;
    min-height: 242px;
  }

  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-card {
    height: 224px;
    min-height: 224px;
  }
}

@media (max-width: 560px) {
  .folder-card {
    height: 224px;
    min-height: 224px;
    padding: 15px 10px 13px;
  }

  .folder-card::before {
    top: -15px;
    width: 86px;
    height: 29px;
    border-radius: 15px 15px 0 0;
  }

  .folder-media {
    height: 105px;
    flex-basis: 105px;
  }

  .folder-title {
    min-height: 38px;
    font-size: 15px;
  }

  .calendar-card {
    height: 210px;
    min-height: 210px;
  }

  .calendar-rings {
    padding: 0 20px;
  }

  .calendar-title {
    min-height: 44px;
    font-size: 15.5px;
  }

  .calendar-media {
    height: 66px;
    flex-basis: 66px;
  }
}


/* === v1.4: ярлычок крепится к папке, картинка крупнее === */

/* Папка теперь выше: есть место между ярлычком и картинкой */
.folder-card {
  height: 286px !important;
  min-height: 286px !important;
  padding: 34px 16px 18px !important;
  border-radius: 0 21px 21px 21px !important;
}

/* Ярлычок относится к корпусу папки и не налезает на превью */
.folder-card::before {
  top: -21px !important;
  left: -1px !important;
  width: 122px !important;
  height: 42px !important;
  border-radius: 20px 20px 0 0 !important;
  z-index: 0 !important;
}

/* Лёгкая линия верхнего края папки, чтобы ярлычок выглядел прикреплённым к самой папке */
.folder-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98) 0%, rgba(255,253,254,.98) 100%) !important;
}

.folder-card .folder-media {
  position: relative;
  z-index: 2;
}

/* Картинка крупнее и ближе к макету */
.folder-media {
  height: 148px !important;
  flex: 0 0 148px !important;
  border-radius: 15px !important;
}

.folder-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* Чуть компактнее низ, чтобы крупная картинка не давила карточку */
.folder-title {
  margin-top: 14px !important;
  margin-bottom: 4px !important;
  min-height: 40px !important;
  font-size: 16.5px !important;
}

.folder-count {
  font-size: 13.5px !important;
}

/* На мобильных сохраняем аккуратные пропорции */
@media (max-width: 920px) {
  .folder-card {
    height: 270px !important;
    min-height: 270px !important;
    padding-top: 30px !important;
  }

  .folder-media {
    height: 136px !important;
    flex-basis: 136px !important;
  }
}

@media (max-width: 560px) {
  .folder-card {
    height: 246px !important;
    min-height: 246px !important;
    padding: 25px 10px 14px !important;
  }

  .folder-card::before {
    top: -17px !important;
    width: 94px !important;
    height: 34px !important;
    border-radius: 16px 16px 0 0 !important;
  }

  .folder-media {
    height: 118px !important;
    flex-basis: 118px !important;
  }

  .folder-title {
    font-size: 15px !important;
    min-height: 38px !important;
  }
}


/* === v1.6: исправленная папка — ярлычок над корпусом, без большой пустоты === */

/* Убираем неудачную логику предыдущей версии */
.folder-card {
  height: 268px !important;
  min-height: 268px !important;
  padding: 20px 16px 18px !important;
  border-radius: 0 20px 20px 20px !important;
  overflow: visible !important;
  background: linear-gradient(180deg, #fff 0%, #fffdfd 100%) !important;
  border: 1px solid #e8dde6 !important;
  box-shadow: 0 12px 28px rgba(73, 57, 80, .075) !important;
  outline: none !important;
}

/* Ярлычок полностью над папкой: его низ ровно совпадает с верхом карточки */
.folder-card::before {
  content: "" !important;
  position: absolute !important;
  left: -1px !important;
  top: -34px !important;
  width: 112px !important;
  height: 34px !important;
  border-radius: 18px 18px 0 0 !important;
  background: var(--tab, #ffd7e4) !important;
  border: 1px solid #e8dde6 !important;
  border-bottom: 0 !important;
  z-index: 1 !important;
  box-shadow: none !important;
}

/* Полностью убираем любые старые "вторые листы" и верхние наложения */
.folder-card::after {
  content: none !important;
  display: none !important;
}

/* Картинка крупнее, но без огромного отступа сверху */
.folder-media {
  position: relative !important;
  z-index: 2 !important;
  height: 152px !important;
  flex: 0 0 152px !important;
  margin-top: 0 !important;
  border-radius: 15px !important;
  background: #fff8fb !important;
  border: 1px solid #eee2ea !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7) !important;
}

.folder-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

.folder-title {
  position: relative !important;
  z-index: 2 !important;
  margin: 14px 0 5px !important;
  min-height: 40px !important;
  font-size: 16.5px !important;
  line-height: 1.22 !important;
  font-weight: 600 !important;
}

.folder-count {
  position: relative !important;
  z-index: 2 !important;
  margin-top: auto !important;
  font-size: 13.5px !important;
}

.folder-grid {
  gap: 42px 24px !important;
}

/* На телефонах ярлычок тоже снаружи */
@media (max-width: 920px) {
  .folder-card {
    height: 254px !important;
    min-height: 254px !important;
    padding: 18px 12px 15px !important;
  }

  .folder-card::before {
    top: -30px !important;
    width: 98px !important;
    height: 30px !important;
    border-radius: 16px 16px 0 0 !important;
  }

  .folder-media {
    height: 138px !important;
    flex-basis: 138px !important;
  }

  .folder-grid {
    gap: 38px 18px !important;
  }
}

@media (max-width: 560px) {
  .folder-card {
    height: 228px !important;
    min-height: 228px !important;
    padding: 14px 10px 13px !important;
    border-radius: 0 17px 17px 17px !important;
  }

  .folder-card::before {
    top: -25px !important;
    width: 86px !important;
    height: 25px !important;
    border-radius: 14px 14px 0 0 !important;
  }

  .folder-media {
    height: 114px !important;
    flex-basis: 114px !important;
    border-radius: 13px !important;
  }

  .folder-title {
    font-size: 15px !important;
    min-height: 36px !important;
  }

  .folder-grid {
    gap: 34px 15px !important;
  }
}


/* === v1.7: smaller folder tab like mockup, more breathing room above cards === */
.folder-grid {
  gap: 34px 24px !important;
  margin-top: 12px !important;
}

.folder-card {
  height: 264px !important;
  min-height: 264px !important;
  padding: 18px 16px 18px !important;
}

.folder-card::before {
  top: -24px !important;
  width: 84px !important;
  height: 24px !important;
  border-radius: 14px 14px 0 0 !important;
}

.folder-media {
  height: 152px !important;
  flex: 0 0 152px !important;
}

.folder-title {
  margin-top: 14px !important;
  font-size: 16px !important;
}

@media (max-width: 920px) {
  .folder-grid {
    gap: 30px 18px !important;
    margin-top: 10px !important;
  }
  .folder-card {
    height: 248px !important;
    min-height: 248px !important;
    padding: 16px 12px 15px !important;
  }
  .folder-card::before {
    top: -21px !important;
    width: 76px !important;
    height: 21px !important;
    border-radius: 12px 12px 0 0 !important;
  }
  .folder-media {
    height: 138px !important;
    flex-basis: 138px !important;
  }
}

@media (max-width: 560px) {
  .folder-grid {
    gap: 26px 15px !important;
    margin-top: 8px !important;
  }
  .folder-card {
    height: 224px !important;
    min-height: 224px !important;
    padding: 14px 10px 13px !important;
  }
  .folder-card::before {
    top: -18px !important;
    width: 64px !important;
    height: 18px !important;
    border-radius: 10px 10px 0 0 !important;
  }
  .folder-media {
    height: 114px !important;
    flex-basis: 114px !important;
  }
}


/* === v1.8: folder tab with diagonal cut like reference === */
.folder-card {
  overflow: visible !important;
}

/* base tab */
.folder-card::before {
  top: -22px !important;
  width: 86px !important;
  height: 24px !important;
  border-radius: 14px 12px 0 0 !important;
  /* angled cut on the right side */
  clip-path: polygon(0 0, 74px 0, 86px 24px, 0 24px) !important;
  -webkit-clip-path: polygon(0 0, 74px 0, 86px 24px, 0 24px) !important;
  border-right: 0 !important;
}

/* thin border line to preserve outline on clipped edge */
.folder-card::after {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  top: -22px !important;
  width: 86px !important;
  height: 24px !important;
  pointer-events: none !important;
  clip-path: polygon(0 0, 74px 0, 86px 24px, 0 24px) !important;
  -webkit-clip-path: polygon(0 0, 74px 0, 86px 24px, 0 24px) !important;
  background:
    linear-gradient(#e8dde6,#e8dde6) top left/74px 1px no-repeat,
    linear-gradient(#e8dde6,#e8dde6) left bottom/1px 24px no-repeat,
    linear-gradient(135deg, transparent 48%, #e8dde6 49%, #e8dde6 55%, transparent 56%) top right/12px 24px no-repeat !important;
  z-index: 2 !important;
}

.folder-card .folder-media,
.folder-card .folder-title,
.folder-card .folder-count {
  z-index: 3 !important;
}

@media (max-width: 920px) {
  .folder-card::before,
  .folder-card::after {
    top: -20px !important;
    width: 78px !important;
    height: 22px !important;
    clip-path: polygon(0 0, 67px 0, 78px 22px, 0 22px) !important;
    -webkit-clip-path: polygon(0 0, 67px 0, 78px 22px, 0 22px) !important;
  }
  .folder-card::after {
    background:
      linear-gradient(#e8dde6,#e8dde6) top left/67px 1px no-repeat,
      linear-gradient(#e8dde6,#e8dde6) left bottom/1px 22px no-repeat,
      linear-gradient(135deg, transparent 48%, #e8dde6 49%, #e8dde6 55%, transparent 56%) top right/11px 22px no-repeat !important;
  }
}

@media (max-width: 560px) {
  .folder-card::before,
  .folder-card::after {
    top: -17px !important;
    width: 64px !important;
    height: 18px !important;
    clip-path: polygon(0 0, 55px 0, 64px 18px, 0 18px) !important;
    -webkit-clip-path: polygon(0 0, 55px 0, 64px 18px, 0 18px) !important;
  }
  .folder-card::after {
    background:
      linear-gradient(#e8dde6,#e8dde6) top left/55px 1px no-repeat,
      linear-gradient(#e8dde6,#e8dde6) left bottom/1px 18px no-repeat,
      linear-gradient(135deg, transparent 48%, #e8dde6 49%, #e8dde6 55%, transparent 56%) top right/9px 18px no-repeat !important;
  }
}


/* === v1.9: softer folder tab cut, closer to reference === */
.folder-card {
  overflow: visible !important;
}

/* main rounded tab body */
.folder-card::before {
  content: "" !important;
  position: absolute !important;
  left: -1px !important;
  top: -22px !important;
  width: 72px !important;
  height: 22px !important;
  background: var(--tab, #f3cfe0) !important;
  border: 1px solid #e8dde6 !important;
  border-bottom: 0 !important;
  border-radius: 14px 14px 0 0 !important;
  z-index: 2 !important;
  clip-path: none !important;
  -webkit-clip-path: none !important;
  box-shadow: none !important;
}

/* soft slanted extension */
.folder-card::after {
  content: "" !important;
  position: absolute !important;
  left: 66px !important;
  top: -22px !important;
  width: 16px !important;
  height: 22px !important;
  background: var(--tab, #f3cfe0) !important;
  border-top: 1px solid #e8dde6 !important;
  border-right: 1px solid #e8dde6 !important;
  border-bottom: 0 !important;
  border-left: 0 !important;
  border-radius: 0 10px 0 0 !important;
  transform: skewX(26deg) !important;
  transform-origin: left bottom !important;
  z-index: 2 !important;
  box-shadow: none !important;
  clip-path: none !important;
  -webkit-clip-path: none !important;
}

.folder-card .folder-media,
.folder-card .folder-title,
.folder-card .folder-count {
  z-index: 3 !important;
}

@media (max-width: 920px) {
  .folder-card::before {
    top: -20px !important;
    width: 64px !important;
    height: 20px !important;
    border-radius: 12px 12px 0 0 !important;
  }
  .folder-card::after {
    left: 58px !important;
    top: -20px !important;
    width: 14px !important;
    height: 20px !important;
    border-radius: 0 9px 0 0 !important;
    transform: skewX(24deg) !important;
  }
}

@media (max-width: 560px) {
  .folder-card::before {
    top: -17px !important;
    width: 54px !important;
    height: 17px !important;
    border-radius: 10px 10px 0 0 !important;
  }
  .folder-card::after {
    left: 49px !important;
    top: -17px !important;
    width: 11px !important;
    height: 17px !important;
    border-radius: 0 8px 0 0 !important;
    transform: skewX(22deg) !important;
  }
}


/* === v2.0: removed "Все категории" quick button, folder image slightly larger === */
.folder-card {
  min-height: 270px !important;
}

.folder-media {
  height: 160px !important;
  flex: 0 0 160px !important;
}

.folder-title {
  margin-top: 12px !important;
}

@media (max-width: 920px) {
  .folder-media {
    height: 144px !important;
    flex-basis: 144px !important;
  }
}

@media (max-width: 560px) {
  .folder-media {
    height: 120px !important;
    flex-basis: 120px !important;
  }
}


/* === v2.1: holiday calendar cards redesigned closer to mockup === */
.calendar-grid {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 20px !important;
  align-items: start !important;
}
.calendar-item { min-width: 0; }
.calendar-card {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  height: 235px !important;
  min-height: 235px !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 18px !important;
  background: #fff !important;
  border: 1px solid #eadde6 !important;
  box-shadow: 0 8px 20px rgba(72, 58, 81, .08) !important;
  text-decoration: none !important;
}
.calendar-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(72, 58, 81, .12) !important; }
.calendar-top {
  height: 42px !important;
  flex: 0 0 42px !important;
  background: var(--cal, #ffd3df) !important;
  border-bottom: 1px solid rgba(0,0,0,.04) !important;
}
.calendar-rings {
  position: absolute !important;
  top: 10px !important;
  left: 13px !important;
  right: 13px !important;
  display: flex !important;
  justify-content: space-between !important;
  z-index: 3 !important;
  pointer-events: none !important;
}
.calendar-rings span {
  width: 5px !important;
  height: 26px !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, #8e8798 0%, #a8a1af 100%) !important;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.45) !important;
}
.calendar-title {
  order: 2 !important;
  min-height: 66px !important;
  padding: 18px 10px 8px !important;
  margin: 0 !important;
  font-size: 18px !important;
  line-height: 1.18 !important;
  font-weight: 700 !important;
  color: #202743 !important;
  text-align: center !important;
}
.calendar-media {
  order: 3 !important;
  margin: auto 10px 10px !important;
  height: 86px !important;
  flex: 0 0 86px !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  background: #fff8fb !important;
  border: 1px solid #eee1ea !important;
}
.calendar-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}
.calendar-count {
  display: block !important;
  margin-top: 8px !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
  text-align: center !important;
  color: #6f778d !important;
}
@media (max-width: 1180px) {
  .calendar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 760px) {
  .calendar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 18px !important; }
  .calendar-card { height: 226px !important; min-height: 226px !important; }
}
@media (max-width: 480px) {
  .calendar-grid { grid-template-columns: 1fr !important; }
}


/* === v2.2: holiday calendars closer to reference === */
.section-calendar .section-head {
  align-items: flex-start !important;
}

.section-calendar .section-sub {
  margin-top: 2px !important;
}

.calendar-grid {
  display: grid !important;
  grid-template-columns: repeat(6, 150px) !important;
  justify-content: flex-start !important;
  gap: 22px !important;
  margin-top: 10px !important;
}

.calendar-item {
  width: 150px !important;
}

.calendar-card {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  width: 150px !important;
  height: 214px !important;
  min-height: 214px !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 14px !important;
  background: #fff !important;
  border: 1px solid #eadde6 !important;
  box-shadow: 0 6px 14px rgba(72, 58, 81, .10) !important;
  text-decoration: none !important;
  transform: none !important;
}

.calendar-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 18px rgba(72, 58, 81, .12) !important;
}

.calendar-top {
  height: 34px !important;
  flex: 0 0 34px !important;
  background: var(--cal, #ffd3df) !important;
  border-bottom: 1px solid rgba(57, 48, 67, .06) !important;
}

.calendar-rings {
  position: absolute !important;
  top: -9px !important;
  left: 18px !important;
  right: 18px !important;
  display: flex !important;
  justify-content: space-between !important;
  z-index: 3 !important;
  pointer-events: none !important;
}

.calendar-rings span {
  width: 10px !important;
  height: 18px !important;
  border: 2px solid #a59dac !important;
  border-bottom: 0 !important;
  border-radius: 9px 9px 0 0 !important;
  background: rgba(255,255,255,.9) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,.55) inset !important;
}

.calendar-title {
  order: 2 !important;
  min-height: 82px !important;
  padding: 18px 12px 8px !important;
  margin: 0 !important;
  font-size: 17px !important;
  line-height: 1.15 !important;
  font-weight: 700 !important;
  letter-spacing: -.01em !important;
  color: #1f2741 !important;
  text-align: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.calendar-media {
  order: 3 !important;
  margin: auto 10px 10px !important;
  height: 62px !important;
  flex: 0 0 62px !important;
  border-radius: 0 0 10px 10px !important;
  overflow: hidden !important;
  background: transparent !important;
  border: 0 !important;
}

.calendar-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  border-radius: 10px !important;
}

.calendar-count {
  display: block !important;
  margin-top: 8px !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
  text-align: center !important;
  color: #58617d !important;
}

@media (max-width: 1180px) {
  .calendar-grid {
    grid-template-columns: repeat(3, 150px) !important;
  }
}

@media (max-width: 760px) {
  .calendar-grid {
    grid-template-columns: repeat(2, 150px) !important;
    gap: 18px !important;
  }
}

@media (max-width: 420px) {
  .calendar-grid {
    grid-template-columns: 150px !important;
  }
}


/* === v2.3: custom lightweight WebP illustrations for date holidays === */
.calendar-media {
  height: 68px !important;
  flex: 0 0 68px !important;
  margin: auto 8px 9px !important;
  background: transparent !important;
  border: 0 !important;
  overflow: hidden !important;
}

.calendar-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center bottom !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.calendar-title {
  min-height: 78px !important;
  padding-bottom: 4px !important;
}

.calendar-card {
  height: 214px !important;
  min-height: 214px !important;
}


/* === v2.4: holiday images enlarged and fitted like reference === */
.calendar-card {
  width: 150px !important;
  height: 214px !important;
  min-height: 214px !important;
}

.calendar-title {
  min-height: 78px !important;
  padding: 17px 10px 4px !important;
}

.calendar-media {
  height: 78px !important;
  flex: 0 0 78px !important;
  margin: auto 8px 8px !important;
  border-radius: 0 0 11px 11px !important;
  background: #fff !important;
  overflow: hidden !important;
}

.calendar-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center bottom !important;
  display: block !important;
  border-radius: 0 0 10px 10px !important;
}


/* === v2.5: holiday images are NOT cropped === */
.calendar-card {
  height: 218px !important;
  min-height: 218px !important;
}

.calendar-title {
  min-height: 74px !important;
  padding: 16px 10px 2px !important;
}

.calendar-media {
  height: 84px !important;
  flex: 0 0 84px !important;
  margin: auto 7px 8px !important;
  border: 0 !important;
  background: #fff !important;
  overflow: visible !important;
}

.calendar-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center bottom !important;
  display: block !important;
  border-radius: 0 !important;
  background: transparent !important;
}


/* === v2.6: tight WebP holiday drawings, bigger but not cropped === */
.calendar-card {
  height: 218px !important;
  min-height: 218px !important;
}

.calendar-title {
  min-height: 74px !important;
  padding: 15px 10px 2px !important;
}

.calendar-media {
  height: 86px !important;
  flex: 0 0 86px !important;
  margin: auto 7px 8px !important;
  background: #fff !important;
  border: 0 !important;
  overflow: visible !important;
}

.calendar-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center bottom !important;
  display: block !important;
  border-radius: 0 !important;
  background: transparent !important;
}


/* === v2.7: bigger holiday illustrations + always 6 holiday cards === */
.calendar-grid {
  grid-template-columns: repeat(6, 150px) !important;
  gap: 22px !important;
}

.calendar-card {
  width: 150px !important;
  height: 220px !important;
  min-height: 220px !important;
}

.calendar-title {
  min-height: 68px !important;
  padding: 14px 10px 0 !important;
  font-size: 17px !important;
  line-height: 1.16 !important;
}

.calendar-media {
  height: 98px !important;
  flex: 0 0 98px !important;
  margin: auto 5px 7px !important;
  background: #fff !important;
  border: 0 !important;
  overflow: visible !important;
}

.calendar-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center bottom !important;
  display: block !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.calendar-count {
  margin-top: 7px !important;
}

@media (max-width: 1180px) {
  .calendar-grid {
    grid-template-columns: repeat(3, 150px) !important;
  }
}

@media (max-width: 760px) {
  .calendar-grid {
    grid-template-columns: repeat(2, 150px) !important;
    gap: 20px 18px !important;
  }
}

@media (max-width: 420px) {
  .calendar-grid {
    grid-template-columns: 150px !important;
  }
}


/* === v3.4: clean balanced layout reset === */

/* Ширина сайта: убираем ощущение маленькой страницы слева */
.site-container,
.page-wrap,
.header-inner,
.site-footer-inner {
  max-width: 1440px !important;
}

.page-wrap {
  display: grid !important;
  grid-template-columns: 260px minmax(0, 1fr) !important;
  gap: 34px !important;
  width: min(1440px, calc(100% - 48px)) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.site-main {
  min-width: 0 !important;
  width: 100% !important;
}

.section {
  width: 100% !important;
  max-width: 100% !important;
}

/* Папки категорий: красивый крупный вид, без крошечности */
.folder-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(210px, 1fr)) !important;
  gap: 38px 28px !important;
  align-items: start !important;
}

.folder-card {
  position: relative !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 268px !important;
  height: 268px !important;
  padding: 18px 16px 18px !important;
  border-radius: 0 20px 20px 20px !important;
  background: #fff !important;
  border: 1px solid #eadfe7 !important;
  box-shadow: 0 10px 24px rgba(70, 55, 76, .075) !important;
  overflow: visible !important;
}

.folder-card::before {
  top: -22px !important;
  left: -1px !important;
  width: 72px !important;
  height: 22px !important;
  border-radius: 14px 14px 0 0 !important;
}

.folder-card::after {
  left: 66px !important;
  top: -22px !important;
  width: 16px !important;
  height: 22px !important;
}

.folder-media {
  height: 158px !important;
  flex: 0 0 158px !important;
  margin: 0 0 13px !important;
  border-radius: 15px !important;
  overflow: hidden !important;
}

.folder-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
}

.folder-title {
  min-height: 40px !important;
  margin: 0 0 6px !important;
  font-size: 16px !important;
  line-height: 1.22 !important;
  font-weight: 700 !important;
  text-align: center !important;
}

.folder-count {
  font-size: 13.5px !important;
  text-align: center !important;
}

/* Календари: возвращаем аккуратный макет 6 штук в ряд */
.calendar-grid {
  display: grid !important;
  grid-template-columns: repeat(6, 150px) !important;
  gap: 22px !important;
  justify-content: flex-start !important;
  align-items: start !important;
}

.calendar-item {
  width: 150px !important;
}

.calendar-card {
  width: 150px !important;
  height: 218px !important;
  min-height: 218px !important;
  border-radius: 14px !important;
  overflow: hidden !important;
}

.calendar-title {
  min-height: 74px !important;
  padding: 15px 10px 2px !important;
  font-size: 17px !important;
  line-height: 1.16 !important;
  font-weight: 700 !important;
}

.calendar-media {
  height: 90px !important;
  flex: 0 0 90px !important;
  margin: auto 7px 8px !important;
  overflow: visible !important;
}

.calendar-media img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center bottom !important;
}

.calendar-count {
  margin-top: 7px !important;
  font-size: 13px !important;
}

/* Открытки: чистая галерея для категорий и Новых открыток */
.postcard-gallery {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)) !important;
  gap: 24px !important;
  align-items: start !important;
}

.postcard-gallery .post-card,
.postcard-gallery .post-card.stack {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 10px 10px 13px !important;
  border-radius: 18px !important;
  background: #fff !important;
  border: 1px solid #eadfe7 !important;
  box-shadow: 0 10px 24px rgba(70, 55, 76, .075) !important;
  text-align: center !important;
  overflow: hidden !important;
  transform: none !important;
}

.postcard-gallery .post-card::before,
.postcard-gallery .post-card::after,
.postcard-gallery .post-card.stack::before,
.postcard-gallery .post-card.stack::after {
  content: none !important;
  display: none !important;
}

.postcard-gallery .post-thumb {
  width: 100% !important;
  height: 250px !important;
  flex: 0 0 250px !important;
  margin: 0 0 11px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  border-radius: 15px !important;
  overflow: hidden !important;
}

.postcard-gallery .post-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center top !important;
  border-radius: 13px !important;
  display: block !important;
  background: transparent !important;
}

.postcard-gallery .post-title {
  min-height: 38px !important;
  margin: 0 0 9px !important;
  font-size: 14.5px !important;
  line-height: 1.25 !important;
  font-weight: 600 !important;
}

.postcard-gallery .post-date {
  display: none !important;
}

.postcard-gallery .post-actions {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 7px !important;
  margin-top: auto !important;
}

.postcard-gallery .post-card-button {
  min-height: 34px !important;
  padding: 0 13px !important;
  font-size: 13.5px !important;
  border-radius: 10px !important;
}

.postcard-gallery .post-card-button.icon {
  width: 34px !important;
  min-width: 34px !important;
  padding: 0 !important;
}

/* Адаптив */
@media (max-width: 1280px) {
  .page-wrap {
    grid-template-columns: 240px minmax(0, 1fr) !important;
    width: min(1180px, calc(100% - 36px)) !important;
    gap: 26px !important;
  }

  .folder-grid {
    grid-template-columns: repeat(3, minmax(210px, 1fr)) !important;
  }

  .calendar-grid {
    grid-template-columns: repeat(3, 150px) !important;
  }
}

@media (max-width: 920px) {
  .page-wrap {
    display: block !important;
    width: min(100% - 28px, 760px) !important;
  }

  .sidebar {
    display: none !important;
  }

  .folder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 32px 18px !important;
  }

  .folder-card {
    height: 250px !important;
    min-height: 250px !important;
  }

  .folder-media {
    height: 140px !important;
    flex-basis: 140px !important;
  }

  .calendar-grid {
    grid-template-columns: repeat(2, 150px) !important;
    gap: 22px 18px !important;
  }

  .postcard-gallery {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
    gap: 18px !important;
  }

  .postcard-gallery .post-thumb {
    height: 225px !important;
    flex-basis: 225px !important;
  }
}

@media (max-width: 640px) {
  .folder-grid,
  .postcard-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .calendar-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr)) !important;
    gap: 18px 14px !important;
  }

  .calendar-item,
  .calendar-card {
    width: 100% !important;
  }

  .postcard-gallery .post-card {
    padding: 8px 8px 11px !important;
  }

  .postcard-gallery .post-thumb {
    height: 198px !important;
    flex-basis: 198px !important;
  }

  .postcard-gallery .post-title {
    font-size: 13.5px !important;
    min-height: 34px !important;
  }
}

@media (max-width: 420px) {
  .postcard-gallery .post-thumb {
    height: 176px !important;
    flex-basis: 176px !important;
  }
}


/* === v3.4.1: center holiday row + full-fill new cards === */

/* Праздники по датам — центрируем сам ряд календарей */
.calendar-grid {
  justify-content: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Новые открытки — картинка заполняет карточку заметно лучше */
.home-postcards.postcard-gallery {
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)) !important;
  gap: 24px !important;
}

.home-postcards.postcard-gallery .post-card,
.home-postcards.postcard-gallery .post-card.stack {
  padding: 0 0 12px !important;
  border-radius: 18px !important;
  overflow: hidden !important;
}

.home-postcards.postcard-gallery .post-thumb {
  width: 100% !important;
  height: 318px !important;
  flex: 0 0 318px !important;
  margin: 0 0 10px !important;
  border-radius: 18px 18px 0 0 !important;
  overflow: hidden !important;
  background: #f8f3f7 !important;
}

.home-postcards.postcard-gallery .post-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center top !important;
  border-radius: 0 !important;
}

.home-postcards.postcard-gallery .post-title,
.home-postcards.postcard-gallery .post-actions,
.home-postcards.postcard-gallery .post-date,
.home-postcards.postcard-gallery .post-excerpt {
  padding-left: 12px !important;
  padding-right: 12px !important;
}

.home-postcards.postcard-gallery .post-title {
  min-height: 40px !important;
  margin: 0 0 10px !important;
}

.home-postcards.postcard-gallery .post-actions {
  margin-top: auto !important;
}

@media (max-width: 920px) {
  .home-postcards.postcard-gallery {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    gap: 18px !important;
  }

  .home-postcards.postcard-gallery .post-thumb {
    height: 276px !important;
    flex-basis: 276px !important;
  }
}

@media (max-width: 640px) {
  .home-postcards.postcard-gallery .post-thumb {
    height: 230px !important;
    flex-basis: 230px !important;
  }
}


/* === v3.5: related postcards + admin-selected homepage folders === */

/* Похожие открытки: тот же чистый формат, что и в категориях */
.related-postcards.postcard-gallery {
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)) !important;
  gap: 24px !important;
  align-items: start !important;
}

.related-postcards.postcard-gallery .post-card,
.related-postcards.postcard-gallery .post-card.stack {
  padding: 0 0 12px !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  background: #fff !important;
  border: 1px solid #eadfe7 !important;
  box-shadow: 0 10px 24px rgba(70, 55, 76, .075) !important;
}

.related-postcards.postcard-gallery .post-card::before,
.related-postcards.postcard-gallery .post-card::after,
.related-postcards.postcard-gallery .post-card.stack::before,
.related-postcards.postcard-gallery .post-card.stack::after {
  content: none !important;
  display: none !important;
}

.related-postcards.postcard-gallery .post-thumb {
  width: 100% !important;
  height: 318px !important;
  flex: 0 0 318px !important;
  margin: 0 0 10px !important;
  padding: 0 !important;
  border: 0 !important;
  background: #f8f3f7 !important;
  border-radius: 18px 18px 0 0 !important;
  overflow: hidden !important;
}

.related-postcards.postcard-gallery .post-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center top !important;
  border-radius: 0 !important;
  display: block !important;
}

.related-postcards.postcard-gallery .post-title,
.related-postcards.postcard-gallery .post-actions,
.related-postcards.postcard-gallery .post-date,
.related-postcards.postcard-gallery .post-excerpt {
  padding-left: 12px !important;
  padding-right: 12px !important;
}

.related-postcards.postcard-gallery .post-title {
  min-height: 40px !important;
  margin: 0 0 10px !important;
  font-size: 14.5px !important;
  line-height: 1.25 !important;
}

.related-postcards.postcard-gallery .post-actions {
  margin-top: auto !important;
}

/* На одиночной странице не даём старой сетке сжимать похожие открытки */
.related-section .post-grid {
  width: 100% !important;
}

/* Ещё раз гасим старые стили стопки именно в похожих */
.related-section .post-card.stack::before,
.related-section .post-card.stack::after {
  content: none !important;
  display: none !important;
}

@media (max-width: 920px) {
  .related-postcards.postcard-gallery {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    gap: 18px !important;
  }

  .related-postcards.postcard-gallery .post-thumb {
    height: 276px !important;
    flex-basis: 276px !important;
  }
}

@media (max-width: 640px) {
  .related-postcards.postcard-gallery .post-thumb {
    height: 230px !important;
    flex-basis: 230px !important;
  }
}


/* === v3.6: updated share buttons on single postcard page === */
.single-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  justify-content: center !important;
  align-items: center !important;
}

.single-actions .download-button,
.single-actions .share-button {
  min-height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
}

@media (max-width: 640px) {
  .single-actions .download-button,
  .single-actions .share-button {
    min-height: 40px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    font-size: 14px !important;
  }
}


/* === v3.7: selectable top categories + professional mobile drawer === */

.header-tools {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px !important;
}

.mobile-categories-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid #eadde5;
  border-radius: 999px;
  background: #fff;
  color: #2b3043;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(76, 61, 84, .06);
}

.burger-lines {
  width: 18px;
  height: 14px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
}

.burger-lines span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.mobile-categories-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(33, 30, 42, .34);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.mobile-categories-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 96;
  width: min(88vw, 360px);
  height: 100vh;
  padding: 18px;
  background:
    radial-gradient(circle at 8px 8px, rgba(233, 93, 143, .10) 1px, transparent 1.8px) 0 0 / 24px 24px,
    #fff;
  border-left: 1px solid #eadfe7;
  box-shadow: -18px 0 40px rgba(55, 43, 65, .16);
  transform: translateX(105%);
  transition: transform .25s ease;
  overflow-y: auto;
}

.mobile-categories-open {
  overflow: hidden;
}

.mobile-categories-open .mobile-categories-overlay {
  opacity: 1;
  pointer-events: auto;
}

.mobile-categories-open .mobile-categories-panel {
  transform: translateX(0);
}

.mobile-categories-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.mobile-categories-head strong {
  font-size: 21px;
  line-height: 1.2;
  color: #2b3043;
}

.mobile-categories-close {
  width: 38px;
  height: 38px;
  border: 1px solid #eadde5;
  border-radius: 50%;
  background: #fff;
  color: #2b3043;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.mobile-categories-search {
  margin-bottom: 16px;
}

.mobile-categories-search .search-form {
  border-radius: 14px;
}

.mobile-categories-list {
  display: grid;
  gap: 9px;
}

.mobile-categories-list a {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #eee2ea;
  border-radius: 15px;
  background: rgba(255,255,255,.88);
  color: #2b3043;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(76, 61, 84, .045);
}

.mobile-categories-list a:hover {
  color: var(--pink);
  transform: translateY(-1px);
}

.mobile-categories-list small {
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f4f0f4;
  color: #7a8194;
  font-size: 12px;
  font-weight: 700;
}

/* Mobile header */
@media (max-width: 920px) {
  body.admin-bar .site-header {
    top: 46px;
  }

  .header-inner {
    grid-template-columns: 1fr auto !important;
    gap: 14px !important;
    padding: 14px 16px 12px !important;
  }

  .site-branding {
    grid-column: 1 / 2;
  }

  .site-title {
    font-size: 28px !important;
  }

  .site-description {
    font-size: 13px !important;
  }

  .header-search {
    grid-column: 1 / -1;
    order: 3;
  }

  .header-tools {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
  }

  .header-favorite {
    display: none !important;
  }

  .mobile-categories-toggle {
    display: inline-flex !important;
  }

  .quick-nav {
    display: none !important;
  }
}

@media (max-width: 520px) {
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto !important;
    padding: 12px 12px 10px !important;
  }

  .site-title {
    font-size: 25px !important;
  }

  .site-description {
    max-width: 210px;
  }

  .mobile-categories-toggle {
    min-height: 39px;
    padding: 0 12px;
    font-size: 14px;
  }

  .mobile-categories-panel {
    width: min(92vw, 340px);
    padding: 16px;
  }
}


/* === v3.7.1: burger menu contains all site categories === */
.mobile-categories-panel {
  padding-bottom: 28px !important;
}

.mobile-categories-list {
  padding-bottom: 18px !important;
}

.mobile-categories-list a {
  min-height: 46px !important;
}

.mobile-categories-list a span:nth-child(2) {
  overflow-wrap: anywhere !important;
}

@media (max-width: 520px) {
  .mobile-categories-head strong {
    font-size: 20px !important;
  }

  .mobile-categories-list a {
    grid-template-columns: 26px minmax(0, 1fr) auto !important;
    gap: 9px !important;
    padding: 9px 11px !important;
    font-size: 15px !important;
  }
}


/* === v3.7.2: real mobile layout, hide old sidebar categories === */

/* На планшетах и телефонах старый сайдбар полностью убираем.
   Все категории теперь открываются только через кнопку "Категории". */
@media (max-width: 1100px) {
  .page-wrap {
    display: block !important;
    width: min(100% - 28px, 820px) !important;
    max-width: 820px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .site-sidebar,
  aside.site-sidebar,
  .sidebar {
    display: none !important;
  }

  .site-main {
    width: 100% !important;
    max-width: 100% !important;
  }

  .quick-nav {
    display: none !important;
  }

  .mobile-categories-toggle {
    display: inline-flex !important;
  }

  .header-favorite {
    display: none !important;
  }

  .header-inner {
    grid-template-columns: 1fr auto !important;
    gap: 14px !important;
    padding: 14px 16px 12px !important;
  }

  .site-branding {
    grid-column: 1 / 2 !important;
  }

  .header-tools {
    grid-column: 2 / 3 !important;
    grid-row: 1 / 2 !important;
  }

  .header-search {
    grid-column: 1 / -1 !important;
    order: 3 !important;
  }
}

/* Чуть компактнее для узких экранов */
@media (max-width: 640px) {
  .page-wrap {
    width: min(100% - 22px, 620px) !important;
  }

  .site-title {
    font-size: 25px !important;
  }

  .site-description {
    max-width: 220px !important;
  }

  .mobile-categories-toggle {
    min-height: 39px !important;
    padding: 0 12px !important;
    font-size: 14px !important;
  }
}


/* === v3.7.3: mobile section header overlap fix === */
@media (max-width: 1100px) {
  .section {
    position: relative !important;
    clear: both !important;
  }

  .section-head {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin: 0 0 22px !important;
    padding: 0 !important;
    position: relative !important;
    z-index: 3 !important;
  }

  .section-head > div {
    width: 100% !important;
    min-width: 0 !important;
  }

  .section-title {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.18 !important;
    position: relative !important;
    z-index: 4 !important;
  }

  .section-subtitle {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 6px 0 0 !important;
    padding: 0 !important;
    line-height: 1.35 !important;
    position: relative !important;
    z-index: 4 !important;
  }

  .section-more {
    position: static !important;
    align-self: flex-start !important;
    margin: 4px 0 0 !important;
    transform: none !important;
    z-index: 4 !important;
  }

  .section-head + .folder-grid,
  .section-head + .calendar-grid,
  .section-head + .post-grid,
  .section-head + .postcard-gallery {
    margin-top: 16px !important;
    position: relative !important;
    z-index: 1 !important;
  }

  .folder-grid {
    clear: both !important;
  }
}

@media (max-width: 640px) {
  .section {
    margin-bottom: 42px !important;
  }

  .section-head {
    gap: 7px !important;
    margin-bottom: 18px !important;
  }

  .section-title {
    font-size: 27px !important;
  }

  .section-subtitle {
    font-size: 15px !important;
  }

  .section-more {
    min-height: 32px !important;
    padding: 0 14px !important;
    font-size: 13px !important;
  }

  .section-head + .folder-grid,
  .section-head + .calendar-grid,
  .section-head + .post-grid,
  .section-head + .postcard-gallery {
    margin-top: 18px !important;
  }
}


/* === v3.7.4: stronger mobile spacing after header/search === */

/* На мобильной версии первый блок больше не должен залезать под поиск */
@media (max-width: 1100px) {
  .page-wrap {
    padding-top: 34px !important;
  }

  #all-categories {
    padding-top: 28px !important;
    margin-top: 0 !important;
  }

  #all-categories .section-head {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin: 0 0 24px !important;
    padding: 0 !important;
    position: relative !important;
    z-index: 10 !important;
  }

  #all-categories .section-head > div {
    display: block !important;
    order: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    position: relative !important;
    z-index: 11 !important;
  }

  #all-categories .section-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    overflow: visible !important;
    line-height: 1.18 !important;
    position: relative !important;
    z-index: 12 !important;
  }

  #all-categories .section-subtitle {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.35 !important;
    position: relative !important;
    z-index: 12 !important;
  }

  #all-categories .section-more {
    order: 2 !important;
    position: relative !important;
    display: inline-flex !important;
    align-self: flex-start !important;
    width: auto !important;
    max-width: max-content !important;
    margin: 8px 0 0 !important;
    transform: none !important;
    z-index: 12 !important;
  }

  #all-categories .folder-grid {
    margin-top: 18px !important;
    position: relative !important;
    z-index: 1 !important;
  }
}

/* На совсем узких экранах даём ещё немного воздуха */
@media (max-width: 640px) {
  .page-wrap {
    padding-top: 42px !important;
  }

  #all-categories {
    padding-top: 34px !important;
  }

  #all-categories .section-head {
    margin-bottom: 22px !important;
  }

  #all-categories .section-title {
    font-size: 26px !important;
    line-height: 1.16 !important;
  }

  #all-categories .section-subtitle {
    font-size: 15px !important;
  }

  #all-categories .section-more {
    margin-top: 10px !important;
  }
}

/* Если админ-бар сверху включён, не даём ему визуально сжимать начало контента */
@media (max-width: 1100px) {
  body.admin-bar #all-categories {
    padding-top: 42px !important;
  }
}


/* === v3.7.5: remove "Смотреть все" and improve mobile calendar columns === */

/* Кнопку "Смотреть все" убираем полностью на всех экранах */
.section-more {
  display: none !important;
}

/* После удаления кнопки шапка секции становится компактнее и ровнее */
.section-head {
  justify-content: flex-start !important;
}

/* Праздники по датам: на планшетной/широкой мобильной версии 3 календаря в ряд */
@media (max-width: 1100px) {
  .calendar-grid {
    grid-template-columns: repeat(3, 150px) !important;
    justify-content: center !important;
    gap: 22px !important;
  }

  .calendar-item,
  .calendar-card {
    width: 150px !important;
  }
}

/* На маленьком мобильном экране — 2 календаря в ряд */
@media (max-width: 640px) {
  .calendar-grid {
    grid-template-columns: repeat(2, minmax(140px, 150px)) !important;
    justify-content: center !important;
    gap: 20px 16px !important;
  }

  .calendar-item,
  .calendar-card {
    width: 100% !important;
    max-width: 150px !important;
  }
}

/* На совсем узких экранах сохраняем 2 в ряд, но делаем карточки чуть уже */
@media (max-width: 380px) {
  .calendar-grid {
    grid-template-columns: repeat(2, minmax(128px, 1fr)) !important;
    gap: 18px 12px !important;
  }

  .calendar-card {
    max-width: 140px !important;
  }

  .calendar-title {
    font-size: 15px !important;
  }
}


/* === v3.8.0: category SEO text fields === */
.category-description-bottom h2,
.category-description-bottom h3 {
  margin-top: 22px;
  margin-bottom: 10px;
  line-height: 1.22;
}

.category-description-bottom ul {
  padding-left: 22px;
}

.category-description-bottom li + li {
  margin-top: 6px;
}
