/* ========================================
   Как мы тусуемся с друзьями — Style
   ======================================== */

/* ----- Базовые настройки ----- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Цветовая палитра (тёплая, дружелюбная) */
  --color-primary: #ff8c5a;       /* персиковый */
  --color-primary-dark: #e67545;
  --color-secondary: #7bc8a4;     /* мятный */
  --color-secondary-dark: #5fa88a;
  --color-bg-light: #fef9f4;     /* тёплый белый */
  --color-bg-white: #ffffff;
  --color-bg-alt: #f5f0eb;
  --color-text: #3a3a3a;          /* тёплый тёмно-серый */
  --color-text-light: #7a7a7a;
  --color-text-muted: #aaaaaa;
  --color-border: #e8e0d8;
  --color-overlay: rgba(0, 0, 0, 0.75);

  /* Шрифты */
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Размеры */
  --header-height: 70px;
  --container-width: 1140px;
  --border-radius: 12px;
  --transition: 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg-light);
  line-height: 1.6;
  min-height: 100vh;
}

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

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

ul {
  list-style: none;
}

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

.section {
  padding: 80px 0;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 48px;
  color: var(--color-text);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--color-primary);
  border-radius: 2px;
  margin: 12px auto 0;
}

/* ----- Кнопки ----- */
.btn {
  display: inline-block;
  padding: 14px 32px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  text-align: center;
}

.btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 140, 90, 0.35);
}

.btn:active {
  transform: translateY(0);
}

/* ========================================
   Header
   ======================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: var(--color-bg-white);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  z-index: 1000;
  transition: box-shadow var(--transition);
}

.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

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

.header__logo i {
  font-size: 1.6rem;
}

.header__nav {
  display: flex;
}

.header__menu {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header__menu-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  padding: 6px 0;
  position: relative;
}

.header__menu-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width var(--transition);
}

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

.header__menu-link:hover::after {
  width: 100%;
}

/* ----- Бургер-кнопка ----- */
.header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.header__burger-line {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* Анимация бургера в крестик */
.header__burger--active .header__burger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

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

.header__burger--active .header__burger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ========================================
   Hero
   ======================================== */
.hero {
  padding: calc(var(--header-height) + 80px) 0 80px;
  background: linear-gradient(135deg, var(--color-bg-light) 0%, var(--color-bg-alt) 100%);
  text-align: center;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

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

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.2;
}

.hero__description {
  font-size: 1.1rem;
  color: var(--color-text-light);
  max-width: 600px;
  line-height: 1.7;
}

.hero__btn {
  margin-top: 8px;
}

/* ========================================
   About
   ======================================== */
.about {
  background: var(--color-bg-white);
}

.about__content {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

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

.about__text p:last-child {
  margin-bottom: 0;
}

.about__avatars {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
}

.about__avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform var(--transition);
}

.about__avatar:hover {
  transform: translateY(-6px);
}

.about__avatar img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--color-secondary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.about__avatar-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}

/* ========================================
   Events / Cards
   ======================================== */
.events {
  background: var(--color-bg-alt);
}

.events__cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

/* Карточка */
.card {
  background: var(--color-bg-white);
  border-radius: var(--border-radius);
  padding: 32px 28px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
}

.card__icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-secondary);
  border-radius: 50%;
  color: #fff;
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.card__date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card__title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
}

.card__desc {
  font-size: 0.95rem;
  color: var(--color-text-light);
  line-height: 1.7;
}

/* Анимация появления (Intersection Observer) */
.anim-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.anim-card--visible {
  opacity: 1;
  transform: translateY(0);
}

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

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

.gallery__item {
  border-radius: var(--border-radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
}

.gallery__item:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.gallery__item img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: transform var(--transition);
}

.gallery__item:hover img {
  transform: scale(1.05);
}

/* ========================================
   Lightbox
   ======================================== */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-overlay);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.lightbox--open {
  display: flex;
}

.lightbox__image {
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
  animation: lightboxFadeIn 0.3s ease;
}

@keyframes lightboxFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2.8rem;
  color: #fff;
  cursor: pointer;
  transition: color var(--transition), transform var(--transition);
  line-height: 1;
}

.lightbox__close:hover {
  color: var(--color-primary);
  transform: rotate(90deg);
}

.lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
  backdrop-filter: blur(4px);
}

.lightbox__arrow:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.lightbox__arrow--prev {
  left: 20px;
}

.lightbox__arrow--next {
  right: 20px;
}

.lightbox__counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 18px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* ========================================
   Contacts
   ======================================== */
.contacts {
  background: var(--color-bg-alt);
}

.contacts__subtitle {
  text-align: center;
  font-size: 1rem;
  color: var(--color-text-light);
  max-width: 520px;
  margin: -32px auto 36px;
  line-height: 1.7;
}

.contacts__form {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contacts__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contacts__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}

.contacts__input,
.contacts__textarea {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text);
  background: var(--color-bg-white);
  border: 2px solid var(--color-border);
  border-radius: 10px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.contacts__input:focus,
.contacts__textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 140, 90, 0.15);
}

.contacts__input--invalid,
.contacts__textarea--invalid {
  border-color: #e74c3c;
}

.contacts__error {
  font-size: 0.82rem;
  color: #e74c3c;
  min-height: 18px;
}

.contacts__btn {
  align-self: flex-start;
}

/* ========================================
   Toast
   ======================================== */
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--color-secondary);
  color: #fff;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
  font-weight: 600;
  font-size: 0.95rem;
  z-index: 3000;
  transform: translateY(120px);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.toast--show {
  transform: translateY(0);
  opacity: 1;
}

.toast__icon {
  font-size: 1.4rem;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  background: var(--color-text);
  color: #e0ddd8;
  padding: 40px 0;
}

.footer__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

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

.footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #e0ddd8;
  font-size: 1.2rem;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.footer__social-link:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-3px);
}

.footer__copy {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ========================================
   Адаптивность (Responsive)
   ======================================== */

/* Планшеты (768–1024px) */
@media (max-width: 1024px) {
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .events__cards {
    gap: 20px;
  }
}

/* Мобильные (< 768px) */
@media (max-width: 768px) {
  .section {
    padding: 60px 0;
  }

  .section-title {
    font-size: 1.6rem;
    margin-bottom: 32px;
  }

  /* Header & burger */
  .header__burger {
    display: flex;
  }

  .header__nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--color-bg-white);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    padding: 100px 32px 40px;
    transition: right 0.4s ease;
    z-index: 999;
  }

  .header__nav--open {
    right: 0;
  }

  .header__menu {
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
  }

  .header__menu-link {
    font-size: 1.1rem;
  }

  /* Hero */
  .hero {
    padding: calc(var(--header-height) + 40px) 0 60px;
    min-height: auto;
  }

  .hero__title {
    font-size: 2rem;
  }

  .hero__description {
    font-size: 1rem;
  }

  /* Events cards — одна колонка */
  .events__cards {
    grid-template-columns: 1fr;
  }

  /* Gallery — одна колонка */
  .gallery__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .gallery__item img {
    height: 200px;
  }

  /* Lightbox */
  .lightbox {
    padding: 20px;
  }

  .lightbox__arrow {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .lightbox__arrow--prev {
    left: 10px;
  }

  .lightbox__arrow--next {
    right: 10px;
  }

  .lightbox__close {
    top: 12px;
    right: 16px;
    font-size: 2.2rem;
  }

  /* Contacts */
  .contacts__form {
    padding: 0 4px;
  }

  /* Toast */
  .toast {
    left: 20px;
    right: 20px;
    bottom: 20px;
    justify-content: center;
  }
}
