/* =========================================================
   SCP HOME V2 - portada editorial
   Requiere site-v2.css cargado previamente.
   ========================================================= */

html, body { background: #fff; }
body { color: var(--scp-text); font-family: var(--scp-font-sans); }

/* ---------- News hero ---------- */
.scp-home-news {
  padding: 22px 0 18px;
  background: #fff;
}

.scp-home-news .container {
  max-width: 1240px;
}

.scp-home-news__hero-row > [class*="col-"] {
  min-height: 438px;
}

.scp-story {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--scp-line);
  border-radius: var(--scp-radius);
  background: #fff;
}

.scp-story--lead {
  position: relative;
  min-height: 438px;
  display: flex;
  align-items: flex-end;
  border: 0;
  background: #dfe8f0;
  box-shadow: var(--scp-shadow);
}

.scp-story__lead-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.scp-story__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(4, 20, 39, 0.02) 20%, rgba(4, 19, 38, 0.72) 70%, rgba(3, 15, 30, 0.94) 100%);
}

.scp-story__lead-content {
  position: relative;
  z-index: 2;
  width: min(94%, 760px);
  padding: 28px 28px 30px;
  color: #fff;
}

.scp-story__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}

.scp-story__meta--light .scp-story__date {
  color: rgba(255,255,255,.94);
}

.scp-story__category {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 5px 10px;
  border-radius: 5px;
  background: var(--scp-navy);
  color: #fff;
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.scp-story__date {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--scp-muted);
  font-size: 0.76rem;
}

.scp-story__lead-title,
.scp-story__pinned-title,
.scp-news-mini h3,
.scp-commitment h2,
.scp-commitment-item h3 {
  font-family: var(--scp-font-serif);
  color: var(--scp-ink);
}

.scp-story__lead-title {
  max-width: 760px;
  margin: 0 0 8px;
  color: #fff;
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.scp-story__lead-excerpt {
  max-width: 720px;
  margin: 0 0 18px;
  color: rgba(255,255,255,.93);
  font-size: 0.98rem;
  line-height: 1.55;
}

.scp-story__button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border-radius: 7px;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease;
}

.scp-story__button--light {
  background: #fff;
  color: var(--scp-navy);
}

.scp-story__button:hover {
  transform: translateY(-1px);
}

.scp-story--pinned {
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(16,39,67,.07);
}

.scp-story__media,
.scp-news-mini__media {
  position: relative;
  display: block;
  overflow: hidden;
  background: #e9eff5;
}

.scp-story--pinned .scp-story__media {
  flex: 0 0 198px;
}

.scp-story__image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 300ms ease;
}

.scp-story__media:hover .scp-story__image,
.scp-news-mini__media:hover img {
  transform: scale(1.025);
}

.scp-story__media .scp-story__category,
.scp-news-mini__media .scp-story__category {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 2;
}

.scp-story__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 18px 19px 17px;
}

.scp-story__pinned-title {
  margin: 8px 0 8px;
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.018em;
}

.scp-story__pinned-title a,
.scp-news-mini h3 a {
  color: inherit;
  text-decoration: none;
}

.scp-story__pinned-title a:hover,
.scp-news-mini h3 a:hover {
  color: var(--scp-blue);
}

.scp-story__pinned-excerpt {
  margin: 0 0 10px;
  color: var(--scp-text);
  font-size: 0.9rem;
  line-height: 1.45;
}

.scp-story__text-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  color: var(--scp-blue);
  font-size: .86rem;
  font-weight: 700;
  text-decoration: none;
}

.scp-story__text-link:hover {
  color: var(--scp-navy-dark);
}

.scp-home-news__grid {
  margin-top: 1px;
}

.scp-news-mini {
  width: 100%;
  min-height: 318px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--scp-line);
  border-radius: var(--scp-radius);
  background: #fff;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.scp-news-mini:hover {
  transform: translateY(-3px);
  border-color: #c6d5e4;
  box-shadow: 0 10px 25px rgba(16,39,67,.08);
}

.scp-news-mini__media {
  height: 145px;
  flex: 0 0 145px;
}

.scp-news-mini__media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 300ms ease;
}

.scp-news-mini__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px 14px 13px;
}

.scp-news-mini h3 {
  margin: 8px 0 7px;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.16;
}

.scp-news-mini p {
  margin: 0 0 12px;
  color: var(--scp-text);
  font-size: .84rem;
  line-height: 1.4;
}

.scp-story--loading {
  min-height: 320px;
  display: grid;
  place-items: center;
  background: linear-gradient(110deg, #edf2f7 8%, #f8fafc 18%, #edf2f7 33%);
  background-size: 200% 100%;
  animation: scp-loading 1.4s linear infinite;
}

.scp-story__placeholder,
.scp-story__error {
  padding: 30px;
  color: var(--scp-muted);
  text-align: center;
}

.scp-story__error {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.scp-story__image--sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@keyframes scp-loading {
  to { background-position-x: -200%; }
}

/* ---------- Commitment strip ---------- */
.scp-commitment {
  margin-top: 4px;
  padding: 29px 0 30px;
  border-top: 1px solid #e5edf4;
  border-bottom: 1px solid #e5edf4;
  background: linear-gradient(180deg, #f8fbfd, #f1f6fa);
}

.scp-commitment .container {
  max-width: 1240px;
}

.scp-commitment__layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  align-items: center;
  gap: 40px;
}

.scp-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--scp-navy);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.scp-commitment__heading h2 {
  position: relative;
  margin: 0;
  padding-bottom: 14px;
  font-size: 1.55rem;
  line-height: 1.08;
}

.scp-commitment__heading h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 3px;
  background: #20a9e0;
}

