:root {
  --brand-red: #d93a1b;
  --brand-orange: #e8541e;
  --brand-dark: #1a0a04;
  --brand-mid: #2d1107;
  --accent: #ff6b35;
  --accent-muted: rgba(255, 107, 53, 0.15);
  --text-primary: #fff;
  --text-muted: rgba(255, 255, 255, 0.55);
  --card-bg: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.1);
  --radius-card: 18px;
  --radius-modal: 60px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  background-image: url(https://live.hng.pp.ua/wp-content/uploads/2026/05/Background-scaled.png);
  background-size: cover;
  background-position: center;
  background-repeat: repeat-y;
}

.filter-select,
.filter-label {
  font-family: "ITCAvantGarde", sans-serif;
  font-weight: 400 !important;
  font-style: normal;
  font-stretch: normal;
}

.news-section {
  padding: 8rem 0;
  overflow: hidden;
}

.news-inner {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 40px;

  /* background: rgb(0 0 0 / 28%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); */
  padding: var(--hng-section-pad);
  box-sizing: border-box;
  border-radius: 60px;
}

.news-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 44px;
}

.news-title-block h2 {
  font-family: "ITCAvantGarde", sans-serif;
  font-weight: 600 !important;
  font-style: normal;
  font-stretch: normal;
  font-size: var(--hng-h2-size, clamp(2.25rem, 4.5vw, 3.625rem));
  line-height: 1;
  color: var(--text-primary);
}

.news-title-block p {
  margin-top: 10px;
  font-family: "ITCAvantGarde", sans-serif;
  font-weight: 400 !important;
  font-style: normal;
  font-stretch: normal;
  font-size: var(--hng-body-size, clamp(1rem, 1.5vw, 1.25rem));
  color: var(--hng-white);
  max-width: 420px;
  line-height: 1.6;
}

.filter-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.filter-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.filter-select-wrap {
  position: relative;
}

/* Native select — hidden, used only for value/change events */
.filter-select {
  display: none;
}

/* Trigger pill */
.cs-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50px;
  color: #fff;
  padding: 10px 14px 10px 18px;
  min-width: 140px;
  cursor: pointer;
  font-family: "ITCAvantGarde", sans-serif;
  font-size: 0.88rem;
  font-weight: 500 !important;
  transition:
    background 0.2s,
    border-color 0.2s;
  user-select: none;
}

.cs-trigger:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
}

.cs-arrow {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s;
}

.cs-arrow svg {
  width: 8px;
  height: 8px;
  fill: #fff;
  display: block;
}

.cs-wrap.open .cs-arrow {
  transform: rotate(180deg);
}

/* Dropdown panel */
.cs-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 100%;
  background: #1e0905;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  overflow: hidden;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition:
    opacity 0.2s,
    transform 0.2s,
    visibility 0.2s;
}

.cs-wrap.open .cs-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cs-option {
  padding: 9px 18px;
  font-family: "ITCAvantGarde", sans-serif;
  font-size: 0.88rem;
  font-weight: 400 !important;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  white-space: nowrap;
}

.cs-option:hover {
  background: rgba(255, 107, 53, 0.15);
  color: #fff;
}

.cs-option.is-selected {
  color: var(--accent);
  font-weight: 600 !important;
}

.news-layout {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  overflow: visible;
  position: relative;
}

.featured-card {
  width: 100%;
  max-width: 420px;
  min-width: 420px;
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  aspect-ratio: 4/5;
  cursor: pointer;
  background: var(--card-bg);
  z-index: 2;
}

.featured-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  background: var(--accent);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.72rem;
  color: #fff;
  font-size: 0.78rem;
  font-family: "ITCAvantGarde", sans-serif;
  font-weight: 500 !important;
  font-style: normal;
  font-stretch: normal;
}

.featured-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px 24px 28px;
  background: linear-gradient(
    to top,
    rgba(10, 3, 1, 0.95) 0%,
    transparent 100%
  );
}

.post-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.featured-overlay h3,
.news-card-body h3 {
  font-size: 1.25rem;
  font-family: "ITCAvantGarde", sans-serif;
  font-weight: 400 !important;
  font-style: normal;
  font-stretch: normal;
  margin-bottom: 14px;
  line-height: 1.3;
  color: var(--hng-white);
}

.featured-footer,
.news-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.post-date {
  font-size: 0.78rem;
  font-family: "ITCAvantGarde", sans-serif;
  font-weight: 600 !important;
  font-style: normal;
  font-stretch: normal;
  color: var(--hng-white);
}

