/*
 * KamuVizyon responsive media contract.
 * Loaded after style.css so homepage media has one authoritative layout layer.
 */

.home .kv-feature {
  aspect-ratio: 16 / 9;
  min-height: 0;
}

.home .kv-feature__excerpt {
  display: none !important;
}

/* Keep the desktop/tablet headline compact so the artwork remains dominant. */
@media (min-width: 721px) {
  .home .kv-feature__body {
    padding: clamp(16px, 2.2vw, 26px);
  }

  .home .kv-feature__copy {
    margin-top: 7px;
    max-width: 100%;
  }

  .home .kv-feature__title {
    background: rgba(8, 16, 15, .58);
    font-size: clamp(27px, 3vw, 40px);
    line-height: 1.08;
    max-width: min(700px, 86%);
    padding: clamp(9px, 1.1vw, 13px);
    width: fit-content;
  }
}

.home .kv-feature > img,
.home .kv-hero__rail .kv-rail-card img,
.kv-card__media img,
.kv-category-section--mosaic .kv-card__media img {
  background: #edf3f1;
  object-fit: contain !important;
  object-position: center !important;
  padding: 0 !important;
  transform: none !important;
}

.home .kv-hero__rail .kv-rail-card,
.home .kv-hero__rail .kv-rail-card--wide-media {
  min-width: 0;
}

.home .kv-hero__rail .kv-rail-card > a,
.home .kv-hero__rail .kv-rail-card--wide-media > a {
  background: #edf3f1;
}

.home .kv-card,
.home .kv-card__body,
.home .kv-card__title,
.home .kv-card__title a,
.home .kv-rail-card__body,
.home .kv-rail-card__title,
.home .kv-rail-card__title a {
  min-width: 0;
  overflow-wrap: break-word;
}

/* Portrait and compact tablets: true 16:9 rail images above readable text. */
@media (min-width: 721px) and (max-width: 1050px) {
  .home .kv-hero__rail {
    align-items: stretch;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home .kv-hero__rail .kv-rail-card,
  .home .kv-hero__rail .kv-rail-card--wide-media {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 8px;
  }

  .home .kv-hero__rail .kv-rail-card > a,
  .home .kv-hero__rail .kv-rail-card--wide-media > a {
    aspect-ratio: 16 / 9;
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    width: 100% !important;
  }

  .home .kv-hero__rail .kv-rail-card img,
  .home .kv-hero__rail .kv-rail-card--wide-media img {
    height: 100% !important;
    min-height: 0;
    width: 100% !important;
  }

  .home .kv-hero__rail .kv-rail-card__body {
    align-content: start;
    flex: 1;
    padding: 5px 3px 3px;
  }

  .home .kv-hero__rail .kv-rail-card__title {
    font-size: clamp(14px, 2vw, 16px);
    line-height: 1.24;
    -webkit-line-clamp: 4;
  }

  .home .kv-category-section--showcase .kv-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home .kv-category-section--showcase .kv-card:first-child {
    display: grid;
    grid-column: 1 / -1;
    grid-row: auto;
    grid-template-columns: minmax(0, 1.25fr) minmax(240px, .75fr);
  }

  .home .kv-category-section--showcase .kv-card:first-child .kv-card__media {
    align-self: center;
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .home .kv-category-section--showcase .kv-card:not(:first-child) {
    grid-template-columns: 120px minmax(0, 1fr);
  }
}

/* Phones use a dedicated editorial flow: complete lead image, then headline. */
@media (max-width: 720px) {
  .home .kv-feature {
    aspect-ratio: auto;
    background: var(--kv-surface);
    display: grid;
    grid-template-rows: auto auto;
    min-height: 0;
  }

  .home .kv-feature::after {
    display: none;
  }

  .home .kv-feature > img {
    aspect-ratio: 16 / 9;
    display: block;
    height: auto;
    inset: auto;
    position: relative;
    width: 100%;
  }

  .home .kv-feature__body {
    background: var(--kv-showcase-bg);
    bottom: auto;
    color: var(--kv-showcase-text);
    left: auto;
    padding: 15px 14px 16px;
    position: relative;
    right: auto;
  }

  .home .kv-feature__copy {
    margin-top: 7px;
  }

  .home .kv-feature__title {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-size: clamp(24px, 7vw, 29px);
    line-height: 1.12;
    margin: 0;
    padding: 0;
    text-shadow: none;
  }

  .home .kv-feature__excerpt {
    display: none;
  }

  .home .kv-hero__rail .kv-rail-card,
  .home .kv-hero__rail .kv-rail-card--wide-media {
    grid-template-columns: 112px minmax(0, 1fr) !important;
    min-height: 98px;
  }

  .home .kv-hero__rail .kv-rail-card > a,
  .home .kv-hero__rail .kv-rail-card--wide-media > a {
    height: 100%;
    min-height: 86px;
    width: 112px !important;
  }

  .home .kv-hero__rail .kv-rail-card img,
  .home .kv-hero__rail .kv-rail-card--wide-media img {
    height: 100% !important;
    min-height: 0;
    width: 112px !important;
  }

  .home .kv-category-section--showcase .kv-card:first-child .kv-card__media {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .home .kv-category-section--showcase .kv-card:not(:first-child) {
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 104px;
  }

  .home .kv-category-section--showcase .kv-card:not(:first-child) .kv-card__media {
    height: 100%;
    min-height: 0;
  }

  .home .kv-category-section--compact .kv-card__media,
  .home .kv-category-section--compact .kv-card__media > a,
  .home .kv-category-section--compact .kv-card__media img {
    height: 100%;
    min-height: 0;
  }
}

@media (max-width: 380px) {
  .home .kv-hero__rail .kv-rail-card,
  .home .kv-hero__rail .kv-rail-card--wide-media {
    grid-template-columns: 102px minmax(0, 1fr) !important;
  }

  .home .kv-hero__rail .kv-rail-card > a,
  .home .kv-hero__rail .kv-rail-card img,
  .home .kv-hero__rail .kv-rail-card--wide-media > a,
  .home .kv-hero__rail .kv-rail-card--wide-media img {
    width: 102px !important;
  }
}
