/* Gallery Page Styles */
body {
  background: #D2FFFB;
  margin: 0;
  padding: 0;
  position: relative;
  overflow-x: hidden;
}

/* Main Container with Hand-drawn Border */
.gallery-container {
  min-height: 100vh;
  padding: 160px 20px 40px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.hand-drawn-border {
  width: 100%;
  max-width: 1400px;
  background: white;
  border: 4px solid #12A89C;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(18, 168, 156, 0.15);
}

.hand-drawn-border::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: 
    radial-gradient(circle at 15% 15%, #12A89C 3px, transparent 3px),
    radial-gradient(circle at 85% 15%, #12A89C 3px, transparent 3px),
    radial-gradient(circle at 15% 85%, #12A89C 3px, transparent 3px),
    radial-gradient(circle at 85% 85%, #12A89C 3px, transparent 3px),
    linear-gradient(90deg, #12A89C 0%, #12A89C 100%),
    linear-gradient(0deg, #12A89C 0%, #12A89C 100%),
    linear-gradient(90deg, #12A89C 0%, #12A89C 100%),
    linear-gradient(0deg, #12A89C 0%, #12A89C 100%);
  background-size: 
    120px 120px, 
    120px 120px, 
    120px 120px, 
    120px 120px, 
    100% 4px, 
    4px 100%, 
    100% 4px, 
    4px 100%;
  background-position: 
    0 0, 
    100% 0, 
    0 100%, 
    100% 100%, 
    0 0, 
    0 0, 
    0 100%, 
    100% 0;
  background-repeat: no-repeat;
  z-index: -1;
  border-radius: 20px;
}

.content-wrapper {
  padding: 40px;
  scroll-behavior: smooth;
}

/* Header Section */
.gallery-header {
  text-align: center;
  margin-bottom: 60px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease-out forwards;
}

.gallery-header h1 {
  font-family: 'Amatic SC', cursive;
  font-size: 3.5rem;
  color: #333;
  margin-bottom: 20px;
  font-weight: 700;
}

.gallery-header p {
  font-family: 'Zain', cursive;
  font-size: 1.3rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
}

/* Filter Section */
.gallery-filter-section {
  margin-bottom: 40px;
  text-align: center;
}

.gallery-filter-hint {
  font-family: 'Zain', cursive;
  font-size: 1.05rem;
  color: #666;
  margin: 0 0 18px;
}

.filter-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 100%;
}

.filter-btn {
  background: transparent;
  border: 2px solid #12A89C;
  color: #12A89C;
  padding: 12px 20px;
  border-radius: 25px;
  font-family: 'Zain', cursive;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  font-weight: 600;
  min-height: 44px;
  line-height: 1.2;
  white-space: normal;
  text-align: center;
}

.filter-btn:hover,
.filter-btn.active {
  background: #12A89C;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(18, 168, 156, 0.3);
}

.filter-btn:focus-visible {
  outline: 3px solid #12A89C;
  outline-offset: 2px;
}

/* Empty state */
.gallery-empty-state {
  text-align: center;
  padding: 48px 24px;
  margin-bottom: 24px;
  background: #f4fbfb;
  border: 2px dashed #12A89C;
  border-radius: 12px;
}

.gallery-empty-state p {
  margin: 0;
  font-family: 'Zain', cursive;
  font-size: 1.1rem;
  color: #555;
  line-height: 1.6;
}

/* Simple Gallery Grid */
.simple-gallery-section {
  margin-bottom: 80px;
}

.simple-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.gallery-item {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.9);
  animation: fadeInScale 0.6s ease-out forwards;
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
  width: 100%;
  height: clamp(220px, 22vw, 280px);
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

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

.gallery-item-overlay h3 {
  font-family: 'Amatic SC', cursive;
  font-size: 1.5rem;
  margin-bottom: 8px;
  font-weight: 700;
}

.gallery-item-overlay p {
  font-family: 'Zain', cursive;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Featured Gallery Section */
.featured-gallery-section {
  margin-bottom: 80px;
}

.featured-gallery-section h2 {
  font-family: 'Amatic SC', cursive;
  font-size: 2.8rem;
  color: #12A89C;
  margin-bottom: 40px;
  text-align: center;
  font-weight: 700;
}

.featured-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 20px;
  height: 400px;
}

.featured-item {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.featured-item.large {
  grid-row: span 2;
}

.featured-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.featured-item:hover img {
  transform: scale(1.1);
}

.featured-item .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

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

.featured-item .overlay h3 {
  font-family: 'Amatic SC', cursive;
  font-size: 1.8rem;
  margin-bottom: 8px;
  font-weight: 700;
}

.featured-item .overlay p {
  font-family: 'Zain', cursive;
  font-size: 1rem;
  opacity: 0.9;
}

/* Photo Story Section */
.photo-story-section {
  margin-bottom: 80px;
}

.photo-story-section h2 {
  font-family: 'Amatic SC', cursive;
  font-size: 2.8rem;
  color: #12A89C;
  margin-bottom: 40px;
  text-align: center;
  font-weight: 700;
}

.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.story-item {
  display: flex;
  background: #f9f9f9;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.story-item:hover {
  transform: translateY(-5px);
}

.story-image {
  flex: 0 0 200px;
}

.story-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-content {
  padding: 25px;
  flex: 1;
}

.story-content h3 {
  font-family: 'Amatic SC', cursive;
  font-size: 1.8rem;
  color: #333;
  margin-bottom: 15px;
  font-weight: 700;
}

.story-content p {
  font-family: 'Zain', cursive;
  font-size: 1rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 15px;
}

.story-date {
  font-family: 'Zain', cursive;
  font-size: 0.9rem;
  color: #12A89C;
  font-weight: 600;
}

/* Contact Form Section */
.gallery-contact-section {
  margin-bottom: 40px;
}

.gallery-contact-section h2 {
  font-family: 'Amatic SC', cursive;
  font-size: 2.8rem;
  color: #12A89C;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 700;
}

.gallery-contact-section p {
  font-family: 'Zain', cursive;
  font-size: 1.2rem;
  color: #555;
  text-align: center;
  margin-bottom: 40px;
}

.gallery-form {
  max-width: 800px;
  margin: 0 auto;
  background: #f9f9f9;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  font-family: 'Zain', cursive;
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 8px;
  font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-family: 'Zain', cursive;
  font-size: 1rem;
  color: #333;
  background: white;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #12A89C;
  box-shadow: 0 0 0 3px rgba(18, 168, 156, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group small {
  font-family: 'Zain', cursive;
  font-size: 0.9rem;
  color: #666;
  margin-top: 5px;
  display: block;
}

.submit-btn {
  background: #FF9801;
  color: white;
  border: none;
  padding: 15px 30px;
  font-family: 'Zain', cursive;
  font-size: 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  width: 100%;
  font-weight: 600;
  letter-spacing: 1px;
}

.submit-btn:hover {
  background: #ffb300;
  transform: translateY(-2px);
}

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

/* Lightbox Styles */
.lightbox {
  display: none;
  position: fixed;
  z-index: 1400;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
}

.lightbox-content {
  position: relative;
  margin: auto;
  padding: 20px;
  width: 90%;
  max-width: 800px;
  height: 90%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.close-lightbox {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1401;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color 0.3s ease;
}

.close-lightbox:hover {
  color: #12A89C;
}

.lightbox-image {
  max-width: 100%;
  max-height: 80%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  color: white;
  text-align: center;
  margin-top: 20px;
  font-family: 'Zain', cursive;
  font-size: 1.1rem;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  padding: 15px 20px;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav.prev {
  left: 20px;
}

.lightbox-nav.next {
  right: 20px;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Touch devices: show overlay without hover */
@media (hover: none), (pointer: coarse) {
  .gallery-item-overlay {
    transform: translateY(0);
  }

  .gallery-item:hover {
    transform: scale(1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  }

  .gallery-item:hover img {
    transform: none;
  }
}

/* Tablet */
@media (max-width: 1024px) {
  .gallery-container {
    padding: 148px 16px 40px;
  }

  .content-wrapper {
    padding: 32px 24px;
  }

  .gallery-header {
    margin-bottom: 40px;
  }

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

  .gallery-item img {
    height: clamp(210px, 24vw, 260px);
  }

  .featured-grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .featured-item.large {
    grid-row: auto;
    height: 300px;
  }
}

/* Mobile landscape / small tablet */
@media (max-width: 768px) {
  .gallery-container {
    padding: 124px 12px 32px;
  }

  .content-wrapper {
    padding: 24px 16px;
  }

  .gallery-header h1 {
    font-size: 2.5rem;
  }

  .gallery-header {
    margin-bottom: 32px;
  }

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

  .gallery-item img {
    height: clamp(190px, 28vw, 240px);
  }

  .simple-gallery-section {
    margin-bottom: 48px;
  }

  .story-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .story-item {
    flex-direction: column;
  }

  .story-image {
    flex: none;
    height: 200px;
  }

  .filter-buttons {
    gap: 10px;
  }

  .filter-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .gallery-form {
    padding: 20px;
  }

  .close-lightbox {
    top: 10px;
    right: 16px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .gallery-container {
    padding: 124px 10px 24px;
  }

  .content-wrapper {
    padding: 20px 12px;
  }

  .gallery-header h1 {
    font-size: 2rem;
  }

  .gallery-header p {
    font-size: 1.1rem;
  }

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

  .gallery-item img {
    height: clamp(200px, 52vw, 260px);
  }

  .gallery-filter-section {
    margin-bottom: 28px;
  }

  .gallery-filter-hint {
    font-size: 0.95rem;
    margin-bottom: 14px;
  }

  .filter-buttons {
    gap: 8px;
  }

  .filter-btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 140px;
    max-width: 100%;
    padding: 10px 14px;
    font-size: 0.88rem;
  }

  .gallery-form {
    padding: 15px;
  }

  .lightbox-nav {
    padding: 10px 15px;
    font-size: 18px;
  }

  .lightbox-nav.prev {
    left: 10px;
  }

  .lightbox-nav.next {
    right: 10px;
  }
}

/* Small mobile */
@media (max-width: 380px) {
  .gallery-container {
    padding: 120px 8px 20px;
  }

  .content-wrapper {
    padding: 16px 10px;
  }

  .gallery-header h1 {
    font-size: 1.85rem;
  }

  .simple-gallery-grid {
    gap: 14px;
  }

  .gallery-item img {
    height: clamp(190px, 54vw, 230px);
  }

  .gallery-item-overlay {
    padding: 14px 16px;
  }

  .gallery-item-overlay h3 {
    font-size: 1.3rem;
  }

  .filter-btn {
    flex: 1 1 100%;
    min-width: 0;
    font-size: 0.85rem;
    padding: 10px 12px;
  }

  .gallery-empty-state {
    padding: 32px 16px;
  }

  .close-lightbox {
    right: 10px;
  }
}
