@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  --color-text: #1a1a1a;
  --color-subtext: #666;
  --color-bg: #ffffff;
  --grid-gap: 0px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  margin: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Top nav (minimal text links) ────────────────── */
.obras-top {
  position: sticky;
  top: 0;
  z-index: 10000;
  background: #fff;
  padding: 22px 24px 10px;
  margin-bottom: 0;
}

.obras-top__inner {
  max-width: 1680px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.obras-top__links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 20px;
  min-width: 0;
}

.obras-top__home {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: #111;
  text-decoration: none;
  letter-spacing: 0.01em;
  margin-right: 4px;
}

.obras-top__home:hover {
  opacity: 0.65;
}

.cat-pill {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  color: #111;
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0.45;
  transition: opacity 0.2s ease;
}

.cat-pill:hover {
  opacity: 0.85;
}

.cat-pill.active {
  opacity: 1;
  font-weight: 600;
}

.obras-top__lang {
  flex-shrink: 0;
  padding-top: 2px;
}

.obras-top__lang .lang-switcher-global {
  display: flex;
  align-items: center;
  gap: 8px;
}

.obras-top__lang .lang-btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 300;
  text-decoration: none;
  color: #111;
  transition: opacity 0.2s ease;
}

.obras-top__lang .lang-sep {
  font-size: 0.9rem;
  font-weight: 300;
  color: #111;
  opacity: 0.45;
  user-select: none;
}

/* ── Container ───────────────────────────────────── */
.container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* ── Gallery (single continuous grid) ────────────── */
.obras-gallery {
  margin: 0;
  padding: 0;
}

.obras-videos {
  margin: 0;
  padding: 0;
}

section[id] {
  scroll-margin-top: 72px;
}

.masonry-item[data-section-anchor] {
  scroll-margin-top: 72px;
}

.section-title {
  display: none !important;
}

/* ── Masonry grid: gapless, 4 columns ───────────── */
.masonry-grid {
  column-count: 4;
  column-gap: 0;
  padding: 0;
  font-size: 0;
  line-height: 0;
}

.masonry-item {
  break-inside: avoid;
  display: block;
  width: 100%;
  position: relative;
  margin: 0;
  padding: 0;
  line-height: 0;
  font-size: 0;
}

.artwork-card {
  position: relative;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: hidden;
  cursor: pointer;
}

.masonry-item.is-visible .artwork-card:hover {
  transform: none;
  box-shadow: none;
}

.artwork-media {
  position: relative;
  overflow: hidden;
  line-height: 0;
  font-size: 0;
  background: #fff;
  margin: 0;
  padding: 0;
}

.artwork-media--pending {
  background: #f0f0f0;
}

@keyframes obras-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.masonry-item.reveal-item {
  opacity: 0;
  transition: opacity 0.6s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.masonry-item.reveal-item.is-visible {
  opacity: 1;
}

.masonry-item.reveal-item img {
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.55s ease, transform 0.7s var(--ease-out);
}

.masonry-item.reveal-item.is-loaded img {
  opacity: 1;
  transform: scale(1);
}

.artwork-media img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  margin: 0;
  padding: 0;
  border: 0;
  vertical-align: top;
  transition: transform 0.55s var(--ease-out);
}

.masonry-item:hover .artwork-media img {
  transform: scale(1.04);
}

.artwork-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 2;
  padding: 5px 10px;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.92);
  color: #444;
  border: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(4px);
}

.artwork-badge--sold {
  color: #8b4513;
}

/* Hover overlay — title + details on mouse over */
.masonry-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.35) 45%,
    transparent 100%
  );
  display: flex;
  justify-content: center;
  align-items: flex-end;
  text-align: center;
  padding: 20px 16px;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.masonry-item:hover .masonry-overlay {
  opacity: 1;
}

.overlay-content {
  transform: translateY(12px);
  transition: transform 0.35s var(--ease-out);
  width: 100%;
}

.masonry-item:hover .overlay-content {
  transform: translateY(0);
}

.overlay-title {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.1rem;
  margin: 0 0 6px;
  font-weight: 400;
  color: #fff;
  line-height: 1.25;
}

