/* News Page Styles extracted from inline <style> */
:root {
  --news-purple: #6c4ec4;
  --news-purple-dark: #5a3ca7;
  --news-gray: #e6e0f5;
  --news-text: #1f1f1f;
}

.news-page {
  position: relative;
}
/* give space below the site header so content doesn't sit flush against it */
.news-page {
  padding-top: 110px;
}
.news-container {
  max-width: none;
  margin: 0 135px;
  padding: 32px 0 96px;
}

/* Keep news header/footer alignment consistent with site header wrapper.
   Provide responsive fallback for smaller screens. */
@media (max-width: 992px) {
  .news-container {
    margin: 0 20px;
    padding: 24px 12px 64px;
  }
}
.news-section {
  margin-bottom: 72px;
}

/* Constrain the featured articles section (first section) to match the grid width */
.news-container > .news-section:first-child {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 72px;
}
.news-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.news-header h2 {
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--news-purple);
  font-size: 48px;
  margin: 0;
}
.news-more {
  position: relative;
  color: var(--news-purple);
  text-decoration: none;
  font-weight: 400;
  padding-right: 56px;
}
.news-more:after {
  content: "";
  position: absolute;
  /* keep the icon inside the content wrapper instead of nudging outside
		   previous value used a negative right offset which pushed the arrow
		   too far toward the viewport edge. Use a small positive offset so the
		   arrow aligns with the inner edge (similar visual offset as the
		   header burger). */
  right: 12px;
  top: 50%;
  width: 30px;
  height: 30px;
  display: inline-block; /* ensure pseudo is rendered */
  z-index: 2;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transform: translateY(-50%);
  /* Prefer absolute public path (leading slash) so browser can resolve from site root */
  background-image: url("/cfind/source/thumb/images/more-button.svg");
}

/* Fallback: if SVG fails to load, show a subtle line so layout still indicates more */
.news-more:after[style="background-image: none"] {
  background-color: transparent;
}

/* Card rows */
.cards {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 40px 20px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  align-items: center;
  /* center card rows by default so card groups appear centered on the page */
  justify-content: center;
  position: relative;
  /* Hide the native horizontal scrollbar while keeping scrolling functional */
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
  width: 100%;
  box-sizing: border-box;
}
.cards.no-snap {
  scroll-snap-type: none;
}
.cards.no-smooth {
  scroll-behavior: auto !important;
}
.cards::-webkit-scrollbar {
  display: none;
  height: 0;
}

.cards .card {
  flex-shrink: 0;
  scroll-snap-align: center;
  transition: transform 0.4s ease, opacity 0.4s ease, box-shadow 0.4s ease;
  cursor: pointer;
}

