*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Open Sans", sans-serif;
  background-color: #f5f5f5;
  color: #444;
}

/* ── HEADER ── */
header {
  background-color: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header .logo {
  font-family: "Raleway", sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #333;
  letter-spacing: 1px;
  text-decoration: none;
}

header nav a {
  font-family: "Raleway", sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #555;
  text-decoration: none;
  margin-left: 28px;
  transition: color 0.2s;
}

header nav a:hover,
header nav a.active {
  color: #e74c3c;
}

/* ── PAGE TITLE ── */
.page-title {
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 48px 20px;
}

.page-title h1 {
  font-family: "Raleway", sans-serif;
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.page-title p {
  font-size: 13px;
  color: #aaa;
  letter-spacing: 1px;
}

/* ── GALLERY SECTION ── */
.gallery-section {
  max-width: 1140px;
  margin: 60px auto;
  padding: 0 20px;
}

.gallery-section h2 {
  font-family: "Raleway", sans-serif;
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  color: #333;
  margin-bottom: 8px;
}

.section-line {
  width: 50px;
  height: 2px;
  background: #e74c3c;
  margin: 0 auto 40px;
}

/* ── FLIP CARD GRID ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.flip-card {
  width: 100%;
  aspect-ratio: 4/3;
  perspective: 1000px;
  cursor: pointer;
}

.flip-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 2px;
  overflow: hidden;
}

.flip-card-front {
  background-color: #ccc;
}

.flip-card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.flip-card:hover .flip-card-front img {
  transform: scale(1.05);
}

.flip-card-back {
  background-color: #e74c3c;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  text-align: center;
}

.flip-card-back .back-icon {
  font-size: 36px;
  margin-bottom: 14px;
  line-height: 1;
}

.flip-card-back h3 {
  font-family: "Raleway", sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 10px;
}

.flip-card-back p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.7;
  margin-bottom: 18px;
}

.flip-card-back .view-btn {
  display: inline-block;
  border: 2px solid #fff;
  color: #fff;
  font-family: "Raleway", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  padding: 8px 20px;
  border-radius: 1px;
  transition:
    background 0.25s,
    color 0.25s;
  cursor: pointer;
  background: transparent;
}

.flip-card-back .view-btn:hover {
  background: #fff;
  color: #e74c3c;
}

.flip-card:nth-child(3n + 2) .flip-card-back {
  background-color: #2c3e50;
}

.flip-card:nth-child(3n + 2) .flip-card-back .view-btn:hover {
  color: #2c3e50;
}

.flip-card:nth-child(3n + 3) .flip-card-back {
  background-color: #27ae60;
}

.flip-card:nth-child(3n + 3) .flip-card-back .view-btn:hover {
  color: #27ae60;
}

.card-caption {
  margin-top: 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  text-align: center;
}

/* ── LIGHTBOX ── */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
}

.lightbox-overlay.active {
  display: flex;
}

/* Zoom-in animation when opens */
@keyframes lbZoomIn {
  from {
    transform: scale(0.6);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes lbZoomOut {
  from {
    transform: scale(1);
    opacity: 1;
  }

  to {
    transform: scale(0.6);
    opacity: 0;
  }
}

.lightbox-content {
  position: relative;
  max-width: 88vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: lbZoomIn 0.35s cubic-bezier(0.34, 1.3, 0.64, 1) both;
}

.lightbox-content.closing {
  animation: lbZoomOut 0.25s ease forwards;
}

.lightbox-img-wrap {
  position: relative;
  line-height: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.lightbox-img-wrap img {
  max-width: 80vw;
  max-height: 75vh;
  object-fit: contain;
  display: block;
  border-radius: 2px;
}

/* Caption */
.lightbox-caption {
  margin-top: 14px;
  font-family: "Raleway", sans-serif;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

/* Counter  e.g. 3 / 9 */
.lightbox-counter {
  position: absolute;
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.45);
  font-family: "Raleway", sans-serif;
}

/* Close button */
.lb-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  z-index: 10000;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    transform 0.2s;
}

.lb-close:hover {
  background: #e74c3c;
  border-color: #e74c3c;
  transform: rotate(90deg);
}

.lb-close svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
  stroke-width: 2.5;
  fill: none;
}

/* Prev / Next arrows */
.lb-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  z-index: 10000;
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.lb-arrow:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: #fff;
}

.lb-arrow svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  stroke-width: 2.5;
  fill: none;
}

.lb-prev {
  left: 20px;
}

.lb-next {
  right: 20px;
}

/* Slide animation */
@keyframes slideLeft {
  from {
    transform: translateX(60px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideRight {
  from {
    transform: translateX(-60px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.lightbox-img-wrap.slide-left {
  animation: slideLeft 0.28s ease both;
}

.lightbox-img-wrap.slide-right {
  animation: slideRight 0.28s ease both;
}

/* ── FOOTER ── */
footer {
  background-color: #e1f8d0;
  color: #fcf9f9;
  text-align: center;
  padding: 28px 20px;
  font-size: 13px;
  margin-top: 60px;
}

footer a {
  color: #e74c3c;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  header {
    flex-direction: column;
    gap: 12px;
  }

  header nav a {
    margin-left: 14px;
  }

  .lightbox-img-wrap img {
    max-width: 92vw;
    max-height: 65vh;
  }

  .lb-prev {
    left: 8px;
  }

  .lb-next {
    right: 8px;
  }

  .lb-arrow {
    width: 38px;
    height: 38px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flip-card-inner {
    transition: none;
  }

  .lightbox-content {
    animation: none;
  }
}
