@import url("https://fonts.googleapis.com/css2?family=Noto+Serif+Georgian:wght@400;500;600;700&display=swap");

@font-face {
  font-family: "DM Constitution";
  src: url("./public/DM-CONSTITUTION (1)-94159443193.ttf") format("truetype");
  font-display: swap;
}

:root {
  --font-display: "Noto Serif Georgian", "Sylfaen", "DejaVu Serif", Georgia, serif;
  --font-body: "DM Constitution", sans-serif;
  --paper: #d8c3a1;
  --paper-light: #eadfcb;
  --paper-soft: rgba(245, 237, 224, 0.84);
  --ink: #251915;
  --ink-soft: rgba(37, 25, 21, 0.72);
  --oxide: #8e5b3e;
  --oxide-deep: #5a3425;
  --gold-dust: #b8965e;
  --line: rgba(73, 46, 32, 0.24);
  --shadow: 0 24px 80px rgba(32, 18, 11, 0.22);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(186, 145, 94, 0.28), transparent 25%),
    radial-gradient(circle at bottom right, rgba(101, 58, 34, 0.28), transparent 22%),
    linear-gradient(135deg, #6e4d38 0%, #b38a64 18%, #ebdec7 54%, #d7c4a0 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(56, 32, 20, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 32, 20, 0.12) 1px, transparent 1px);
  background-size: 100% 3px, 3px 100%;
  mix-blend-mode: multiply;
}

.page-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  padding: 28px 22px;
  background: linear-gradient(180deg, rgba(33, 21, 16, 0.96), rgba(62, 38, 28, 0.92));
  color: #f5ead8;
  border-right: 1px solid rgba(225, 207, 178, 0.16);
  box-shadow: 10px 0 30px rgba(19, 10, 7, 0.18);
  z-index: 3;
}

.hero-slider__content h2,
.panel h2,
.panel h3,
.archive-card h3,
.library-summary-card h3,
.result-card h3,
.result-card h4 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}