.scp-commitment__items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.scp-commitment-item {
  min-height: 105px;
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 15px;
  align-items: start;
  padding: 6px 28px;
  border-left: 1px solid #cfdce7;
}

.scp-commitment-item:first-child {
  border-left: 0;
}

.scp-commitment-item__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--scp-navy);
  font-size: 1.8rem;
}

.scp-commitment-item h3 {
  margin: 1px 0 6px;
  color: var(--scp-navy-dark);
  font-family: var(--scp-font-sans);
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.25;
  text-transform: uppercase;
}

.scp-commitment-item p {
  margin: 0;
  color: #647489;
  font-size: .78rem;
  line-height: 1.42;
}

/* Existing sections below the new fold: normalize spacing so the transition is clean. */
.scp-home-profession {
  padding-top: 58px;
}

/* ---------- Homepage responsive ---------- */
@media (max-width: 1199.98px) {
  .scp-commitment__layout { grid-template-columns: 240px 1fr; gap: 25px; }
  .scp-commitment-item { padding-inline: 18px; }
}

@media (max-width: 991.98px) {
  .scp-home-news__hero-row > [class*="col-"] { min-height: auto; }
  .scp-story--lead { min-height: 470px; }
  .scp-story--pinned .scp-story__media { flex-basis: 260px; }
  .scp-commitment__layout { grid-template-columns: 1fr; }
  .scp-commitment__heading { max-width: 430px; }
}

@media (max-width: 767.98px) {
  .scp-home-news .container,
  .scp-commitment .container { width: min(100% - 24px, 1240px); }
  .scp-home-news { padding-top: 12px; }
  .scp-story--lead { min-height: 440px; }
  .scp-story__lead-content { width: 100%; padding: 24px 20px; }
  .scp-story__lead-title { font-size: clamp(1.7rem, 8.5vw, 2.35rem); }
  .scp-story__lead-excerpt { font-size: .9rem; }
  .scp-story--pinned .scp-story__media { flex-basis: 210px; }
  .scp-news-mini { min-height: 0; }
  .scp-news-mini__media { height: 190px; flex-basis: 190px; }
  .scp-commitment { padding: 26px 0; }
  .scp-commitment__items { grid-template-columns: 1fr; }
  .scp-commitment-item,
  .scp-commitment-item:first-child {
    min-height: 0;
    padding: 18px 0;
    border-left: 0;
    border-top: 1px solid #cfdce7;
  }
  .scp-commitment-item:first-child { margin-top: 5px; }
}

@media (max-width: 420px) {
  .scp-story__date { font-size: .7rem; }
  .scp-story__category { font-size: .65rem; }
}

/* =========================================================
   SCP HOME V2 - responsive hardening
   Ajustes específicos para contenido real de WordPress.
   ========================================================= */

.scp-story__lead-title,
.scp-story__pinned-title,
.scp-news-mini h3,
.scp-story__lead-excerpt,
.scp-story__pinned-excerpt,
.scp-news-mini p {
  overflow-wrap: anywhere;
}

/* Tablet horizontal / notebook chico */
@media (max-width: 1199.98px) and (min-width: 992px) {
  .scp-story__lead-title {
    font-size: clamp(1.9rem, 2.7vw, 2.55rem);
  }

  .scp-story__lead-content {
    padding: 24px;
  }

  .scp-story__pinned-title {
    font-size: 1.35rem;
  }

  .scp-story--pinned .scp-story__media {
    flex-basis: 180px;
  }
}

/* Tablet: hero apilado y noticias secundarias en 2 columnas. */
@media (max-width: 991.98px) {
  .scp-home-news {
    padding-top: 18px;
  }

  .scp-home-news__hero-row {
    row-gap: 16px;
  }

  .scp-story--lead {
    min-height: 500px;
  }

  .scp-story__lead-content {
    width: min(100%, 760px);
  }

  .scp-story--pinned {
    display: grid;
    grid-template-columns: minmax(280px, .95fr) minmax(0, 1.05fr);
    min-height: 300px;
  }

  .scp-story--pinned .scp-story__media {
    min-height: 300px;
    height: 100%;
    flex-basis: auto;
  }

  .scp-story--pinned .scp-story__body {
    min-width: 0;
    padding: 24px;
  }

  .scp-story__pinned-title {
    font-size: clamp(1.45rem, 3vw, 1.85rem);
  }

  .scp-home-profession {
    padding: 52px 20px;
  }

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

  .scp-institutional__inner {
    width: min(100%, 1180px);
  }
}

