/* ===== Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --green-1: #2ecc71;
  --green-2: #27ae60;
  --text: #333;
  --muted: #555;
  --bg: #f9f9f9;
  --card: #fff;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

/* ===== Header & Navigation ===== */
header {
  background: linear-gradient(135deg, var(--green-1) 0%, var(--green-2) 100%);
  color: #fff;
  padding: 20px 0;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header p {
  font-size: 1.1em;
  opacity: 0.95;
}

nav {
  background-color: var(--green-2);
  padding: 15px 0;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

nav a {
  color: #fff;
  text-decoration: none;
  margin: 0 15px;
  font-weight: 500;
  transition: opacity 0.3s, transform 0.2s;
  display: inline-block;
}

nav a:hover {
  opacity: 0.85;
  text-decoration: underline;
}

nav a.active {
  text-decoration: underline;
  text-underline-offset: 4px;
  opacity: 1;
}

/* ===== Layout ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  width: 100%;
}

/* ===== Home ===== */
.home-section {
  text-align: center;
}

.home-section h2 {
  font-size: 2em;
  color: var(--green-1);
  margin-bottom: 20px;
}

.home-section p {
  font-size: 1.1em;
  color: var(--muted);
  margin-bottom: 30px;
  line-height: 1.8;
}

.catalog-intro {
  color: var(--green-2);
  font-weight: 700;
  font-size: 22px;
  text-align: center;
  margin-top: 10px;
}

/* ===== Cards Gallery (каталог) ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: 25px;
  margin-top: 40px;
}

.mint-card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  min-width: 0;
}

.mint-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(46, 204, 113, 0.3);
}

.mint-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background-color: #f0f0f0;
  display: block;
}

.mint-card h3 {
  padding: 15px;
  color: var(--green-1);
  font-size: 1.3em;
}

.mint-card p {
  padding: 0 15px 15px 15px;
  font-size: 0.95em;
  color: #666;
}

/* ===== Photo Gallery Page ===== */
.gallery-page-intro {
  margin-bottom: 10px;
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  gap: 25px;
  margin-top: 40px;
}

/* Карточка миниатюры с эффектом "кнопки" */
.photo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  background: var(--card);
  border: none;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: center;
  padding: 0;
  font: inherit;
  -webkit-tap-highlight-color: transparent;

  transform: scale(1);
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

/* ПК: при наведении карточка чуть уменьшается */
.photo-card:hover,
.photo-card:focus-visible {
  transform: scale(0.9);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

/* Мобильный "нажата" (класс из JS) */
.photo-card.touch-pressed {
  transform: scale(0.9);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

/* Миниатюра внутри карточки */
.photo-card img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 230px;
  object-fit: cover;
  display: block;
  background-color: #f0f0f0;

  filter: blur(1.2px) saturate(0.96) brightness(0.97);
  transition: filter 0.15s ease-out;
}

/* Подпись */
.photo-card span {
  display: block;
  padding: 14px 15px 16px;
  color: var(--green-1);
  font-size: 1.05em;
  font-weight: 600;
  opacity: 0.92;
  transition: opacity 0.15s ease-out;
  text-align: center;
  width: 100%;
}

/* При наведении/нажатии подпись чуть ярче */
.photo-card:hover span,
.photo-card:focus-visible span,
.photo-card.touch-pressed span {
  opacity: 1;
}

/* ===== Detail Page ===== */
.breadcrumbs {
  font-size: 0.95em;
  color: #666;
  margin-bottom: 18px;
  word-break: break-word;
}

.breadcrumbs a {
  color: var(--green-2);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.detail-header {
  text-align: center;
  margin-bottom: 30px;
}

.detail-header h2 {
  color: var(--green-1);
  font-size: 2.5em;
  margin-bottom: 15px;
  word-break: break-word;
}

.detail-image {
  max-width: 500px;
  margin: 0 auto 30px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.detail-image img {
  width: 100%;
  height: auto;
  display: block;
  background: #f0f0f0;
}

.detail-content {
  max-width: 800px;
  margin: 0 auto;
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.detail-content h3 {
  color: var(--green-2);
  font-size: 1.4em;
  margin-top: 20px;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--green-1);
  padding-bottom: 10px;
}

.detail-content p {
  font-size: 1em;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 15px;
}

.back-btn {
  display: inline-block;
  background: var(--green-1);
  color: #fff;
  padding: 12px 30px;
  border-radius: 6px;
  text-decoration: none;
  margin: 0 0 30px 0;
  transition: background 0.3s;
  cursor: pointer;
  border: none;
  font-size: 1em;
  max-width: 100%;
}

.back-btn:hover {
  background: var(--green-2);
}

/* ===== Info Block ===== */
.info-block {
  background-color: #f0f8f4;
  padding: 30px 20px;
  text-align: center;
  border-top: 2px solid var(--green-1);
}

.info-block__inner {
  max-width: 900px;
  margin: 0 auto;
}

.info-block p {
  font-size: 1.05em;
  color: #555;
  line-height: 1.8;
  margin: 0;
}

/* ===== Footer ===== */
footer {
  background: #2c3e50;
  color: #fff;
  text-align: center;
  padding: 20px;
  margin-top: 50px;
}

/* номер + Дядь_Саш + иконки в одну строку */
.footer-contact {
  margin-top: 0;
  color: #ffffff;
  font-size: 1.1em;
  font-weight: 400;

  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 8px;
}

.footer-phone {
  color: var(--green-1);
  text-decoration: none;
  white-space: nowrap;
}

.footer-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  vertical-align: middle;
}

.footer-icons a {
  display: inline-flex;
  text-decoration: none;
}

.footer-icons img {
  display: block;
}

.footer-meta {
  margin-top: 8px;
  color: #ffffff;
  font-size: 1em;
  font-weight: 400;
}

/* ===== Lightbox ===== */
.modal-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  touch-action: pan-y; /* Добавлено для корректной работы свайпов на телефоне */
}

.lightbox.open {
  display: block;
}

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(19, 31, 24, 0.88);
}

@supports ((-webkit-backdrop-filter: blur(2px)) or (backdrop-filter: blur(2px))) {
  .lightbox-overlay {
    background: rgba(19, 31, 24, 0.82);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }
}

.lightbox-content {
  position: relative;
  z-index: 2;
  width: min(96vw, 900px);
  max-height: 94vh;
  margin: 3vh auto;
  background: #ffffff;
  border-radius: 14px;
  padding: 16px 16px 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  text-align: center;
  overflow: hidden;
}

.lightbox-content img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 78vh;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
  object-fit: contain;
}

.lightbox-content p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 1em;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--green-2);
  color: #fff;
  font-size: 28px;
  line-height: 42px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: background 0.3s, transform 0.2s;
  z-index: 4;
}

