/* ============================================
   TORRELLES DE LLOBREGAT - Full-screen slides
   Colors originals de Manel Olid Bayona
   ============================================ */

:root {
  --primary: #990000;
  --primary-dark: #660000;
  --accent: #3366cc;
  --footer-bg: #008000;
  --menu-bg: rgba(255,255,255,0.92);
  --menu-width: 60px;
  --text-dark: #222;
  --text-muted: #555;
  --bg-white: #fff;
  --bg-light: #f5f5f5;
}

* { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior: smooth; }

/* Google Fonts es carrega des del HTML */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  background: var(--bg-white);
  color: var(--text-dark);
  line-height: 1.7;
  overflow: hidden;
}

h1, h2, h3, .slide-title {
  font-family: 'Inter', Georgia, serif;
  font-weight: 400;
}

#side-menu a {
  font-weight: 400;
}

/* ===== MENÚ LATERAL IZQUIERDO ===== */
#side-menu {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--menu-width);
  height: 100vh;
  background: var(--menu-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  z-index: 100;
  border-right: 1px solid rgba(0,0,0,0.06);
}

#side-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

#side-menu a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  text-decoration: none;
  color: #aaa;
  border-radius: 50%;
  transition: all 0.3s ease;
}

#side-menu a:hover {
  color: var(--primary);
  background: rgba(153,0,0,0.06);
}

#side-menu a.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(153,0,0,0.3);
}

#side-menu .menu-label {
  position: absolute;
  bottom: 1.2rem;
  font-size: 0.6rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-weight: 600;
}

/* ===== SLIDES CONTAINER ===== */
.slides-container {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* ===== CADA SLIDE ===== */
.slide {
  height: 100vh;
  min-height: 100vh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  padding-left: calc(var(--menu-width) + 2rem);
  padding-bottom: 3rem;
}

.slide:nth-child(even) {
  background: var(--bg-light);
}

.slide-content {
  width: 100%;
  max-width: 750px;
}

.slide-title {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--primary);
  font-size: 1.8rem;
  margin-bottom: 1.2rem;
  text-align: center;
}

.slide p {
  margin-bottom: 0.85rem;
  line-height: 1.7;
}

/* ===== GALERIA FOTOS ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.5rem;
}

.gallery-grid img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  transition: transform 0.3s;
  cursor: pointer;
}

.gallery-grid img:hover {
  transform: scale(1.05);
}

/* ===== ENLLAÇOS ===== */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.link-cat h3 {
  font-family: Georgia, serif;
  color: var(--primary);
  font-size: 1rem;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--primary);
  padding-bottom: 0.3rem;
}

.link-cat ul {
  list-style: none;
}

.link-cat li {
  margin-bottom: 0.3rem;
}

.link-cat a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.link-cat a:hover {
  text-decoration: underline;
}

/* ===== ENTITATS ===== */
.orgs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.org-card {
  background: var(--bg-white);
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
  transition: box-shadow 0.3s;
}

.org-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.org-card h3 {
  font-family: Georgia, serif;
  color: var(--primary);
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.org-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ===== BOTÓ WEB ORIGINAL ===== */
.btn-original {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 0.8rem 2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s;
}

.btn-original:hover {
  background: var(--primary-dark);
}

/* ===== BARRA INFERIOR ===== */
#slide-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 28px;
  background: var(--footer-bg);
  color: #fff;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  z-index: 100;
  padding-left: var(--menu-width);
  padding-right: 0.5rem;
}

#slide-footer a {
  color: #fff;
  text-decoration: underline;
}

#slide-footer a:hover {
  color: #ddd;
}

/* ===== FLECHAS NAVEGACIÓN ===== */
.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 99;
  background: rgba(0,0,0,0.08);
  color: rgba(0,0,0,0.35);
  border: none;
  font-size: 1.8rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#nav-prev { left: 72px; }
#nav-next { right: 1.2rem; }

.nav-arrow:hover {
  background: rgba(153,0,0,0.15);
  color: var(--primary);
  transform: translateY(-50%) scale(1.1);
}

@media (max-width: 768px) {
  .nav-arrow { display: none; }
}

/* ===== RESPONSIVE MÒBIL ===== */
@media (max-width: 768px) {
  #side-menu {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    padding: 0.3rem 0;
    border-right: none;
    border-top: 1px solid rgba(0,0,0,0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
    z-index: 100;
  }

  #side-menu ul {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
    gap: 0;
  }

  #side-menu a {
    width: auto;
    height: auto;
    font-size: 1.3rem;
    padding: 0.2rem 0.4rem;
    border-radius: 0;
    color: #aaa;
  }

  #side-menu a.active {
    background: none;
    color: var(--primary);
    box-shadow: none;
    border-bottom: 2px solid var(--primary);
    border-radius: 0;
  }

  #side-menu .menu-label {
    display: none;
  }

  .slide {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 3.5rem;
    padding-top: 1.5rem;
  }

  .slide-title {
    font-size: 1.4rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    max-height: 55vh;
  }

  .gallery-grid img {
    height: 90px;
  }

  .links-grid {
    grid-template-columns: 1fr;
  }

  .orgs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  #slide-footer {
    display: none;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid img {
    height: 80px;
  }

  .orgs-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== MODAL LIGHTBOX ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.modal-overlay.active {
  display: flex;
}

.modal-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

.modal-close {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  z-index: 1001;
  background: none;
  border: none;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.modal-close:hover {
  opacity: 1;
}

.modal-counter {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.85rem;
  opacity: 0.7;
  z-index: 1001;
}

.modal-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 1001;
  background: none;
  border: none;
  opacity: 0.5;
  transition: opacity 0.3s;
  padding: 1rem;
}

.modal-nav:hover {
  opacity: 1;
}

.modal-prev {
  left: 1rem;
}

.modal-next {
  right: 1rem;
}

@media (max-width: 768px) {
  .modal-nav {
    font-size: 1.8rem;
    padding: 0.5rem;
  }
  .modal-close {
    font-size: 1.5rem;
    top: 0.5rem;
    right: 0.8rem;
  }
}

/* ===== NARRATIVA MANEL ===== */
.manel-narrativa {
  text-align: left;
  max-width: 680px;
  margin: 0 auto;
}

.manel-narrativa p {
  margin-bottom: 1rem;
  line-height: 1.8;
  font-size: 1.05rem;
}

.manel-narrativa strong {
  color: var(--primary);
  font-weight: 600;
}

.manel-narrativa em {
  color: var(--accent);
  font-style: italic;
}
