/* ═══════════════════════════════════════════
   Art House — style.css
   ═══════════════════════════════════════════ */

:root {
  --navy:      #0C132F;
  --orange:    #DE623E;
  --orange-dk: #c04f2b;
  --orange-lt: #f0845f;
  --cream:     #FAF8F5;
  --gray-100:  #F2EFE9;
  --gray-200:  #E0DBD3;
  --gray-500:  #8C8680;
  --text:      #1C1A18;
  --white:     #FFFFFF;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --radius:    10px;
  --shadow-sm: 0 2px 12px rgba(12,19,47,.08);
  --shadow-md: 0 8px 32px rgba(12,19,47,.14);
  --shadow-lg: 0 20px 60px rgba(12,19,47,.20);
  --ease:      cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; }
body  { background: var(--cream); color: var(--text); font-family: var(--font-body);
        font-size: 1rem; line-height: 1.65; overflow-x: hidden; }

/* ── Navbar ────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 70px;
  background: var(--navy);
  box-shadow: 0 2px 20px rgba(0,0,0,.3);
  z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 5vw; gap: 1rem;
}
.logo-container { height: 95px; flex-shrink: 0; }
.logo-container img { height: 100%; width: auto; }
.nav-links { display: flex; gap: .25rem; list-style: none; margin: 0 auto; padding: 0; }
.nav-links a {
  color: rgba(255,255,255,.8); text-decoration: none;
  font-size: clamp(.82rem, 1.4vw, 1rem); font-weight: 500; letter-spacing: .02em;
  padding: .45rem .9rem; border-radius: 6px;
  transition: background .22s var(--ease), color .22s var(--ease);
}
.nav-links a:hover { background: rgba(222,98,62,.2); color: var(--orange-lt); }


/* ── Carousel ──────────────────────────── */
.carousel {
  position: relative; width: 100vw; height: 600px;
  margin-top: 70px; overflow: hidden; background: var(--navy);
}
.carousel-track {
  display: flex; height: 100%;
  transition: transform .65s cubic-bezier(.77,0,.18,1);
  will-change: transform;
}
.carousel-slide { min-width: 100vw; height: 100%; flex-shrink: 0; }
.carousel-slide img {
  width: 100vw;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* @media (min-width: 1500px) { */
  .carousel-slide img {
    /* object-position: left center;   */
    /* смещает вправо — правый край обрезается */
    transform: scaleX(1.08);       /* чуть растягивает в ширь */
    transform-origin: left center;
  }
/* } */
.c-overlay {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 16px;
  z-index: 10; white-space: nowrap;
}
.c-flag { height: 200px; width: auto; border-radius: 3px; flex-shrink: 0; padding-right: 10px; }
.c-overlay-text { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.c-overlay-text span { white-space: nowrap; }
.c-overlay-text span:first-child {
  font-size: 65px; font-weight: 600; color: #fff; line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8), 0 0 12px rgba(0,0,0,0.6);
}
.c-overlay-text span:last-child {
  font-size: 50px; font-weight: 400; color: rgba(255,255,255,.95); line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8), 0 0 12px rgba(0,0,0,0.6);
}
.carousel::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(12,19,47,.50) 0%, rgba(222,98,62,.18) 100%);
  pointer-events: none;
}
.c-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  background: rgba(12,19,47,.55); border: 1px solid rgba(255,255,255,.15); color: #fff;
  font-size: 2.2rem; line-height: 1; width: 52px; height: 52px; border-radius: 50%;
  cursor: pointer; transition: background .22s var(--ease), transform .22s var(--ease);
  display: flex; align-items: center; justify-content: center;
  padding-right: 3px; padding-bottom: 6px;
}
.c-btn:hover { background: var(--orange); transform: translateY(-50%) scale(1.08); }
@media(max-width: 850px) {
  .c-btn { display: none; }
}
.c-prev { left: 1.5rem; }
.c-next { right: 1.5rem; padding-left: 5px; }
.c-dots {
  position: absolute; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  z-index: 2; display: flex; gap: .5rem;
}
.c-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255,255,255,.45); border: 1.5px solid rgba(255,255,255,.5);
  cursor: pointer; transition: background .22s, transform .22s;
}
.c-dot.active { background: var(--orange); border-color: var(--orange); transform: scale(1.3); }
.c-dot:hover  { background: rgba(255,255,255,.8); }