.sidebar__eyebrow,
.hero-slider__eyebrow,
.panel__eyebrow,
.archive-card__label,
.result-card__meta,
.menu-section__count {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.sidebar__brand {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(226, 210, 182, 0.16);
}

.sidebar__wordmark {
  margin: 8px 0 6px;
  width: min(100%, 220px);
  line-height: 0;
}

.sidebar__wordmark img {
  display: block;
  width: 100%;
  height: auto;
  filter: invert(1) brightness(1.18) contrast(1.04);
  mix-blend-mode: screen;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.rich-text {
  display: grid;
  gap: 0.8rem;
}

.rich-text > :first-child {
  margin-top: 0;
}

.rich-text > :last-child {
  margin-bottom: 0;
}

.rich-text p,
.rich-text ul,
.rich-text ol,
.rich-text blockquote,
.rich-text h2,
.rich-text h3,
.rich-text h4 {
  margin: 0;
}

.rich-text ul,
.rich-text ol {
  padding-left: 1.25rem;
}

.rich-text blockquote {
  padding-left: 1rem;
  border-left: 3px solid rgba(184, 150, 94, 0.5);
  font-style: italic;
}

.rich-text h2,
.rich-text h3,
.rich-text h4 {
  color: var(--ink);
  font-family: var(--font-display);
  line-height: 1.2;
}

.rich-text a {
  color: var(--oxide-deep);
  text-decoration-thickness: 0.08em;
}

.sidebar__text,
.audio-status,
.archive-card p,
.field span,
.result-card p,
.subsection-item p {
  color: rgba(245, 234, 216, 0.76);
}

.sidebar__menu {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.sidebar__menu::-webkit-scrollbar {
  width: 10px;
}

.sidebar__menu::-webkit-scrollbar-thumb {
  background: rgba(232, 215, 188, 0.16);
  border-radius: 999px;
}

.sidebar__text a {
  color: #fff6e7;
}

.menu-tree {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-section {
  border: 1px solid rgba(226, 210, 182, 0.1);
  border-radius: 16px;
  background: rgba(255, 249, 239, 0.03);
  overflow: hidden;
  transition: transform 200ms ease, border-color 200ms ease, background 200ms ease;
}

.menu-section:hover,
.menu-section.is-active {
  transform: translateX(4px);
  border-color: rgba(226, 210, 182, 0.28);
  background: rgba(255, 249, 239, 0.06);
}

.menu-section__trigger {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.menu-section__trigger span:first-child {
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 500;
}

.menu-section__trigger .menu-section__count {
  color: rgba(245, 234, 216, 0.6);
}

.menu-section__children {
  max-height: 0;
  overflow: hidden;
  transition: max-height 280ms ease, padding 280ms ease;
  padding: 0 16px;
}

.menu-section.is-open .menu-section__children {
  max-height: 560px;
  padding: 0 16px 14px;
}

.menu-section__children a,
.menu-section__children button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(245, 234, 216, 0.82);
  cursor: pointer;
  padding: 8px 0 8px 18px;
  position: relative;
  text-align: left;
  font: inherit;
  text-decoration: none;
}

.menu-section__children a::before,
.menu-section__children button::before {
  content: "•";
  position: absolute;
  left: 2px;
  color: var(--gold-dust);
}

.menu-section__browse {
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.menu-section__browse::before {
  content: "↗";
}

.menu-section__children a:hover,
.menu-section__children button:hover,
.menu-section__children button.is-selected {
  color: #fff6e7;
}

.sidebar__footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.sound-toggle,
.button {
  border-radius: 999px;
  border: 1px solid rgba(226, 210, 182, 0.26);
  background: rgba(255, 249, 239, 0.07);
  color: inherit;
  padding: 12px 18px;
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.sound-toggle:hover,
.button:hover {
  transform: translateY(-2px);
  background: rgba(255, 249, 239, 0.12);
  border-color: rgba(226, 210, 182, 0.36);
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(226, 210, 182, 0.26);
  background: rgba(255, 249, 239, 0.07);
  color: #f5ead8;
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.admin-link:hover {
  transform: translateY(-2px);
  background: rgba(255, 249, 239, 0.12);
  border-color: rgba(226, 210, 182, 0.36);
}

.main-content {
  padding: 28px;
  display: grid;
  gap: 24px;
  font-family: var(--font-display);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.hero-slider {
  position: relative;
  min-height: clamp(460px, 54vw, 620px);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
  background-size: cover;
  background-position: top center;
  isolation: isolate;
}

.hero-slider::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(21, 12, 8, 0.18), rgba(21, 12, 8, 0.5)),
    linear-gradient(0deg, rgba(18, 10, 8, 0.68), rgba(18, 10, 8, 0.1));
  z-index: -1;
}

.hero-slider__overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(227, 188, 121, 0.16), transparent 18%),
    radial-gradient(circle at 85% 15%, rgba(255, 239, 210, 0.18), transparent 18%),
    linear-gradient(180deg, rgba(255, 232, 200, 0.08), transparent 26%, rgba(0, 0, 0, 0.28));
}

.hero-slider__content {
  position: absolute;
  inset: auto 28px 28px 28px;
  width: auto;
  padding: 0;
  color: #fff5e2;
  display: grid;
  gap: 14px;
}

.hero-slider__content h2 {
  font-size: clamp(1.05rem, 1.85vw, 1.75rem);
  line-height: 1.42;
  max-width: none;
  font-weight: 500;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.72);
}

.hero-slider__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 2px;
}

.hero-slider__dots {
  display: flex;
  gap: 8px;
}

.hero-slider__dots button {
  width: 11px;
  height: 11px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 244, 228, 0.64);
  background: transparent;
  cursor: pointer;
}

.hero-slider__dots button.is-active {
  background: #fff2d7;
}

.hero-panel__details {
  display: grid;
  gap: 24px;
}

.archive-card,
.panel,
.result-card,
.subsection-item {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(248, 240, 226, 0.86), rgba(233, 221, 198, 0.92));
  box-shadow: 0 14px 44px rgba(57, 34, 20, 0.12);
}

