/**
 * Impact Stories — Archive + Single styles
 * Enqueued on impact_story archive & single templates
 */

@import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@600;700&display=swap");

:root {
  --is-blue: #005b9e;
  --is-blue-dark: #004578;
  --is-yellow: #fdb913;
  --is-text: #1a1a1a;
  --is-muted: #5a5a5a;
  --is-light: #f5f7fa;
  --is-border: #e5e8ec;
  --is-white: #ffffff;
  --is-heading-font: "Nunito Sans", sans-serif;
}

/* ========== ARCHIVE: Full-width hero ========== */
.is-archive-hero {
  position: relative;
  width: 100%;
  min-height: 400px;
  height: 50vh;
  max-height: 560px;
  background-color: var(--is-blue);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  align-items: center; /* vertically center title */
  justify-content: flex-start;
}

.is-archive-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0, 40, 80, 0.72) 0%,
    rgba(0, 60, 110, 0.4) 45%,
    rgba(0, 0, 0, 0.15) 100%
  );
}
.newsletter-section {
  margin: 48px 0;
}
.is-archive-hero-inner {
  position: relative;
  z-index: 1;
  padding-top: 40px;
  padding-bottom: 40px;
  text-align: left;
}

.is-archive-hero h1 {
  color: var(--is-white);
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
  text-align: left;
}

.is-archive-hero p {
  display: none;
}

/* ========== ARCHIVE: Image + title cards (ILO style) ========== */
.is-posts-section {
  padding: 56px 0 80px;
  background: var(--is-blue);
}

.is-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 24px;
}

.is-post-card {
  display: flex;
  flex-direction: column;
  background: var(--is-white);
  border: 0;
  box-shadow: none;
  overflow: hidden;
}

.is-post-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  background: var(--is-white);
}

.is-post-card-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 0;
  background: var(--is-light);
  margin: 0;
}

.is-post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.is-post-card:hover .is-post-card-media img {
  transform: scale(1.04);
}

.is-post-card-body {
  background: var(--is-white);
  padding: 28px 24px 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--is-border);
  border-top: 0;
}

.is-post-card-body h3 {
  font-family: var(--is-heading-font);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.4;
  margin: 0 0 10px;
  color: var(--is-blue);
}

.is-post-card-link:hover .is-post-card-body h3 {
  color: var(--is-blue-dark);
}

.is-post-card-date {
  display: block;
  font-size: 12px;
  color: var(--is-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 16px;
}

.is-post-card .is-read-more {
  display: inline-block;
  margin-top: auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--is-blue);
  text-decoration: none;
  border-bottom: 2px solid var(--is-yellow);
  padding-bottom: 1px;
}

.is-post-card-link:hover .is-read-more {
  color: var(--is-blue-dark);
}

.is-post-card-cats,
.is-post-card .is-excerpt,
.is-posts-head {
  display: none !important;
}

.is-archive-pagination {
  margin-top: 48px;
  text-align: center;
}

.is-archive-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--is-muted);
}

/* ========== SINGLE: 100vh hero ========== */
.is-single-hero {
  position: relative;
  width: 100%;
  height: 88vh;
  min-height: 88vh;
  background-color: var(--is-blue);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-end;
}

.is-single-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 30, 60, 0.85) 0%,
    rgba(0, 40, 80, 0.35) 45%,
    rgba(0, 0, 0, 0.1) 100%
  );
}

.is-single-hero-inner {
  position: relative;
  z-index: 1;
  padding-top: 0;
  padding-bottom: 120px;
}

.is-single-hero h1 {
  font-family: var(--is-heading-font);
  color: var(--is-white);
  font-size: clamp(1.85rem, 4vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  max-width: 820px;
}

.is-single-hero-date {
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--is-yellow);
  margin: 0;
  font-weight: 600;
}

.is-single-hero-cats {
  margin-bottom: 12px;
}

.is-single-hero-cats a {
  display: inline-block;
  background: var(--is-yellow);
  color: var(--is-text);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 2px;
  text-decoration: none;
  margin-right: 6px;
}

/* Scroll anchor → content */
.is-scroll-down {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 2;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--is-white);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.95;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.is-scroll-down:hover {
  color: var(--is-white);
  opacity: 1;
  transform: translateX(-50%) translateY(3px);
}

.is-scroll-down-icon {
  display: block;
  width: 22px;
  height: 22px;
  border-right: 2px solid var(--is-white);
  border-bottom: 2px solid var(--is-white);
  transform: rotate(45deg);
  /* animation: is-scroll-bounce 1.6s ease-in-out infinite; */
}

.is-scroll-down-text {
  white-space: nowrap;
}

@keyframes is-scroll-bounce {
  0%,
  100% {
    transform: rotate(45deg) translateY(0);
  }
  50% {
    transform: rotate(45deg) translateY(5px);
  }
}

html {
  scroll-behavior: smooth;
}

#is-story-content {
  scroll-margin-top: 20px;
}

/* ========== SINGLE: Content + sidebar ========== */
.is-single-body {
  padding: 56px 0 80px;
  background: var(--is-white);
}