/* ── Sections ──────────────────────────── */
section { padding: 80px 8vw 60px; }
section:nth-of-type(even) { background: var(--gray-100); }
.content-wrapper { max-width: 1200px; margin: 0 auto; }
.section-label {
  font-size: .68rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase;
  color: var(--orange); text-align: center; margin-bottom: .65rem;
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 700; color: var(--navy); text-align: center; margin-bottom: 1.4rem; line-height: 1.15;
}
h2::after {
  content: ''; display: block; width: 46px; height: 3px; background: var(--orange);
  margin: 1.8rem auto 1.8rem; border-radius: 2px;
}
.text-block {
  font-size: 1.05rem; line-height: 1.8;
  max-width: 800px; margin: 0 auto 2.5rem; text-align: center; color: #3a3530;
}
.text-block p + p { margin-top: .85rem; }

/* ── Stats ─────────────────────────────── */
.stats-row { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; margin-top: 2.5rem; }
.stat {
  background: var(--navy); color: var(--white);
  flex: 1 1 140px; max-width: 210px;
  padding: 2rem 1.5rem; text-align: center; border-radius: var(--radius);
  display: flex; flex-direction: column; gap: .4rem;
  transition: background .25s var(--ease);
}
.stat:hover { background: var(--orange); }
.stat-num { font-family: var(--font-display); font-size: 2.3rem; font-weight: 700; line-height: 1; color: var(--orange); }
.stat:hover .stat-num { color: var(--white); }
.stat-label { font-size: .72rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.stat:hover .stat-label { color: rgba(255,255,255,.85); }

/* ── Gallery filters ───────────────────── */
.gallery-filters { display: flex; justify-content: center; gap: .6rem; margin-bottom: 2rem; flex-wrap: wrap; }
.gf-btn {
  background: transparent; border: 2px solid var(--gray-200); color: var(--gray-500);
  font-family: var(--font-body); font-size: .76rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  padding: .5rem 1.6rem; border-radius: 50px; cursor: pointer;
  transition: border-color .22s, color .22s, background .22s, transform .22s;
}
.gf-btn:hover { border-color: var(--orange); color: var(--orange); transform: translateY(-1px); }
.gf-btn.active { background: var(--orange); border-color: var(--orange); color: var(--white); }

/* ── Gallery preview wrap ──────────────── */
.gallery-preview-wrap { position: relative; }

.gallery-fade {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 55%;
  background: linear-gradient(to bottom, transparent, rgba(12,19,47,.85) 80%);
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 2rem; pointer-events: none;
}
.gallery-fade.expanded {
  position: static; height: auto; background: none;
  padding: 2rem 0 0; pointer-events: all;
}
.gallery-open-btn {
  pointer-events: all;
  padding: 12px 32px; background: var(--orange); color: #fff;
  font-family: var(--font-body); font-weight: 600; font-size: .9rem;
  border-radius: 8px; border: none; cursor: pointer; letter-spacing: .04em;
  transition: background .18s, transform .18s, box-shadow .18s;
  box-shadow: 0 4px 18px rgba(222,98,62,.4);
}

.gallery-fade.expanded {
  position: static; height: auto; background: none;
  padding: 0; pointer-events: all;
}

/* Кнопка внутри грида — sticky в пределах галереи */
.gallery-open-btn {
  column-span: all;
  position: sticky;
  bottom: 2rem;
  display: block;
  width: fit-content;
  margin: 1.5rem auto;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,.45), 0 4px 18px rgba(222,98,62,.5);
}

.gallery-open-btn:hover { background: var(--orange-dk); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(222,98,62,.5); }

/* ── Gallery grid — CSS masonry columns ─── */
/*  Images keep natural proportions (height-driven layout).
    Columns fill from top; each image is as tall as it naturally is. */
.gallery-grid {
  columns: 4 200px;   /* 4 cols on wide screens, auto-fit on narrow */
  column-gap: 8px;
}

.gallery-empty {
  column-span: all;
  text-align: center; color: var(--gray-500); font-size: .85rem;
  letter-spacing: .12em; text-transform: uppercase; padding: 3rem 0;
}

