/**
 * @file
 * Latest News component styles.
 *
 * Four-column card grid displayed at the bottom of Article pages.
 * Design tokens sourced from the four-column-unified Gutenberg block
 * and Figma spec at node 6502:14438.
 */

/* ==========================================================================
   SECTION
   ========================================================================== */

.latest-news {
  width: 100%;
  padding-top: 4rem;
  padding-bottom: 4rem;
  box-sizing: border-box;
}

/* ==========================================================================
   CONTENT WRAPPER — flex column layout with 40px gap per Figma spec
   ========================================================================== */

.latest-news__content {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ==========================================================================
   INTRO (Header)
   ========================================================================== */

.latest-news__intro {
  width: 100%;
  max-width: 768px;
}

.latest-news__header {
  font-family: 'Gelasio', serif;
  font-weight: 700;
  font-size: 48px;
  line-height: 56px;
  letter-spacing: 0;
  color: #840029;
  margin: 0;
  text-align: left;
}

/* ==========================================================================
   ITEMS GRID — 4 columns, 37px gap per Figma spec
   ========================================================================== */

.latest-news__items-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 37px;
  width: 100%;
}

/* ==========================================================================
   INDIVIDUAL ITEM
   ========================================================================== */

.latest-news__item {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Image — fixed 200px height, object-fit cover per Figma spec */
.latest-news__item-image-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.latest-news__item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   ITEM CONTENT (Title + Description + CTA)
   ========================================================================== */

.latest-news__item-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-grow: 1;
}

/* Item Title — Gelasio Bold 22px per Figma H4 */
.latest-news__item-header {
  font-family: 'Gelasio', serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.39;
  letter-spacing: 0;
  color: #500617;
  margin: 0;
}

/* Item Description — Gelasio Regular 16px per Figma Body Small */
.latest-news__item-description {
  font-family: 'Gelasio', serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.62;
  letter-spacing: 0;
  color: #500617;
  margin: 0;
}

/* ==========================================================================
   BODY LINK CTA — Gotham Bold 16px, gold chevron
   Matches the BodyLink component from Figma (node 723:4453)
   ========================================================================== */

.latest-news__item-cta {
  display: block;
  margin-top: auto;
  padding-top: 4px;
}

.latest-news__item-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  text-decoration: none;
  color: #840029;
  font-family: 'Gotham', sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.18;
  letter-spacing: 0;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.latest-news__item-cta-link:hover {
  color: #500617;
  text-decoration: none;
}

.latest-news__item-cta-text {
  font-family: 'Gotham', sans-serif;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.18;
  letter-spacing: 0;
}

/* Chevron icon */
.latest-news__item-cta-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--btn-item-detail-size, 24px);
  height: var(--btn-item-detail-size, 24px);
  transition: all 0.3s ease;
}

.latest-news__item-cta-chevron svg {
  width: var(--btn-item-detail-size, 24px);
  height: var(--btn-item-detail-size, 24px);
}

.latest-news__item-cta-link:hover .latest-news__item-cta-chevron {
  transform: translateX(4px);
}

.view-all-items-btn {
  --vaib-text-color: #500617;
  --vaib-text-size: 16px;
  --vaib-icon-size: 28px;

  padding-top: 3rem;
  text-align: center;

  @media (min-width: 768.1px) {
    --vaib-text-size: 18px;
    --vaib-icon-size: 36px;
  }

  @media (min-width: 1024.1px) {
    --vaib-text-size: 22px;
    --vaib-icon-size: 56px;
  }
}

.view-all-items-btn-link {
  display: inline-flex;
  gap: .75rem;
  align-items: center;
  text-decoration: none;
  color: var(--vaib-text-color);
  font-family: Gelasio;
  font-size: var(--vaib-text-size);
  font-style: normal;
  font-weight: 700;
  line-height: 139%;

  &:hover {
    .view-all-items-btn-icon {
      transform: translateX(4px);
    }
  }
}

.view-all-items-btn-icon {
  width: var(--vaib-icon-size);
  height: var(--vaib-icon-size);
  transition: all 0.3s ease;

  svg {
    max-width: 100%;
    max-height: 100%;
  }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Desktop — 3 columns */
@media (max-width: 1200px) {
  .latest-news__content {
    gap: 32px;
  }

  .latest-news__header {
    font-size: 42px;
    line-height: 50px;
  }

  .latest-news__items-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }
}