.overlay-details {
  font-family: var(--font-body);
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.55;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

.btn-grid-details {
  pointer-events: auto;
  margin-top: 12px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.btn-grid-details:hover {
  background: #fff;
  color: #111;
}

/* ── Video grid ──────────────────────────────────── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  max-width: none;
  margin: 0;
}

.video-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.video-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.video-card__inner {
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: hidden;
}

.video-card.is-visible .video-card__inner:hover {
  transform: none;
  box-shadow: none;
}

.video-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #1a1a1a;
  overflow: hidden;
}

.video-card__player {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #111;
}

.video-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.15) 55%, rgba(0, 0, 0, 0.2) 100%);
  cursor: pointer;
  transition: opacity 0.3s ease, background 0.3s ease;
}

.video-card__play-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  position: relative;
  transition: transform 0.25s ease, background 0.25s ease;
}

.video-card__play-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent #1a1a1a;
}

.video-card__play:hover .video-card__play-icon {
  transform: scale(1.06);
  background: #fff;
}

.video-card.is-playing .video-card__play {
  opacity: 0;
  pointer-events: none;
}

.video-card.is-playing .video-card__player {
  object-fit: contain;
  background: #000;
}

.video-card__title {
  margin: 0;
  padding: 12px 16px 14px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #555;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .section-title,
  .masonry-item.reveal-item,
  .masonry-item.reveal-item img,
  .video-card,
  .artwork-media--pending,
  .artwork-card,
  .artwork-media img,
  .masonry-overlay,
  .overlay-content {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
    animation: none !important;
  }

  section .section-title::after {
    transform: scaleX(1) !important;
  }
}

/* ── Footer ──────────────────────────────────────── */
footer {
  padding: 40px 24px;
  text-align: center;
  border-top: 1px solid #eee;
  margin-top: 40px;
}

footer p {
  font-size: 0.85rem;
  color: #999;
}

/* ── Lightbox ────────────────────────────────────── */
.lightbox-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  inset: 0;
  background: rgba(20, 20, 20, 0.96);
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox-modal.active {
  display: flex;
  opacity: 1;
}

.lightbox-image {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 38px;
  font-weight: 300;
  cursor: pointer;
  z-index: 10001;
  transition: color 0.2s;
}

.lightbox-close:hover {
  color: #ccc;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.4);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  user-select: none;
  transition: background 0.2s;
}

.lightbox-prev {
  left: 30px;
}

.lightbox-next {
  right: 30px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* ── Info Modal ──────────────────────────────────── */
.image-modal {
  display: none;
  position: fixed;
  z-index: 3000;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-modal.active {
  display: flex;
  opacity: 1;
}

/* Hide close-container and top nav when modal open */
body.obras-modal-open .close-container {
  z-index: 1 !important;
  pointer-events: none !important;
  opacity: 0;
}

body.obras-modal-open .obras-top {
  z-index: 1 !important;
  pointer-events: none !important;
  opacity: 0;
  transition: opacity 0.2s;
}

.modal-container {
  display: flex;
  margin: auto;
  background: #fff;
  width: 90%;
  max-width: 1000px;
  height: 80vh;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #000;
  font-size: 40px;
  font-weight: 300;
  cursor: pointer;
  z-index: 3001;
  transition: color 0.3s;
  line-height: 1;
}

.modal-close:hover {
  color: #666;
}

.modal-image-wrapper {
  flex: 1.5;
  background: #f4f4f4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.modal-prev,
.modal-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #111;
  font-size: 22px;
  cursor: pointer;
  z-index: 3001;
  background: rgba(255, 255, 255, 0.8);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  user-select: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: background 0.2s, color 0.2s;
}

.modal-prev {
  left: 16px;
}

.modal-next {
  right: 16px;
}

.modal-prev:hover,
.modal-next:hover {
  background: #111;
  color: #fff;
}

.modal-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Info panel: flex column with scroll + pinned button */
.modal-info-wrapper {
  flex: 1;
  padding: 50px 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: left;
  overflow: hidden;
  min-height: 0;
}

.modal-info-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

.modal-info-scroll::-webkit-scrollbar {
  width: 3px;
}

.modal-info-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 2px;
}

.modal-btn-footer {
  flex-shrink: 0;
  padding-top: 20px;
}

.modal-title {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.9rem;
  margin: 0 0 16px;
  font-weight: 400;
}

.modal-technique,
.modal-dimensions {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: #666;
  margin-bottom: 8px;
  line-height: 1.5;
}

.modal-actions {
  margin-top: 24px;
}

.obras-share {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  flex-wrap: wrap;
}

.obras-share-label {
  font-size: 0.75rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.obras-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #e0e0e0;
  background: transparent;
  color: #666;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.obras-share-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.obras-share-btn:hover {
  background: #f5f5f5;
  color: #111;
  border-color: #ccc;
}

.obras-share-toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #333;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 10002;
  pointer-events: none;
}

.obras-share-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.btn-modal-buy,
.modal-buy-btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  background: #000;
  color: #fff;
  text-transform: uppercase;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-align: center;
  transition: background 0.25s;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
}

.btn-modal-buy:hover,
.modal-buy-btn:hover {
  background: #333;
}

/* ── Responsive columns ──────────────────────────── */
@media (max-width: 1280px) {
  .masonry-grid {
    column-count: 3;
  }

  .video-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ── Mobile / tablet nav: single row, scrollable categories ─ */
@media (max-width: 900px) {
  .obras-top {
    padding: 0;
    border-bottom: 1px solid #ececea;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  }

  .obras-top__inner {
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    position: relative;
    min-height: 50px;
  }

  .obras-top__lang {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    padding: 0 14px 0 24px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #fff 32%);
    padding-top: 0;
  }

  .obras-top__lang .lang-btn,
  .obras-top__lang .lang-sep {
    font-size: 0.82rem;
  }

  .obras-top__links {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    gap: 0;
    width: 100%;
    min-width: 0;
    padding: 14px 72px 14px 16px;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 16px;
    mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
  }

  .obras-top__links::-webkit-scrollbar {
    display: none;
  }

  .obras-top__home {
    flex-shrink: 0;
    scroll-snap-align: start;
    font-size: 0.84rem;
    margin-right: 0;
    padding-right: 14px;
    border-right: 1px solid #e8e8e8;
  }

  .cat-pill {
    flex-shrink: 0;
    scroll-snap-align: start;
    font-size: 0.84rem;
    margin-left: 16px;
  }

  .obras-top__home + .cat-pill {
    margin-left: 14px;
  }

  section[id],
  .masonry-item[data-section-anchor] {
    scroll-margin-top: 56px;
  }

  .section-title {
    padding-left: 16px;
    padding-right: 16px;
  }

  .masonry-grid {
    column-count: 3;
  }

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

@media (max-width: 768px) {
  .masonry-grid {
    column-count: 2 !important;
  }

  .video-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .video-card__play-icon {
    width: 48px;
    height: 48px;
  }

  .video-card__play-icon::after {
    border-width: 8px 0 8px 13px;
  }

  .overlay-title {
    font-size: 0.95rem;
    margin-bottom: 6px;
  }

  .overlay-details {
    font-size: 0.62rem;
    line-height: 1.4;
  }

  .masonry-overlay {
    padding: 12px;
  }

  .image-modal {
    align-items: flex-start;
    padding: 0;
    background: #fff;
  }

  .modal-container {
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
    width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
  }

  .modal-close {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    z-index: 10001;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    color: #000;
    line-height: 1;
  }

  .modal-image-wrapper {
    flex: 0 0 45vh;
    height: 45vh;
    min-height: 0;
    padding: 12px 16px;
    overflow: hidden;
    background: #f5f5f5;
  }

  .modal-image {
    max-height: 100%;
    width: 100%;
    object-fit: contain;
  }

  .modal-info-wrapper {
    flex: 0 0 auto;
    padding: 16px 20px 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 50vh;
    min-height: 0;
  }

  .modal-info-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 0;
    min-height: 0;
  }

  .modal-title {
    font-size: 1.3rem;
    margin-bottom: 6px;
  }

  .modal-technique,
  .modal-dimensions {
    font-size: 0.82rem;
    margin-bottom: 5px;
  }

  .modal-btn-footer {
    flex-shrink: 0;
    padding: 10px 0 14px;
  }

  .btn-modal-buy,
  .modal-buy-btn {
    padding: 14px 20px;
    font-size: 0.82rem;
  }
}