@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Colors */
  --primary: hsl(135, 44%, 26%);       /* Forest green accent */
  --primary-light: hsl(135, 35%, 92%); /* Light background green */
  --primary-medium: hsl(135, 30%, 45%);
  --secondary: hsl(38, 85%, 55%);      /* Warm gold for accents */
  --dark: #1e2520;                     /* Slate black */
  --light: #f7f9f7;                    /* Off-white */
  --white: #ffffff;
  --gray: #e6eae6;
  --text-muted: #5e6960;
  
  /* Fonts */
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Spacing */
  --container-width: 1200px;
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --box-shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.12);
}

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

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-main);
  background-color: var(--light);
  color: var(--dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Base Styles */
a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--secondary);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 0.5em;
  color: var(--dark);
}

/* Layout */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

main {
  padding-top: 190px; /* offset for taller navbar (170px) + extra breathing space */
  min-height: calc(100vh - 180px);
}

section {
  padding: 60px 0;
}

/* Glassmorphic Navbar */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray);
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
  transition: var(--transition);
}

header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 170px;
}

.logo img {
  height: 150px;
  display: block;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 30px;
}

.nav-links a {
  font-weight: 500;
  font-size: 16px;
  color: var(--dark);
  position: relative;
  padding: 8px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links li.active a::after {
  width: 100%;
}

.nav-links li.active a {
  color: var(--primary);
  font-weight: 600;
}

/* Burger menu */
.burger {
  display: none;
  cursor: pointer;
  background: transparent;
  border: none;
}

.burger div {
  width: 25px;
  height: 3px;
  background-color: var(--primary);
  margin: 5px;
  transition: var(--transition);
}

/* Footer logo strip */
footer {
  background-color: var(--white);
  border-top: 1px solid var(--gray);
  padding: 40px 0;
  margin-top: 40px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.footer-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 40px;
  width: 100%;
}

.footer-logos img {
  height: 45px;
  max-width: 100%;
  object-fit: contain;
  transition: var(--transition);
  filter: grayscale(10%) contrast(90%);
}

.footer-logos img:hover {
  filter: none;
  transform: translateY(-2px);
}

.footer-info {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.footer-info a {
  color: var(--text-muted);
  text-decoration: underline;
}

.footer-info a:hover {
  color: var(--primary);
}

/* Home Section Styles */
.intro-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}

.intro-text p {
  font-size: 18px;
  margin-bottom: 20px;
  color: var(--text-muted);
}

.intro-text strong {
  color: var(--dark);
}

.intro-image img {
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
}

.intro-image img:hover {
  transform: scale(1.01);
  box-shadow: var(--box-shadow-hover);
}

/* Gallery Slider */
.home-gallery {
  background-color: var(--white);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--box-shadow);
  margin-bottom: 40px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 15px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 4/3;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-caption {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
  margin-top: 10px;
}

/* Objectives Section */
.objectives {
  background-color: var(--primary-light);
  border-radius: var(--border-radius);
  padding: 40px;
  margin-bottom: 40px;
}

.objectives h2 {
  text-align: center;
  margin-bottom: 30px;
}

.objectives-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  list-style: none;
}

.objectives-list li {
  background-color: var(--white);
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
  border-left: 4px solid var(--primary);
  transition: var(--transition);
}

.objectives-list li:hover {
  transform: translateY(-5px);
  box-shadow: var(--box-shadow-hover);
}

/* Map Section */
.map-box {
  background-color: var(--white);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--box-shadow);
  text-align: center;
}

.map-box img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 15px;
}

.map-box figcaption {
  font-size: 14px;
  color: var(--text-muted);
}

/* Button utility */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white);
  border: 2px solid var(--primary);
}

.btn-primary:hover {
  background-color: transparent;
  color: var(--primary);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary);
  color: var(--white);
}

/* Timeline article buttons (Inscripcions, etc.) */
.wp-block-button__link,
.timeline-content a.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 26px;
  background-color: var(--primary);
  color: var(--white) !important;
  border: 2px solid var(--primary);
  border-radius: 30px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.wp-block-button__link::before,
.timeline-content a.button::before {
  content: '→';
  font-size: 15px;
}

.wp-block-button__link:hover,
.timeline-content a.button:hover {
  background-color: transparent;
  color: var(--primary) !important;
}

/* Catalogs Page */
.catalogs-grid {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.catalog-card {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 35px;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--gray);
  display: flex;
  flex-direction: column;
  gap: 15px;
  position: relative;
  transition: var(--transition);
}

.catalog-card:hover {
  box-shadow: var(--box-shadow-hover);
  border-color: var(--primary-medium);
}

