@import url("https://fonts.googleapis.com/css?family=Cardo|Pathway+Gothic+One");

/* =========================================================
   BASE & RESET
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; padding: 0; background: #808080; }
img { max-width: 100%; height: auto; display: block; }

/* Scrollbar */
.content::-webkit-scrollbar        { width: 8px; }
.content::-webkit-scrollbar-track  { background: #f1f1f1; }
.content::-webkit-scrollbar-thumb  { background: #888; border-radius: 4px; }
.content::-webkit-scrollbar-thumb:hover { background: #555; }

/* =========================================================
   NAVBAR  – clean rewrite
   ========================================================= */
.navbar {
  background: rgba(0,0,0,0.6);
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 2000;
  /* flex row: hamburger on left, links fill the rest */
  display: flex;
  align-items: stretch;
}

/* ── Hamburger button ── */
.nav-toggle {
  /* always in the DOM but hidden on desktop */
  display: none;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 18px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-height: 54px;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
/* animate to X when open */
.navbar.open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.navbar.open .nav-toggle span:nth-child(2) { opacity: 0; }
.navbar.open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ── Link list ── */
.navbar ul {
  list-style: none;
  margin: 0; padding: 0 12px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  flex: 1;
}
.navbar li { position: relative; }
.navbar a {
  display: block;
  padding: 16px 12px;
  text-decoration: none;
  color: #fff;
  font-weight: bold;
  font-size: 16px;
  font-family: "Pathway Gothic One", sans-serif;
  white-space: nowrap;
  transition: color 0.2s;
}
.navbar a:hover { color: #ddd; }

/* underline hover */
.navbar li::after {
  content: "";
  position: absolute;
  bottom: 8px; left: 12px;
  width: 0; height: 2px;
  background: #fff;
  transition: width 0.25s;
}
.navbar li:hover::after { width: calc(100% - 24px); }

/* active tab */
.navbar .active a { color: #d4d0c7; }
.navbar .active::after {
  content: "";
  position: absolute;
  bottom: 8px; left: 12px;
  width: calc(100% - 24px); height: 2px;
  background: #d4d0c7;
}

/* ── Mobile nav  (≤ 640 px) ── */
@media (max-width: 640px) {
  /* show the hamburger */
  .nav-toggle { display: flex; }

  /* stack the navbar vertically */
  .navbar { flex-direction: column; align-items: flex-start; }

  /* hide the link list; reveal when .open */
  .navbar ul {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    transition: max-height 0.35s ease;
  }
  .navbar.open ul { max-height: 360px; }

  .navbar li { width: 100%; }
  .navbar a { padding: 13px 20px; font-size: 17px; }

  /* underlines in mobile */
  .navbar li::after,
  .navbar .active::after {
    left: 20px;
    bottom: 6px;
    width: calc(100% - 40px);
  }
}

/* =========================================================
   TIMELINE PAGE  (index.html)
   ========================================================= */
.timeline-container {
  width: 100%;
  position: relative;
  padding: 100px 0 80px;
  background-attachment: fixed;
  background-size: cover;
  transition: background-image 0.3s ease;
}
.timeline-container::before {
  content: "";
  position: absolute; inset: 0;
  background: rgba(99,99,99,0.8);
}

.timeline-header {
  width: 100%; text-align: center;
  margin-bottom: 60px; position: relative;
  padding: 0 16px;
}
.timeline-header__title {
  color: #fff; font-size: clamp(26px,6vw,46px);
  font-family: Cardo,serif; font-weight: normal; margin: 0;
}
.timeline-header__subtitle {
  color: rgba(255,255,255,0.5);
  font-family: "Pathway Gothic One",sans-serif;
  font-size: 16px; letter-spacing: 5px; margin: 10px 0 0; font-weight: normal;
}
.timeline-header audio { margin: 14px auto 0; width: min(100%,380px); display:block; }

.timeline {
  display: flex; flex-direction: column;
  max-width: 700px; margin: 0 auto;
  position: relative; padding: 0 16px;
}
.timeline::before {
  content: ""; position: absolute;
  left: calc(50% + 16px); width: 2px; height: 100%;
  background: rgba(255,255,255,0.1);
}

.timeline-item {
  padding: 32px 0;
  width: calc(50% - 40px);
  position: relative; z-index: 0;
}
.timeline-item::before {
  content: attr(data-text);
  letter-spacing: 3px; width: 100%;
  position: absolute;
  color: rgba(255,255,255,0.5); font-size: 12px;
  font-family: "Pathway Gothic One",sans-serif;
  border-left: 2px solid rgba(255,255,255,0.4);
  top: 70%; padding-left: 14px; opacity: 0;
  right: calc(-100% - 56px);
  transition: opacity 0.3s, top 0.3s;
}
.timeline-item:nth-child(even) { align-self: flex-end; }
.timeline-item:nth-child(even)::before {
  right: auto; left: calc(-100% - 56px);
  text-align: right; padding-left: 0;
  border-left: none; border-right: 2px solid rgba(255,255,255,0.4);
  padding-right: 14px;
}
.timeline-item--active::before { top: 50%; opacity: 1; }

.timeline__content {
  position: relative; border-radius: 10px;
  overflow: hidden; cursor: pointer;
}
.timeline__img {
  width: 100%; border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
  transition: transform 0.3s ease;
}
.timeline__content-title {
  font-weight: normal;
  font-size: clamp(30px,8vw,66px);
  margin: 0; padding: 0 10px;
  font-family: "Pathway Gothic One",sans-serif;
  color: #D3DBDB; background: rgba(0,0,0,0.5);
  border-radius: 10px 10px 0 0; text-align: center;
  position: absolute; top: 0; left: 0; right: 0; z-index: 1;
  transition: transform 0.3s ease;
}
.timeline-item:hover .timeline__img,
.timeline-item:hover .timeline__content-title { transform: scale(1.05); }

.timeline__content-desc {
  margin: 10px 0 0; font-size: 15px;
  color: rgba(255,255,255,0.75);
  font-family: Cardo,serif; line-height: 1.6;
}
.timeline__content-desc a { color: #c9d4d4; }

/* Mobile: single column */
@media (max-width: 767px) {
  .timeline { padding: 0 8px 0 40px; }
  .timeline::before { left: 18px; }
  .timeline-item,
  .timeline-item:nth-child(even) {
    width: 100%; align-self: auto; padding: 18px 0;
  }
  .timeline-item::before,
  .timeline-item:nth-child(even)::before { display: none; }
  .timeline-item::after {
    content: ""; position: absolute;
    left: -26px; top: 26px;
    width: 10px; height: 10px; border-radius: 50%;
    background: rgba(255,255,255,0.45);
    border: 2px solid rgba(255,255,255,0.8);
  }
  .timeline-item:hover .timeline__img,
  .timeline-item:hover .timeline__content-title { transform: none; }
}

/* =========================================================
   ZOOMED OVERLAY  (timeline image click)
   ========================================================= */
.zoomed-container {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 9999;
}
.zoomed-image {
  max-width: 94vw; max-height: 90vh;
  width: auto; height: auto;
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 6px; user-select: none;
}
.xBtn {
  position: absolute; top: 12px; right: 16px;
  font-size: 34px; color: rgba(255,255,255,0.85);
  cursor: pointer; z-index: 10000; line-height: 1;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(60,60,60,0.65); border-radius: 50%;
  transition: background 0.2s;
}
.xBtn:hover { background: rgba(0,0,0,0.8); }

/* =========================================================
   DOCUMENTS PAGE
   ========================================================= */
.header-wrapper { padding-top: 90px; text-align: center; }

.documents_title {
  font-family: "Pathway Gothic One",sans-serif;
  color: #555; font-size: clamp(28px,7vw,58px);
  margin: 0 0 20px; padding: 0 12px;
  font-weight: normal; text-align: center;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 16px; padding: 16px;
  max-width: 1100px; margin: 0 auto;
}
@media (max-width: 900px) { .document-grid { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 580px) { .document-grid { grid-template-columns: repeat(2,1fr); gap:10px; padding:10px; } }

.document-entry { animation: fadeIn 0.5s ease-in-out; }

.document-content { text-align: center; cursor: pointer; }
.document-content:hover { transform: scale(1.05); transition: transform 0.3s; }
@media (max-width: 580px) { .document-content:hover { transform: none; } }

.document-image img {
  width: 100%; height: 120px; object-fit: cover;
  border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
@media (max-width: 580px) { .document-image img { height: 90px; } }

.document-title a {
  font-family: "Pathway Gothic One",sans-serif;
  color: #444; font-size: 15px; text-decoration: none; transition: color 0.3s;
}
.document-title a:hover { color: #111; text-decoration: underline; }

.document-date {
  font-family: "Pathway Gothic One",sans-serif;
  color: #666; font-size: 13px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   DOCUMENT DETAIL SLIDER PAGES
   ========================================================= */
#img_slider { text-align: center; padding-top: 80px; }

/* thumbnail strip */
#small_image {
  display: flex; flex-wrap: wrap;
  justify-content: center;
  gap: 8px; padding: 12px;
}
#small_image img {
  width: 120px; height: 120px;
  object-fit: cover; border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}
#small_image img:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(0,0,0,0.6);
}
@media (max-width: 580px) {
  #small_image img { width: calc(33vw - 14px); height: calc(33vw - 14px); }
}

/* big image viewer: scrollable container so zoom works */
#big_image {
  padding: 8px 12px 80px;
  overflow: auto;           /* ← key: allows pan after zoom */
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
#big_image img {
  /* start at natural width up to viewport; zoom changes this */
  width: min(600px, 96vw);
  height: auto;
  border-radius: 10px;
  cursor: zoom-in;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  transform-origin: top center;
  transition: width 0.2s ease;
  flex-shrink: 0;
}

/* zoom buttons — desktop: left side float; mobile: bottom bar */
.float_btn {
  position: fixed;
  left: 12px; bottom: 50%;
  transform: translateY(50%);
  z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
}
#zoomInButton, #zoomOutButton {
  background: rgba(0,100,220,0.6);
  color: #fff; font-size: 26px; font-weight: bold;
  border: none; border-radius: 50%;
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
#zoomInButton:hover, #zoomOutButton:hover {
  background: rgba(0,70,190,0.85); transform: scale(1.1);
}
#zoomInButton:focus, #zoomOutButton:focus { outline: none; }

@media (max-width: 640px) {
  .float_btn {
    bottom: 16px; left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
  }
}

/* =========================================================
   MAP PAGE
   ========================================================= */
.container_map {
  width: 100%; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; padding: 90px 12px 30px;
}
.container_map iframe {
  width: 100%; max-width: 900px; height: 500px;
  border: 0; border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
@media (max-width: 580px) { .container_map iframe { height: 360px; } }

/* =========================================================
   PDF / RESTITUTION PAGE
   ========================================================= */
.pdf-wrapper { text-align: center; padding: 20px 12px 40px; }
.pdf-wrapper iframe {
  width: min(85%,860px); height: 500px;
  border: 0; border-radius: 8px;
}
@media (max-width: 580px) { .pdf-wrapper iframe { width: 100%; height: 420px; } }
.pdf-wrapper a {
  display: inline-block; margin-top: 12px;
  color: #333; font-family: "Pathway Gothic One",sans-serif; font-size: 16px;
}
