:root {
  --primary-bg-color: #f4faf3;
  --secondary-bg-color: #aabfa7;
  --primary-text-color: #0f0d13;
  --secondary-text-color: #193116;
}
html,
body {
  overflow-x: hidden;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Page load animation */
body {
  font-family: "Source Serif 4", serif;
  background-color: var(--primary-bg-color);
  color: var(--primary-text-color);
  line-height: 1;
  animation: bodyFadeIn 0.8s ease-out forwards;
}

@keyframes bodyFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Hero animations */
@keyframes heroFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes titleSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes subtitleFadeIn {
  from {
    opacity: 0;
    letter-spacing: 0.5em;
  }
  to {
    opacity: 1;
    letter-spacing: 0.2em;
  }
}

.hero {
  position: relative;
  height: 30em;
  background: url("/images/hero.png");
  background-size: cover;
  background-position: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--primary-bg-color);
  animation: heroFadeIn 1s ease-out forwards;
}

.language-switcher {
  position: absolute;
  top: 20px;
  display: flex;
  gap: 12px;
}

.lang-btn {
  width: 2em;
  height: 2em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  opacity: 0.8;
  transition:
    opacity 0.3s,
    transform 0.3s;
}

.lang-btn:hover,
.lang-btn.active {
  opacity: 1;
  transform: scale(1.1);
}

.lang-sl {
  background: url("/images/slo.png") center/cover;
}
.lang-it {
  background: url("/images/it.png") center/cover;
}
.lang-en {
  background: url("/images/end.png") center/cover;
}

.hero-title {
  font-family: "EB Garamond", serif;
  font-size: 5em;
  font-weight: 400;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  opacity: 0;
  animation: titleSlideUp 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.4s forwards;
}

.hero-subtitle {
  font-size: 2em;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 2.5;
  opacity: 0;
  animation: subtitleFadeIn 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) 0.8s forwards;
}

.about-section {
  display: flex;
  gap: 10rem;
  padding: 60px 20px;
  max-width: 60%;
  margin-top: 3em;
  margin-left: auto;
  margin-right: auto;
  align-items: flex-end;
}

.about-paragraph {
  opacity: 0;
  transform: translateY(12px);
  animation: paragraphReveal 0.8s ease forwards;
}

@keyframes paragraphReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.about-image-animated {
  opacity: 0;
  transform: translateY(10px);
  animation: imageReveal 1s ease forwards;
}

@keyframes imageReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1780px) {
  .about-section {
    margin-top: 1.5rem;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3rem;
    max-width: 80%;
  }

  .about-text {
    order: 1;
  }

  .about-image {
    order: 2;
  }
}

.about-text {
  flex: 1;
  line-height: 1.5;
}

.about-text p {
  margin-bottom: 15px;
}

.about-image {
  width: 22rem;
  height: 22rem;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 3em;
  background: var(--secondary-bg-color);
  margin: 3em 0;
}

.category-btn {
  padding: 12px 30px;
  font-family: "EB Garamond", serif;
  font-weight: 600;
  background: var(--secondary-bg-color);
  border: 2px solid var(--primary-text-color);
  font-size: 1.2rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 50px;
}

.category-btn:hover,
.category-btn.active {
  background: var(--primary-bg-color);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 15px;
  padding: 20px;
}

.gallery-item {
  cursor: pointer;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s;
}

.gallery-item:hover {
  transform: scale(1.02);
}

.gallery-item img {
width: 100%;
  height: 500px;              /* Keeps your clean, uniform 500px tall cards */
  object-fit: cover;          /* CHANGED from contain: Fills the card completely with no white space */
  object-position: top center; /* CRITICAL: Aligns the camera to the top so heads are always visible */
  display: block;
}

.contact-section {
  text-align: center;
  padding: 60px 20px;
}

.contact-btn {
  padding: 12px 30px;
  font-family: "EB Garamond", serif;
  font-weight: 600;
  background: var(--primary-bg-color);
  border: 2px solid var(--primary-text-color);
  font-size: 1.2rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 50px;
}

