/* ==========================================================================
   Gallery pages (pinturas.html, murales.html) · from Figma "pinturas", on Bootstrap 5.3
   ========================================================================== */

:root {
  --forest-dark: #134820;
  --panel: rgb(6 75 22 / 0.73);
  --radius: 12px;

  --font-display: "Futura", system-ui, sans-serif;
  --font-script: "Futura", system-ui, sans-serif;

  --header-h: 188px;          /* full header, as in the design */
  --header-h-compact: 76px;   /* after scrolling */
  --header-ease: 0.3s ease;

  --gallery-inline: clamp(12px, 3vw, 48px);   /* side space of the full-width galleries */

  --bs-body-font-family: var(--font-display);
  --bs-body-font-weight: 600;
}

body.gallery-page {
  min-height: 100vh;
  /* Reserve the full header height so the page never jumps when it compacts */
  padding-top: var(--header-h);
  background: #fff url("../img/bg-brush.png") center 17.09% / cover no-repeat fixed;
}
/* Plain white page, no brush background (pinturas.html, murales.html, digital.html) */
body.gallery-page--plain { background: #fff; }

/* Header (Bootstrap .fixed-top) --------------------------------------------- */

.site-header {
  height: var(--header-h);
  background: rgb(255 255 255 / 0);
  transition: height var(--header-ease), background-color var(--header-ease), box-shadow var(--header-ease);
}
.site-header.is-compact {
  height: var(--header-h-compact);
  background: rgb(255 255 255 / 0.82);
  box-shadow: 0 2px 14px rgb(0 0 0 / 0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  height: 100%;
  max-width: calc(1190px + var(--bs-gutter-x));
  transition: padding var(--header-ease);
}
.is-compact .page-header {
  align-items: center;
  padding-block: 10px;
}
.page-title {
  margin: 0;
  color: #000;
  font-family: var(--font-script);
  font-size: 60px;
  font-weight: 400;
  line-height: 1;
  transition: font-size var(--header-ease);
}
.page-subtitle {
  margin: 12px 0 0;
  color: var(--forest-dark);
  font-size: 30px;
  line-height: 28px;
  transition: font-size var(--header-ease), line-height var(--header-ease), margin var(--header-ease);
}
.page-home {
  flex: none;
  width: 246px;
  transition: opacity 0.2s, width var(--header-ease);
}
.page-home:hover { opacity: 0.75; }
.page-home img { width: 100%; height: auto; }

.is-compact .page-title { font-size: 34px; }

/* Hand-lettered title image (pinturas.html, murales.html, digital.html) instead of text */
.page-title--img img {
  display: block;
  width: auto;
  height: 104px;
  transition: height var(--header-ease);
}
.is-compact .page-title--img img { height: 46px; }
.is-compact .page-subtitle {
  margin-top: 2px;
  font-size: 17px;
  line-height: 20px;
}
.is-compact .page-home { width: 130px; }

/* Tabs + gallery panel ----------------------------------------------------- */

.gallery {
  max-width: none;
  padding-inline: var(--gallery-inline);
  padding-top: 132px;
  padding-bottom: 70px;
}

/* Section headings (murales.html) */
.gallery-heading {
  margin: 0 0 20px;
  color: var(--forest-dark);
  font-size: 30px;
  line-height: 1.2;
}

/* Responsive image grid (murales.html) ------------------------------------- */

.gallery-grid-section {
  max-width: none;
  padding-inline: var(--gallery-inline);
  padding-top: 132px;
}
/* Tabs come right after the grid there, so less space above them */
.gallery-grid-section + .gallery { padding-top: 64px; }

/* Masonry columns (grid and tabs): pictures stacked at their natural
   proportions, 8px apart */
.gallery__column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gallery__tile {
  position: relative;
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery__tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.3);
}
.gallery__tile-caption {
  position: absolute;
  inset: auto 0 0;
  padding: 32px 12px 10px;
  background: linear-gradient(transparent, rgb(6 75 22 / 0.9));
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.gallery__tile:hover .gallery__tile-caption,
.gallery__tile:focus-within .gallery__tile-caption {
  opacity: 1;
  transform: none;
}
@media (hover: none) {
  .gallery__tile-caption {
    opacity: 1;
    transform: none;
  }
}
.gallery__tile-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

/* Tab strip: plain text names, left aligned, no borders or backgrounds.
   The active tab is the one in full colour. */
.gallery__tabs {
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 28px;
  padding: 6px 8px 10px;   /* lines up with the pictures below */
  overflow-x: auto;
  overflow-y: hidden;
  border: 0;
  background: transparent;
  scroll-margin-top: calc(var(--header-h-compact) + 16px);
  scrollbar-width: thin;
  scrollbar-color: var(--forest-dark) transparent;
}
.gallery__tabs .nav-link,
.gallery__tabs .nav-link.active {
  margin: 0;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 18px;
  line-height: 28px;
  text-align: left;
  white-space: nowrap;
  transition: color 0.25s;
}
.gallery__tabs .nav-link { color: rgb(19 72 32 / 0.7); }
.gallery__tabs .nav-link:hover,
.gallery__tabs .nav-link.active { color: var(--forest-dark); }
.gallery__tabs .nav-link:focus-visible {
  outline: 2px solid var(--forest-dark);
  outline-offset: 3px;
}

.gallery__panels {
  height: 624px;
  margin-top: 10px;
  background: transparent;
  overflow: hidden;
}
.gallery__panels > .tab-pane { height: 100%; }

/* Scrollable fluid image grid */
.gallery__scroll {
  height: 100%;
  padding: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--forest-dark) transparent;
}

/* Picture card: image + title + description, on no background of its own */
.gallery__card {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--forest-dark);
  transition: transform 0.3s ease;
}
.gallery__card:hover { transform: translateY(-4px); }
.gallery__card .gallery__thumb { border-radius: var(--radius); }
.gallery__card .card-body { padding: 8px 2px 12px; }
.gallery__card .card-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}
.gallery__card .card-text {
  margin: 6px 0 0;
  color: rgb(19 72 32 / 0.75);
  font-size: 14px;
  line-height: 1.45;
}