.gallery-item {
  break-inside: avoid;       /* never split an image across columns */
  margin-bottom: 8px;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.gallery-item.hidden { display: none; }
.gallery-item:hover  { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;        /* natural height — no cropping */
  transition: transform .55s cubic-bezier(.22,1,.36,1), filter .35s;
  filter: brightness(.92);
}
.gallery-item:hover img { transform: scale(1.04); filter: brightness(1); }

.gallery-item-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(12,19,47,.82) 0%, transparent 100%);
  color: var(--white); font-size: .65rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  padding: 1.6rem .9rem .65rem;
  opacity: 0; transition: opacity .28s;
}
.gallery-item:hover .gallery-item-label { opacity: 1; }

/* Кнопка floating поверх страницы */
.gallery-preview-wrap.btn-fixed > .gallery-open-btn {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,.45), 0 4px 18px rgba(222,98,62,.5);
}

/* Кнопка прибита к низу галереи */
.gallery-preview-wrap.btn-absolute > .gallery-open-btn {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,.45), 0 4px 18px rgba(222,98,62,.5);
}

/* ── Mobile: полностью скрыть галерею до открытия ──── */
@media (max-width: 768px) {

  /* Грид невидим, пока fade не expanded */
  .gallery-preview-wrap:not(:has(.gallery-fade.expanded)) .gallery-grid {
    display: none;
  }

  /* Убираем абсолютное позиционирование и градиент у кнопки */
  .gallery-fade:not(.expanded) {
    position: static;
    height: auto;
    background: none;
    padding: 2rem 0;
    pointer-events: all;
  }

  #gallery:not(:has(.gallery-fade.expanded)) .gallery-filters {
      display: none;
    }
}

/* ── Lightbox ──────────────────────────── */
#lightbox {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.93); align-items: center; justify-content: center; padding: 2rem;
}
#lightbox.open { display: flex; animation: lbFadeIn .25s ease; }
@keyframes lbFadeIn { from { opacity: 0; } to { opacity: 1; } }
#lb-img {
  max-width: min(900vw, 1200px); max-height: 85vh; object-fit: contain;
  border: 1px solid rgba(255,255,255,.08); box-shadow: var(--shadow-lg);
  animation: lbSlideUp .3s cubic-bezier(.22,1,.36,1);
}
@keyframes lbSlideUp {
  from { transform: translateY(18px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.lb-close {
  position: fixed; top: 1.2rem; right: 1.5rem;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.7); font-size: 1.1rem; width: 40px; height: 40px;
  border-radius: 50%; cursor: pointer; transition: background .2s, color .2s;
  display: flex; align-items: center; justify-content: center;
}
.lb-close:hover { background: var(--orange); color: #fff; border-color: var(--orange); }
.lb-nav {
  position: fixed; bottom: 1.8rem; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 1rem;
}
.lb-btn {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.75); font-size: 1.5rem; width: 44px; height: 44px;
  border-radius: 50%; cursor: pointer; transition: background .2s, color .2s;
  display: flex; align-items: center; justify-content: center;
}
.lb-btn:hover { background: var(--orange); color: #fff; border-color: var(--orange); }
#lb-counter { font-size: .7rem; letter-spacing: .22em; color: rgba(255,255,255,.5); min-width: 55px; text-align: center; }

/* ── Contact form ──────────────────────── */
#contact form {
  max-width: 620px; margin: 2.5rem auto; background: var(--white);
  padding: 2.5rem 2rem; border-radius: 14px; box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; gap: 1rem; border-top: 4px solid var(--orange);
}
#contact label { font-weight: 600; font-size: .9rem; color: var(--navy); margin-bottom: .2rem; display: block; }
#contact input, #contact textarea, #contact select {
  width: 100%; padding: .8rem 1rem; border: 1.5px solid var(--gray-200); border-radius: 8px;
  font-size: .95rem; font-family: var(--font-body); color: var(--text); background: var(--cream);
  transition: border-color .22s, box-shadow .22s; outline: none;
}
#contact input:focus, #contact textarea:focus, #contact select:focus {
  border-color: var(--orange); box-shadow: 0 0 0 3px rgba(222,98,62,.15); background: var(--white);
}
#contact input[type="file"] { padding: .55rem .8rem; cursor: pointer; }
#contact button[type="submit"] {
  background: var(--orange); color: var(--white); border: none; padding: .95rem 2rem;
  border-radius: 8px; font-family: var(--font-body); font-size: 1rem; font-weight: 600;
  letter-spacing: .04em; cursor: pointer; transition: background .22s, transform .22s, box-shadow .22s; margin-top: .4rem;
}
#contact button[type="submit"]:hover { background: var(--orange-dk); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(222,98,62,.35); }
.privacy-note { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--gray-500); }
.privacy-checkbox { width: 16px !important; height: 16px; flex-shrink: 0; cursor: pointer; accent-color: var(--orange); }
.privacy-note a { color: var(--orange); text-decoration: underline; }
.contact-info { text-align: center; margin-top: 2.5rem; font-size: 1.05rem; display: flex; flex-direction: column; gap: .8rem; }
.contact-info p { display: flex; align-items: center; justify-content: center; gap: .6rem; }
.contact-info a { color: var(--navy); text-decoration: none; font-weight: 500; transition: color .2s; }
.contact-info a:hover { color: var(--orange); }
.contact-icon { width: 34px; height: 34px; object-fit: contain; }

