/* ==========================================================================
   Yiran homepage faq-news module
   Extracted from yiran-home.css for safer long-term maintenance
   ========================================================================== */

/* =========================================================================
   FAQ — minimal hairline accordion
   ========================================================================= */
.yr-faq-cols { gap: clamp(36px, 5vw, 80px); align-items: flex-start; }
.yr-faq-aside { position: sticky; top: 40px; }
.yr-faq-item { border-bottom: 1px solid var(--yr-line); }
.yr-faq-item summary {
  position: relative;
  display: block;
  list-style: none;
  cursor: pointer;
  padding: 24px 44px 24px 0;
  font-family: var(--wp--preset--font-family--montserrat), sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--yr-heading);
}
.yr-faq-item summary::-webkit-details-marker { display: none; }
.yr-faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 22px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 400;
  color: var(--yr-accent);
  border: 1px solid var(--yr-line);
  border-radius: 50%;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.yr-faq-item summary:hover::after {
  border-color: var(--yr-accent);
  background: color-mix(in srgb, var(--yr-accent) 8%, transparent);
}
.yr-faq-item[open] summary::after { content: "\2212"; background: var(--yr-accent); color: #fff; border-color: var(--yr-accent); }
.yr-faq-item[open] summary:hover::after { background: var(--yr-accent-2, #5a8cf0); border-color: var(--yr-accent-2, #5a8cf0); }
.yr-faq-item p { margin: 0; padding: 0 44px 26px 0; font-size: 15px; line-height: 1.8; color: var(--yr-text); }

/* =========================================================================
   NEWS — four-column editorial cards with a reference-style heading action
   ========================================================================= */
body.home .yr-section.yr-news {
  --yr-news-card-surface: color-mix(in srgb, var(--yr-heading) 3%, var(--yr-paper));
  padding-block: clamp(56px, 4vw, 64px);
  padding-inline: clamp(24px, 4.8vw, 70px);
  background: var(--yr-paper) !important;
}

.yr-news-head,
.yr-home-news-grid {
  width: min(100%, 1680px) !important;
  max-width: 1680px !important;
  margin-inline: auto !important;
}

.yr-news-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 40px;
}

.yr-news-head .yr-h2 {
  max-width: none;
  margin: 0;
  font-size: var(--yr-section-title-size);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.025em;
  text-align: left;
}

.yr-news-discover {
  box-sizing: border-box;
  display: inline-flex;
  min-width: max-content;
  min-height: 49px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border: 2px solid color-mix(in srgb, var(--yr-accent) 40%, transparent);
  border-radius: 40px;
  background: transparent;
  color: var(--yr-accent);
  font-family: var(--wp--preset--font-family--montserrat), sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.yr-news-discover svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.22s ease;
}

.yr-news-discover:hover,
.yr-news-discover:focus-visible {
  border-color: var(--yr-accent);
  background: var(--yr-accent);
  color: var(--yr-button-text, #fff);
  outline: none;
  transform: translateY(-1px);
}

.yr-news-discover:hover svg,
.yr-news-discover:focus-visible svg {
  transform: translate(2px, -2px);
}

.yr-home-news-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 1.8vw, 28px);
  align-items: stretch;
}

.yr-news-reference-card {
  display: flex;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  flex-direction: column;
  border-radius: 10px;
  background: var(--yr-news-card-surface, var(--yr-paper-2));
  color: var(--yr-text);
}

.yr-news-reference-media {
  position: relative;
  display: block;
  overflow: hidden;
  flex: 0 0 auto;
  aspect-ratio: 3 / 2;
  background: var(--yr-card-media-bg, var(--yr-paper-3));
}

.yr-news-reference-media img,
.yr-news-reference-media .yr-image-placeholder,
.yr-news-reference-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  transition: transform 0.3s linear;
}

.yr-news-reference-media .yr-image-placeholder,
.yr-news-reference-placeholder {
  border-radius: 0;
  background: linear-gradient(135deg, var(--yr-paper-3), var(--yr-paper));
}

