.caltino-proyectos {
  --cp-bg: #f8fbee;
  --cp-surface: #ffffff;
  --cp-primary: #4c5e49;
  --cp-secondary: #685d49;
  --cp-border: #d9ddd3;
  --cp-text: #191d16;
  --cp-muted: #444841;
  --cp-soft: #eef2e6;
  background: var(--cp-bg);
  color: var(--cp-text);
}

/* Astra content wrapper compatibility */
#content > .ast-container > main.caltino-proyectos {
  width: 100%;
  max-width: none;
  flex: 1 1 100%;
}

main.caltino-proyectos .cp-hero,
main.caltino-proyectos .cp-section,
main.caltino-proyectos .cp-cta-section {
  width: 100%;
  max-width: none;
}

.cp-container {
  width: min(1240px, calc(100% - 32px));
  max-width: 1240px;
  margin-inline: auto;
}

.cp-section {
  padding: 4rem 0;
}

.cp-hero {
  position: relative;
  min-height: 70vh;
  display: grid;
  align-items: center;
  overflow: hidden;
}

/* Archivo /proyectos: hero a media altura */
main.caltino-proyectos-archive .cp-hero {
  min-height: 35vh;
}

.cp-hero__bg {
  position: absolute;
  inset: 0;
  width: auto;
  background-color: #8f958d;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.cp-hero__content {
  width: min(1052px, calc(100% - 32px));
  max-width: 1052px;
  margin-inline: auto;
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
  padding: 5rem 0;
}

/* Landing: forzar H1 blanco (Astra puede sobrescribir) */
main.caltino-proyectos-archive .cp-hero__content h1 {
  color: #fff;
}

main.caltino-proyectos #cp-proyectos-grid,
main.caltino-proyectos .cp-cta-box {
  width: min(1240px, calc(100% - 32px));
  max-width: 1240px;
  margin-inline: auto;
}

.cp-hero h1,
.cp-single-hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 1.05;
}

.cp-hero p {
  max-width: 680px;
  margin: 0 auto 1.5rem;
  font-size: 1.1rem;
}

.cp-hero__actions,
.cp-single-cta__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.cp-btn {
  display: inline-block;
  border-radius: 999px;
  padding: 0.8rem 1.4rem;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
}

.cp-btn--primary {
  background: var(--cp-primary);
  color: #fff;
}

.cp-btn--ghost {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* Hovers en hero del archivo */
main.caltino-proyectos-archive .cp-hero__actions .cp-btn--ghost:hover {
  background: #fff;
  border-color: #fff;
  color: var(--cp-primary);
}

main.caltino-proyectos-archive .cp-hero__actions .cp-btn--primary:hover {
  background: #647760;
  color: #fff;
}

.cp-btn--outline {
  border-color: var(--cp-primary);
  color: var(--cp-primary);
}

.cp-filters-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 2rem;
  width: 100%;
}

.cp-filters-head__intro {
  width: 100%;
}

.cp-kicker {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cp-primary);
  margin-bottom: 0.5rem;
}

.cp-filters-head h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
}

.cp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cp-chips--archive-row {
  width: 100%;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
}

.cp-chips--archive-row::-webkit-scrollbar {
  display: none;
}

.cp-chip {
  text-decoration: none;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(76, 94, 73, 0.14);
  background: rgba(76, 94, 73, 0.06);
  color: rgba(25, 29, 22, 0.78);
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.cp-chip:hover {
  background: rgba(76, 94, 73, 0.1);
  color: rgba(25, 29, 22, 0.92);
}

.cp-chip.is-active {
  background: var(--cp-primary);
  color: #fff;
  border-color: rgba(76, 94, 73, 0.4);
}

.cp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
}

/* Archivo: 3 columnas en escritorio (12 ítems = 3×4), responsive */
main.caltino-proyectos-archive .cp-grid.cp-grid--archive-3col {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  main.caltino-proyectos-archive .cp-grid.cp-grid--archive-3col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  main.caltino-proyectos-archive .cp-grid.cp-grid--archive-3col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cp-card {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  padding: 0;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  min-height: 100%;
}

.cp-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
  border-color: rgba(76, 94, 73, 0.35);
}

.cp-card__media {
  position: relative;
  display: block;
  width: 100%;
  height: 320px;
  overflow: hidden;
  background: #f3f4ef;
  text-decoration: none;
}

.cp-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cp-card__media-fallback {
  width: 100%;
  height: 100%;
  display: block;
  background: linear-gradient(135deg, rgba(100, 119, 96, 0.18), rgba(100, 119, 96, 0.06));
}

