/*! VAR GLOBALI */
:root {
  /* palette Terra e Inchiostro + colori logo */
  --col-bg: #E8E3D6;
  --col-primary: #2B3D3A;
  --col-primary-light: #4A7C8C;
  --col-accent-teal: #7FA9B5;
  --col-accent-secondary: #A88860;
  --col-white: #ffffff;
  --col-card-bg: #ffffffaa;
  --col-border: #7FA9B555;

  /* font fam */
  --font-lato: "Lato", sans-serif;
  --font-tangerine: "Tangerine", cursive;
  --font-inter: "Inter", sans-serif;
}

/*! FONT */
@font-face {
  font-family: "Lato";
  src: url("./assets/fonts/Lato-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("./assets/fonts/Lato-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("./assets/fonts/Lato-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Tangerine";
  src: url("./assets/fonts/Tangerine-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Tangerine";
  src: url("./assets/fonts/Tangerine-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

/*! RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-inter);
}

html,
body {
  width: 100%;
  min-height: 100vh;
  font-family: var(--font-inter);
  background: var(--col-bg);
  color: var(--col-primary);
  position: relative;
  display: flex;
  flex-direction: column;
}


/* Background texture effect */
html::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.03;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, var(--col-primary) 2px, var(--col-primary) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, var(--col-primary) 2px, var(--col-primary) 4px);
  pointer-events: none;
  z-index: 0;
}

/* Parchment Watermark - Effetto Pergamena */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    /* Macchie di invecchiamento più visibili */
    radial-gradient(ellipse at 20% 30%, rgba(168, 136, 96, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(139, 115, 85, 0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(160, 130, 90, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 10% 80%, rgba(150, 120, 80, 0.05) 0%, transparent 40%),
    radial-gradient(ellipse at 90% 20%, rgba(170, 140, 100, 0.05) 0%, transparent 45%),
    /* Venature orizzontali della pergamena */
    linear-gradient(90deg,
      transparent 0%,
      rgba(168, 136, 96, 0.03) 10%,
      transparent 20%,
      rgba(139, 115, 85, 0.04) 35%,
      transparent 50%,
      rgba(160, 130, 90, 0.03) 70%,
      transparent 80%,
      rgba(168, 136, 96, 0.03) 90%,
      transparent 100%),
    /* Texture fibre diagonali */
    repeating-linear-gradient(45deg,
      transparent,
      transparent 60px,
      rgba(168, 136, 96, 0.02) 60px,
      rgba(168, 136, 96, 0.02) 62px),
    repeating-linear-gradient(-45deg,
      transparent,
      transparent 80px,
      rgba(139, 115, 85, 0.015) 80px,
      rgba(139, 115, 85, 0.015) 81px),
    /* Noise pattern sottile */
    repeating-linear-gradient(0deg,
      transparent,
      transparent 3px,
      rgba(160, 130, 90, 0.008) 3px,
      rgba(160, 130, 90, 0.008) 4px);
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: multiply;
}
/* don't show */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* !HEADER */
.site-header {
  display: flex;
  justify-content: flex-end;
  padding: 16px 24px;
  flex-shrink: 0;
}

/* !FOOTER */
.institutional-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 20px;
  background-color: #f5f0e8;
  border-top: 1px solid #d4c9b0;
}

.footer-logo {
  height: 5rem;
  width: auto;
  object-fit: contain;
}

.footer-text {
  font-size: 0.72rem;
  text-align: center;
  color: #4a3f2f;
  line-height: 1.4;
  margin: 0;
  font-style: italic;
}

.footer-tea {
  display: flex;
  flex-direction: column;
  flex: 1;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.footer-tea-label {
  font-size: 0.7rem;
  color: var(--col-primary);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.7;
}

.footer-left a,
.footer-center a,
.footer-tea .footer-tea-link {
  display: inline-block;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.footer-left a:hover,
.footer-center a:hover,
.footer-tea .footer-tea-link:hover {
  opacity: 1
}

.footer-tea-logo {
  height: 42px;
  width: auto;
  filter: brightness(0.85) sepia(0.2);
}

/* !UTILITY */
.z-999 {
  z-index: 999;
}

/* !LAYOUT */

#app {
  flex: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  padding: 4rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

#app::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center,
      transparent 40%,
      rgba(43, 61, 58, 0.12) 100%);
  pointer-events: none;
  z-index: 0;
}

.text-box {
  margin: 10px;
  animation: fadeIn 1s ease 0.3s both;
}

/* !TESTI */
h1 {
  font-size: 3.5rem;
  color: var(--col-primary);
  font-family: var(--font-tangerine);
  animation: fadeInDown 0.8s ease both;
}

h2 {
  font-size: 2.8rem;
  letter-spacing: 4px;
  max-width: 1000px;
  font-family: var(--font-tangerine);
  color: var(--col-primary-light);
}

p {
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 10px 0;
  font-size: 1.3rem;
  animation: fadeIn 1s ease 0.3s both;
}

/* !LOGO */
.logo {
  width: 15rem;
  max-width: 60vw;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
  animation: blurToFocus 1.4s ease-out forwards;
}

@keyframes blurToFocus {
  0% {
    opacity: 0;
    filter: blur(12px) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
  }

  100% {
    opacity: 1;
    filter: blur(0) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
  }
}

/* !SEPARATORE */
/* Separatore elegante */
.separator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  max-width: 400px;
  margin: 30px 0;
  animation: fadeIn 1s ease 0.6s both;
}

.separator-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right,
      transparent,
      var(--col-primary-light) 20%,
      var(--col-primary-light) 80%,
      transparent);
  opacity: 0.4;
}

.separator-ornament {
  color: var(--col-accent-secondary);
  font-size: 1.4rem;
  line-height: 1;
  opacity: 0.75;
  filter: drop-shadow(0 1px 2px rgba(168, 136, 96, 0.3));
  transition: opacity 0.3s ease, transform 0.3s ease;
  user-select: none;
}

.separator-ornament:hover {
  opacity: 1;
  transform: scale(1.15);
}

/* !BOTTONI */
.buttons {
  display: flex;
  gap: 1rem;
  animation: fadeInUp 1s ease 0.6s both;
}

button {
  padding: 1.3rem 1.8rem;

  font-family: var(--font-tangerine);
  font-size: 3rem;

  background: var(--col-primary-light);
  color: var(--col-bg);

  border: 2px solid transparent;
  border-radius: 20px;

  cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: 0 6px 20px rgba(74, 124, 140, 0.12);
  position: relative;
  overflow: hidden;
}

/* Info button */
.info-btn {
  padding: 0.8rem 1.5rem;
  font-size: 1.1rem;
  font-family: var(--font-inter);
  font-weight: 700;
  background: var(--col-accent-secondary);
  color: var(--col-bg);
  border: 2px solid transparent;
  animation: fadeIn 1s ease 0.5s both;
}

.info-btn:hover {
  background: transparent;
  border: 2px solid var(--col-accent-secondary);
  color: var(--col-accent-secondary);
}

/* Shimmer effect on hover */
button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s ease;
}