/* Tablet — 2 columns, centered header */
@media (max-width: 1024px) {
  .latest-news__content {
    gap: 28px;
  }

  .latest-news__intro {
    max-width: 100%;
  }

  .latest-news__header {
    font-size: 36px;
    line-height: 44px;
    text-align: center;
  }

  .latest-news__items-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }

  .latest-news__item-header {
    font-size: 20px;
  }
}

/* Mobile Landscape — 1 column */
@media (max-width: 768px) {
  .latest-news {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  .latest-news__content {
    gap: 24px;
  }

  .latest-news__header {
    font-size: 2rem;
    line-height: 1.25;
  }

  .latest-news__items-container {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .latest-news__item-header {
    font-size: 1.25rem;
  }
}

/* Mobile Portrait */
@media (max-width: 567px) {
  .latest-news {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .latest-news__content {
    gap: 20px;
  }

  .latest-news__header {
    font-size: 24px;
    line-height: 1.25;
  }

  .latest-news__item-content {
    gap: 12px;
  }

  .latest-news__item-header {
    font-size: 18px;
  }

  .latest-news__item-cta-text {
    font-size: 14px;
  }
}

/* ==========================================================================
   Curated News Block — Footer / Bottom Content Styling
   ========================================================================== */

.latest-news.curated-news-block {
  padding-bottom: 0 !important;
  margin-bottom: 3rem !important;
}

.curated-news-block .latest-news__content {
  gap: 1.5rem;
}

.curated-news-block .curated-news-block__description {
  font-family: 'Gelasio', serif;
  font-size: 1.125rem;
  line-height: 1.6;
  color: #500617;
  max-width: 800px;
  margin-bottom: 0;
  text-align: left;
}

.curated-news-block .curated-news-block__footer {
  width: 100%;
}

.curated-news-block .curated-news-block__after-description {
  font-family: 'Gelasio', serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.6;
  color: #500617;
  margin-top: 0;
  margin-bottom: 2rem;
  max-width: 60%;
  text-align: left;
}

.curated-news-block .curated-news-block__after-description p {
  margin: 0 0 1em 0;
}

.curated-news-block .curated-news-block__after-description p:last-child {
  margin-bottom: 0;
}

.curated-news-block .curated-news-block__ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 2rem;
  margin-top: 2rem;
  width: 100%;
}

.curated-news-block .curated-news-block__cta-item {
  display: inline-flex;
}

.curated-news-block .curated-news-block__cta-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: none;
  text-decoration: none;
  color: #500617;
  font-family: 'Gelasio', serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.39;
  letter-spacing: 0;
  vertical-align: middle;
  transition: all 0.3s ease;
  cursor: pointer;
}

.curated-news-block .curated-news-block__cta-link:hover {
  gap: 25px;
  color: #B40015;
  text-decoration: none;
}

.curated-news-block .curated-news-block__cta-text {
  font-family: 'Gelasio', serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.39;
  letter-spacing: 0;
  vertical-align: middle;
}

.curated-news-block .curated-news-block__cta-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.curated-news-block .curated-news-block__cta-arrow svg {
  width: 56px;
  height: 56px;
  transition: all 0.3s ease;
}

.curated-news-block .curated-news-block__cta-arrow svg circle {
  stroke: #B40015;
  transition: all 0.3s ease;
}

.curated-news-block .curated-news-block__cta-arrow svg path {
  stroke: #B40015;
  transition: all 0.3s ease;
}

.curated-news-block .curated-news-block__cta-link:hover .curated-news-block__cta-arrow svg circle {
  fill: #B40015;
  stroke: #B40015;
}

.curated-news-block .curated-news-block__cta-link:hover .curated-news-block__cta-arrow svg path {
  stroke: white;
}

/* Responsive Descriptors */
@media (max-width: 1024px) {
  .curated-news-block .curated-news-block__after-description {
    font-size: 18px;
  }
}

@media (max-width: 768px) {
  .curated-news-block .curated-news-block__after-description {
    font-size: 1rem;
    max-width: 100%;
    margin-bottom: 1.5rem;
  }

  .curated-news-block .curated-news-block__ctas {
    flex-direction: column;
    gap: 1.5rem;
  }
}

@media (max-width: 567px) {
  .curated-news-block .curated-news-block__after-description {
    font-size: 14px !important;
    margin-bottom: 1rem;
  }

  .curated-news-block .curated-news-block__cta-text {
    font-size: 18px;
  }

  .curated-news-block .curated-news-block__cta-arrow svg {
    width: 40px;
    height: 40px;
  }
}