/* ── Floating WhatsApp ─────────────────── */
.floating-whatsapp { position: fixed; left: 20px; bottom: 20px; z-index: 999; }
.wa-btn {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; background: #25D366; border-radius: 50%;
  box-shadow: 0 6px 24px rgba(37,211,102,.45); text-decoration: none;
  transition: transform .25s, box-shadow .25s;
}
.wa-btn:hover { transform: scale(1.1) translateY(-2px); box-shadow: 0 10px 32px rgba(37,211,102,.55); }

/* ── Character / House ─────────────────── */
.desktop-only { display: none; }
@media (min-width: 1500px) { .desktop-only { display: block; } }
#house { position: fixed; right: -4vw; top: 0; height: 100vh; width: 10vw; z-index: 1; pointer-events: none; }
#ladder { position: fixed; bottom: -1vw; height: 86vh; width: 10vw; z-index: 2; pointer-events: none; image-rendering: pixelated; margin-right: -1.8vw; right: -150vw; }
#character { position: fixed; height: auto; z-index: 3; image-rendering: pixelated; transition: top .24s ease-out, right .24s ease-out; transform: rotate(8deg); transform-origin: bottom center; width: 4%; }

/* ── Language Switcher ─────────────────── */
.ld-wrap { position: relative; display: inline-block; font-family: var(--font-body); flex-shrink: 0; }
.ld-btn {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; cursor: pointer;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 8px;
  font-size: 13px; font-weight: 500; color: rgba(255,255,255,.85);
  transition: background .15s; user-select: none;
}
.ld-btn:hover { background: rgba(255,255,255,.18); }
.ld-arrow { font-size: 9px; color: rgba(255,255,255,.45); margin-left: 2px; transition: transform .15s; }
.ld-wrap.open .ld-arrow { transform: rotate(180deg); }
.ld-menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: 8px; overflow: hidden; min-width: 130px; z-index: 99; box-shadow: var(--shadow-md);
}
.ld-wrap.open .ld-menu { display: block; }
.ld-option { display: flex; align-items: center; gap: 8px; padding: 9px 14px; cursor: pointer; font-size: 13px; color: var(--text); transition: background .1s; white-space: nowrap; }
.ld-option:hover    { background: var(--gray-100); }
.ld-option.selected { font-weight: 600; color: var(--orange); }
.flag { width: 18px; height: 12px; border-radius: 2px; overflow: hidden; display: inline-flex; flex-shrink: 0; box-shadow: 0 0 0 .5px rgba(0,0,0,.12); }
.flag svg { width: 100%; height: 100%; display: block; }

/* ── Responsive ────────────────────────── */
@media (max-width: 1100px) { .gallery-grid { columns: 3 180px; } }
@media (max-width: 1300px) {
  .carousel { height: 340px; }
  .c-overlay-text span:first-child { font-size: 36px; }
  .c-overlay-text span:last-child  { font-size: 28px; }
  .c-flag { height: 100px; }
  .gallery-grid { columns: 2 160px; }
}
@media (max-width: 680px) {
  section { padding: 60px 5vw 40px; }
  .carousel { height: 260px; }
  .nav-links { display: none; }
  .stats-row { gap: .4rem; }
  .gallery-grid { columns: 2 130px; }
  .c-overlay-text span:first-child { font-size: 24px; }
  .c-overlay-text span:last-child  { font-size: 18px; }
  .c-flag { height: 60px; }
}
@media (max-width: 420px) { .gallery-grid { columns: 1; } }