button:hover::before {
  left: 100%;
}

button:hover {
  background: transparent;
  border: 2px solid var(--col-primary-light);
  color: var(--col-primary-light);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(74, 124, 140, 0.25);
}

button:active {
  transform: translateY(-2px);
}

/* Btn chiusura */
.close-btn {
  position: absolute;
  top: 24px;
  right: 24px;

  width: 50px;
  height: 50px;

  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--col-primary);
  border-radius: 50%;

  font-family: var(--font-lato);
  color: var(--col-bg);
  font-size: 24px;
  font-weight: bold;

  border: none;
  cursor: pointer;

  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(43, 61, 58, 0.15);
}

.close-btn::before {
  display: none;
}

.close-btn:hover {
  background: var(--col-primary-light);
  color: var(--col-bg);
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 6px 20px rgba(74, 124, 140, 0.3);
  border: none;
}

.close-btn:active {
  transform: rotate(90deg) scale(0.95);
}

/* Btn back */
.back-btn {
  padding: 0.5rem 1rem;
  font-family: var(--font-tangerine);
  font-size: 2rem;
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 100;
}

.back-btn::before {
  display: none;
}

.back-btn:hover {
  background: var(--col-accent-teal);
  border-color: var(--col-accent-teal);
  color: var(--col-bg);
}

/* !GALLERY ACQUISIZIONI */
.gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-top: 40px;
  width: 100%;
  max-width: 1600px;
  animation: fadeIn 0.8s ease 0.4s both;
}

