/* ============================================================
   Фотоцентр Лисёнок — Основные стили
   ============================================================ */

/* ----- CSS Custom Properties (переменные) ----- */
:root {
  --primary: #E67E22;       /* Оранжевый — основной цвет лисы */
  --secondary: #8B4513;     /* Коричневый — дополнительный */
  --accent: #FFF3E0;        /* Бежевый — фон для облачка подсказок */
  --dark: #2C3E50;          /* Тёмный — для текста */

  --primary-light: #F39C12;
  --primary-dark: #D35400;

  --bg-light: #FFF8F0;
  --bg-white: #FFFFFF;
  --text-color: #2C3E50;
  --text-light: #7F8C8D;
  --border-color: #E8E0D8;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.18);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  --font-main: 'Segoe UI', 'Arial', sans-serif;
  --font-size-base: 16px;
  --line-height: 1.6;
}

/* ----- Сброс и базовая стилизация ----- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;  /* Плавный скролл */
  font-size: var(--font-size-base);
}

body {
  font-family: var(--font-main);
  line-height: var(--line-height);
  color: var(--text-color);
  background-color: var(--bg-light);
  min-width: 320px;
  overflow-x: hidden;
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

ul {
  list-style: none;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

/* ----- Container ----- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ----- Section styling ----- */
.section {
  padding: 80px 0;
}

.section__title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  color: var(--dark);
}

.section__subtitle {
  font-size: 1.1rem;
  text-align: center;
  color: var(--text-light);
  margin-bottom: 48px;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--primary);
}

.btn--primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background: var(--accent);
  color: var(--dark);
  border: 2px solid var(--border-color);
}

.btn--secondary:hover {
  background: #FFE0B2;
  border-color: var(--primary);
}

.btn__icon {
  font-size: 0.9rem;
}

/* ============================================================
   PRELOADER
   ============================================================ */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.preloader--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader__content {
  text-align: center;
}

.preloader__fox {
  animation: foxBob 1s ease-in-out infinite;
}

.preloader__fox img {
  width: 80px;
  height: 80px;
  filter: drop-shadow(0 0 12px rgba(230, 126, 34, 0.6));
}

.preloader__text {
  margin-top: 16px;
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 600;
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  z-index: 1000;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--dark);
  font-weight: 700;
  font-size: 1.2rem;
}

.header__logo:hover {
  color: var(--primary);
}

.header__logo-icon {
  width: 36px;
  height: 36px;
  transition: transform var(--transition-normal);
}

.header__logo:hover .header__logo-icon {
  transform: rotate(-10deg);
}

.header__nav-list {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header__nav-link {
  display: block;
  padding: 8px 16px;
  color: var(--text-color);
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition-normal);
  position: relative;
}

.header__nav-link:hover {
  color: var(--primary);
  background: var(--accent);
}

.header__nav-link--active {
  color: var(--primary);
  background: var(--accent);
}

.header__nav-link--active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

/* Burger button (mobile) */
.header__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
}

.header__burger-line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition: all var(--transition-normal);
}

.header__burger--active .header__burger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.header__burger--active .header__burger-line:nth-child(2) {
  opacity: 0;
}

.header__burger--active .header__burger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('../images/photos/hero-bg.svg') center center / cover no-repeat, linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  overflow: hidden;
}

/* Градиент поверх фона */
.hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(230, 126, 34, 0.3) 0%,
    rgba(139, 69, 19, 0.2) 50%,
    rgba(44, 62, 80, 0.5) 100%
  );
  z-index: 1;
}

.hero__inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 20px;
  max-width: 800px;
}

.hero__title {
  font-size: 3.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 20px;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 1s ease-out 0.3s both;
}

.hero__subtitle {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 40px;
  line-height: 1.6;
  animation: fadeInUp 1s ease-out 0.5s both;
}

.hero__btn {
  animation: fadeInUp 1s ease-out 0.7s both;
}

/* ============================================================
   GALLERY
   ============================================================ */
.gallery {
  background: var(--bg-white);
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.gallery__card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  background: var(--bg-light);
}

.gallery__card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

/* Затемнение всей карточки при наведении */
.gallery__card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity var(--transition-normal);
  z-index: 1;
  pointer-events: none;
}

.gallery__card:hover::after {
  opacity: 1;
}

.gallery__card-img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-slow);
}

.gallery__card:hover .gallery__card-img {
  transform: scale(1.08);
}

.gallery__card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  transform: translateY(100%);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2;
}

.gallery__card:hover .gallery__card-overlay {
  transform: translateY(0);
}

.gallery__card-title {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
}

.gallery__card-btn {
  align-self: flex-start;
  padding: 8px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.gallery__card-btn:hover {
  background: var(--primary-dark);
}

/* ============================================================
   ABOUT
   ============================================================ */
.about {
  background: var(--bg-light);
}

.about__inner {
  display: flex;
  align-items: center;
  gap: 60px;
  max-width: 1000px;
  margin: 0 auto;
}

.about__content {
  flex: 1;
}

.about__text {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 16px;
  color: var(--text-color);
}

.about__text strong {
  color: var(--primary);
}

.about__image {
  flex-shrink: 0;
}

.about__fox-img {
  width: 200px;
  height: 200px;
  animation: foxBob 3s ease-in-out infinite;
}

/* ============================================================
   CONTACTS
   ============================================================ */
.contacts {
  background: var(--bg-white);
}

.contacts__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.contacts__socials {
  display: flex;
  gap: 20px;
}

.contacts__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--primary);
  font-size: 1.5rem;
  transition: all var(--transition-normal);
}

