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

:root {
  --bg-color: #FAF2EC;
  --bg-card: #FAF2EC;
  --primary-gold: #A88F4A;
  --dark-gold: #83713E;
  --text-dark: #1A1A1A;
  --text-muted: #524F47;
  --text-sub: #4D4D4D;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Open Sans', 'Noto Sans', sans-serif;
  --transition: all 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.text-center { text-align: center; }
.mb-5 { margin-bottom: 3rem; }

/* Шапка */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(250, 242, 236, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(168, 143, 74, 0.15);
  transition: var(--transition);
}

.header.scrolled {
  box-shadow: 0 4px 20px rgba(131, 113, 62, 0.12);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 90px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 500;
  background: linear-gradient(135deg, #6F664E 0%, #A88F4A 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-link {
  font-size: 1.1rem;
  color: var(--text-dark);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-gold);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary-gold);
}

.btn-primary {
  background-color: var(--primary-gold);
  color: #FFF;
  padding: 12px 28px;
  border-radius: 24px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  display: inline-block;
  transition: var(--transition);
  border: none;
}

.btn-primary:hover {
  background-color: var(--dark-gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(168, 143, 74, 0.3);
}

.mobile-btn { display: none; }
.burger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.burger-menu span {
  width: 100%;
  height: 2px;
  background-color: var(--dark-gold);
  transition: var(--transition);
}

/* Hero */
.hero-section {
  position: relative;
  padding: 60px 0 80px;
  background-color: #FAF2EC;
  background-image: url('assets/images/backgrounds/backlilya.png');
  background-repeat: no-repeat;
  background-position: left top;
  background-size: cover;
  min-height: 976px;
}

.hero-container {
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  height: 100%;
}

.hero-content {
  position: absolute;
  left: 788px;
  top: 60px;
  width: 572px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 4.2rem;
  line-height: 1.1;
  color: var(--dark-gold);
  font-weight: 400;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--primary-gold);
  font-weight: 500;
  margin-bottom: 24px;
}

.hero-description {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--text-dark);
  margin-bottom: 35px;
}