.cp-card__body {
  margin-top: 0;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.cp-card__title {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.12;
  color: var(--cp-text);
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.cp-card__title-link {
  color: inherit;
  text-decoration: none;
  display: block;
  padding: 0;
  border-radius: 0;
  transition: color 0.18s ease, background 0.18s ease;
}

.cp-card:hover .cp-card__title-link,
.cp-card:focus-within .cp-card__title-link {
  color: var(--cp-primary);
  background: transparent;
}

@media (max-width: 639px) {
  .cp-card__media {
    height: 240px;
  }

  .cp-card__title {
    font-size: 24px;
  }
}

.cp-pagination ul {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.cp-pagination a,
.cp-pagination span {
  display: inline-block;
  min-width: 2.2rem;
  text-align: center;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--cp-border);
  color: var(--cp-secondary);
}

.cp-pagination .current {
  background: var(--cp-primary);
  color: #fff;
  border-color: var(--cp-primary);
}

.cp-cta-section {
  background: #eff3e8;
  padding: 4rem 0;
}

.cp-cta-box h2 {
  margin-top: 0;
}

/* ============================
   SINGLE (nuevo layout)
   ============================ */
main.caltino-proyectos-single {
  background: var(--cp-bg);
}

.cp-single-cover {
  width: 100%;
}

.cp-single-cover__media {
  width: 100%;
  background: #dde3d4;
}

.cp-single-cover__image {
  display: block;
  width: 100%;
  height: clamp(374px, 73.33vh, 827px);
  object-fit: cover;
}

.cp-single-cover__placeholder {
  width: 100%;
  height: clamp(374px, 73.33vh, 827px);
  background: #dde3d4;
}

.cp-single-cover__meta {
  background: var(--cp-surface);
  border-bottom: 1px solid var(--cp-border);
}

.cp-single-cover__meta-inner {
  padding: 1.75rem 0 1.25rem;
}

.cp-single-title {
  margin: 0.75rem 0 0.25rem;
  color: var(--cp-text);
  letter-spacing: -0.02em;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
}

.cp-single-location {
  margin: 0 0 1.25rem;
  color: var(--cp-muted);
  font-weight: 600;
}

.cp-badge {
  color: var(--cp-primary);
  background: rgba(211, 232, 205, 0.7);
  border: 1px solid rgba(76, 94, 73, 0.15);
}

/* Specs: más editorial y consistente */
main.caltino-proyectos-single .cp-specs {
  margin-top: 1.25rem;
  background: #fff;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: none;
  border: 1px solid var(--cp-border);
  padding: 1.25rem;
}

.cp-specs__item span {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cp-muted);
}

.cp-specs__item strong {
  font-size: 1.05rem;
  color: var(--cp-text);
}

.cp-challenge-solution--editorial article {
  background: var(--cp-surface);
  border: 1px solid var(--cp-border);
  border-radius: 5px;
  padding: 1.25rem;
}

.cp-challenge-solution--editorial h2 {
  margin-top: 0.25rem;
}

/* Proceso: imágenes apiladas */
.cp-process__images.cp-process__images--stacked {
  grid-template-columns: 1fr;
}

.cp-process__images.cp-process__images--stacked .cp-process__img {
  height: 220px;
}

@media (min-width: 900px) {
  .cp-process__images.cp-process__images--stacked .cp-process__img {
    height: 210px;
  }
}

/* Galería: grupos visibles a la vez */
.cp-gallery--stacked .cp-gallery__groups {
  display: grid;
  gap: 2.25rem;
}

.cp-chip--static {
  pointer-events: none;
}

.cp-gallery__head {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
  border-radius: 5px;
  padding: 1.25rem 1.25rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
}

.cp-gallery__title {
  margin: 0;
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  letter-spacing: -0.02em;
}

.cp-gallery__subtitle {
  margin: 0.5rem 0 0;
  color: rgba(25, 29, 22, 0.7);
  font-size: 1rem;
  line-height: 1.5;
}

.cp-gallery__group-bar {
  width: 100%;
  border-radius: 5px;
  padding: 0.85rem 1rem;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.92),
    rgba(255, 255, 255, 0)
  );
  border: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 0.9rem;
}

.cp-gallery__group-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(25, 29, 22, 0.75);
}

.cp-gallery__grid.cp-gallery__grid--despues {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.cp-gallery__grid.cp-gallery__grid--pairs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.cp-gallery__media {
  display: block;
  border-radius: 5px;
  overflow: hidden;
  background: #f3f4ef;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
}

.cp-gallery__img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}

.cp-gallery__grid--despues .cp-gallery__img {
  height: clamp(420px, 55vw, 820px);
}

.cp-gallery__grid--pairs .cp-gallery__img {
  height: clamp(200px, 28vw, 360px);
}

/* Resultados: izquierda resultados, derecha testimonio */
.cp-results.cp-results--split {
  padding: 4rem 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

.cp-results__left h2 {
  margin-top: 0.25rem;
}

.cp-results__right {
  display: grid;
  gap: 1rem;
}

.cp-quote {
  margin: 0;
  background: linear-gradient(135deg, rgba(211, 232, 205, 0.35), rgba(255, 255, 255, 0.9));
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-left: 5px solid rgba(76, 94, 73, 0.55);
  padding: 1.35rem 1.35rem;
  border-radius: 5px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.08);
}

.cp-quote p {
  margin: 0 0 0.75rem;
  color: var(--cp-text);
  font-size: 1.05rem;
  line-height: 1.55;
}

.cp-quote cite {
  font-style: normal;
  font-weight: 800;
  color: var(--cp-primary);
}

@media (min-width: 900px) {
  .cp-results.cp-results--split {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
  }
}

.cp-two-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  padding: 4rem 0;
}

.cp-process {
  background: #f1f5ea;
  padding: 4rem 0;
}

.cp-process__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.cp-steps {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.7rem;
}

.cp-steps li {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.cp-steps li span {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #dbe7d2;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cp-primary);
  flex: 0 0 auto;
}

.cp-process__images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.cp-process__img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 5px;
}

.cp-gallery {
  padding: 4rem 0;
}

.cp-gallery__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
}

.cp-results__img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-radius: 5px;
}

.cp-single-cta {
  padding: 2rem 0 4rem;
}

.cp-single-cta__box {
  background: #d9e8cd;
  border-radius: 5px;
  text-align: center;
  padding: 2rem;
}

.cp-empty {
  margin: 1rem 0;
}

@media (min-width: 900px) {
  .cp-process__grid {
    grid-template-columns: 1fr 1fr;
  }
}
