/**
 * Home / section layouts for YourDailyVital redesign.
 */

.av-section {
  padding: 72px 0;
}

.av-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.av-section-head--stack {
  flex-direction: column;
  align-items: flex-start;
  max-width: 760px;
  margin-bottom: 40px;
}

.av-topics__head {
  margin-bottom: 40px;
}

.av-topics__intro {
  min-width: 0;
  max-width: 760px;
}

.av-topics__intro .av-section-title {
  margin-bottom: 10px;
}

.av-topics__intro .av-section-sub {
  margin: 0;
}

.av-topics__view-all {
  flex-shrink: 0;
  white-space: nowrap;
}

.av-section-title {
  font-size: clamp(1.75rem, 2.4vw, 2.25rem);
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--ink);
}

.av-section-sub {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 46rem;
}

.av-btn--sm {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 15px;
}

.av-card__body .av-btn:hover,
.av-section-head .av-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(17, 97, 73, 0.28);
}

.av-media-fallback {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 120px;
  background: linear-gradient(135deg, #dfe8e3, #c5d5cc);
}

/* Hero: featured + 3 */
.av-hero {
  padding-top: 40px;
  padding-bottom: 48px;
}

.av-hero__feature {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 36px;
}

.av-hero__media {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 11;
  background: var(--bg-soft);
}

.av-hero__media img {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  display: block;
}

.av-hero__title {
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  margin: 0 0 16px;
}

.av-hero__title a {
  color: inherit;
}

.av-hero__title a:hover {
  color: var(--brand);
}

.av-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
}

.av-hero__cat {
  color: var(--brand);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}

.av-hero__sep {
  color: #cbd5e1;
}

.av-hero__date {
  color: var(--muted);
}

.av-hero__meta--sm {
  margin: 0 0 6px;
  font-size: 12px;
}

.av-hero__meta--sm .av-hero__cat {
  font-size: 11px;
}

.av-hero__excerpt {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.65;
}

.av-hero__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.av-hero__item {
  display: flex;
  align-items: center;
  gap: 16px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.av-hero__thumb {
  flex: 0 0 152px;
  width: 152px;
  height: 116px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-soft);
}

.av-hero__thumb img {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  display: block;
}

.av-hero__item-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.av-hero__item-title {
  display: block;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}

/* Blog cards grid */
.av-posts__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.av-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.av-card__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--bg-soft);
  margin: 0;
  border-radius: 0;
}

.av-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.av-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 22px 24px;
}

.av-card__title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 12px;
}

.av-card__title a {
  color: inherit;
}

.av-card__title a:hover {
  color: var(--brand);
}

.av-card__excerpt {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.av-card__meta {
  margin: 0 0 18px;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
}

.av-card__sep {
  margin: 0 6px;
}

.av-card__body .av-btn {
  margin-top: auto;
  align-self: flex-start;
}

/* Categories / topics */
.av-topics {
  background: var(--bg-soft);
}

.av-topics__list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.av-topics__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.av-topics__row:last-child {
  border-bottom: 0;
}

.av-topics__copy {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.av-topics__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  font-weight: 700;
  font-size: 14px;
  border: 1px solid rgba(17, 97, 73, 0.18);
}

.av-topics__title {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.av-topics__title a:hover {
  color: var(--brand);
}

.av-topics__desc {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.av-topics__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.av-topics__links a {
  color: #116149;
  font-size: 14px;
  font-weight: 500;
}

.av-topics__links a:hover {
  color: var(--brand);
}

.av-topics__cat-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 16px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
}

.av-topics__cat-btn:hover {
  background: var(--brand-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(17, 97, 73, 0.28);
  text-decoration: none;
}

.av-topics__media {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #fff;
}

.av-topics__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* FAQ */
.av-faq__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 48px;
  align-items: start;
}

.av-faq__intro {
  position: sticky;
  top: calc(var(--sticky-header-offset, 72px) + 24px);
  align-self: start;
}

.av-faq__item {
  border-bottom: 1px solid var(--line);
}

.av-faq__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border: 0;
  background: transparent;
  text-align: left;
  font-family: var(--font);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.av-faq__icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  color: var(--brand);
  transition: transform 0.35s ease;
}

.av-faq__item.is-open .av-faq__icon {
  transform: rotate(45deg);
}

.av-faq__a {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.35s ease, opacity 0.28s ease;
}

.av-faq__item.is-open .av-faq__a {
  grid-template-rows: 1fr;
  opacity: 1;
}

.av-faq__a>p {
  overflow: hidden;
  min-height: 0;
  margin: 0;
  padding: 0 40px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  transition: padding-bottom 0.35s ease;
}

.av-faq__item.is-open .av-faq__a>p {
  padding-bottom: 18px;
}

@media (prefers-reduced-motion: reduce) {

  .av-faq__a,
  .av-faq__a>p,
  .av-faq__icon {
    transition: none;
  }
}

/* Footer brand green */
footer.site {
  background: var(--brand) !important;
  color: #fff;
}

footer.site a {
  color: rgba(255, 255, 255, 0.9);
}

footer.site a:hover {
  color: #fff;
}

footer.site h5,
footer.site .logo,
footer.site .wp-av-footer-tagline,
footer.site .footer-bottom {
  color: #fff;
}

/* Header mobile full-height menu */
@media (max-width: 1024px) {
  header.site.wp-av-site-header.is-menu-open #site-primary-nav {
    position: fixed;
    top: var(--av-nav-top, var(--sticky-header-offset));
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(100dvh - var(--av-nav-top, var(--sticky-header-offset)));
    max-height: calc(100dvh - var(--av-nav-top, var(--sticky-header-offset)));
    overflow-y: auto;
    background: #fff;
    z-index: 999;
    padding: 16px var(--gutter) 32px;
  }

  .av-hero__feature,
  .av-faq__grid,
  .av-topics__row {
    grid-template-columns: 1fr;
  }

  .av-faq__intro {
    position: static;
    top: auto;
  }

  .av-hero__list,
  .av-posts__grid {
    grid-template-columns: 1fr;
  }

  .av-section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .av-topics__media {
    max-width: 420px;
  }
}

@media (max-width: 720px) {
  :root {
    --gutter: 20px;
  }

  .av-section {
    padding: 20px 0;
  }

  .av-hero__list {
    gap: 18px;
  }

  .av-hero__item {
    flex-direction: column;
  }

  .av-hero__thumb {
    flex: unset;
    width: 100%;
    height: 100%;
  }

  .av-faq__grid {
    gap: 25px;
  }

}