/* Teléfono / tablet vertical */
@media (max-width: 767.98px) {
  .scp-home-news {
    padding: 12px 0 16px;
  }

  .scp-home-news .container,
  .scp-commitment .container {
    width: min(100% - 24px, 1240px);
    padding-inline: 0;
  }

  .scp-story--lead {
    min-height: 510px;
    border-radius: 7px;
  }

  .scp-story__overlay {
    background: linear-gradient(180deg, rgba(4,20,39,.05) 12%, rgba(4,19,38,.68) 58%, rgba(3,15,30,.96) 100%);
  }

  .scp-story__lead-content {
    padding: 24px 20px 22px;
  }

  .scp-story__meta {
    gap: 9px;
    margin-bottom: 9px;
  }

  .scp-story__lead-title {
    margin-bottom: 9px;
    font-size: clamp(1.72rem, 7.8vw, 2.35rem);
    line-height: 1.04;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    overflow: hidden;
  }

  .scp-story__lead-excerpt {
    margin-bottom: 16px;
    font-size: .9rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }

  .scp-story__button {
    min-height: 42px;
    padding: 9px 14px;
  }

  .scp-story--pinned {
    display: flex;
    min-height: 0;
  }

  .scp-story--pinned .scp-story__media {
    width: 100%;
    height: auto;
    min-height: 0;
    flex: none;
    aspect-ratio: 16 / 9;
  }

  .scp-story--pinned .scp-story__body {
    padding: 18px 18px 17px;
  }

  .scp-story__pinned-title {
    margin-top: 8px;
    font-size: clamp(1.35rem, 6vw, 1.7rem);
    line-height: 1.1;
  }

  .scp-story__pinned-excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
  }

  .scp-home-news__grid {
    row-gap: 14px;
  }

  .scp-news-mini {
    min-height: 0;
  }

  .scp-news-mini__media {
    height: auto;
    flex-basis: auto;
    aspect-ratio: 16 / 9;
  }

  .scp-news-mini__body {
    padding: 16px;
  }

  .scp-news-mini h3 {
    font-size: 1.16rem;
    line-height: 1.18;
  }

  .scp-home-profession {
    padding: 46px 16px;
  }

  .scp-home-profession__header {
    margin-bottom: 24px;
  }

  .scp-home-profession__title {
    font-size: 1.75rem;
  }

  .scp-home-profession__intro {
    font-size: .95rem;
    line-height: 1.6;
  }

  .scp-home-profession__grid {
    gap: 16px;
  }

  .scp-institutional {
    padding: 48px 16px;
  }

  .scp-institutional__header {
    margin-bottom: 26px;
  }

  .scp-institutional__title {
    font-size: clamp(1.9rem, 8vw, 2.25rem);
  }

  .scp-institutional__intro {
    margin-top: 16px;
    font-size: .96rem;
    line-height: 1.6;
  }

  .scp-institutional__directory {
    width: 100%;
    overflow: hidden;
  }
}

/* Teléfono estándar */
@media (max-width: 575.98px) {
  .scp-home-profession__grid {
    grid-template-columns: 1fr;
  }

  .scp-home-profession-card {
    padding: 22px 20px;
  }

  .scp-commitment__heading h2 {
    font-size: 1.4rem;
  }

  .scp-commitment-item {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
  }

  .scp-commitment-item__icon {
    width: 40px;
    height: 40px;
    font-size: 1.55rem;
  }

  .scp-institutional__channels li {
    min-width: 0;
  }

  .scp-institutional__channels a,
  .scp-institutional__authorities dd {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* Teléfonos angostos: priorizamos titular e imagen, reducimos ruido. */
@media (max-width: 420px) {
  .scp-home-news .container,
  .scp-commitment .container {
    width: min(100% - 20px, 1240px);
  }

  .scp-story--lead {
    min-height: 480px;
  }

  .scp-story__lead-content {
    padding: 21px 17px 18px;
  }

  .scp-story__lead-title {
    font-size: clamp(1.55rem, 7.7vw, 1.95rem);
    -webkit-line-clamp: 5;
  }

  .scp-story__lead-excerpt {
    font-size: .84rem;
    -webkit-line-clamp: 3;
  }

  .scp-story__date {
    font-size: .69rem;
  }

  .scp-story__category {
    min-height: 24px;
    padding: 4px 8px;
    font-size: .63rem;
  }

  .scp-story__body,
  .scp-story--pinned .scp-story__body,
  .scp-news-mini__body {
    padding-inline: 15px;
  }

  .scp-news-mini h3 {
    font-size: 1.08rem;
  }

  .scp-home-profession,
  .scp-institutional {
    padding-inline: 12px;
  }

  .scp-institutional__panel {
    padding: 22px 17px;
  }
}

@media (max-width: 340px) {
  .scp-story--lead {
    min-height: 455px;
  }

  .scp-story__lead-title {
    font-size: 1.48rem;
  }

  .scp-story__lead-excerpt {
    -webkit-line-clamp: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scp-story__image,
  .scp-news-mini__media img,
  .scp-news-mini,
  .scp-story__button {
    transition: none !important;
  }

  .scp-story--loading {
    animation: none !important;
  }
}
