/* EECC sermon archive redesign. Enqueued only on /sermons/. Safe to delete with the mu-plugin. */

.eecc-sermons-page {
  --eecc-teal: #1D343E;
  --eecc-teal-dark: #132229;
  --eecc-teal-border: #44646F;
  --eecc-link: #17607A;
  --eecc-link-hover: #119CA6;
  --eecc-paper: #F7FAFA;
  --eecc-heading: #132128;
  --eecc-muted: #5B6B70;
  --eecc-accent: #46BDDB;
  max-width: 974px;
  margin: 0 auto 2.5em;
  padding: 0 8px 1em;
  font-family: "Nunito", "Segoe UI", sans-serif;
  color: #474747;
}

.eecc-sermons-header {
  margin: 0 0 1.5em;
  text-align: center;
}

.eecc-sermons-title {
  margin: 0 0 0.3em;
  color: var(--eecc-heading);
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: 0.01em;
}

.eecc-sermons-intro {
  margin: 0 auto;
  max-width: 36em;
  color: var(--eecc-muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

/* --- Latest sermon feature --- */
.eecc-latest-sermon {
  position: relative;
  margin: 0 0 1.75em;
  padding: 1.5em 1.5em 1.35em;
  background: linear-gradient(180deg, #eef5f6 0%, #ffffff 55%);
  border: 2px solid var(--eecc-teal-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(29, 52, 62, 0.12);
}

.eecc-latest-badge {
  position: absolute;
  top: 0;
  left: 1.25em;
  transform: translateY(-50%);
  display: inline-block;
  padding: 0.2em 0.75em;
  background: var(--eecc-teal-border);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(29, 52, 62, 0.2);
}

.eecc-latest-inner {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.4em;
  align-items: start;
}

.eecc-latest-media img,
.eecc-latest-placeholder {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--eecc-teal-border);
}

.eecc-latest-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.35;
  padding: 1em;
  text-decoration: none;
  box-sizing: border-box;
}

.eecc-latest-placeholder:hover,
.eecc-latest-placeholder:focus {
  color: #fff;
  background: var(--eecc-teal);
}

.eecc-latest-title {
  margin: 0 0 0.55em;
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--eecc-heading);
}

.eecc-latest-title a {
  color: var(--eecc-heading);
  text-decoration: none;
}

.eecc-latest-title a:hover,
.eecc-latest-title a:focus {
  color: var(--eecc-link);
}

.eecc-latest-meta {
  list-style: none;
  margin: 0 0 1em;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em 1.15em;
  color: var(--eecc-muted);
  font-size: 0.95rem;
}

.eecc-latest-meta .eecc-meta-label {
  font-weight: 700;
  color: var(--eecc-teal-border);
  margin-right: 0.2em;
}

.eecc-latest-meta a {
  color: var(--eecc-link);
  text-decoration: none;
}

.eecc-latest-meta a:hover,
.eecc-latest-meta a:focus {
  color: var(--eecc-link-hover);
  text-decoration: underline;
}

.eecc-latest-player {
  margin: 0 0 1em;
}

.eecc-latest-player audio,
.eecc-latest-player .plyr,
.eecc-latest-player .wpfc-sermon-audio-player,
.eecc-latest-video {
  width: 100%;
  max-width: 100%;
}

.eecc-latest-cta {
  display: inline-block;
  padding: 0.55em 1.2em;
  background: var(--eecc-teal-border);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 6px;
  border: 2px solid var(--eecc-teal-border);
}

.eecc-latest-cta:hover,
.eecc-latest-cta:focus {
  background: var(--eecc-teal);
  border-color: var(--eecc-teal);
  color: #fff !important;
}

/* --- Search + filters --- */
.eecc-sermon-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75em 1em;
  align-items: center;
  margin: 0 0 1.5em;
  padding: 1em;
  background: #fff;
  border: 1px solid #d5e0e3;
  border-radius: 8px;
}

.eecc-sermon-search {
  display: flex;
  flex: 1 1 220px;
  gap: 0.4em;
  min-width: 200px;
}

.eecc-sermon-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.5em 0.75em;
  border: 1px solid var(--eecc-teal-border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
}

.eecc-sermon-search input[type="search"]:focus {
  outline: 2px solid var(--eecc-accent);
  outline-offset: 1px;
}

.eecc-sermon-search button {
  padding: 0.5em 0.9em;
  background: var(--eecc-teal);
  color: #fff;
  border: 0;
  border-radius: 6px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.eecc-sermon-search button:hover,
.eecc-sermon-search button:focus {
  background: var(--eecc-teal-border);
}

.eecc-sermon-filters {
  flex: 2 1 420px;
}

.eecc-sermon-filters #wpfc_sermon_sorting {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}

.eecc-sermon-filters #wpfc_sermon_sorting > div {
  display: inline-block;
  flex: 1 1 140px;
}

.eecc-sermon-filters select {
  width: 100%;
  max-width: 100%;
  padding: 0.5em 0.6em;
  border: 1px solid var(--eecc-teal-border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
}

.eecc-search-status {
  margin: -0.75em 0 1.25em;
  color: var(--eecc-muted);
  font-size: 0.95rem;
}

.eecc-search-status a {
  margin-left: 0.5em;
}

/* --- Browse by series --- */
.eecc-series-browse {
  margin: 0 0 2em;
}

.eecc-series-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
  margin: 0 0 0.75em;
}