.btn-read {
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 50px;
  padding: 10px 18px;
  cursor: pointer;

  transition:
    background 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

/* Subtle rollover */
.btn-read:hover {
  background: #ff7a42;
  transform: translateY(-2px);

  box-shadow: 0 8px 18px rgba(255, 107, 53, 0.22);
}

/* Click */
.btn-read:active {
  transform: translateY(0);
}

.modal-close {
  transition:
    background 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
  background-color: unset;
}

/* Rollover */
.modal-close:hover {
  background: var(--accent);
  transform: rotate(90deg) scale(1.05);

  box-shadow: 0 8px 18px rgba(255, 107, 53, 0.22);
}

/* Click */
.modal-close:active {
  transform: rotate(90deg) scale(0.96);
}

.slider-col {
  overflow: visible;
  position: relative;
  min-width: 0;
  z-index: 1;

  /*
  FULL BLEED TO VIEWPORT RIGHT EDGE:
  Force the column to stretch from its natural grid position all the way
  to the right edge of the viewport, bypassing the .news-inner padding
  and any centered container offset.
  - width: 100vw minus the column's distance from the left viewport edge
    (achieved via left offset of the featured card column + gap).
  - margin-right pulls it flush to the viewport edge.
  */
  /*width: calc(100vw - 420px - 28px - max(40px, (100vw - 1320px) / 2 + 40px));*/
  margin-right: calc(-1 * max(40px, (100vw - 1320px) / 2 + 40px));
}

.news-card {
  /* background: var(--card-bg); */
  border-radius: var(--radius-card);
  overflow: hidden;
  height: 100%;
  cursor: pointer;

  /* FIX: equal-height card bodies */
  display: flex;
  flex-direction: column;
}

.news-card-thumb-wrap {
  overflow: hidden;
}

.news-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.news-card-body {
  padding: 20px 22px 24px;

  /* FIX: stretch to fill remaining card height */
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-card-body h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  line-height: 1.4;
}

/* FIX: push footer (date + button + hr) to bottom of every card */
.news-card-footer {
  margin-top: auto;
}

.empty-state {
  display: none;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state.show {
  display: block;
}

/*
FIX: Added visibility: hidden alongside pointer-events: none.
This fully removes the modal from the stacking context when closed,
preventing it from intercepting clicks on the Splide slider and
pagination underneath it.
*/
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 3, 1, 0.78);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.3s,
    visibility 0.3s;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.modal-box {
  background: #fff;
  border-radius: 40px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-img {
  width: 100%;
  aspect-ratio: 16/8;
  object-fit: cover;
}

.modal-content {
  padding: 40px;
  border: unset !important;
}

.modal-category {
  color: var(--brand-red);
  text-transform: uppercase;
  font-size: 0.7rem;
}

.modal-date {
  color: #777;
  font-size: 0.8rem;
}

.modal-title {
  font-size: 2rem;
  margin: 16px 0 20px;
}

.modal-body {
  line-height: 1.8;
  color: #333;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.splide {
  overflow: visible !important;
}

.splide__track {
  overflow: hidden;
}

.splide__slide {
  opacity: 1;
}

.splide__pagination {
  display: none !important;
}

/* ── Arrow buttons (all breakpoints) ─────────────────────────── */
.splide__arrows {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  position: static !important; /* override any Splide absolute positioning */
}

.splide__arrow {
  position: static !important;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s,
    transform 0.2s;
  transform: none !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  opacity: 1 !important;
}

.splide__arrow:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(232, 102, 26, 0.15);
}

.splide__arrow:disabled {
  opacity: 0.3 !important;
  cursor: default;
}

.splide__arrow svg {
  width: 14px;
  height: 14px;
  fill: #fff;
}

.splide__arrow--prev,
.splide__arrow--next {
  position: static !important;
  left: auto !important;
  right: auto !important;
}

.image-layout.imageIsOne {
  grid-template-columns: 1fr;
}

.image-layout.imageIsOne .main-image {
  width: 100%;
}

.image-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: auto;
  padding: 30px 30px 10px 30px;
}

.modal-meta {
  padding: 0 30px;
}

.main-image {
  width: 356px;
}

/* Left image */
.main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}

/* Right 2x2 gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}

.modal-header h2 {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-family: "ITCAvantGarde";
  font-weight: 600;
  font-style: normal;
  font-stretch: normal;
  font-display: swap;
  font-size: var(--hng-h3-size, clamp(1.5rem, 2.5vw, 1.875rem));
  color: #717070;
}

.modal-header {
  border: unset;
  padding: 40px 30px 0 30px;
}

#modal-thumbnail .modal-box {
  max-height: unset;
  background: unset;
}

#modalThumbnailImg {
  width: 100%;
}

@media (max-width: 1259px) {
  .featured-footer,
  .news-card-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .news-section-box {
    padding: 0;
  }
}

@media (max-width: 900px) {
  .news-layout {
    display: block;
  }

  .featured-card {
    max-width: 100%;
    min-width: 100%;
    margin-bottom: 8%;
  }

  .slider-col {
    width: calc(100vw - 40px);
    margin-right: -40px;
  }

  .image-layout {
    grid-template-columns: 1fr;
  }

  .main-image {
    width: 100%;
  }

  .main-image {
    min-height: 300px;
  }

  .gallery-grid {
    min-height: auto;
  }

  .gallery-grid img {
    aspect-ratio: 1 / 1;
  }

  .splide__arrows {
    margin-top: 20px;
  }

  .gallery-grid img {
    height: unset;
  }
}

@media (max-width: 640px) {
  .slider-col {
    /* width: calc(100vw - 20px);
    margin-right: -20px; */
    display: block;
    width: 100%;
    margin-right: 0 !important;
  }

  .main-image {
    min-height: unset;
  }
}

.modal-box {
  background: #fff;
  border-radius: 40px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;

  /* Minimalist scrollbar */
  scrollbar-width: none;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* WebKit (Chrome, Safari, Edge) */
.modal-box::-webkit-scrollbar {
  width: 4px;
}

.modal-box::-webkit-scrollbar-track {
  background: transparent;
}

.modal-box::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 999px;
}

.news-card-body hr {
  width: 100%;
}

.gallery-thumb,
.main-image {
  cursor: pointer;
}

