/* CHK Portafolio — galería A+D (2026-09-25). */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,500;9..40,700;9..40,800&display=swap");

:root {
  --chk-azul: #193cff;
  --chk-coral: #ff8566;
  --chk-base: #f9f9f9;
}

/* Page: less air above grid; hide empty slots without featured image */
body.page-id-2302 .entry-content > .wp-block-spacer,
body.page-id-2302 .wp-block-post-content > .wp-block-spacer {
  display: none;
}

body.page-id-2302 .wp-block-post:not(:has(.wp-block-post-featured-image)) {
  display: none !important;
}

body.page-id-2302 .wp-block-query .wp-block-group {
  padding-top: 0 !important;
  padding-bottom: clamp(1.5rem, 4vw, 2.5rem) !important;
}

body.page-id-2302 .chk-folio-intro {
  max-width: 62ch;
  margin: 0 auto clamp(1.25rem, 3vw, 2rem);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: clamp(1rem, 1.15vw, 1.125rem);
  line-height: 1.55;
  color: var(--chk-base);
  text-align: center;
  opacity: 0.92;
}

body.page-id-2302 .wp-block-post-template {
  gap: clamp(1rem, 2.5vw, 1.75rem) !important;
}

/* Card: image + title overlay */
body.page-id-2302 .chk-folio-card,
body.page-id-2302 .wp-block-post > .wp-block-group.chk-folio-card {
  position: relative;
  display: block;
  margin: 0;
  overflow: hidden;
  border-radius: var(--wp--preset--spacing--20, 1rem);
}

body.page-id-2302 .chk-folio-card .wp-block-post-featured-image,
body.page-id-2302 .wp-block-post .wp-block-post-featured-image {
  margin: 0;
  width: 100%;
}

body.page-id-2302 .chk-folio-card .wp-block-post-featured-image img,
body.page-id-2302 .wp-block-post .wp-block-post-featured-image img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border-radius: var(--wp--preset--spacing--20, 1rem);
  transition: transform 0.35s ease, filter 0.35s ease;
}

body.page-id-2302 .chk-folio-card .wp-block-post-title,
body.page-id-2302 .wp-block-post .wp-block-post-title {
  font-family: "DM Sans", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: none;
  margin: 0;
}

body.page-id-2302 .chk-folio-card .wp-block-post-title a,
body.page-id-2302 .wp-block-post .wp-block-post-title a {
  color: var(--chk-base);
  text-decoration: none;
}

/* Desktop: title as overlay on hover / focus */
@media (hover: hover) and (pointer: fine) {
  body.page-id-2302 .chk-folio-card .wp-block-post-title,
  body.page-id-2302 .wp-block-post .wp-block-post-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 1.25rem 1rem 1rem;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    background: linear-gradient(transparent, rgba(25, 60, 255, 0.92) 38%, rgba(25, 60, 255, 0.98));
    border-radius: 0 0 var(--wp--preset--spacing--20, 1rem) var(--wp--preset--spacing--20, 1rem);
    opacity: 0;
    transform: translateY(0.4rem);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
  }

  body.page-id-2302 .chk-folio-card .wp-block-post-title a,
  body.page-id-2302 .wp-block-post .wp-block-post-title a {
    pointer-events: auto;
    color: var(--chk-coral);
  }

  body.page-id-2302 .chk-folio-card:hover .wp-block-post-title,
  body.page-id-2302 .chk-folio-card:focus-within .wp-block-post-title,
  body.page-id-2302 .wp-block-post:hover .wp-block-post-title,
  body.page-id-2302 .wp-block-post:focus-within .wp-block-post-title {
    opacity: 1;
    transform: translateY(0);
  }

  body.page-id-2302 .chk-folio-card:hover img,
  body.page-id-2302 .wp-block-post:hover .wp-block-post-featured-image img {
    transform: scale(1.03);
    filter: brightness(0.88);
  }
}

/* Mobile / touch: title always under image */
@media (hover: none), (pointer: coarse) {
  body.page-id-2302 .chk-folio-card .wp-block-post-title,
  body.page-id-2302 .wp-block-post .wp-block-post-title {
    position: static;
    margin-top: 0.65rem;
    padding: 0 0.15rem;
    font-size: clamp(1.05rem, 4.2vw, 1.25rem);
    background: none;
    opacity: 1;
    transform: none;
  }

  body.page-id-2302 .chk-folio-card .wp-block-post-title a,
  body.page-id-2302 .wp-block-post .wp-block-post-title a {
    color: var(--chk-coral);
  }
}

/* Fallback if no hover media query support: show title under */
@supports not ((hover: hover) and (pointer: fine)) {
  body.page-id-2302 .chk-folio-card .wp-block-post-title,
  body.page-id-2302 .wp-block-post .wp-block-post-title {
    position: static;
    margin-top: 0.65rem;
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    opacity: 1;
  }
  body.page-id-2302 .chk-folio-card .wp-block-post-title a {
    color: var(--chk-coral);
  }
}

/* Tighten page title spacing a bit */
body.page-id-2302 .wp-block-post-title:where(h1),
body.page-id-2302 main h1.wp-block-post-title {
  margin-bottom: 0.75rem;
}
