.gallery-hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #fff;
  background: var(--forest-dark);
  isolation: isolate;
}
.gallery-hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-position: center;
  background-size: cover;
  transform: scale(1.015);
}
.gallery-hero__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(13,22,14,.94) 0%, rgba(13,22,14,.76) 48%, rgba(13,22,14,.28) 78%, rgba(13,22,14,.12) 100%);
}
.gallery-hero__content { padding-block: 80px 72px; }
.gallery-hero__content > div { max-width: 790px; }
.gallery-hero h1 {
  margin: 0;
  max-width: 850px;
  font-size: clamp(42px, 5.2vw, 72px);
  line-height: .99;
  letter-spacing: -.045em;
  font-weight: 750;
}
.gallery-hero__lead {
  max-width: 690px;
  margin: 26px 0 0;
  color: rgba(255,255,255,.8);
  font-size: clamp(17px, 1.6vw, 21px);
}
.gallery-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.gallery-meta {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}
.gallery-meta > div { padding: 26px max(24px, calc((100vw - min(1180px, calc(100% - 40px))) / 2)); background: #fff; }
.gallery-meta > div:first-child { padding-right: 24px; }
.gallery-meta > div:nth-child(2) { padding-inline: 28px; }
.gallery-meta > div:last-child { padding-left: 28px; }
.gallery-meta strong, .gallery-meta span { display: block; }
.gallery-meta strong { font-size: 14px; }
.gallery-meta span { margin-top: 4px; color: var(--muted); font-size: 12px; }

.gallery-benefits { display: grid; grid-template-columns: .85fr 1.15fr; gap: 90px; align-items: start; }
.gallery-benefits__copy h2,
.gallery-showcase__head h2,
.gallery-cta h2 {
  margin: 0;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1.03;
  letter-spacing: -.038em;
  font-weight: 720;
}
.gallery-benefits__copy > p:not(.eyebrow) { margin: 24px 0 0; color: var(--muted); }
.benefit-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.benefit-list li { display: grid; grid-template-columns: 54px 1fr; gap: 20px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.benefit-list span { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.benefit-list strong { display: block; margin-bottom: 6px; font-size: 18px; }
.benefit-list p { margin: 0; color: var(--muted); font-size: 14px; }

.gallery-showcase { padding: 100px 0 110px; background: #fff; }
.gallery-showcase__head { display: grid; grid-template-columns: 1.25fr .75fr; gap: 70px; align-items: end; margin-bottom: 42px; }
.gallery-showcase__head > p { margin: 0 0 4px; color: var(--muted); }
.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.gallery-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 0;
  border-radius: 15px;
  padding: 0;
  background: #e9e9e3;
  cursor: zoom-in;
}
.gallery-card:nth-child(7n + 1), .gallery-card:nth-child(7n + 5) { grid-column: span 2; grid-row: span 2; }
.gallery-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.gallery-card::after {
  content: "Ver proyecto";
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 8px 11px;
  border-radius: 999px;
  color: #fff;
  background: rgba(16,23,17,.75);
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 750;
  opacity: 0;
  transform: translateY(7px);
  transition: opacity .2s ease, transform .2s ease;
}
.gallery-card:hover img { transform: scale(1.035); }
.gallery-card:hover::after, .gallery-card:focus-visible::after { opacity: 1; transform: none; }
.gallery-card:focus-visible { outline: 3px solid rgba(48,65,25,.35); outline-offset: 3px; }
.gallery-card.is-hidden { display: none; }
.gallery-more { display: flex; justify-content: center; margin-top: 34px; }
.gallery-count { margin-top: 15px; text-align: center; color: var(--muted); font-size: 12px; }

.gallery-links { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.gallery-links a {
  display: flex;
  min-height: 130px;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  transition: transform .18s ease, box-shadow .18s ease;
}
.gallery-links a:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.gallery-links strong { font-size: 16px; }
.gallery-links span { color: var(--muted); font-size: 12px; }

.gallery-cta { padding: 90px 0; color: #fff; background: var(--forest-dark); }
.gallery-cta__grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 70px; align-items: end; }
.gallery-cta p { max-width: 650px; margin: 22px 0 0; color: rgba(255,255,255,.72); }
.gallery-cta__actions { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }

.gallery-lightbox {
  width: min(94vw, 1500px);
  max-width: none;
  height: min(92vh, 1000px);
  max-height: none;
  border: 0;
  padding: 0;
  border-radius: 18px;
  background: #0f130f;
  color: #fff;
  overflow: hidden;
}
.gallery-lightbox::backdrop { background: rgba(4,8,5,.88); backdrop-filter: blur(4px); }
.gallery-lightbox__inner { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.gallery-lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.gallery-lightbox__close,
.gallery-lightbox__nav {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  color: #fff;
  background: rgba(8,12,9,.68);
  backdrop-filter: blur(8px);
  cursor: pointer;
}
.gallery-lightbox__close { top: 18px; right: 18px; width: 44px; height: 44px; font-size: 25px; }
.gallery-lightbox__nav { top: 50%; width: 48px; height: 48px; transform: translateY(-50%); font-size: 24px; }
.gallery-lightbox__nav--prev { left: 18px; }
.gallery-lightbox__nav--next { right: 18px; }
.gallery-lightbox__caption { position: absolute; left: 18px; bottom: 18px; padding: 8px 12px; border-radius: 999px; background: rgba(8,12,9,.68); font-size: 12px; }

@media (max-width: 1000px) {
  .gallery-benefits, .gallery-cta__grid { grid-template-columns: 1fr; gap: 48px; }
  .gallery-showcase__head { grid-template-columns: 1fr; gap: 18px; }
  .gallery-grid { grid-template-columns: repeat(3,1fr); }
  .gallery-links { grid-template-columns: repeat(2,1fr); }
  .gallery-cta__actions { justify-content: flex-start; }
}

@media (max-width: 640px) {
  .gallery-hero { min-height: 610px; }
  .gallery-hero__shade { background: linear-gradient(180deg, rgba(13,22,14,.42), rgba(13,22,14,.94) 74%); }
  .gallery-hero__content { padding-block: 55px; }
  .gallery-hero h1 { font-size: clamp(39px,12vw,55px); }
  .gallery-hero__actions { display: grid; }
  .gallery-meta { grid-template-columns: 1fr; }
  .gallery-meta > div, .gallery-meta > div:first-child, .gallery-meta > div:nth-child(2), .gallery-meta > div:last-child { padding: 18px 14px; }
  .gallery-benefits { gap: 42px; }
  .gallery-showcase { padding: 72px 0 80px; }
  .gallery-grid { grid-template-columns: repeat(2,1fr); gap: 8px; }
  .gallery-card:nth-child(7n + 1), .gallery-card:nth-child(7n + 5) { grid-column: span 2; grid-row: span 1; aspect-ratio: 16 / 10; }
  .gallery-card { border-radius: 11px; }
  .gallery-card::after { display: none; }
  .gallery-links { grid-template-columns: 1fr; }
  .gallery-cta { padding: 72px 0; }
  .gallery-lightbox { width: 100vw; height: 100vh; border-radius: 0; }
  .gallery-lightbox__nav { width: 42px; height: 42px; }
  .gallery-lightbox__nav--prev { left: 8px; }
  .gallery-lightbox__nav--next { right: 8px; }
}