.card figure {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.4s ease;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card figcaption {
  padding: 10px 2px;
  text-align: center;
}
.card strong {
  display: block;
  font-size: 13px;
  color: #363636;
  font-weight: 600;
}
.card small {
  display: block;
  font-size: 11px;
  color: #8a8a8a;
  margin-top: 2px;
}

/* Blog cards specific sizing and layout */
.cards-blog .card {
  width: 310px;
  max-width: 100%;
}
.cards-blog .card figure {
  height: 243px;
}
.cards-blog .card figcaption {
  text-align: left;
  padding: 8px 6px;
}

/* Placeholder container shown when a category has no articles.
   Renders a full-width, low-opacity centered message instead of
   a single card so the category area stays visible and communicates
   that there are currently no articles. */
.cards .cards-empty {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 243px; /* match blog card height for visual balance */
  box-sizing: border-box;
  padding: 10px 18px;
  pointer-events: none; /* purely informational */
}
.cards .cards-empty__text {
  color: rgba(31, 31, 31, 0.28); /* light opacity text */
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.2px;
}

/* Ensure Blog and Press rows start from the content edge so the
   first card is never partially clipped. The site-wide .cards uses
   centered alignment by default (looks nice for smaller groups),
   but for horizontally scrollable lists we want a left-start flow. */
.cards-blog {
  justify-content: flex-start;
  /* keep a small internal padding so cards don't touch the container edge */
  padding-left: 16px;
}

/* Featured Article layout - horizontal scrollable row, width matches news-grid */
.cards-featured {
  justify-content: flex-start;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 32px 0;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.cards-featured .card {
  flex: 0 0 auto;
  width: 270px;
  opacity: 1;
  transform: none;
  text-decoration: none;
  scroll-snap-align: start;
}

.cards-featured .card figure {
  height: 200px;
  border-radius: 10px;
}

.cards-featured .card figcaption {
  text-align: left;
  padding: 14px 4px 0;
}

.cards-featured .card strong {
  font-size: 14px;
  font-weight: 600;
  color: #363636;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.cards-featured .card small {
  font-size: 12px;
  color: #8a8a8a;
  margin-top: 6px;
}

.cards-featured .card:hover {
  transform: translateY(-4px);
}

/* Divider */
.section-divider {
  position: relative;
  height: 22px;
  margin-top: 16px;
}
.section-divider:before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 10px;
  height: 2px;
  background: gray;
}
/* Featured section divider: scrollbar-style thumb */
.cards-featured + .section-divider i {
  left: 0;
  transform: translateX(var(--thumbX, 0px));
  width: var(--thumbW, 80px);
  opacity: 1;
  transition: transform 150ms ease;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}

.cards-featured + .section-divider i.is-full {
  width: 100% !important;
  transform: translateX(0) !important;
  cursor: default;
}

.cards-featured + .section-divider i.is-dragging {
  cursor: grabbing;
}

/* Generic divider thumb (for other sections) */
.section-divider i {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 350px;
  height: 6px;
  background: var(--news-purple-dark);
  transform: translateX(
    calc(-50% + var(--dividerBase, 0px) + var(--dividerPhase, 0px))
  );
  transition: transform 650ms ease, opacity 650ms ease;
  will-change: transform, opacity;
  opacity: 0;
  pointer-events: none;
}

.section-divider i.is-visible {
  opacity: 1;
}

.section-divider i.is-exiting {
  transition: transform 650ms ease, opacity 650ms ease;
}

/* Responsive */
@media (max-width: 640px) {
  .news-page {
    padding-top: 80px;
  }
  .news-header h2 {
    font-size: 28px;
  }

  .cards {
    gap: 16px;
    padding: 20px 10px;
  }

  /* reduce left inset on narrow screens but keep start-aligned */
  .cards-blog {
    padding-left: 12px;
  }

  .cards-featured {
    gap: 16px;
  }

  .cards-featured .card {
    width: 200px;
  }

  .cards-featured .card figure {
    height: 160px;
  }
}

/* Keep the 'More' link color fixed on hover/focus/active (override other site rules) */
.news-more,
.news-more:link,
.news-more:visited,
.news-more:hover,
.news-more:focus,
.news-more:active {
  color: #7f6dbf !important;
  text-decoration: none !important;
  opacity: 1 !important;
  transition: none !important;
}

/* Scrollbar-style divider thumb for Blog and Press sections
   Target only the divider immediately following a .cards-blog row. */
.cards-blog + .section-divider i {
  /* Override article-centric defaults */
  left: 0; /* anchor to track's left edge */
  transform: translateX(
    var(--thumbX, 0px)
  ); /* driven by JS based on scrollLeft */
  width: var(
    --thumbW,
    80px
  ); /* computed in JS: proportional to visible fraction */
  opacity: 1; /* always visible for scrollbar */
  transition: transform 150ms ease; /* snappy follow */
  pointer-events: auto; /* interactive */
  cursor: grab;
  touch-action: none; /* allow drag on touch */
}

/* When no horizontal overflow, make the thumb span full track width (optional fallback).
   JS will set --thumbW accordingly; this class is left for clarity/possible future use. */
.cards-blog + .section-divider i.is-full {
  width: 100% !important;
  transform: translateX(0) !important;
  cursor: default;
}

/* Visual feedback when dragging */
.cards-blog + .section-divider i.is-dragging {
  cursor: grabbing;
}

/* ===== Search and Tabbed Section ===== */
.news-tabbed-section {
  margin-top: 80px;
}

/* Search Bar */
.news-search-wrapper {
  position: relative;
  max-width: 760px;
  margin: 0 auto 48px;
}

.news-search-input {
  width: 100%;
  padding: 14px 50px 14px 20px;
  font-size: 16px;
  font-weight: 400;
  color: #1f1f1f;
  background: #ffffff;
  border: 1px solid #d4d4d4;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.news-search-input::placeholder {
  color: #9a9a9a;
}

.news-search-input:focus {
  border-color: #999999;
}

.news-search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #666666;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

/* Category Tabs */
.news-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 64px;
  flex-wrap: wrap;
}

.news-tab {
  background: none;
  border: none;
  font-size: 18px;
  font-weight: 400;
  color: #808080;
  cursor: pointer;
  padding: 8px 24px;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.news-tab:hover {
  color: #5a5a5a;
  background: transparent !important;
  box-shadow: none !important;
}

.news-tab.active {
  color: #1f1f1f;
  font-weight: 600;
}

.news-tab-separator {
  color: #cccccc;
  font-size: 18px;
  user-select: none;
  padding: 0 8px;
}

/* Ensure no hover/focus background for tabs (override global/button defaults) */
.news-tab,
.news-tab:hover,
.news-tab:focus,
.news-tab:active {
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Articles Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px 80px;
  max-width: 1200px;
  margin: 0 auto;
}

.news-grid-item {
  border-bottom: 1px solid #d4d4d4;
  padding-bottom: 24px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.news-grid-item:hover {
  opacity: 0.7;
}

.news-grid-title {
  font-size: 18px;
  font-weight: 600;
  color: #4a4a4a;
  margin: 0 0 12px 0;
  line-height: 1.4;
}

.news-grid-meta {
  font-size: 14px;
  font-weight: 400;
  color: #8a8a8a;
  margin: 4px 0;
  line-height: 1.5;
}

input[type="reset"]:hover, input[type="submit"]:hover {
    background-color: none !important;
    border-color: none !important;
    color: #000 !important;
    outline: 0 !important;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .news-tabbed-section {
    margin-top: 60px;
  }

  .news-search-wrapper {
    max-width: 100%;
    margin-bottom: 36px;
  }

  .news-tabs {
    gap: 8px;
    margin-bottom: 48px;
  }

  .news-tab {
    font-size: 16px;
    padding: 6px 16px;
  }

  .news-tab-separator {
    font-size: 16px;
    padding: 0 4px;
  }

  .news-grid {
    gap: 36px 40px;
  }
}

@media (max-width: 640px) {
  .news-tabbed-section {
    margin-top: 40px;
  }

  .news-search-wrapper {
    margin-bottom: 28px;
  }

  .news-search-input {
    padding: 12px 45px 12px 16px;
    font-size: 15px;
  }

  .news-tabs {
    margin-bottom: 36px;
    gap: 6px;
  }

  .news-tab {
    font-size: 14px;
    padding: 5px 12px;
  }

  .news-tab-separator {
    font-size: 14px;
    padding: 0 2px;
  }

  .news-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .news-grid-item {
    padding-bottom: 20px;
  }

  .news-grid-title {
    font-size: 16px;
  }

  .news-grid-meta {
    font-size: 13px;
  }
}