.contacts__social-link:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(230, 126, 34, 0.4);
}

.contacts__email {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  color: var(--text-color);
}

.contacts__email i {
  color: var(--primary);
  font-size: 1.2rem;
}

.contacts__email a {
  color: var(--dark);
  font-weight: 500;
}

.contacts__email a:hover {
  color: var(--primary);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.8);
  padding: 30px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__copy {
  font-size: 0.95rem;
}

.footer__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer__to-top {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  transition: color var(--transition-fast);
}

.footer__to-top:hover {
  color: var(--primary);
}

.footer__show-fox {
  padding: 8px 16px;
  font-size: 0.9rem;
}

/* ============================================================
   FOX CHARACTER (fixed в правом нижнем углу)
   ============================================================ */
.fox {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.fox__img {
  width: 80px;
  height: 80px;
  animation: foxBob 2s ease-in-out infinite;
  transition: opacity var(--transition-normal);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.fox__img:hover {
  animation-play-state: paused;
}

.fox__close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--dark);
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-normal);
  z-index: 2;
  line-height: 1;
}

.fox:hover .fox__close {
  opacity: 1;
}

.fox__close:hover {
  background: #e74c3c;
}

/* Облачко подсказки */
.fox__bubble {
  background: var(--accent);
  color: var(--dark);
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-width: 260px;
  position: relative;
  animation: bubbleAppear 0.3s ease-out both;
  margin-bottom: 4px;
}

/* "Хвостик" облачка (треугольник) */
.fox__bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 30px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 12px solid var(--accent);
}

.fox__bubble-text {
  font-size: 0.9rem;
  line-height: 1.4;
  font-weight: 500;
}

/* Скрытие лисы с плавной анимацией */
.fox--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: all var(--transition-normal);
}

.modal--open {
  visibility: visible;
  opacity: 1;
}

.modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
}

.modal__content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.9);
  transition: transform var(--transition-normal);
}

.modal--open .modal__content {
  transform: scale(1);
}

.modal__img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.modal__caption {
  margin-top: 12px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
}

.modal__close {
  position: absolute;
  top: -40px;
  right: -10px;
  font-size: 2rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition-fast);
  padding: 4px 8px;
}

.modal__close:hover {
  color: var(--primary);
}

/* ============================================================
   CSS ANIMATIONS
   ============================================================ */

/* Покачивание лисы (translateY) */
@keyframes foxBob {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Появление облачка (scale 0 → 1) */
@keyframes bubbleAppear {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* FadeInUp для элементов Hero */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   MEDIA QUERIES
   ============================================================ */

/* ----- Планшет (768px - 1023px) ----- */
@media (max-width: 1023px) {
  .section {
    padding: 50px 0;
  }

  .section__title {
    font-size: 2rem;
  }

  .section__subtitle {
    margin-bottom: 36px;
  }

  /* Галерея: 2 колонки */
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .gallery__card-img {
    height: 240px;
  }

  /* About */
  .about__inner {
    gap: 40px;
  }

  .about__fox-img {
    width: 160px;
    height: 160px;
  }

  /* Fox */
  .fox__img {
    width: 70px;
    height: 70px;
  }

  /* Hero */
  .hero__title {
    font-size: 2.5rem;
  }

  .hero__subtitle {
    font-size: 1.1rem;
  }
}

/* ----- Мобильный (≤767px) ----- */
@media (max-width: 767px) {
  .section {
    padding: 30px 0;
  }

  .section__title {
    font-size: 1.5rem;
  }

  .section__subtitle {
    font-size: 0.95rem;
    margin-bottom: 28px;
  }

  /* Burger menu */
  .header__burger {
    display: flex;
  }

  .header__nav {
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px 20px;
    box-shadow: var(--shadow-md);
    transform: translateY(-120%);
    opacity: 0;
    transition: all var(--transition-normal);
  }

  .header__nav--open {
    transform: translateY(0);
    opacity: 1;
  }

  .header__nav-list {
    flex-direction: column;
    gap: 4px;
  }

  .header__nav-link {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
  }

  /* Галерея: 1 колонка */
  .gallery__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .gallery__card-img {
    height: 220px;
  }

  /* Hero */
  .hero__title {
    font-size: 1.8rem;
  }

  .hero__subtitle {
    font-size: 1rem;
  }

  .hero__btn {
    padding: 12px 24px;
    font-size: 0.95rem;
  }

  /* About */
  .about__inner {
    flex-direction: column-reverse;
    gap: 30px;
    text-align: center;
  }

  .about__fox-img {
    width: 140px;
    height: 140px;
  }

  /* Footer */
  .footer__inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .footer__actions {
    flex-direction: column;
    gap: 10px;
  }

  /* Fox */
  .fox {
    bottom: 16px;
    right: 16px;
  }

  .fox__img {
    width: 60px;
    height: 60px;
  }

  .fox__bubble {
    max-width: 200px;
    padding: 10px 14px;
  }

  .fox__bubble-text {
    font-size: 0.82rem;
  }
}

/* ----- Десктоп (≥1024px) — уже задано по умолчанию ----- */
@media (min-width: 1024px) {
  .gallery__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .fox__img {
    width: 80px;
    height: 80px;
  }
}
