/* News index card-height refinement --------------------------------------
 * Scope: /news/ list page only (TH + EN)
 * Goal: remove unnecessary vertical dead space while preserving content.
 */

/* Large desktop / monitor: match the original card proportion more closely. */
.news-index .news-index__card {
  height: 240px;
}

/* Keep the content compact enough to fit the shorter card comfortably. */
.news-index .news-card__content {
  padding: 20px 18px 16px;
}

.news-index .news-card__summary {
  margin-top: 12px;
  line-height: 1.62;
}

/* Medium desktop / tablet landscape: slightly more room for wrapping. */
@media (max-width: 1100px) {
  .news-index .news-index__card {
    height: 250px;
  }
}

/* Tablet: keep horizontal cards compact instead of expanding to 300px. */
@media (max-width: 900px) {
  .news-index .news-index__card {
    height: 250px;
  }

  .news-index .news-card__content {
    padding: 20px 18px 16px;
  }
}

/* Mobile: content determines height; no forced empty space. */
@media (max-width: 640px) {
  .news-index .news-index__card {
    height: auto;
  }

  .news-index .news-card__content {
    padding: 21px 18px 18px;
  }

  .news-index .news-card__summary {
    margin-top: 12px;
    line-height: 1.65;
  }
}


/* Mobile news-index layout: dropdown + readable card rhythm ---------------- */
.news-index__category-select,
.news-index .news-card__mobile-meta {
  display: none;
}

@media (max-width: 640px) {
  .news-index__section {
    padding-top: 58px;
  }

  .news-index__title {
    font-size: 34px;
    line-height: 1.15;
  }

  /* Desktop/tablet category tabs become a compact dropdown on phones. */
  .news-index__categories {
    display: none;
  }

  .news-index__category-select {
    position: relative;
    display: block;
    width: 100%;
    margin-top: 56px;
  }

  .news-index__category-select label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    margin: -1px;
    padding: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
  }

  .news-index__category-select::after {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 0;
    height: 0;
    border-top: 8px solid var(--color-primary);
    border-right: 6px solid transparent;
    border-left: 6px solid transparent;
    content: "";
    pointer-events: none;
    transform: translateY(-40%);
  }

  .news-index__category-select select {
    width: 100%;
    height: 42px;
    padding: 0 40px 0 14px;
    color: #4d4d4d;
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 4px;
    font-family: var(--font-text);
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    text-align: center;
    text-align-last: center;
    appearance: none;
    -webkit-appearance: none;
  }

  .news-index__category-select select:focus,
  .news-index__category-select select:focus-visible {
    border-color: #dddddd;
    outline: none;
    box-shadow: none;
  }

  .news-index__list {
    gap: 20px;
    margin-top: 16px;
  }

  .news-index .news-index__card {
    height: auto;
  }

  .news-index .news-card__media {
    aspect-ratio: 16 / 9.2;
  }

  .news-index .news-card__content {
    display: flex;
    min-height: 0;
    padding: 25px 16px 17px;
  }

  .news-index .news-card__title {
    font-size: 18px;
    line-height: 1.55;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  /* Mobile gets its own metadata row immediately below the title. */
  .news-index .news-card__mobile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0 7px;
    margin: 14px 0 0;
    color: var(--news-date-color);
    font-family: var(--font-brand);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
  }

  .news-index .news-card__mobile-meta time,
  .news-index .news-card__mobile-meta span {
    color: inherit;
    font: inherit;
  }

  .news-index .news-card__summary {
    margin: 13px 0 0;
    font-size: 15px;
    line-height: 1.72;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  .news-index .news-card__footer {
    display: flex;
    align-items: center;
    margin-top: 20px;
  }

  /* Desktop/tablet date stays in the footer; mobile uses the row above. */
  .news-index .news-card__footer .news-card__date {
    display: none;
  }

  .news-index .news-card__button {
    width: 100%;
    height: 36px;
    margin-left: 0;
    align-self: stretch;
    font-size: 15px;
  }
}

@media (max-width: 420px) {
  .news-index__category-select {
    margin-top: 52px;
  }

  .news-index .news-card__content {
    padding-inline: 15px;
  }
}