.is-single-row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -16px;
}

.is-single-content {
  width: 75%;
  padding: 0 16px;
  box-sizing: border-box;
}

.is-single-sidebar {
  width: 25%;
  padding: 0 16px;
  box-sizing: border-box;
  position: sticky;
  top: 100px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.is-single-content .entry-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #333;
}

.is-single-content .entry-content p {
  margin-bottom: 1.25em;
}

.is-single-content .entry-content h2,
.is-single-content .entry-content h3 {
  margin: 1.5em 0 0.75em;
  color: var(--is-text);
}

.is-single-content .entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5em 0;
}

.is-single-content .entry-content blockquote {
  margin: 16px 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-style: normal;
}

/* ILO-style pull quote — wrap text in:
   <span class="is-quote">Your quote text here</span>
   or use <blockquote class="is-quote">...</blockquote>
*/
.is-single-content .entry-content .is-quote,
.is-single-content .entry-content span.is-quote,
.is-single-content .entry-content blockquote.is-quote {
  display: block;
  position: relative;
  margin: 2.75em 0 2.5em;
  padding: 1.15em 0 0;
  max-width: 920px;
  border: 0;
  background: transparent;
  font-family: var(--is-heading-font);
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 600;
  font-style: normal;
  line-height: 1.45;
  color: #1a1a1a;
  text-align: left;
}

.is-single-content .entry-content .is-quote::before,
.is-single-content .entry-content span.is-quote::before,
.is-single-content .entry-content blockquote.is-quote::before {
  content: "\201C";
  display: block;
  margin: 0 0 0.15em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.25rem;
  font-weight: 700;
  line-height: 0.8;
  color: #005b9e;
  speak: never;
}

.is-sidebar-box {
  background: var(--is-light);
  border-radius: 8px;
  padding: 24px;
  margin: 0;
}

/* Explicit 48px between meta box and author/share box */
.is-sidebar-meta-box {
  margin-bottom: 48px;
}

.is-sidebar-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--is-blue);
  font-weight: 700;
  margin: 0 0 8px;
}

.is-sidebar-meta {
  font-size: 1rem;
  font-weight: 600;
  color: var(--is-text);
  margin: 0 0 18px;
  line-height: 1.35;
}

.is-sidebar-meta-box .is-sidebar-meta:last-child {
  margin-bottom: 0;
}

.is-sidebar-author {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--is-text);
  margin: 0;
  line-height: 1.3;
}

.is-share-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--is-muted);
  font-weight: 700;
  margin: 20px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--is-border);
}

.is-share-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.is-share-links a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--is-border);
  background: var(--is-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--is-blue);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.is-share-links a:hover {
  background: var(--is-blue);
  border-color: var(--is-blue);
  color: var(--is-white);
}

.is-share-links a.is-share-fb:hover {
  background: #1877f2;
  border-color: #1877f2;
}

.is-share-links a.is-share-x:hover {
  background: #000;
  border-color: #000;
}

.is-share-links a.is-share-ig:hover {
  background: #e4405f;
  border-color: #e4405f;
}

.is-back-link {
  display: inline-block;
  margin-top: 32px;
  font-weight: 600;
  color: var(--is-blue);
  text-decoration: none;
  border-bottom: 2px solid var(--is-yellow);
  padding-bottom: 2px;
}

.is-back-link:hover {
  color: var(--is-blue-dark);
}

/* ========== SINGLE: Related stories carousel ========== */
.is-related-section {
  padding: 56px 0 80px;
  background: var(--is-light);
  border-top: 1px solid var(--is-border);
}

.is-related-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.is-related-head h2 {
  font-family: var(--is-heading-font);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--is-blue);
  margin: 0;
}

.is-related-nav {
  display: flex;
  gap: 8px;
}

.is-related-prev,
.is-related-next {
  width: 40px;
  height: 40px;
  border: 1px solid var(--is-border);
  background: var(--is-white);
  color: var(--is-blue);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.is-related-prev:hover,
.is-related-next:hover {
  background: var(--is-blue);
  border-color: var(--is-blue);
  color: var(--is-white);
}

.is-related-prev.swiper-button-disabled,
.is-related-next.swiper-button-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.is-related-swiper {
  overflow: hidden;
  width: 100%;
}

.is-related-swiper .swiper-slide {
  height: auto;
}

.is-related-card {
  height: 100%;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 991px) {
  .is-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .is-single-content,
  .is-single-sidebar {
    width: 100%;
  }

  .is-single-sidebar {
    margin-top: 40px;
    position: static;
  }

  .is-single-hero {
    height: 85vh;
    min-height: 85vh;
  }
}

@media (max-width: 575px) {
  .is-posts-grid {
    grid-template-columns: 1fr;
  }

  .is-archive-hero {
    min-height: 400px;
    height: 42vh;
  }

  .is-archive-hero-inner {
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .is-single-hero-inner {
    padding-bottom: 100px;
  }

  .is-single-hero {
    height: 100vh;
    min-height: 100vh;
  }

  .is-posts-section,
  .is-single-body {
    padding: 40px 0 56px;
  }
}