.archive-card {
  padding: 24px;
}

.archive-card--intro h3 {
  font-size: 2rem;
  margin: 6px 0 10px;
  font-weight: 600;
}

.archive-card--intro p:last-child,
.result-card p,
.subsection-item p,
.panel__header p,
.field span {
  color: var(--ink-soft);
}

.archive-card--signature {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  background:
    linear-gradient(145deg, rgba(241, 231, 211, 0.9), rgba(212, 194, 163, 0.82)),
    url("./public/statue.png") center/contain no-repeat;
}

.archive-card--signature img {
  width: min(100%, 280px);
  object-fit: contain;
  mix-blend-mode: multiply;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.75fr);
  gap: 24px;
}

.panel {
  padding: 24px;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

.panel__header--stack {
  align-items: start;
}

.panel__header h2,
.panel__header h3 {
  font-size: clamp(1.6rem, 2vw, 2.25rem);
}

.panel__summary {
  margin: 0;
  max-width: 48ch;
  color: var(--ink-soft);
  line-height: 1.7;
}

.subsection-list,
.results-grid {
  display: grid;
  gap: 14px;
}

.subsection-item {
  padding: 18px 18px 18px 20px;
  position: relative;
  overflow: hidden;
}

.subsection-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--gold-dust), var(--oxide));
}

.subsection-item h4,
.library-summary-card h3,
.result-card h3,
.result-card h4 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-family: var(--font-display);
  font-weight: 600;
}

.search-form {
  display: grid;
  gap: 16px;
}

.search-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.search-form__row:has(> :nth-child(3)) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.quick-filters p,
.results-count {
  font-size: 0.9rem;
}

.field input,
.field select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(89, 58, 39, 0.22);
  background: rgba(255, 251, 243, 0.84);
  color: var(--ink);
  padding: 14px 16px;
  font: inherit;
  font-family: var(--font-display);
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(184, 150, 94, 0.5);
  outline-offset: 2px;
}

.search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  color: var(--ink);
}

.button--primary {
  background: linear-gradient(135deg, var(--oxide), var(--gold-dust));
  color: #fff8ec;
  border-color: transparent;
}

.button--ghost {
  background: rgba(255, 252, 245, 0.56);
}

.quick-filters {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.quick-filters__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-filter {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(89, 58, 39, 0.16);
  background: rgba(255, 248, 238, 0.78);
  cursor: pointer;
  font: inherit;
  font-family: var(--font-display);
}

.quick-filter:hover,
.quick-filter.is-active {
  background: rgba(184, 150, 94, 0.18);
  border-color: rgba(89, 58, 39, 0.26);
}

.results-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.result-card {
  padding: 20px;
  display: grid;
  gap: 12px;
}

.result-card__meta {
  color: var(--oxide);
}

.result-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-card__tags span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(139, 93, 62, 0.1);
  color: var(--oxide-deep);
  font-size: 0.82rem;
}

.result-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result-card__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(89, 58, 39, 0.18);
  background: rgba(255, 248, 238, 0.84);
  color: var(--ink);
  text-decoration: none;
}

.result-card__action:hover {
  background: rgba(184, 150, 94, 0.16);
}

.result-card__action--primary {
  background: linear-gradient(135deg, var(--oxide), var(--gold-dust));
  color: #fff8ec;
  border-color: transparent;
}

.result-card__action--link {
  background: rgba(139, 93, 62, 0.1);
}

.result-card__hint {
  margin: 0;
  color: var(--ink-soft);
}

.result-card__thumb {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--radius-lg, 14px);
  margin-bottom: 2px;
}

.result-card__audio {
  width: 100%;
  margin: 4px 0;
  border-radius: 8px;
}

.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.page-card {
  align-content: start;
}

.admin-link--page,
.admin-link--back {
  color: var(--ink);
  background: rgba(255, 248, 238, 0.78);
  border-color: rgba(89, 58, 39, 0.16);
}

