/* ==========================================================================
   Лицкевич В.К. — тёплая «галерейная» тема
   ========================================================================== */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond-cyrillic-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fonts/cormorant-garamond-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
                 U+FEFF, U+FFFD;
}

:root {
  --paper: #faf6ee;
  --paper-soft: #f4ecdf;
  --surface: #fffdf8;
  --ink: #2c2621;
  --ink-soft: #6d6156;
  --ink-faint: #9a8f82;
  --accent: #b0603f;
  --accent-strong: #964c30;
  --accent-soft: #c98a6a;
  --line: #e8ddca;
  --line-strong: #d9cbb2;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(44, 38, 33, 0.05), 0 4px 14px rgba(44, 38, 33, 0.06);
  --shadow: 0 1px 2px rgba(44, 38, 33, 0.06), 0 14px 34px rgba(44, 38, 33, 0.12);
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --container: 1120px;
  --header-h: 64px;
}

/* --- Reset / base --------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(1200px 600px at 50% -200px, #fdfaf4 0%, var(--paper) 70%);
}

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

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

a:hover {
  color: var(--accent-strong);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

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

/* --- Header / navbar ------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 238, 0.88);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

.navbar__brand {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.navbar__brand:hover {
  color: var(--accent);
}

.navbar__menu {
  display: flex;
  align-items: center;
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  color: var(--ink-soft);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.nav-link:hover {
  color: var(--ink);
  background: var(--paper-soft);
}

.nav-link.is-active {
  color: var(--accent-strong);
}

/* dropdown */

.nav-dropdown {
  position: relative;
}

.nav-dropdown__caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.7;
}

.nav-dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 280px;
  max-height: min(70vh, 560px);
  overflow-y: auto;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}

.nav-dropdown.is-open .nav-dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown__item {
  display: block;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.95rem;
}

.nav-dropdown__item:hover {
  background: var(--paper-soft);
  color: var(--accent-strong);
}

/* burger */

.navbar__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.navbar__toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.navbar__toggle[aria-expanded="true"] .navbar__toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.navbar__toggle[aria-expanded="true"] .navbar__toggle-bar:nth-child(2) {
  opacity: 0;
}

.navbar__toggle[aria-expanded="true"] .navbar__toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Sections / titles ---------------------------------------------------- */

.section {
  margin-top: 56px;
}

.page-title {
  text-align: center;
  font-weight: 600;
  margin-top: 50px;
  margin-bottom: 40px;
  font-size: 2rem;
}

.page-title::after {
  content: "";
  display: block;
  margin: 16px auto 0;
  width: 72px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* --- Hero (index) --------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 380px) 1fr;
  gap: 44px;
  align-items: center;
  padding: 40px 0 8px;
}

.hero__photo {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 6px solid var(--surface);
  background: var(--surface);
}

.hero__title {
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  margin-bottom: 0.35em;
}

.hero__epigraph {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--accent);
  margin: 0 0 0.75em;
}

.hero__lead {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 56ch;
}

/* --- Button --------------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.16s ease, transform 0.16s ease;
}

.btn:hover {
  background: var(--accent-strong);
  color: #fff;
  transform: translateY(-1px);
}

/* --- Gallery grid (index cards) ------------------------------------------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 26px;
}

.gallery-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--ink);
}

.gallery-card__media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}

.gallery-card__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-card:hover .gallery-card__media img {
  transform: scale(1.05);
}

.gallery-card__title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  line-height: 1.35;
}

.gallery-card:hover .gallery-card__title {
  color: var(--accent-strong);
}

/* --- Biography ------------------------------------------------------------ */

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

.prose {
  font-size: 1.12rem;
  line-height: 1.75;
}

.prose p {
  margin: 16px 0;
  text-align: justify;
  text-indent: 40px;
}

.prose ul {
  margin: 12px 0 16px;
  padding-left: 26px;
}

.prose li {
  margin: 4px 0;
}

/* --- Masonry (gallery page) & photo masonry (about) ----------------------- */

.masonry,
.photo-masonry {
  columns: 3 220px;
  column-gap: 16px;
}

.masonry__item,
.photo-masonry__item {
  display: block;
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  background: var(--surface);
}

.masonry__item img,
.photo-masonry__item img {
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}

.masonry__item:hover img,
.photo-masonry__item:hover img {
  transform: scale(1.03);
}

.photo-masonry {
  margin-bottom: 48px;
  columns: 4 180px;
}

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  margin-top: 72px;
  border-top: 1px solid var(--line);
  padding: 28px 0 36px;
  color: var(--ink-faint);
  background: var(--paper-soft);
}

.site-footer .container {
  text-align: center;
}

.site-footer p {
  margin: 4px 0;
}

.site-footer__motto {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

/* --- Error / empty -------------------------------------------------------- */

.error {
  text-align: center;
  padding: 80px 0;
}

.error__title {
  font-size: 2.4rem;
}

.error__text {
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.empty {
  text-align: center;
  color: var(--ink-faint);
  font-style: italic;
  padding: 24px 0;
}

/* --- PhotoSwipe tweaks ---------------------------------------------------- */

.pswp__bg {
  background: #241d17;
}

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero__media {
    max-width: 380px;
    margin: 0 auto;
  }

  .hero__body {
    text-align: center;
  }

  .hero__lead {
    margin-left: auto;
    margin-right: auto;
  }

  .navbar__toggle {
    display: flex;
  }

  .navbar__menu {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .navbar__menu.is-open {
    max-height: min(80vh, 620px);
    overflow-y: auto;
  }

  .navbar__links {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px 20px;
    gap: 2px;
  }

  .nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 11px 13px;
  }

  .nav-dropdown__menu {
    position: static;
    box-shadow: none;
    border: none;
    max-height: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    padding-left: 16px;
  }

  .nav-dropdown.is-open .nav-dropdown__menu {
    display: block;
  }

  .masonry,
  .photo-masonry {
    columns: 2 160px;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 1.6rem;
  }

  .masonry,
  .photo-masonry {
    columns: 1;
  }
}

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