/*
 * Homepage-only bridge between WordPress block wrappers/dynamic output and the
 * approved static prototype. Enqueue after style.css and only on front page.
 */

.udfo-home .udfo-home-main > *,
.udfo-home .udfo-home-main .wp-block-group > * {
  margin-block-start: 0;
}

.udfo-home .udfo-home-main .wp-block-heading {
  margin-block-start: 0;
}

/* The pattern keeps the prototype's direct SVG children instead of glyphs. */
.udfo-home .quick-card > .udfo-icon,
.udfo-home .home-services-fallback .service-card > .udfo-icon,
.udfo-home .join-illustration {
  display: block;
  flex: 0 0 auto;
}

.udfo-home .quick-card > a,
.udfo-home .home-all-news,
.udfo-home .resources-block .text-link,
.udfo-home .about-block > a,
.udfo-home .join-banner > a {
  text-decoration: none;
}

/* Actualités: keep REST/SSR data while reproducing .news-list/.news-item. */
.udfo-home .udfo-home-news {
  padding: 62px 0;
}

.udfo-home .udfo-home-news .section-head {
  margin-bottom: 25px;
}

.udfo-home .home-all-news svg {
  width: 17px;
  height: 17px;
}

.udfo-home .home-news-feed .udfo-browser-status {
  position: absolute !important;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.udfo-home .home-news-feed .udfo-card-grid,
.udfo-home .home-news-feed .news-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

/* Compatibility with both the theme fallback and UDFO Core compact renderer. */
.udfo-home .home-news-feed .udfo-article-card,
.udfo-home .home-news-feed .news-card,
.udfo-home .home-news-feed .news-item {
  display: grid;
  min-height: 125px;
  overflow: visible;
  grid-template-columns: 205px minmax(0, 1fr);
  align-items: center;
  gap: 25px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.udfo-home .home-news-feed .udfo-article-card > a:first-child,
.udfo-home .home-news-feed .news-card > a:first-child,
.udfo-home .home-news-feed .news-card > img,
.udfo-home .home-news-feed .news-item > img {
  display: block;
  width: 205px;
  height: 125px;
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
}

.udfo-home .home-news-feed .udfo-article-card img,
.udfo-home .home-news-feed .udfo-card-placeholder,
.udfo-home .home-news-feed .news-card img,
.udfo-home .home-news-feed .news-item img {
  width: 205px;
  height: 125px;
  min-height: 0;
  border-radius: 8px;
  object-fit: cover;
}

.udfo-home .home-news-feed article:nth-child(1) img {
  object-position: 72% center;
}

.udfo-home .home-news-feed article:nth-child(2) img {
  object-position: center 70%;
}

.udfo-home .home-news-feed article:nth-child(3) img {
  object-position: 56% center;
}

.udfo-home .home-news-feed .udfo-article-card-body,
.udfo-home .home-news-feed .news-card-body {
  display: flex;
  min-width: 0;
  height: 100%;
  padding: 0;
  flex-direction: column;
  justify-content: center;
}

.udfo-home .home-news-feed .udfo-article-card .article-meta {
  display: contents;
}

.udfo-home .home-news-feed .udfo-article-card .article-meta strong,
.udfo-home .home-news-feed .news-card .eyebrow,
.udfo-home .home-news-feed .news-item .eyebrow {
  order: 1;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  line-height: 1.3;
  text-transform: uppercase;
}

.udfo-home .home-news-feed .udfo-article-card h2,
.udfo-home .home-news-feed .news-card h2,
.udfo-home .home-news-feed .news-card h3,
.udfo-home .home-news-feed .news-item h3 {
  order: 2;
  margin: 4px 0 5px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.udfo-home .home-news-feed .udfo-article-card p,
.udfo-home .home-news-feed .news-card p,
.udfo-home .home-news-feed .news-item p {
  order: 3;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.udfo-home .home-news-feed .udfo-article-card time,
.udfo-home .home-news-feed .news-card time,
.udfo-home .home-news-feed .news-item time {
  display: block;
  order: 4;
  margin-top: 4px;
  color: #9a9ca2;
  font-size: 11px;
}

.udfo-home .home-news-feed .udfo-article-card .text-link {
  display: none;
}

/* Dynamic featured article takes the exact visual role of .featured-news. */
.udfo-home .home-featured-news,
.udfo-home .home-featured-news > .sidebar-card,
.udfo-home .home-featured-news > .featured-news {
  min-width: 0;
  height: 100%;
}

.udfo-home .home-featured-news > .sidebar-card,
.udfo-home .home-featured-news > .featured-news {
  padding: 28px 30px 30px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff7f7 0%, #ffeaec 100%);
  box-shadow: none;
}

.udfo-home .home-featured-news > .sidebar-card > h2,
.udfo-home .home-featured-news > .featured-news > h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
}

.udfo-home .home-featured-news > .sidebar-card > h2::before,
.udfo-home .home-featured-news > .featured-news > h2::before {
  width: 29px;
  height: 29px;
  color: var(--red);
  content: "\f0a1";
  flex: 0 0 29px;
  font-family: "Font Awesome 6 Free";
  font-size: 26px;
  font-weight: 900;
  line-height: 29px;
}

.udfo-home .home-featured-news > .sidebar-card > img,
.udfo-home .home-featured-news > .featured-news > img {
  width: 100%;
  height: auto;
  aspect-ratio: 1.58;
  margin-bottom: 17px;
  border-radius: 8px;
  object-fit: cover;
}

.udfo-home .home-featured-news .article-meta {
  margin: 0;
}

.udfo-home .home-featured-news .article-meta strong,
.udfo-home .home-featured-news .eyebrow {
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.udfo-home .home-featured-news .article-meta time {
  display: none;
}

.udfo-home .home-featured-news h3 {
  margin: 5px 0 13px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
}

.udfo-home .home-featured-news .text-link,
.udfo-home .home-featured-news > .featured-news > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.udfo-home .home-featured-news .udfo-block-placeholder {
  display: grid;
  min-height: 370px;
  padding: 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff7f7 0%, #ffeaec 100%);
  color: var(--muted);
  place-items: center;
  text-align: center;
}

/* Services: CPT cards win; the static cards are an intentional empty-state. */
.udfo-home .home-services-fallback {
  display: none;
}

.udfo-home .home-services-dynamic:has(.udfo-empty) {
  display: none;
}

.udfo-home .home-services-dynamic:has(.udfo-empty) + .home-services-fallback {
  display: grid;
}

.udfo-home .home-services-dynamic .udfo-service-icon {
  width: 55px;
  height: 55px;
  margin: 0 auto 18px;
  color: var(--red);
  font-size: 0;
  text-align: center;
}

.udfo-home .home-services-dynamic .udfo-service-icon::before {
  content: "\f0c0";
  font-family: "Font Awesome 6 Free";
  font-size: 46px;
  font-weight: 900;
  line-height: 55px;
}

.udfo-home .home-services-dynamic .service-card:nth-child(1) .udfo-service-icon {
}

.udfo-home .home-services-dynamic .service-card:nth-child(1) .udfo-service-icon::before { content: "\f24e"; }

.udfo-home .home-services-dynamic .service-card:nth-child(2) .udfo-service-icon {
}

.udfo-home .home-services-dynamic .service-card:nth-child(2) .udfo-service-icon::before { content: "\f15c"; }

.udfo-home .home-services-dynamic .service-card:nth-child(3) .udfo-service-icon {
}

.udfo-home .home-services-dynamic .service-card:nth-child(3) .udfo-service-icon::before { content: "\f0c0"; }

.udfo-home .home-services-dynamic .service-card:nth-child(4) .udfo-service-icon {
}

.udfo-home .home-services-dynamic .service-card:nth-child(4) .udfo-service-icon::before { content: "\f51c"; }

.udfo-home .home-services-dynamic .service-card:nth-child(5) .udfo-service-icon {
}

.udfo-home .home-services-dynamic .service-card:nth-child(5) .udfo-service-icon::before { content: "\f086"; }

.udfo-home .home-services-dynamic .service-card > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 15px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

/* Agenda/resources have complete visual fallbacks without duplicating data. */
.udfo-home .home-agenda-fallback,
.udfo-home .home-resources-fallback {
  display: none;
}

.udfo-home .home-agenda-dynamic:has(.udfo-empty),
.udfo-home .home-resources-dynamic:has(.udfo-empty) {
  display: none;
}

.udfo-home .home-agenda-dynamic:has(.udfo-empty) + .home-agenda-fallback,
.udfo-home .home-resources-dynamic:has(.udfo-empty) + .home-resources-fallback {
  display: grid;
}

.udfo-home .home-info-section .info-grid {
  align-items: stretch;
}

.udfo-home .home-info-column {
  display: flex;
  min-height: 449px;
  flex-direction: column;
  align-self: stretch;
}

.udfo-home .home-info-column > .section-title,
.udfo-home .home-info-column > .section-head {
  flex: 0 0 auto;
}

.udfo-home .home-info-column > :is(.home-agenda-dynamic, .home-agenda-fallback, .home-resources-dynamic, .home-resources-fallback) {
  flex: 1 0 auto;
}

.udfo-home .home-info-section .udfo-browser-status {
  display: none;
}

.udfo-home .home-info-section .event-list,
.udfo-home .home-info-section .resource-list,
.udfo-home .home-info-section [data-feed-results] {
  min-width: 0;
}

.udfo-home .home-info-section .event h3 a {
  color: inherit;
}

.udfo-home .home-info-section .event small .udfo-icon,
.udfo-home .home-info-section .resource-card .udfo-icon {
  flex: 0 0 auto;
}

.udfo-home .about-block .wp-block-image {
  width: 100%;
  padding: 0;
  margin: 0 0 18px;
}

.udfo-home .about-block .wp-block-image img {
  margin-bottom: 0;
}

.udfo-home .about-block > a {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
}

/* CTA: strip block-button wrappers by using the prototype's direct link. */
.udfo-home .join-banner .join-copy {
  min-width: 0;
}

.udfo-home .join-banner > .button--light {
  color: var(--red);
}

.udfo-home .join-banner > .button--light .udfo-icon {
  width: 17px;
  height: 17px;
  font-size: 14px;
}

@media (max-width: 1050px) {
  .udfo-home .home-info-column {
    min-height: 0;
  }

  .udfo-home .home-featured-news > .sidebar-card,
  .udfo-home .home-featured-news > .featured-news {
    height: auto;
  }
}

@media (max-width: 767px) {
  .udfo-home .udfo-home-news {
    padding: 62px 0;
  }

  .udfo-home .home-news-feed .udfo-card-grid,
  .udfo-home .home-news-feed .news-list {
    gap: 27px;
  }

  .udfo-home .home-news-feed .udfo-article-card,
  .udfo-home .home-news-feed .news-card,
  .udfo-home .home-news-feed .news-item {
    min-height: 105px;
    grid-template-columns: 115px minmax(0, 1fr);
    align-items: start;
    gap: 15px;
  }

  .udfo-home .home-news-feed .udfo-article-card > a:first-child,
  .udfo-home .home-news-feed .news-card > a:first-child,
  .udfo-home .home-news-feed .news-card > img,
  .udfo-home .home-news-feed .news-item > img,
  .udfo-home .home-news-feed .udfo-article-card img,
  .udfo-home .home-news-feed .udfo-card-placeholder,
  .udfo-home .home-news-feed .news-card img,
  .udfo-home .home-news-feed .news-item img {
    width: 115px;
    height: 105px;
    min-height: 0;
  }

  .udfo-home .home-news-feed .udfo-article-card-body,
  .udfo-home .home-news-feed .news-card-body {
    justify-content: flex-start;
  }

  .udfo-home .home-news-feed .udfo-article-card h2,
  .udfo-home .home-news-feed .news-card h2,
  .udfo-home .home-news-feed .news-card h3,
  .udfo-home .home-news-feed .news-item h3 {
    margin-top: 3px;
    font-size: 14px;
  }

  .udfo-home .home-news-feed .udfo-article-card p,
  .udfo-home .home-news-feed .news-card p,
  .udfo-home .home-news-feed .news-item p {
    display: none;
  }

  .udfo-home .home-featured-news > .sidebar-card,
  .udfo-home .home-featured-news > .featured-news {
    padding: 24px 22px 26px;
  }

  .udfo-home .home-services-dynamic:has(.udfo-empty) + .home-services-fallback {
    display: flex;
  }

  .udfo-home .home-info-column {
    height: auto;
  }

  .udfo-home .about-block .wp-block-image {
    margin-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .udfo-home .quick-card,
  .udfo-home .event,
  .udfo-home .resource-card {
    transition: none;
  }
}