.gallery-item {
  cursor: pointer;
  transition: all 0.3s ease;
  width: calc(20% - 20px);
  padding: 12px;
  position: relative;

  background: var(--col-card-bg);
  backdrop-filter: blur(10px);

  text-align: center;
  color: var(--col-primary);

  border-radius: 12px;
  border: 1px solid var(--col-border);
  box-shadow: 0 2px 8px rgba(43, 61, 58, 0.08);

  animation: fadeInUp 0.6s ease both;
}

.year-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-lato);
  background: rgba(43, 61, 58, 0.85);
  color: var(--col-bg);
  border-radius: 20px;
  backdrop-filter: blur(4px);
  letter-spacing: 0.05em;
}

/* Stagger animation for gallery items */
.gallery-item:nth-child(1) {
  animation-delay: 0.1s;
}

.gallery-item:nth-child(2) {
  animation-delay: 0.15s;
}

.gallery-item:nth-child(3) {
  animation-delay: 0.2s;
}

.gallery-item:nth-child(4) {
  animation-delay: 0.25s;
}

.gallery-item:nth-child(5) {
  animation-delay: 0.3s;
}

.gallery-item:nth-child(6) {
  animation-delay: 0.35s;
}

.gallery-item:nth-child(n+7) {
  animation-delay: 0.4s;
}

.gallery-item:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 8px 24px rgba(74, 124, 140, 0.2);
  border-color: var(--col-accent-teal);
}

.gallery-item:hover .img-cover {
  filter: blur(0px);
  transform: scale(1.05);
}

.img-cover {
  object-fit: contain;
  width: 100%;
  height: 200px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--col-primary);
  background: linear-gradient(135deg, #F7F5F0 0%, #E8E6E0 100%);
  transition: all 0.3s ease;
}

/* !MODAL CAROUSEL */
.carousel-title {
  font-family: var(--font-tangerine);
  font-size: 1.8rem;
  color: var(--col-bg);
  letter-spacing: 2px;
  text-align: center;
  flex: 1;
  padding: 0 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(43, 61, 58, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.hidden {
  display: none !important;
}

.modal-content {
  position: relative;
  background: var(--col-bg);
  padding: 0;
  border-radius: 20px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(43, 61, 58, 0.3);
  animation: scaleIn 0.4s ease;
  display: flex;
  flex-direction: column;
}

/* Toolbar header */
.modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(43, 61, 58, 0.95);
  border-bottom: 1px solid rgba(127, 169, 181, 0.2);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

/* Zoom controls nel toolbar */
.zoom-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  position: static;
}

.zoom-btn {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 6px;
  padding: 8px 10px;
  background-color: rgba(127, 169, 181, 0.3);
  color: var(--col-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
}

.zoom-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  transform: none !important;
  filter: grayscale(1);
}

.zoom-btn.reset-btn {
  background-color: rgba(168, 136, 96, 0.4);
  color: var(--col-bg);
  font-size: 13px;
  font-family: 'Lato', sans-serif;
  padding: 8px 14px;
  font-weight: 600;
}

.zoom-btn:hover {
  background-color: rgba(127, 169, 181, 0.6);
  transform: scale(1.05);
}

.zoom-btn.reset-btn:hover {
  background-color: rgba(168, 136, 96, 0.6);
}

.zoom-btn:active {
  transform: scale(0.98);
}

.zoom-btn img {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
}

/* Close button nel toolbar */
#closeCarousel {
  position: static;
  width: 40px;
  height: 40px;
  font-size: 22px;
  border-radius: 50%;
  background: rgba(168, 136, 96, 0.4);
  color: var(--col-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-lato);
  font-weight: bold;
}

#closeCarousel::before {
  display: none;
}

#closeCarousel:hover {
  background: rgba(168, 136, 96, 0.7);
  transform: rotate(90deg) scale(1.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#closeCarousel:active {
  transform: rotate(90deg) scale(0.95);
}

/* Content area */
.modal-body {
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: 12px;
  padding: 12px;
  overflow: hidden;
  min-height: 0;
}

/* Immagine principale */
.image-wrapper {
  overflow: hidden;
  width: 100%;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 12px;
  min-height: 0;
}