.page-view-body {
  min-height: 100vh;
  padding: 28px;
}

.page-view {
  display: grid;
  gap: 18px;
  max-width: 960px;
  margin: 0 auto;
}

.library-view-body,
.post-view-body {
  min-height: 100vh;
  padding: 28px;
}

.library-view,
.post-view {
  display: grid;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
}

.library-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.library-breadcrumbs a {
  color: var(--oxide-deep);
  text-decoration: none;
}

.library-breadcrumbs a:hover {
  text-decoration: underline;
}

.library-hero {
  display: grid;
  gap: 14px;
}

.library-hero h1,
.post-detail h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.2vw, 3.6rem);
  line-height: 1.08;
}

.library-hero__summary {
  margin: 0;
  max-width: 72ch;
  color: var(--ink-soft);
  line-height: 1.8;
}

.library-hero__meta,
.post-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.library-hero__meta span,
.post-detail__meta span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(139, 93, 62, 0.1);
  color: var(--oxide-deep);
}

.library-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.library-summary-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(248, 240, 226, 0.86), rgba(233, 221, 198, 0.92));
  box-shadow: 0 14px 44px rgba(57, 34, 20, 0.12);
}

.library-summary-card h3 a,
.result-card__title-link a {
  color: var(--ink);
  text-decoration: none;
}

.library-summary-card h3 a:hover,
.result-card__title-link a:hover {
  color: var(--oxide-deep);
}

.library-filters-panel {
  scroll-margin-top: 24px;
}

.library-reset-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.library-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
}

.library-pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(89, 58, 39, 0.18);
  background: rgba(255, 248, 238, 0.84);
  color: var(--ink);
  text-decoration: none;
}

.library-pagination__link.is-active {
  background: linear-gradient(135deg, var(--oxide), var(--gold-dust));
  color: #fff8ec;
  border-color: transparent;
}

.post-detail {
  display: grid;
  gap: 18px;
}

.post-detail__header {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  align-items: start;
}

.post-detail__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.post-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(139, 93, 62, 0.1);
  color: var(--oxide-deep);
  text-decoration: none;
}

.post-chip--muted {
  color: var(--ink-soft);
}

.post-detail__image {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.post-detail__content {
  color: var(--ink-soft);
  line-height: 1.8;
}

.post-detail__actions {
  display: grid;
  gap: 12px;
}

.post-detail__actions h2 {
  margin: 0;
  font-family: var(--font-display);
}

.panel--nested {
  padding: 20px;
  box-shadow: none;
}

.page-article h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 1.04;
}

.page-article__excerpt,
.page-article__content {
  color: var(--ink-soft);
  line-height: 1.8;
}

.page-article__excerpt,
.page-article__content,
.result-card__description,
.subsection-item__description {
  color: var(--ink-soft);
}

.empty-state {
  padding: 22px;
  border-radius: var(--radius-md);
  background: rgba(255, 250, 243, 0.7);
  border: 1px dashed rgba(89, 58, 39, 0.22);
}

@media (max-width: 1180px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .main-content {
    padding-top: 0;
  }

  .hero-panel,
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .main-content,
  .sidebar {
    padding: 18px;
  }

  .hero-slider {
    min-height: 460px;
  }

  .page-view-body {
    padding: 18px;
  }

  .library-view-body,
  .post-view-body {
    padding: 18px;
  }

  .hero-slider__content {
    inset: auto 18px 18px 18px;
    width: auto;
    padding: 0;
  }

  .hero-slider__content h2 {
    font-size: clamp(0.95rem, 4vw, 1.25rem);
    line-height: 1.45;
    max-width: none;
  }

  .search-form__row,
  .panel__header {
    grid-template-columns: 1fr;
    display: grid;
    align-items: start;
  }

  .post-detail__header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero-slider__meta,
  .search-actions,
  .library-pagination {
    flex-direction: column;
    align-items: stretch;
  }
}