/* landing/_home_fragment.html — divintech.es home: full-width banner with
   the project name, then the three latest news as cards. The photo banner
   becomes a brand gradient (white text stays >= 5.7:1 on every stop of it). */

.home-hero {
  padding: var(--space-4) var(--space-3);
  background: linear-gradient(
    120deg,
    var(--color-main) 0%,
    var(--color-main-hover) 55%,
    var(--color-accent-text) 100%
  );
  color: var(--color-on-main);
  text-align: center;
}

.home-hero__inner {
  max-width: var(--page-width);
  margin-inline: auto;
}

.home-hero__title {
  margin: 0;
  font-size: clamp(2.25rem, 1.5rem + 3vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.home-hero__subtitle {
  margin: 0.5rem 0 0;
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.5rem);
}

/* --- Shortcuts: "Descripción" / "Objetivos" ---------------------------------------- */
.home-cards {
  display: grid;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
}

@media (min-width: 36rem) {
  .home-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* divintech.es' cream / gold pair becomes a light / stronger teal one. */
.home-card {
  --card-radius: calc(var(--radius) * 1.5);

  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-3);
  border-radius: var(--card-radius);
  background: var(--color-accent-soft);
  box-shadow: var(--shadow-card);
}

.home-card--strong {
  background: var(--color-accent-muted);
}

.home-card__title {
  margin: 0;
  font-size: clamp(1.4rem, 1.2rem + 0.75vw, 1.75rem);
  line-height: 1.3;
  text-align: center;
}

.home-card__link {
  color: var(--color-main);
  text-decoration: none;
}

.home-card:hover .home-card__link {
  text-decoration: underline;
}

/* flex: 1 pushes "+ info" to the bottom, so both cards line it up. */
.home-card__text {
  flex: 1;
  margin: var(--space-2) 0;
  color: var(--color-text);
}

.home-card__more {
  align-self: flex-end;
  color: var(--color-main);
  font-weight: 600;
}

.home-card:hover .home-card__more {
  text-decoration: underline;
}

/* Stretched link, focus ring around the whole card (as in .home-news-card). */
.home-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
}

.home-card__link:focus-visible {
  outline: none;
}

.home-card__link:focus-visible::after {
  outline: 3px solid var(--color-main);
  outline-offset: 3px;
}

/* --- "Últimas noticias" ------------------------------------------------------------ */
.home-news__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: var(--space-3);
}

.home-news__title {
  margin: 0;
  color: var(--color-main);
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
}

/* The teal bar of the section headings. */
.home-news__title::after {
  content: "";
  display: block;
  width: 3rem;
  height: 4px;
  margin-top: 0.75rem;
  border-radius: 2px;
  background: var(--color-accent);
}

.home-news__all {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-size);
  font-weight: 600;
}

/* One column on phones, three side by side from tablet width. */
.home-news__cards {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 48rem) {
  .home-news__cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* No overflow: hidden here: it would clip the focus ring drawn around the card. */
.home-news-card {
  --card-radius: calc(var(--radius) * 1.5);

  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--card-radius);
  background: var(--color-main-soft);
  box-shadow: var(--shadow-card);
}

/* Photo (or, without one, a tinted block of the same size) on top: the
   cards of a row keep their text aligned. */
.home-news-card__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--card-radius) var(--card-radius) 0 0;
  object-fit: cover;
}

.home-news-card__image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-main-wash);
  color: var(--color-main-tint);
}

.home-news-card__image--placeholder .icon {
  width: 3rem;
  height: 3rem;
}

.home-news-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: var(--space-2) var(--space-3) var(--space-3);
}

.home-news-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  line-height: 1.3;
}

.home-news-card__link {
  color: var(--color-text);
  text-decoration: none;
}

.home-news-card:hover .home-news-card__link {
  color: var(--color-main);
  text-decoration: underline;
}

/* Stretched link: the whole card is clickable, but it's still one named
   link for keyboard and screen-reader users. */
.home-news-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
}

/* The ring is drawn on the stretched ::after, i.e. around the whole card. */
.home-news-card__link:focus-visible {
  outline: none;
}

.home-news-card__link:focus-visible::after {
  outline: 3px solid var(--color-main);
  outline-offset: 3px;
}

.home-news-card__date {
  margin: 0 0 0.5rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* A brief description: three lines at most. */
.home-news-card__summary {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}