.main-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  cursor: grab;
  object-fit: contain;
  transition: transform 0.2s ease;
  filter: drop-shadow(0 4px 12px rgba(43, 61, 58, 0.1));
}

.main-image:active {
  cursor: grabbing;
}

/* Thumbnails */
.thumbs {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  width: 110px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--col-primary-light) transparent;
}

.thumbs img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 6px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(43, 61, 58, 0.1);
}

.thumbs img:hover {
  border: 2px solid var(--col-accent-teal);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(74, 124, 140, 0.25);
}

.thumbs img.active {
  border: 2px solid var(--col-primary-light);
  transform: scale(1.05);
}

/* !INFO MODAL */
.info-modal-content {
  position: relative;
  background: var(--col-bg);
  border-radius: 20px;
  max-width: 800px;
  width: 90vw;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(43, 61, 58, 0.3);
  animation: scaleIn 0.4s ease;
  display: flex;
  flex-direction: column;
}

.info-header {
  padding: 32px 60px 24px 32px;
  background: var(--col-primary);
  border-bottom: 2px solid var(--col-primary-light);
  flex-shrink: 0;
}

.info-header h2 {
  font-family: var(--font-tangerine);
  font-size: 2rem;
  text-align: center;
  color: var(--col-bg);
  margin: 0;
  letter-spacing: 2px;
}

.info-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 32px 32px;
  scrollbar-width: thin;
  scrollbar-color: var(--col-primary-light) var(--col-bg);
}

.info-body::-webkit-scrollbar {
  width: 8px;
}

.info-body::-webkit-scrollbar-track {
  background: rgba(43, 61, 58, 0.05);
  border-radius: 10px;
}

.info-body::-webkit-scrollbar-thumb {
  background: var(--col-primary-light);
  border-radius: 10px;
}

.info-body::-webkit-scrollbar-thumb:hover {
  background: var(--col-accent-teal);
}

/* !ACCORDION */
.accordion-item {
  margin-bottom: 16px;
  border: 2px solid var(--col-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--col-white);
  transition: all 0.3s ease;
}

.accordion-item:hover {
  box-shadow: 0 4px 12px rgba(74, 124, 140, 0.15);
  border-color: var(--col-accent-teal);
}

.accordion-header {
  width: 100%;
  border-radius: 0;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-lato);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--col-primary);
  text-align: left;
  transition: all 0.3s ease;
}

.accordion-header:hover {
  background: rgba(127, 169, 181, 0.1);
  border: none;
  transform: none;
  box-shadow: none;
}

.accordion-header span:first-child {
  flex: 1;
  padding-right: 16px;
}

.accordion-header p {
  margin: 0;
}

.accordion-icon {
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--col-primary-light);
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.accordion-item.active .accordion-header {
  background: rgba(74, 124, 140, 0.1);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 24px;
}

.accordion-item.active .accordion-content {
  max-height: 1000px;
  padding: 0 24px 24px;
}

.accordion-content p {
  margin: 0 0 16px 0;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--col-primary);
  font-weight: 400;
  animation: none;
}

.accordion-content p:last-child {
  margin-bottom: 0;
}

.accordion-content ul {
  margin: 12px 0 16px 24px;
  padding: 0;
}

.accordion-content li {
  margin-bottom: 10px;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--col-primary);
}

.accordion-content li:last-child {
  margin-bottom: 0;
}

/* !PAGINATION */
/* !PAGINAZIONE */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 0 16px;
  animation: fadeIn 0.4s ease;
}

.page-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  font-family: var(--font-lato);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  background: transparent;
  color: var(--col-primary);
  border: 2px solid var(--col-border);
  box-shadow: none;
  transition: all 0.25s ease;
}

.page-btn:hover:not(:disabled) {
  background: var(--col-primary-light);
  border-color: var(--col-primary-light);
  color: var(--col-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 124, 140, 0.25);
}

.page-btn.active {
  background: var(--col-primary);
  border-color: var(--col-primary);
  color: var(--col-bg);
  box-shadow: 0 4px 12px rgba(43, 61, 58, 0.2);
}

.page-btn.page-arrow {
  font-size: 1.1rem;
  color: var(--col-primary-light);
  border-color: var(--col-primary-light);
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

/* !ANIMATIONS */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}