.catalog-tag {
  align-self: flex-start;
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.catalog-title {
  font-size: 24px;
  margin-bottom: 5px;
  color: var(--primary);
}

.catalog-authors {
  font-size: 16px;
  font-weight: 500;
  color: var(--primary-medium);
}

.catalog-institution {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: -10px;
}

.catalog-resums {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 15px 0;
}

.resum-box h4 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.resum-box p {
  font-size: 15px;
  text-align: justify;
}

.catalog-citation {
  background-color: var(--light);
  padding: 15px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
  border-left: 3px solid var(--secondary);
}

.catalog-actions {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

/* Catalog Grid split layout */
@media (min-width: 992px) {
  .catalog-card {
    flex-direction: row !important;
    gap: 40px !important;
    align-items: flex-start;
  }
  .catalog-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
  .catalog-sidebar {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .catalog-sidebar .catalog-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 12px;
    margin-top: 0;
  }
  .catalog-sidebar .catalog-actions .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
    margin: 0;
  }
}

@media (max-width: 991px) {
  .catalog-card {
    flex-direction: column;
  }
  .catalog-sidebar {
    width: 100%;
    margin-top: 10px;
    display: flex;
    flex-direction: column-reverse;
    gap: 20px;
  }
  .catalog-sidebar .catalog-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
  }
  .catalog-sidebar .catalog-actions .btn {
    flex: 1;
    min-width: 150px;
    text-align: center;
    justify-content: center;
    margin: 0;
  }
  .catalog-preview {
    max-width: 200px;
    align-self: center;
  }
}

.catalog-preview {
  width: 100%;
  border: 1px solid var(--gray);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: var(--transition);
}
.catalog-preview:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-medium);
}
.catalog-preview img {
  width: 100%;
  height: auto;
  display: block;
}

/* Species Page */
.species-controls {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--box-shadow);
  margin-bottom: 30px;
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 250px;
}

.filter-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.filter-group select,
.filter-group input {
  padding: 12px 16px;
  border: 1px solid var(--gray);
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 16px;
  color: var(--dark);
  outline: none;
  background-color: var(--light);
  transition: var(--transition);
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--primary);
  background-color: var(--white);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.species-results {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: var(--box-shadow);
  overflow-x: auto;
}

.species-count {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-medium);
  margin-bottom: 15px;
}

/* Responsive Table */
.species-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.species-table th,
.species-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray);
}

.species-table th {
  background-color: var(--light);
  color: var(--primary);
  font-weight: 600;
}

.species-table tbody tr:hover {
  background-color: var(--primary-light);
}

.species-table em {
  font-style: italic;
  font-weight: 500;
}

/* Participacio & Noticies Pages (Timeline) */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.timeline-item {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border: 1px solid var(--gray);
  overflow: hidden;
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  grid-template-rows: auto auto;
  transition: var(--transition);
}

.timeline-item:hover {
  box-shadow: var(--box-shadow-hover);
  transform: translateY(-2px);
}

.timeline-img-wrapper {
  grid-column: 1;
  grid-row: 1;
  background: #f8f8f6;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  padding: 15px 10px 15px 15px;
}

.timeline-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 250px;
  display: block;
  border-radius: 10px;
  overflow: hidden;
}

/* When article has gallery: main image shown fully */
.timeline-item.has-gallery .timeline-img-wrapper {
  align-items: flex-start;
}

.timeline-item.has-gallery .timeline-img {
  width: 100%;
  height: auto;
  min-height: unset;
  object-fit: unset;
  object-position: unset;
}

/* Full image (no crop) — for articles where photo must show entirely */
.timeline-item.full-img .timeline-img-wrapper {
  align-items: flex-start;
}

.timeline-item.full-img .timeline-img {
  width: 100%;
  height: auto;
  min-height: unset;
  object-fit: contain;
}

/* Wide image — larger image column, narrower text column */
.timeline-item.wide-img {
  grid-template-columns: 1.4fr 0.6fr;
}

.timeline-content {
  grid-column: 2;
  grid-row: 1;
  padding: 35px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: flex-start;
}

.timeline-meta {
  display: flex;
  gap: 15px;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timeline-title {
  font-size: 24px;
  color: var(--primary);
}

.timeline-desc {
  color: var(--text-muted);
  font-size: 15px;
}

/* Lists inside timeline — plain bulleted list, multi-column */
.timeline-content ul.timeline-desc {
  list-style: disc;
  padding-left: 22px;
  margin: 8px 0 16px;
  display: block;
  columns: 3;
  column-gap: 30px;
}

.timeline-content ul.timeline-desc li {
  font-size: 15px;
  color: var(--text);
  line-height: 1.7;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  white-space: normal;
  break-inside: avoid;
}

.timeline-item.no-image {
  grid-template-columns: 1fr;
}

.timeline-item.no-image .timeline-content {
  grid-column: 1;
}

/* has-gallery: left column uses flex-column wrapper so gallery sits right below image */
.timeline-item.has-gallery {
  grid-template-columns: 0.8fr 1.2fr;
}

.timeline-left {
  display: flex;
  flex-direction: column;
}

.timeline-left .timeline-img-wrapper {
  flex-shrink: 0;
  min-height: unset;
}

.timeline-gallery {
  padding: 0 10px 15px 15px;
  border-top: 1px solid var(--gray);
}

/* Content no longer needs to span rows */
.timeline-item.has-gallery .timeline-content {
  grid-row: unset;
}

.timeline-gallery .gallery-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 15px 15px 10px 15px;
  display: block;
}