.info-block {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.info-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.info-label {
  font-weight: 600;
  font-size: 1.1rem;
}

.info-text {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Биография */
.biography-section-wrap {
  position: relative;
  width: 1440px;
  height: 663px;
  margin: 0 auto;
  background-image: url('assets/images/backgrounds/background1.png');
  background-size: cover;
  background-position: center;
}

.bio-text-content {
  position: absolute;
  left: 200px;
  top: 60px;
  width: 652px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.bio-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 64px;
  color: #83713e;
  font-weight: 400;
  line-height: 1.1;
}

.bio-name-years {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  color: #a88f4a;
  line-height: 1.25;
  font-weight: 400;
}

.bio-full-desc {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: #1a1a1a;
  line-height: 1.55;
  font-weight: 400;
}

.bio-portrait-box {
  position: absolute;
  left: 1000px;
  top: 58px;
  width: 400px;
  height: 546px;
}

.bio-portrait-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}

/* Живопись */
.live-art-section-wrap {
  position: relative;
  width: 1440px;
  height: 739px;
  margin: 0 auto;
  background-image: url('assets/images/backgrounds/background2.png');
  background-size: cover;
  background-position: center;
  padding: 60px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.live-titles-box {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  left: 60px;
}

.live-title-1 {
  font-family: 'Playfair Display', serif;
  font-size: 64px;
  color: #83713e;
  font-weight: 400;
  line-height: 1.1;
}

.live-title-2 {
  font-family: 'Playfair Display', serif;
  font-size: 48px;
  color: #584c2a;
  font-weight: 400;
  margin-top: 5px;
}

.live-images-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 50px;
  width: 100%;
}

.live-art-1 {
  width: 353px;
  height: 499px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.live-art-2 {
  width: 391px;
  height: 445px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.live-art-3 {
  width: 279px;
  height: 394px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

/* Подвал */
.footer-section-wrap {
  position: relative;
  width: 1440px;
  height: 614px;
  margin: 0 auto;
  background-image: url('assets/images/backgrounds/backtext.png');
  background-size: cover;
  background-position: center;
}

.footer-quote-content {
  position: absolute;
  left: 80px;
  top: 130px;
  width: 1280px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-quote-text {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 44px;
  background: linear-gradient(to right, #6f664e, #a88f4a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.3;
  max-width: 1000px;
}

.footer-quote-author {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  color: #a88f4a;
}

.footer-bottom-bar {
  position: absolute;
  left: 80px;
  top: 535px;
  width: 1280px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.footer-line {
  width: 100%;
  height: 1px;
  background-color: #A88F4A;
  opacity: 0.4;
}

.footer-info-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy {
  font-family: 'Open Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: #a88F4A;
  position: relative;
  left: 525px;
}

.footer-socials {
  display: flex;
  gap: 20px;
  margin-left: 20px; 
}

.footer-socials a svg {
  width: 24px;
  height: 24px;
  fill: #A88F4A;
  transition: var(--transition);
}

.footer-socials a:hover {
  transform: translateY(-2px);
}

/* Gallery */
body.bg-gallery {
  background-color: #F8F2ED;
  background-image: url('assets/images/backgrounds/galleryback.png');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% auto;
}

.page-title {
  font-family: var(--font-serif);
  font-size: 3.8rem;
  color: var(--dark-gold);
  margin: 40px 0 30px;
  font-weight: 400;
}

.filter-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 50px;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(168, 143, 74, 0.5);
  color: #FFF;
  border: none;
  padding: 12px 36px;
  border-radius: 20px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
  background-color: var(--primary-gold);
  box-shadow: 0 4px 12px rgba(168, 143, 74, 0.3);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-bottom: 50px;
}

.art-card {
  background-color: var(--bg-card);
  border: 1px solid var(--primary-gold);
  border-radius: 6px;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.art-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(168, 143, 74, 0.2);
}

.art-card-img-wrap {
  width: 100%;
  height: 320px;
  overflow: hidden;
  background-color: #EFE8E1;
}

.art-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.art-card:hover .art-card-img-wrap img {
  transform: scale(1.05);
}

.art-card-body {
  padding: 16px;
}

.art-title {
  font-size: 1.15rem;
  color: #000;
  font-weight: 500;
  margin-bottom: 6px;
}

.art-details {
  font-size: 0.95rem;
  color: var(--text-sub);
}

.btn-outline {
  border: 2px solid var(--primary-gold);
  color: var(--primary-gold);
  background: transparent;
  padding: 14px 48px;
  border-radius: 12px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-outline:hover {
  background-color: var(--primary-gold);
  color: #FFF;
}

.show-more-wrap {
  margin-bottom: 80px;
}

.gallery-footer {
  position: relative;
  width: 1440px;
  height: 120px;
  margin: 0 auto;
  background-color: transparent;
}

.gallery-footer .footer-bottom-bar {
  position: absolute;
  left: 80px;
  top: 40px;
  width: 1280px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Heritage */
body.bg-heritage-page, body.bg-heritage {
  background-color: #F8F2ED;
  background-image: url('assets/images/backgrounds/background3.png');
  background-repeat: repeat-y;
  background-size: 1440px auto;
  background-position: center top;
}

.heritage-hero-wrap {
  position: relative;
  width: 1440px;
  min-height: 520px;
  margin: 0 auto;
  padding-top: 60px;
  text-align: center;
  background-image: url('assets/images/backgrounds/image 49n.png');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 1440px auto;
}

.heritage-hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.heritage-main-title {
  font-family: 'Playfair Display', serif;
  font-size: 64px;
  color: #83713e;
  font-weight: 400;
  margin-bottom: 20px;
}

.heritage-subtitle-text {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  color: #6F664E;
  line-height: 1.35;
  margin-bottom: 30px;
}

.heritage-vignette-divider {
  display: none !important;
}

.quotes-section-heading {
  font-family: 'Playfair Display', serif;
  font-size: 40px;
  color: #83713e;
  font-weight: 400;
  margin-top: 40px;
  margin-bottom: 40px;
}

.heritage-quotes-container {
  width: 1440px;
  margin: 0 auto;
  padding: 0 80px 60px 80px;
}

.quotes-grid-layout {
  display: grid;
  grid-template-columns: repeat(3, 390px);
  gap: 30px;
  justify-content: center;
}

/* карточки цитат */
.quote-card-item {
  background-color: rgba(250, 242, 236, 0.85);
  border: 1px solid #A88F4A;
  border-radius: 4px;
  padding: 25px 30px 30px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: space-between;
  min-height: 300px;
}

.quote-card-mark {
  align-self: flex-start;
  font-family: 'Playfair Display', serif;
  font-size: 72px;
  color: #A88F4A;
  line-height: 0.8;
  margin-bottom: 15px;
  margin-left: -5px;
}

.quote-card-text {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  line-height: 1.55;
  color: #1A1A1A;
  margin-bottom: 25px;
}

.quote-card-author-info strong {
  display: block;
  font-family: 'Open Sans', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #000;
  margin-bottom: 3px;
}

.quote-card-author-info span {
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  color: #524F47;
}

.heritage-memory-wrap {
  width: 1440px;
  margin: 0 auto;
  padding: 20px 80px 80px 80px;
}

.memory-content-box {
  max-width: 850px;
}

.memory-main-title {
  font-family: 'Playfair Display', serif;
  font-size: 48px;
  color: #83713e;
  font-weight: 400;
  margin-bottom: 15px;
}

.memory-subtitle {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: #A88F4A;
  font-weight: 500;
  margin-bottom: 20px;
}

.memory-paragraph {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  line-height: 1.55;
  color: #1A1A1A;
  text-align: left;
}

.heritage-footer-wrap {
  width: 1440px;
  margin: 0 auto;
  padding: 20px 80px 40px 80px;
}

.heritage-footer-bar {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.heritage-footer-line {
  width: 100%;
  height: 1px;
  background-color: #A88F4A;
  opacity: 0.4;
}

.heritage-footer-info {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.heritage-footer-copy {
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  color: #A88F4A;
  font-weight: 600;
  text-align: center;
}

.heritage-footer-socials {
  position: absolute;
  right: 0;
  display: flex;
  gap: 12px;
}

.heritage-footer-socials a svg {
  transition: transform 0.3s ease;
}

.heritage-footer-socials a:hover svg {
  transform: translateY(-2px);
}

/* Адаптивность */
@media (max-width: 1024px) {
  .hero-section {
    background-size: cover;
    background-position: left center;
  }
  
  .hero-container {
    grid-template-columns: 1fr;
  }

  .hero-content {
    position: relative;
    left: 0;
    top: 0;
    padding: 40px;
    width: 100%;
  }

  .bio-text-content {
    position: relative;
    left: 0;
    top: 0;
    width: 100%;
    padding: 20px;
  }

  .bio-portrait-box {
    position: relative;
    left: 0;
    top: 0;
    margin: 20px auto;
  }

  .hero-title { font-size: 3.2rem; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .quotes-grid-layout { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .burger-menu { display: flex; }

  .nav-menu {
    position: fixed;
    top: 90px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 90px);
    background-color: var(--bg-color);
    flex-direction: column;
    padding: 40px;
    transition: var(--transition);
  }

  .nav-menu.active { left: 0; }

  .desktop-btn { display: none; }
  .mobile-btn { display: inline-block; }

  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .quotes-grid-layout { grid-template-columns: 1fr; }

  .live-images-row {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 2.5rem; }
}
/* POP-UP */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.popup-overlay.active {
  display: flex;
}

.popup-content {
  background: #FAF2EC;
  border: 1px solid #A88F4A;
  border-radius: 12px;
  width: 90%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.popup-close {
  position: absolute;
  top: 25px;
  left: 25px;
  background: #A88F4A;
  color: #FFF;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  z-index: 10;
}

.popup-close:hover {
  background: #83713E;
  transform: scale(1.05);
}

.popup-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  margin-top: 10px;
}

.popup-img-wrapper {
  width: 100%;
  height: 420px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #F0E6DD;
  border-radius: 8px;
  overflow: hidden;
}

.popup-img-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.popup-title {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  color: #83713E;
  margin-top: 20px;
  font-weight: 400;
}

.popup-meta {
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  color: #777;
  margin-top: 4px;
}

.popup-description {
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  color: #444;
  margin-top: 16px;
  line-height: 1.6;
}

.popup-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
}

.nav-btn {
  background: #A88F4A;
  color: #FFF;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.nav-btn:hover {
  background: #83713E;
}

.counter {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: #83713E;
}

.sidebar-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  color: #83713E;
  margin-bottom: 20px;
  font-weight: 400;
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-item {
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s;
}

.sidebar-item:hover {
  transform: translateY(-3px);
}

.sidebar-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #A88F4A;
}

.sidebar-item span {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  color: #83713E;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .popup-body {
    grid-template-columns: 1fr;
  }
  .popup-sidebar {
    display: none;
  }
}
/* Просмотр изображения в полномэкране */
.popup-img-wrapper {
  cursor: zoom-in;
}

.fullscreen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  cursor: zoom-out;
}

.fullscreen-overlay.active {
  display: flex;
}

.fullscreen-overlay img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.25s ease;
}

.fullscreen-close {
  position: absolute;
  top: 25px;
  right: 25px;
  background: rgba(168, 143, 74, 0.8);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.fullscreen-close:hover {
  background: #A88F4A;
  transform: scale(1.1);
}

.popup-close {
  left: auto !important;
  right: 25px !important;
  top: 25px !important;
}

.footer-info-row,
.heritage-footer-info {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  position: relative !important;
}

.footer-copy {
  left: 0 !important;
  position: static !important;
  text-align: left !important;
}

.heritage-footer-copy {
  text-align: left !important;
}

.footer-socials,
.heritage-footer-socials {
  display: flex !important;
  align-items: center !important;
  gap: 20px !important;
}

.footer-socials a svg,
.heritage-footer-socials a svg {
  width: 30px !important;
  height: 30px !important;
  transition: transform 0.2s ease, fill 0.2s ease !important;
}

.footer-socials a:hover svg,
.heritage-footer-socials a:hover svg {
  transform: translateY(-2px) scale(1.08) !important;
}

.sidebar-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 24px !important;
  align-items: center !important;
}

.sidebar-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 220px !important;
  cursor: pointer !important;
}

.sidebar-item img {
  width: 100% !important;
  height: 260px !important;
  object-fit: cover !important;
  border-radius: 40px !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.sidebar-item:hover img {
  transform: translateY(-4px) scale(1.02) !important;
  box-shadow: 0 8px 20px rgba(168, 143, 74, 0.25) !important;
}

.sidebar-item span {
  font-family: 'Playfair Display', serif !important;
  font-size: 16px !important;
  color: #A88F4A !important;
  margin-top: 10px !important;
  text-align: center !important;
}
.footer-info-row,
.heritage-footer-info {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
}

.footer-copy,
.heritage-footer-copy {
  text-align: center !important;
  margin: 0 auto !important;
  left: 0 !important;
  position: static !important;
}

.footer-socials,
.heritage-footer-socials {
  position: absolute !important;
  right: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

.heritage-memory-wrap {
  width: 1440px !important;
  margin: 0 auto !important;
  padding: 60px 80px 100px 80px !important;
}

.memory-layout {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-end !important;
  width: 1280px !important;
  margin: 0 auto !important;
}

.memory-content-box {
  width: 652px !important;
  max-width: 652px !important;
  display: flex !important;
  flex-direction: column !important;
}

.memory-main-title {
  font-family: 'Playfair Display', serif !important;
  font-size: 64px !important;
  color: #83713E !important;
  font-weight: 400 !important;
  margin-bottom: 24px !important;
  line-height: 1.1 !important;
}

.memory-subtitle {
  font-family: 'Playfair Display', serif !important;
  font-size: 36px !important;
  color: #A88F4A !important;
  font-weight: 400 !important;
  margin-bottom: 24px !important;
  line-height: 1.2 !important;
}

.memory-paragraph {
  font-family: 'Playfair Display', serif !important;
  font-size: 20px !important;
  line-height: 1.55 !important;
  color: #1A1A1A !important;
  font-weight: 400 !important;
  text-align: left !important;
}

.memory-photo-wrap {
  width: 520px !important;
  display: flex !important;
  justify-content: flex-end !important;
}

.memory-photo-frame {
  position: relative !important;
  padding: 10px !important;
  background-color: #FAF2EC !important;
  border: 1px solid #A88F4A !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 25px rgba(168, 143, 74, 0.12) !important;
}

.memory-photo {
  display: block !important;
  width: 100% !important;
  max-width: 500px !important;
  height: 330px !important;
  object-fit: cover !important;
  border-radius: 4px !important;
  /* Мягкая цветокоррекция в бежево-золотых тонах */
  filter: sepia(0.2) contrast(1.05) brightness(0.98) saturate(0.9) !important;
  transition: filter 0.3s ease, transform 0.3s ease !important;
}

.memory-photo-frame:hover .memory-photo {
  filter: sepia(0.05) contrast(1.08) brightness(1.02) saturate(1) !important;
  transform: scale(1.01) !important;
}
/* Планшет */
@media (min-width: 641px) and (max-width: 1024px) {
  .home-page .header-container { min-height: 78px; height: auto; padding: 14px 28px; }
  .home-page .logo { font-size: 1.55rem; }
  .home-page .nav-menu { gap: 18px; }
  .home-page .nav-link { font-size: 1rem; }
  .home-page .btn-primary { padding: 10px 20px; }

  /* Главный экран */
  .home-page .hero-section {
    min-height: 720px;
    padding: 48px 32px 64px;
    background-position: 38% top;
    background-size: cover;
  }
  .home-page .hero-container { height: auto; }
  .home-page .hero-content {
    position: relative;
    left: auto;
    top: auto;
    width: min(52%, 500px);
    margin-left: auto;
    padding: 34px 30px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 22px;
    background: rgba(250, 242, 236, 0.76);
    box-shadow: 0 14px 38px rgba(72, 54, 31, 0.12);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  .home-page .hero-title { font-size: clamp(3rem, 6.4vw, 4rem); }
  .home-page .hero-subtitle { font-size: clamp(1.35rem, 2.8vw, 1.75rem); }
  .home-page .hero-description { font-size: 1.05rem; }

  /* Биография */
  .home-page .biography-section-wrap {
    width: 100%;
    height: auto;
    min-height: 600px;
    padding: 64px 44px;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.65fr);
    gap: 38px;
    align-items: center;
  }
  .home-page .bio-text-content { position: static; width: 100%; padding: 0; }
  .home-page .bio-section-title { font-size: clamp(3rem, 6vw, 4rem); }
  .home-page .bio-name-years { font-size: clamp(1.65rem, 3.5vw, 2.25rem); }
  .home-page .bio-full-desc { font-size: 1.08rem; }
  .home-page .bio-portrait-box { position: static; width: 100%; height: auto; margin: 0; }
  .home-page .bio-portrait-box img { height: auto; aspect-ratio: 400 / 546; }

  /* Живопись */
  .home-page .live-art-section-wrap { width: 100%; height: auto; padding: 58px 36px 70px; }
  .home-page .live-titles-box { left: 0; }
  .home-page .live-title-1 { font-size: clamp(3rem, 6vw, 4rem); }
  .home-page .live-title-2 { font-size: clamp(2rem, 4.7vw, 3rem); }
  .home-page .live-images-row {
    display: grid;
    grid-template-columns: 1fr 1.1fr 0.9fr;
    align-items: end;
    gap: 24px;
  }
  .home-page .live-art-1,
  .home-page .live-art-2,
  .home-page .live-art-3 { width: 100%; height: auto; aspect-ratio: 3 / 4; }

  /* Подвал */
  .home-page .footer-section-wrap {
    width: 100%;
    height: auto;
    min-height: 520px;
    padding: 100px 44px 34px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #efdadd;
    background-image: linear-gradient(to bottom, rgba(250, 242, 236, 0) 52%, rgba(239, 218, 221, 0.96) 100%), url('assets/images/backgrounds/backtext.png');
    background-size: cover;
    background-position: center top;
  }
  .home-page .footer-quote-content { position: static; width: 100%; gap: 16px; }
  .home-page .footer-quote-text { font-size: clamp(2rem, 4.4vw, 2.75rem); }
  .home-page .footer-quote-author { font-size: 1.7rem; }
  .home-page .footer-bottom-bar { position: static; width: 100%; margin-top: 72px; }
}

/* Меню */
@media (min-width: 641px) and (max-width: 768px) {
  .home-page .nav-menu {
    top: 78px;
    height: calc(100vh - 78px);
  }
}

/* Планшет: галерея и наследие */
@media (min-width: 641px) and (max-width: 1024px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Галерея */
  .bg-gallery .container {
    width: 100%;
    max-width: 100%;
    padding-right: 32px;
    padding-left: 32px;
  }

  .bg-gallery .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .bg-gallery .art-card,
  .bg-gallery .art-card-img-wrap { min-width: 0; }

  .bg-gallery .art-card-img-wrap { height: clamp(260px, 39vw, 360px); }

  /* Подвал галереи */
  .gallery-footer {
    width: 100%;
    height: auto;
    min-height: 110px;
    padding: 24px 32px 30px;
  }

  .gallery-footer .footer-bottom-bar {
    position: static;
    width: 100%;
  }

  /* Наследие */
  body.bg-heritage-page,
  body.bg-heritage { background-size: cover; }

  .heritage-hero-wrap,
  .heritage-quotes-container,
  .heritage-memory-wrap,
  .heritage-footer-wrap {
    width: 100% !important;
    max-width: 100% !important;
  }

  .heritage-hero-wrap {
    min-height: 450px;
    padding: 54px 40px 32px;
    background-size: cover;
  }

  .heritage-hero-content {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
  }

  .heritage-main-title { font-size: clamp(3rem, 7vw, 4rem); }

  .heritage-subtitle-text { font-size: clamp(1.2rem, 2.7vw, 1.6rem); }

  .quotes-section-heading { font-size: clamp(2rem, 4.8vw, 2.5rem); }

  .heritage-quotes-container { padding: 0 32px 54px; }

  .quotes-grid-layout {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .quote-card-item {
    min-width: 0;
    min-height: 320px;
    padding: 24px;
  }

  .heritage-memory-wrap { padding: 48px 32px 64px !important; }

  .memory-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
    width: 100% !important;
    max-width: 100% !important;
    gap: 32px !important;
  }

  .memory-content-box {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
  }

  .memory-main-title { font-size: clamp(3rem, 6vw, 4rem) !important; }

  .memory-subtitle { font-size: clamp(1.7rem, 3.5vw, 2.25rem) !important; }

  .memory-paragraph { font-size: 1.05rem !important; }

  .memory-photo-wrap {
    width: 100% !important;
    min-width: 0;
  }

  .memory-photo {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 3 / 2;
  }

  /* Подвал наследия */
  .heritage-footer-wrap { padding: 24px 32px 32px !important; }

  .heritage-footer-bar,
  .heritage-footer-info { width: 100%; }
}

/* Мобильная адаптация */
@media (max-width: 640px) {

  html, body { width: 100%; overflow-x: hidden; }

  .container { padding: 0 20px; }
  .header {
    position: sticky;
    top: 0;
  }

  .header-container {
    height: auto;
    min-height: 74px;
    padding: 16px 20px;
    align-items: center;
  }

  .logo {
    font-size: 1.3rem;
    line-height: 1.18;
    max-width: 130px;
    flex-shrink: 0;
  }

  .burger-menu { display: flex; }
  .desktop-btn { display: none !important; }

  .nav-menu {
    top: 78px;
    height: calc(100vh - 78px);
    background: rgba(250, 242, 236, 0.96);
    backdrop-filter: blur(10px);
    padding: 30px 24px;
    gap: 0;
  }

  .nav-menu .nav-link {
    width: 100%;
    padding: 16px 0;
    font-size: 1.15rem;
    border-bottom: 1px solid rgba(168, 143, 74, 0.35);
  }

  .nav-menu .nav-link.active::after { display: none; }

  .nav-menu .mobile-btn {
    margin-top: 24px;
    width: 100%;
    text-align: center;
  }

  /* Главный экран */
  .hero-section {
    min-height: auto;
    padding: 10px 20px 0;
    background-color: #FAF2EC;
    background-image: url('assets/images/backgrounds/backlilya.png');
    background-size: 110% auto;
    background-position: top -20px left -35px;
    background-repeat: no-repeat;
  }

  .hero-container { height: auto; }

  .hero-content {
    position: relative;
    z-index: 2;
    margin-left: auto;
    width: 54%;
    text-align: left;
    padding: 5px 0 26px 8px;
  }

  .hero-title {
    font-size: 30px;
    line-height: 1.05;
    margin-bottom: 10px;
  }
  .hero-subtitle {
    font-size: 12px;
    line-height: 1.2;
    margin-bottom: 12px;
  }
  .hero-description {
    font-size: 9.5px;
    line-height: 1.45;
    margin-bottom: 16px;
  }

  .info-block { gap: 12px; }
  .info-item { gap: 8px; }
  .info-icon { width: 16px; height: 16px; margin-top: 1px; }
  .info-label { font-size: 10.5px; margin-bottom: 2px; }
  .info-text { font-size: 9px; line-height: 1.35; }

  /* Биография */
  .biography-section-wrap {
    width: 100%;
    height: auto;
    padding: 32px 20px 16px;
    display: grid;
    grid-template-columns: 1fr 135px;
    column-gap: 12px;
    row-gap: 6px;
    align-items: start;
  }

  .bio-text-content { display: contents; }

  .bio-section-title {
    grid-column: 1 / -1;
    font-size: 34px;
    line-height: 1;
    margin-bottom: 4px;
  }
  .bio-name-years {
    grid-column: 1 / -1;
    font-size: 16px;
    line-height: 1.2;
    margin-bottom: 14px;
  }
  .bio-full-desc {
    grid-column: 1;
    grid-row: 3;
    font-size: 9.5px;
    line-height: 1.45;
    text-align: justify;
  }

  .bio-portrait-box {
    grid-column: 2;
    grid-row: 3;
    position: static;
    width: 135px;
    height: auto;
    margin: -6px 0 0;
  }

  .bio-portrait-box img {
    width: 100%;
    height: auto;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  }

  /* Главная */
  .home-page .hero-section {
    padding: 24px 16px 28px;
    background-size: auto 100%;
    background-position: top center;
  }

  .home-page .hero-content {
    width: min(78%, 400px);
    margin-left: auto;
    padding: 20px 18px 22px;
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: 18px;
    background: rgba(250, 242, 236, 0.78);
    box-shadow: 0 12px 32px rgba(72, 54, 31, 0.12);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  .home-page .hero-title {
    font-size: clamp(2.25rem, 11vw, 3rem);
    line-height: 1.02;
    margin-bottom: 14px;
  }

  .home-page .hero-subtitle {
    font-size: clamp(1rem, 4.6vw, 1.25rem);
    line-height: 1.28;
    margin-bottom: 16px;
  }

  .home-page .hero-description {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
  }

  .home-page .info-block { gap: 16px; }
  .home-page .info-item { gap: 11px; }
  .home-page .info-icon { width: 22px; height: 22px; }
  .home-page .info-label { font-size: 0.9rem; }
  .home-page .info-text { font-size: 0.82rem; line-height: 1.45; }

  .home-page .biography-section-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 42px 22px 38px;
  }

  .home-page .bio-text-content { display: contents; }

  .home-page .bio-section-title {
    font-size: clamp(2.5rem, 12vw, 3.4rem);
    line-height: 1.05;
    margin-bottom: 10px;
  }

  .home-page .bio-name-years {
    font-size: clamp(1.25rem, 6vw, 1.6rem);
    line-height: 1.3;
    margin-bottom: 22px;
  }

  .home-page .bio-portrait-box {
    order: 3;
    width: min(76vw, 310px);
    margin: 0 auto 24px;
  }

  .home-page .bio-full-desc {
    order: 4;
    font-size: 1rem;
    line-height: 1.65;
    text-align: left;
  }

  /* Живопись */
  .live-art-section-wrap {
    width: 100%;
    height: auto;
    padding: 14px 16px 35px;
    text-align: center;
  }

  .live-titles-box { position: static; left: 0; margin-bottom: 20px; }
  .live-title-1 { font-size: 1.6rem; }
  .live-title-2 { font-size: 1.2rem; }

  .live-images-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
  }

  .live-art-1, .live-art-2, .live-art-3 {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    object-fit: cover;
  }

  /* Подвал */
  .home-page .footer-section-wrap {
    width: 100%;
    height: auto;
    min-height: 430px;
    padding: 62px 20px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #efdadd;
    background-image: linear-gradient(to bottom, rgba(250, 242, 236, 0) 48%, rgba(239, 218, 221, 0.98) 100%), url('assets/images/backgrounds/backtext.png');
    background-size: auto 100%;
    background-position: center top;
    background-repeat: no-repeat;
    text-align: center;
  }

  .footer-quote-content {
    position: static;
    width: 100%;
    gap: 8px;
  }

  .footer-quote-text {
    font-size: 21px;
    line-height: 1.25;
    margin-top: 0;
    padding: 0 10px;
    max-width: 100%;
  }
  .footer-quote-author {
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 0;
  }

  .footer-bottom-bar {
    position: static;
    width: 100%;
    margin-top: 56px;
  }

  .footer-info-row,
  .heritage-footer-info {
    flex-direction: column !important;
    gap: 14px !important;
  }

  .footer-copy,
  .heritage-footer-copy {
    text-align: center !important;
    left: 0 !important;
  }

  .footer-socials,
  .heritage-footer-socials {
    position: static !important;
    transform: none !important;
    right: auto !important;
    top: auto !important;
  }

  /* Gallery */
  body.bg-gallery { background-size: cover; }

  .page-title { font-size: 2.1rem; margin: 28px 0 20px; }

  .filter-buttons {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding-bottom: 6px;
    margin-bottom: 30px;
    scrollbar-width: none;
  }
  .filter-buttons::-webkit-scrollbar { display: none; }

  .filter-btn {
    padding: 10px 22px;
    font-size: 0.95rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .gallery-grid { grid-template-columns: 1fr; gap: 22px; }
  .art-card-img-wrap { height: 240px; }

  .btn-outline { padding: 12px 36px; font-size: 1rem; }

  .gallery-footer { width: 100%; height: auto; padding: 20px 0 30px; }
  .gallery-footer .footer-bottom-bar { position: static; width: 100%; padding: 0 20px; }

  /* Heritage */
  body.bg-heritage-page, body.bg-heritage { background-size: cover; }

  .heritage-hero-wrap {
    width: 100%;
    min-height: auto;
    padding: 40px 20px 20px;
    background-size: cover;
  }

  .heritage-main-title { font-size: 2.1rem; }
  .heritage-subtitle-text { font-size: 1rem; }
  .quotes-section-heading { font-size: 1.6rem; margin: 30px 0 24px; }

  .heritage-quotes-container { width: 100%; padding: 0 20px 30px; }
  .quotes-grid-layout { grid-template-columns: 1fr; gap: 18px; }

  .quote-card-item { padding: 20px 22px 24px; min-height: auto; }
  .quote-card-mark { font-size: 56px; }
  .quote-card-text { font-size: 0.95rem; }

  .heritage-memory-wrap {
    width: 100% !important;
    padding: 30px 20px 50px !important;
  }

  .memory-layout {
    width: 100% !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 24px !important;
  }

  .memory-content-box {
    width: 100% !important;
    max-width: 100% !important;
  }

  .memory-main-title { font-size: 1.9rem !important; margin-bottom: 14px !important; }
  .memory-subtitle { font-size: 1.25rem !important; margin-bottom: 14px !important; }
  .memory-paragraph { font-size: 0.95rem !important; }

  .memory-photo-wrap {
    width: 100% !important;
    justify-content: center !important;
  }

  .memory-photo-frame { width: 100%; }

  .memory-photo {
    width: 100% !important;
    max-width: 100% !important;
    height: 220px !important;
  }

  .heritage-footer-wrap {
    width: 100% !important;
    padding: 20px 20px 30px !important;
  }

  /* Popup mobile*/
  .popup-overlay {
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
  }

  .popup-content {
    width: 100%;
    max-width: 400px;
    height: auto;
    max-height: calc(100vh - 48px);
    border-radius: 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .popup-body {
    display: flex;
    flex-direction: column;
    grid-template-columns: unset;
    gap: 0;
    margin-top: 0;
    height: auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .popup-main { display: flex; flex-direction: column; min-height: 0; }

  .popup-close {
    top: -14px !important;
    left: -14px !important;
    right: auto !important;
    width: 34px !important;
    height: 34px !important;
    background: #A88F4A !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    z-index: 5;
  }

  .popup-img-wrapper {
    width: 100%;
    height: 46vh;
    max-height: 320px;
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
  }

  .popup-img-wrapper img { object-fit: cover; }

  .popup-title { padding: 24px 20px 0; margin-top: 0; font-size: 1.3rem; }
  .popup-meta { padding: 0 20px; }
  .popup-description { padding: 0 20px; }

  .popup-controls {
    padding: 20px 20px 24px;
    justify-content: center;
    margin-top: 12px;
  }

  .popup-sidebar { display: none; }
}