.yr-news-reference-info {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  padding: 40px 20px 30px;
  background: var(--yr-news-card-surface, var(--yr-paper-2));
}

.yr-news-reference-date {
  position: absolute;
  top: -45px;
  left: 20px;
  display: flex;
  width: 75px;
  height: 70px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-radius: 5px;
  background: var(--yr-accent);
  color: var(--yr-button-text, #fff);
  font-family: var(--wp--preset--font-family--montserrat), sans-serif;
  font-style: normal;
  line-height: 1;
}

.yr-news-reference-date strong {
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
}

.yr-news-reference-date span {
  margin-top: 5px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
}

.yr-news-reference-title {
  display: -webkit-box;
  min-height: 2.8em;
  margin: 0;
  overflow: hidden;
  color: var(--yr-heading);
  font-size: clamp(19px, 1.5vw, 22px);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.018em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.yr-news-reference-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease;
}

.yr-news-reference-excerpt {
  display: -webkit-box;
  min-height: 3.2em;
  margin: 15px 0;
  overflow: hidden;
  color: var(--yr-muted);
  font-size: 16px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.yr-news-reference-more {
  display: inline-flex;
  min-height: 46px;
  margin-top: auto;
  align-items: center;
  color: var(--yr-accent);
  font-family: var(--wp--preset--font-family--montserrat), sans-serif;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.yr-news-reference-arrow {
  position: relative;
  display: inline-flex;
  width: 30px;
  height: 30px;
  margin-left: 20px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--yr-accent);
  border-radius: 50%;
  background: var(--yr-paper);
  color: var(--yr-accent);
  line-height: 1;
  transition: transform 0.2s linear, background 0.2s linear, border-color 0.2s linear;
}

.yr-news-reference-arrow::before,
.yr-news-reference-arrow::after {
  content: "";
  position: absolute;
}

.yr-news-reference-arrow::before {
  width: 10px;
  height: 1px;
  background: currentColor;
}

.yr-news-reference-arrow::after {
  width: 5px;
  height: 5px;
  margin-left: 4px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.yr-news-reference-card:hover .yr-news-reference-media img,
.yr-news-reference-card:focus-within .yr-news-reference-media img,
.yr-news-reference-card:hover .yr-news-reference-media .yr-image-placeholder,
.yr-news-reference-card:focus-within .yr-news-reference-media .yr-image-placeholder {
  transform: scale(1.045);
}

.yr-news-reference-title a:hover,
.yr-news-reference-title a:focus-visible,
.yr-news-reference-more:hover,
.yr-news-reference-more:focus-visible {
  color: var(--yr-accent-hover, var(--yr-accent));
  outline: none;
}

.yr-news-reference-more:hover .yr-news-reference-arrow,
.yr-news-reference-more:focus-visible .yr-news-reference-arrow {
  transform: translateX(4px);
  background: var(--yr-accent);
  border-color: var(--yr-accent);
  color: var(--yr-button-text, #fff);
}

@media (max-width: 1024px) and (min-width: 681px) {
  .yr-home-news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .yr-news-reference-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    width: calc(50% - 10px);
  }
}

@media (max-width: 900px) {
  .yr-faq-aside {
    position: static;
  }
}

@media (max-width: 781px) {
  .yr-home-news-grid {
    grid-template-columns: 1fr !important;
  }

  .yr-news-reference-card:last-child:nth-child(odd) {
    grid-column: auto;
    width: auto;
  }

  .yr-news-head .yr-h2 {
    font-size: var(--yr-section-title-size);
  }

  .yr-news-head {
    align-items: flex-start;
    margin-bottom: 30px;
  }

  .yr-news-discover {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 12px;
  }

  .yr-news-reference-info {
    padding: 38px 20px 26px;
  }

  .yr-faq-cols {
    flex-wrap: wrap !important;
  }

  .yr-faq-cols > .wp-block-column {
    flex-basis: 100% !important;
  }
}

@media (max-width: 560px) {
  .yr-news-head {
    flex-direction: column;
    gap: 18px;
  }
}