.contact-btn:hover {
  background: var(--secondary-bg-color);
}

.contact-text {
  line-height: 2em;
}

footer {
  background: var(--secondary-text-color);
  color: var(--primary-bg-color);
  text-align: center;
  padding: 20px;
  line-height: 2;
}

footer a {
  color: var(--secondary-bg-color);
  text-decoration: none;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(22, 26, 21, 0.9);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 1001;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
}

.modal-close:hover {
  transform: scale(1.2);
}

.modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 40px 60px 20px;
}

.modal-image-container {
position: relative;
  overflow: hidden; 
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 75vh; /* Slightly lowered to give room for title/description at the bottom */
  cursor: default;
  touch-action: auto;
}

.modal-image-container.zoomed {
  cursor: none;
}

.modal-image {
/* This forces the image to never outgrow its container wrapper */
  max-width: 100%;
  max-height: 100%;
  
  width: auto;
  height: auto;
  object-fit: contain; /* Keeps original aspect ratio intact */
}

.modal-image.zoomed {
/* When zoomed, let it break out of the 100% boundaries */
  max-width: 150%; 
  max-height: 150%;
  position: absolute;
}

/* Only show the zoom cursor on desktop */
@media (min-width: 1024px) {
  .modal-image-container {
    cursor: zoom-in;
  }

  .modal-image-container.zoomed {
    cursor: none;
  }
}

.modal-title {
  width: 100%;
  text-align: center;
  padding: 18px 24px;
  font-family: "EB Garamond", serif;
  text-transform: uppercase;
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--primary-bg-color);
  pointer-events: none;
}

.modal-description {
  color: var(--primary-bg-color);
  text-align: center;
  padding: 15px 20px;
  max-width: 800px;
  font-size: 1rem;
  line-height: 1.6;
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08); /* subtle glassy look */
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  z-index: 1002;
}

.modal-nav svg {
  width: 24px;
  height: 24px;
  stroke: white;
  transition:
    transform 0.25s ease,
    stroke 0.25s ease;
}

.modal-nav:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-50%) scale(1.2);
}

.modal-nav:hover svg {
  stroke: var(--secondary-bg-color);
  transform: translateX(3px); /* subtle arrow movement */
}

.modal-prev:hover svg {
  transform: translateX(-3px);
}

.modal-prev {
  left: 10px;
}

.modal-next {
  right: 10px;
}

.modal-counter {
  color: white;
  font-size: 0.9rem;
  margin-top: 5px;
}

.modal-zoom-hint {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  padding-top: 5px;
}

.fullscreen-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 1.2rem;
  width: 50px;
  height: 50px;
  cursor: pointer;
  transition: background 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  z-index: 1002;
}

.fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
  .about-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 90%;
  }

  .about-text {
    order: 1;
  }

  .about-image {
    order: 2;
    width: min(70vw, 320px);
    height: min(70vw, 320px);
  }

  .hero-title {
    font-size: 2.4em;
  }

  .hero-subtitle {
    font-size: 0.8em;
  }

  .category-buttons {
    gap: 10px;
  }

  .category-btn {
    padding: 10px 20px;
    font-size: 1rem;
  }

  .gallery {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .gallery-item img {
height: auto;            /* Removes the fixed height restriction */
    aspect-ratio: auto;      /* REMOVE 3/4 -> Let the native portrait aspect ratio shine */
    object-fit: cover;
    object-position: top center; /* Keeps the focus on the statue faces on mobile screens */
  }

  .modal-content {
    padding: 40px 20px 20px;
  }

  .modal-image {
    max-width: 100%;
    max-height: 75vh;
  }

  .modal-nav {
    width: 40px;
    height: 40px;
  }

  .modal-nav svg {
    width: 18px;
    height: 18px;
  }

  .modal-prev {
    left: 10px;
  }

  .modal-next {
    right: 10px;
  }
}