.gallery__thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: transparent;
  cursor: zoom-in;
}
.gallery__thumb img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.5s ease, opacity 0.3s;
}
.gallery__thumb:hover img,
.gallery__thumb:focus-visible img { transform: scale(1.06); }
.gallery__thumb:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
.gallery__empty {
  margin: 0;
  padding: 24px;
  color: #fff;
}

/* Lightbox ------------------------------------------------------------------ */

.lightbox .modal-content {
  border: 0;
  border-radius: var(--radius);
  background: #fff;
  color: var(--forest-dark);
}
.lightbox .modal-header {
  gap: 1rem;
  border: 0;
}
.lightbox .modal-title {
  margin: 0;
  font-size: 22px;
}
.lightbox__count {
  margin-left: auto;
  color: rgb(19 72 32 / 0.7);
  font-size: 16px;
}
.lightbox .btn-close { margin: 0; }
.lightbox .modal-body { padding: 0 0 1rem; }
.lightbox .carousel:focus { outline: none; }
/* Dark arrows on the white preview */
.lightbox .carousel-control-prev-icon,
.lightbox .carousel-control-next-icon { filter: invert(1) grayscale(100); }
.lightbox .carousel-item img {
  width: 100%;
  height: 72vh;
  object-fit: contain;
}
.lightbox__caption {
  padding: 14px 24px 0;
  text-align: center;
}
.lightbox__title {
  margin: 0;
  font-size: 20px;
}
.lightbox__text {
  max-width: 60ch;
  margin: 6px auto 0;
  color: rgb(19 72 32 / 0.75);
  font-size: 15px;
  line-height: 1.5;
}

/* Overlay header (artemisa.html, shop.html): transparent over the hero with
   only the home logo; once compact it shows the page title and subtitle. */