.eecc-series-heading h2,
.eecc-grid-heading {
  margin: 0 0 0.75em;
  color: var(--eecc-heading);
  font-size: 1.35rem;
  font-weight: 600;
}

.eecc-view-all-series {
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--eecc-link);
  text-decoration: none;
}

.eecc-view-all-series:hover,
.eecc-view-all-series:focus {
  color: var(--eecc-link-hover);
  text-decoration: underline;
}

.eecc-series-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75em;
}

.eecc-series-row {
  grid-template-columns: repeat(4, 1fr);
}

.eecc-series-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 110px;
  padding: 0.85em 0.9em;
  background: var(--eecc-teal-border);
  color: #fff !important;
  text-decoration: none;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(29, 52, 62, 0.12);
}

.eecc-series-card:hover,
.eecc-series-card:focus {
  background: var(--eecc-teal);
  color: #fff !important;
  text-decoration: none;
}

.eecc-series-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.eecc-series-card.has-image .eecc-series-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(29, 52, 62, 0.15) 20%, rgba(29, 52, 62, 0.82) 100%);
}

.eecc-series-name,
.eecc-series-count {
  position: relative;
  z-index: 1;
}

.eecc-series-name {
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.3;
}

.eecc-series-count {
  margin-top: 0.2em;
  font-size: 0.8rem;
  opacity: 0.85;
}

/* --- Sermon card grid --- */
.eecc-sermon-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1em;
  margin: 0 0 1.5em;
}

.eecc-sermon-card {
  margin: 0 !important;
  background: #fff;
  border: 1px solid #d5e0e3;
  border-top: 3px solid var(--eecc-teal-border);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(29, 52, 62, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.eecc-sermon-card:hover,
.eecc-sermon-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(29, 52, 62, 0.12);
  border-top-color: var(--eecc-link);
}

.eecc-card-link {
  display: block;
  height: 100%;
  padding: 1em 1em 1.1em;
  color: inherit;
  text-decoration: none;
  box-sizing: border-box;
}

.eecc-card-title {
  margin: 0 0 0.4em;
  color: var(--eecc-link);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.3;
}

.eecc-card-link:hover .eecc-card-title,
.eecc-card-link:focus .eecc-card-title {
  color: var(--eecc-link-hover);
}

.eecc-card-date {
  margin: 0 0 0.35em;
  color: var(--eecc-muted);
  font-size: 0.88rem;
}

.eecc-card-meta,
.eecc-card-passage {
  margin: 0 0 0.25em;
  color: #474747;
  font-size: 0.9rem;
  line-height: 1.4;
}

.eecc-card-passage {
  color: var(--eecc-teal-border);
  font-style: italic;
}

.eecc-no-results {
  padding: 1.25em;
  background: #fff;
  border: 1px dashed var(--eecc-teal-border);
  border-radius: 8px;
}

.eecc-sermon-pagination {
  margin: 0 0 1em;
  text-align: center;
}

.eecc-sermon-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3em;
}

.eecc-sermon-pagination .page-numbers {
  display: inline-block;
  min-width: 2em;
  padding: 0.35em 0.6em;
  border-radius: 4px;
  text-decoration: none;
}

.eecc-sermon-pagination .page-numbers.current {
  background: var(--eecc-teal-border);
  color: #fff;
}

/* Hide leftover SM/Astra article chrome if any still renders nearby. */
.post-type-archive-wpfc_sermon .eecc-sermons-page article.wpfc-sermon,
.post-type-archive-wpfc_sermon .eecc-sermons-page .wpfc-sermon-inner {
  /* our cards replace the default excerpt layout */
}

/* Astra separate-container: keep our page from inheriting huge article gaps. */
.post-type-archive-wpfc_sermon.ast-separate-container .eecc-sermon-card.hentry,
.post-type-archive-wpfc_sermon .eecc-sermon-card {
  padding: 0;
}

@media (max-width: 900px) {
  .eecc-latest-inner {
    grid-template-columns: 1fr;
  }
  .eecc-latest-media img,
  .eecc-latest-placeholder {
    height: 160px;
  }
  .eecc-series-grid,
  .eecc-series-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .eecc-sermon-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .eecc-sermons-page {
    padding: 0 2px 1em;
  }
  .eecc-sermons-title {
    font-size: 1.65rem;
  }
  .eecc-latest-sermon {
    padding: 1.35em 1em 1.1em;
  }
  .eecc-latest-title {
    font-size: 1.35rem;
  }
  .eecc-sermon-grid {
    grid-template-columns: 1fr;
  }
  .eecc-series-grid,
  .eecc-series-row {
    grid-template-columns: 1fr 1fr;
  }
  .eecc-sermon-toolbar {
    padding: 0.85em;
  }
  .eecc-series-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25em;
  }
}


/* The SM archive wrapper still prints Astra's sidebar (site search). Hide it; this page is no-sidebar. */
.post-type-archive-wpfc_sermon #secondary,
.post-type-archive-wpfc_sermon .widget-area.secondary {
  display: none !important;
}

/* Keep the series heading above the "View all" link on small screens. */
@media (max-width: 600px) {
  .eecc-series-heading h2 { order: 0; }
  .eecc-series-heading .eecc-view-all-series { order: 1; }
}