.timeline-gallery .gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.gallery-item {
  overflow: hidden;
  border-radius: 6px;
  cursor: zoom-in;
  max-height: 220px;
  display: flex;
  align-items: flex-start;
}

.gallery-item img {
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: var(--transition);
  display: block;
  border-radius: 6px;
}

.gallery-item img:hover {
  transform: scale(1.03);
}

/* Single photo gallery — full width, no tiny thumbnail */
.timeline-gallery.single-photo {
  padding: 0 15px 20px 20px;
}

.timeline-gallery.single-photo .gallery-item {
  aspect-ratio: unset;
  border-radius: 10px;
}

.timeline-gallery.single-photo .gallery-item img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
}

.species-list-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.species-tag {
  background-color: var(--light);
  border: 1px solid var(--gray);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
}


/* ── Lightbox Overlay ── */
#lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 15, 12, 0.88);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
  cursor: zoom-out;
}

#lightbox-overlay.active {
  display: flex;
  animation: lbFadeIn 0.25s ease;
}

@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lb-img {
  max-width: min(90vw, 1000px);
  max-height: 80vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: lbZoomIn 0.25s ease;
  cursor: default;
}

@keyframes lbZoomIn {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.lb-caption {
  margin-top: 14px;
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  text-align: center;
  max-width: 600px;
}

.lb-close {
  position: fixed;
  top: 18px;
  right: 22px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lb-close:hover {
  background: rgba(255,255,255,0.25);
}

/* Contact Page Form */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
}

.contact-info {
  background-color: var(--white);
  border-radius: var(--border-radius);
  padding: 35px;
  box-shadow: var(--box-shadow);
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.contact-block h3 {
  font-size: 16px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.contact-block p {
  font-size: 18px;
  font-weight: 500;
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.social-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background-color: var(--light);
  border-radius: 50%;
  color: var(--primary);
  font-weight: bold;
}

.social-btn:hover {
  background-color: var(--primary);
  color: var(--white);
}

.contact-form-box {
  background-color: var(--white);
  border-radius: var(--border-radius);
  padding: 35px;
  box-shadow: var(--box-shadow);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea {
  padding: 12px 16px;
  border: 1px solid var(--gray);
  border-radius: 8px;
  outline: none;
  font-family: var(--font-main);
  background-color: var(--light);
  font-size: 16px;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  background-color: var(--white);
}

/* Article View Page */
.article-header {
  background-color: var(--white);
  padding: 40px 0;
  border-bottom: 1px solid var(--gray);
  margin-bottom: 40px;
}

.article-meta-info {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 10px;
}

.article-content {
  background-color: var(--white);
  border-radius: var(--border-radius);
  padding: 40px;
  box-shadow: var(--box-shadow);
  margin-bottom: 40px;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  color: #339900 !important;
}

.article-content h2,
.article-content h3 {
  margin-top: 1.5em;
  margin-bottom: 0.8em;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 8px;
}

.article-content p {
  margin-bottom: 1.5em;
  text-align: justify;
}

.article-content p[align="center"],
.article-content p.caption,
.article-content p.captionF {
  text-align: center !important;
}

.article-content p[align="center"] a,
.article-content p.caption a,
.article-content p.captionF a {
  color: #339900 !important;
}

/* Scrollable Table Wrapper */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 25px 0;
  border-radius: 8px;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--gray);
}

.table-wrapper table {
  margin: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* Interactive Tooltips (Citations) */
.citation-tooltip {
  position: relative;
  background-color: var(--primary-light);
  color: var(--primary);
  border-bottom: 1px dashed var(--primary);
  cursor: help;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  display: inline-block;
}

.citation-tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  width: 250px;
  padding: 12px;
  background: rgba(30, 37, 32, 0.95);
  color: var(--white);
  font-size: 13px;
  line-height: 1.4;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  text-align: left;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(4px);
}

.citation-tooltip:hover::before,
.citation-tooltip.clicked::before {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}

/* Lightbox component */
.lightbox {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(30, 37, 32, 0.95);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90%;
  max-height: 80%;
  border-radius: 8px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: 30px;
  right: 30px;
  color: var(--white);
  font-size: 40px;
  cursor: pointer;
  background: transparent;
  border: none;
}

.lightbox-caption {
  position: absolute;
  bottom: 40px;
  color: var(--white);
  font-size: 16px;
}

/* Responsive queries */
@media(max-width: 992px) {
  .intro-grid {
    grid-template-columns: 1fr;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .catalog-resums {
    grid-template-columns: 1fr;
  }
}

@media(max-width: 768px) {
  .nav-container {
    height: 75px;
  }
  
  .logo img {
    height: 55px;
  }
  
  main {
    padding-top: 95px;
  }
  
  .nav-links {
    position: absolute;
    right: 0px;
    height: calc(100vh - 75px);
    top: 75px;
    background-color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60%;
    transform: translateX(100%);
    transition: var(--transition);
    box-shadow: -10px 0 20px rgba(0,0,0,0.05);
    padding-top: 50px;
    gap: 30px;
  }
  
  .nav-links.active {
    transform: translateX(0%);
  }
  
  .burger {
    display: block;
  }
  
  .timeline-item {
    grid-template-columns: 1fr;
  }
  
  .timeline-img-wrapper {
    min-height: 220px;
  }

  .timeline-img {
    height: 220px;
    min-height: auto;
  }

  .timeline-item.has-gallery .timeline-img {
    height: auto;
    min-height: 180px;
  }

  .timeline-content {
    grid-column: 1;
    grid-row: 2;
  }

  .timeline-content ul.timeline-desc {
    columns: 2;
  }

  .timeline-gallery {
    grid-row: 3;
    padding: 0 15px 20px 15px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .article-content {
    padding: 20px;
  }
}

/* Proposta Moderna d'Objectius */
.objectives-section-modern {
  background: linear-gradient(180deg, var(--white) 0%, var(--primary-light) 100%);
  border-radius: 20px;
  padding: 60px 40px;
  box-shadow: var(--box-shadow);
  margin-bottom: 40px;
  border: 1px solid var(--gray);
}

.objectives-header-modern {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 50px auto;
}

.objectives-header-modern h2 {
  font-size: 32px;
  color: var(--primary);
  position: relative;
  display: inline-block;
  padding-bottom: 15px;
  margin-bottom: 0;
}

.objectives-header-modern h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: var(--secondary);
  border-radius: 2px;
}

.objectives-grid-modern {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

@media (max-width: 1200px) {
  .objectives-grid-modern {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

@media (max-width: 576px) {
  .objectives-grid-modern {
    grid-template-columns: 1fr;
  }
}

.objective-card-modern {
  background-color: var(--white);
  border-radius: 16px;
  padding: 30px 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.02);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.objective-card-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-medium) 100%);
  transition: var(--transition);
}

.objective-card-modern:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
  border-color: var(--primary-light);
}

.objective-card-modern:hover::before {
  height: 6px;
  background: linear-gradient(90deg, var(--secondary) 0%, var(--primary) 100%);
}

.objective-number-modern {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 44px;
  font-weight: 800;
  color: rgba(30, 37, 32, 0.05); /* very subtle light text in corner */
  line-height: 1;
  transition: var(--transition);
  font-family: var(--font-main);
}

.objective-card-modern:hover .objective-number-modern {
  color: rgba(30, 37, 32, 0.08);
  transform: scale(1.1);
}

.objective-card-modern h3 {
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 12px;
  margin-top: 10px;
  font-weight: 700;
  z-index: 1;
}

.objective-card-modern p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  z-index: 1;
  margin-bottom: 0;
}

/* =============================================
   HOME PAGE — Original photo composition
   ============================================= */
.home-photos-section {
  padding: 10px 0 40px;
}

.home-photos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 8px;
}

.home-photo {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.home-photos-grid img:nth-child(4) {
  grid-column: 1 / 2;
  grid-row: 2;
  height: 260px;
}

.home-photos-grid img:nth-child(5) {
  grid-column: 2 / 4;
  grid-row: 2;
  height: 260px;
}

.home-photos-credit {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 10px;
}

/* WordPress Default Table Styles for Articles */
.original-wordpress-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
  margin-top: 1.5em;
  font-size: 0.8rem;
}

.original-wordpress-content th,
.original-wordpress-content td {
  border: 1px solid #ddd;
  padding: 4px 6px;
  text-align: center;
  vertical-align: middle;
  word-break: break-word;
}

.original-wordpress-content th {
  background-color: #f9f9f9;
  font-weight: 600;
  text-align: center;
}

.original-wordpress-content th p,
.original-wordpress-content td p {
  text-align: center !important;
  margin: 0 !important;
}