.site-header--overlay .page-header { align-items: center; }
.site-header--overlay .page-home { width: 200px; }
.site-header--overlay .page-header__titles {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--header-ease), transform var(--header-ease), visibility var(--header-ease);
}
.site-header--overlay.is-compact .page-header__titles {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.site-header--overlay.is-compact .page-home { width: 130px; }
/* Over a dark hero the logo is shown in white until the header compacts */
.site-header--on-dark:not(.is-compact) .page-home img { filter: brightness(0) invert(1); }

/* Lina Arias page (linaArias.html) · Figma "lina arias page" ---------------- */

body.lina-page {
  --header-h: 318px;
  /* One picture behind the whole page, from under the header to the bottom.
     The page is at least as tall as the picture (1077×2936) so Lina, at its
     foot, shows below the gallery; taller pages scale it to cover. */
  min-height: max(100vh, calc(100vw * 2936 / 1077));
  background: #fff url("../img/FondoLINAARIAS.png") center top / cover no-repeat;
}

/* Header: the logo is the page title, with the two subtitle lines below */
.page-logo {
  width: 461px;
  margin: 0;
  transition: width var(--header-ease);
}
.page-logo a { display: block; transition: opacity 0.2s; }
.page-logo a:hover { opacity: 0.8; }
.page-logo img { width: 100%; height: auto; }
.lina-page .page-subtitle {
  margin: -22px 0 0 33px;
  font-size: 24px;
  line-height: 33px;
}
.is-compact .page-logo { width: 150px; }
.lina-page .is-compact .page-subtitle { display: none; }

/* Biography over the page background */
.bio {
  padding-top: 24px;
  padding-bottom: 24px;
}
.bio__text {
  max-width: calc(1081px + var(--bs-gutter-x));
  color: #2e502b;
  font-size: 24px;
  line-height: 28px;
}
.bio__text p { margin: 0; }
.bio__text p + p { text-indent: 0.5em; }

.lina-gallery {
  padding-top: 113px;
  padding-bottom: 88px;
}

/* Mobile -------------------------------------------------------------------- */

@media (max-width: 767.98px) {
  .site-header--overlay .page-home { width: 110px; }
  .site-header--overlay.is-compact .page-home { width: 88px; }

  body.lina-page { --header-h: 150px; }
  .page-logo { width: 220px; }
  .lina-page .page-subtitle {
    margin: -8px 0 0 14px;
    font-size: 16px;
    line-height: 21px;
  }
  .is-compact .page-logo { width: 110px; }
  .bio__text {
    font-size: 18px;
    line-height: 25px;
  }
  .lina-gallery { padding-top: 48px; padding-bottom: 48px; }

  :root {
    --header-h: 112px;
    --header-h-compact: 60px;
  }
  body.gallery-page { background-attachment: scroll; }
  .page-header { padding-bottom: 8px; }
  .page-title { font-size: 40px; }
  .page-subtitle {
    margin-top: 8px;
    font-size: 20px;
    line-height: 24px;
  }
  .page-home { width: 120px; }

  .is-compact .page-header { padding-block: 6px; }
  .is-compact .page-title { font-size: 26px; }
  .page-title--img img { height: 58px; }
  .is-compact .page-title--img img { height: 32px; }
  .is-compact .page-subtitle {
    margin-top: 0;
    font-size: 13px;
    line-height: 16px;
  }
  .is-compact .page-home { width: 88px; }

  .gallery { padding-top: 40px; padding-bottom: 32px; }
  .gallery-grid-section { padding-top: 40px; }
  .gallery-grid-section + .gallery { padding-top: 40px; }
  .gallery-heading {
    margin-bottom: 12px;
    font-size: 22px;
  }
  .gallery__tabs { gap: 20px; }
  .gallery__tabs .nav-link,
  .gallery__tabs .nav-link.active { font-size: 16px; }
  .gallery__panels { height: 70vh; }
  .lightbox .carousel-item img { height: 62vh; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-header *,
  .gallery__thumb img,
  .gallery__card,
  .gallery__tile,
  .gallery__tile-caption,
  .gallery__tabs .nav-link { transition: none; }
  .gallery__tile:hover,
  .gallery__card:hover,
  .gallery__thumb:hover img,
  .gallery__thumb:focus-visible img { transform: none; }
}