.lightbox-close:hover {
  background: var(--green-1);
  transform: scale(1.05);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: rgba(39, 174, 96, 0.92);
  color: #fff;
  font-size: 34px;
  line-height: 52px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: background 0.3s, transform 0.2s;
  z-index: 3;
}

.lightbox-nav:hover {
  background: var(--green-1);
}

.lightbox-prev {
  left: 14px;
}

.lightbox-next {
  right: 14px;
}

/* ===== Responsive (мобильный режим) ===== */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.8em;
  }

  header p {
    font-size: 1em;
    padding: 0 10px;
  }

  nav {
    padding: 10px 4px;
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  nav a {
    margin: 0 8px;
    font-size: 0.9em;
  }

  .container {
    padding: 30px 15px;
  }

  .home-section h2 {
    font-size: 1.8em;
  }

  .home-section p {
    font-size: 1em;
    margin-bottom: 20px;
  }

  .catalog-intro {
    font-size: 20px;
  }

  .gallery {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .photo-gallery {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 30px;
  }

  .mint-card,
  .photo-card {
    width: 100%;
    max-width: 100%;
  }

  .mint-card img {
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: cover;
  }

  .photo-card img {
    max-height: 200px;
  }

  .detail-header h2 {
    font-size: 1.8em;
  }

  .detail-content {
    padding: 20px;
  }

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

  .lightbox-content {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    margin: 8px auto;
    padding: 12px 12px 10px;
    border-radius: 12px;
  }

  .lightbox-content img {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
  }

  .lightbox-content p {
    margin-top: 10px;
    font-size: 0.95em;
  }

  /* Прячем стрелки на телефонах, так как теперь есть свайпы */
  .lightbox-nav {
    display: none;
  }

  /* --- НОВЫЙ КОД: Полупрозрачный крестик на мобилках --- */
  .lightbox-close {
    background: rgba(39, 174, 96, 0.35); /* 65% прозрачности */
    box-shadow: none; /* Убираем тень для чистоты цвета */
  }

  /* Эффект при нажатии пальцем на крестик */
  .lightbox-close:active {
    background: rgba(39, 174, 96, 0.6);
  }

  .footer-contact {
    font-size: 1em;
  }
}
