html,
body {
  overflow-x: clip;
}

body {
  background-color: #1a294a;
  font-family: Unbounded, sans-serif;
  padding-top: 23px;
  padding-bottom: 0;
  box-sizing: border-box;
}

.news-page-container {
  width: 100%;
  max-width: 1303px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

.search-bar-container {
  display: flex;
  width: 100%;
  margin: 0 0 40px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 0;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.search-bar-container:focus-within {
  border-color: rgba(255, 255, 255, 0.4);
}

.search-input {
  flex-grow: 1;
  padding: 10px 15px;
  border: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  font-family: Unbounded, sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: #fff;
  background: transparent;
  outline: none;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 300;
}

.search-button {
  background: transparent;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.search-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.search-button img {
  width: 20px;
  height: 20px;
  opacity: 0.6;
}

.main-content-area {
  display: grid;
  grid-template-columns: 254px 1fr;
  align-items: flex-start;
  gap: 21px;
}

/* .sidebar base styles from catalog_sidebar.css */
.sidebar-block {
  width: 100%;
  margin-bottom: 0;
}

.suggest-news-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  background: linear-gradient(180deg, #ffef2b 0%, #f9f7d6 100%);
  box-shadow: 2px 2px 4px rgb(0 0 0 / 25%);
  border-radius: var(--radius-xl);
  color: black;
  font-size: 14px;
  font-family: Unbounded, sans-serif;
  font-weight: 400;
  line-height: 16px;
  text-decoration: none;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

/* .sidebar-label, .sidebar-select, .sidebar-title from catalog_sidebar.css */

.sidebar-label {
  display: block;
  margin-bottom: 8px;
}

.sidebar-title {
  margin-bottom: 8px;
}

/* News uses .category-list instead of .categories-list — mirror pill-tag styles */
.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-list li {
  display: inline-flex;
}

.category-list label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-family: Unbounded, sans-serif;
  font-weight: 300;
  letter-spacing: 0.12px;
  margin-left: 0;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.category-list label:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.15);
}

.category-list input[type='checkbox'] {
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: none;
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.category-list li:has(input[type='checkbox']:checked) label {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.microinvest-block {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.microinvest-block .sidebar-label {
  margin-bottom: 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #d9d9d9;
  transition: 0.4s;
}

.slider::before {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: #004e9f;
}

input:checked + .slider::before {
  transform: translateX(16px);
  background-color: #f5f5f5;
}

.slider.round {
  border-radius: var(--radius-full);
}

.slider.round::before {
  border-radius: 50%;
}

.help-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #d9d9d9;
  color: white;
  font-size: 10px;
  font-weight: bold;
  cursor: help;
  margin-left: 8px;
  user-select: none;
  font-family: Inter, sans-serif;
  line-height: 16px;
}

.rating-block .rating-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.rating-block .rating-value {
  text-align: right;
  color: #1e1e1e;
  font-size: 14px;
  font-family: Inter, sans-serif;
  font-weight: 400;
  line-height: 19.6px;
}

.rating-slider {
  width: 100%;
  height: 4px;
  background: #ebebeb;
  border-radius: var(--radius-full);
  appearance: none;
  outline: none;
  margin-bottom: 5px;
}

.rating-slider::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  background: #004e9f;
  border-radius: 50%;
  cursor: pointer;
}

.rating-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #004e9f;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.rating-filter .noUi-target {
  background: #ebebeb;
  border-radius: var(--radius-full);
  border: none;
  box-shadow: none;
  height: 4px;
  margin-bottom: 5px;
}

.rating-filter .noUi-connect {
  background: #004e9f;
  border-radius: var(--radius-full);
}

.rating-filter .noUi-handle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #004e9f;
  border: none;
  box-shadow: none;
  cursor: pointer;
  right: -8px;
  top: -6px;
}

.rating-filter .noUi-handle:focus {
  outline: none;
}

.rating-filter .noUi-handle::before,
.rating-filter .noUi-handle::after {
  display: none;
}

.rating-range-label {
  display: block;
  color: #757575;
  font-size: 8px;
  font-family: Unbounded, sans-serif;
  font-weight: 300;
  letter-spacing: 0.08px;
  margin-top: 20px;
}

.rating-filter .rating-value {
  text-align: right;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-family: Inter, sans-serif;
  font-weight: 400;
  line-height: 19.6px;
}

/* .show-filters-btn base from catalog_sidebar.css, override only what differs */
.show-filters-btn {
  width: 100%;
  cursor: pointer;
}

.news-feed-column {
  flex-grow: 1;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-flow: dense;
  gap: 20px;
  margin-top: 20px;
  margin-bottom: 40px;
}

/* ── News card (base) ─────────────────── */

.news-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.news-card > a.news-card__link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.news-card__title a {
  position: relative;
  z-index: 2;
}

.news-card .delete-news-btn {
  z-index: 3;
}

.news-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  z-index: 2;
}

/* ── Featured: full width, image left + text right ── */

.news-card--featured {
  grid-column: span 3;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  min-height: 300px;
  background: rgba(0, 8, 25, 0.7);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.news-card--featured .news-card__image {
  overflow: hidden;
}

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

.news-card--featured .news-card__body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.news-card--featured .news-card__title {
  font-size: 22px;
  line-height: 1.3;
}

/* Featured without image: just full-width text */
.news-card--featured:not(:has(.news-card__image)) {
  grid-template-columns: 1fr;
}

/* ── Medium: 2 columns, image on top ──── */

.news-card--medium {
  grid-column: span 2;
  background: rgba(0, 8, 25, 0.6);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.news-card--medium .news-card__image {
  height: 220px;
  overflow: hidden;
  flex-shrink: 0;
}

.news-card--medium .news-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-card--medium .news-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-card--medium .news-card__title {
  font-size: 19px;
  line-height: 1.35;
}

/* ── Standard: 1 column, image on top ─── */

.news-card--standard {
  grid-column: span 1;
  background: rgba(0, 8, 25, 0.6);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.news-card--standard .news-card__image {
  height: 180px;
  overflow: hidden;
  flex-shrink: 0;
}

.news-card--standard .news-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-card--standard .news-card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.news-card--standard .news-card__title {
  font-size: 16px;
  line-height: 1.35;
}

/* ── Text-only: full width strip ──────── */

.news-card--text-full {
  grid-column: span 3;
  background: rgba(0, 8, 25, 0.45);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 20px 28px;
}

.news-card--text-full .news-card__body {
  display: flex;
  align-items: center;
  gap: 24px;
}

.news-card--text-full .news-card__meta {
  flex-shrink: 0;
  margin-bottom: 0;
}

.news-card--text-full .news-card__title {
  font-size: 16px;
  flex: 1;
  min-width: 0;
}

.news-card--text-full .news-card__excerpt {
  flex: 1;
  min-width: 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  margin-top: 0;
  -webkit-line-clamp: 2;
}

/* ── Common card styles ───────────────── */

.news-card__title {
  font-family: Unbounded, sans-serif;
  font-weight: 500;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card__title a {
  color: #fff;
  text-decoration: none;
  transition: color 0.15s ease;
}

.news-card__title a:hover {
  color: #FFD700;
}

.news-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.news-card__date {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-family: Unbounded, sans-serif;
  font-weight: 300;
}

.news-card__category {
  background: linear-gradient(135deg, rgba(55, 65, 180, 0.9) 0%, rgba(75, 90, 200, 0.85) 100%);
  color: #fff;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-family: Unbounded, sans-serif;
}

.news-card__excerpt {
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  font-family: Unbounded, sans-serif;
  font-weight: 300;
  line-height: 1.55;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.no-news {
  grid-column: span 3;
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.5);
  font-family: Unbounded, sans-serif;
  font-size: 15px;
}

.delete-news-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ff6161;
  color: #fff;
  border: none;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-family: Inter, sans-serif;
  font-size: 12px;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.news-card:hover .delete-news-btn {
  opacity: 1;
}

.ad-label-on-image {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgb(217 217 217 / 58%);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: white;
  font-size: 12px;
  font-family: Unbounded, sans-serif;
  font-weight: 300;
  letter-spacing: 0.12px;
}

.ad-label-on-image img {
  width: 16px;
  height: 16px;
}

.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.popup {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 24px 24px 28px;
  border-radius: var(--radius-lg);
  width: 560px;
  max-width: 95%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  color: #fff;
  animation: modalFadeIn 0.25s ease-out;
}

.glass-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: var(--radius-lg);
  background: radial-gradient(120% 120% at 10% 0%, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.02) 60%, rgba(255,255,255,0) 100%);
}

.modal-title {
  margin: 0 0 18px;
  font-size: 20px;
  font-weight: 500;
  color: #fff;
}

.popup-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #fff;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color .2s ease;
}

.popup-close:hover {
  background: rgba(255,255,255,0.15);
}

.popup h2 { display: none; }

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-family: Unbounded, sans-serif;
  font-size: 13px;
  font-weight: 300;
  margin-bottom: 6px;
  color: #e9eef7;
}

.form-group input[type='text'],
.form-group textarea,
.form-group input[type='file'] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: var(--radius-sm);
  font-family: Unbounded, sans-serif;
  font-size: 14px;
  box-sizing: border-box;
}

.custom-file-label {
  display: inline-block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: var(--radius-sm);
  font-family: Unbounded, sans-serif;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.custom-file-label:focus,
.custom-file-label:hover {
  outline: none;
  background: rgba(255,255,255,0.1);
}

.modal-popup .form-group,
.modal-popup form { width: 100%; }
.modal-popup .form-group input[type='text'],
.modal-popup .form-group textarea,
.modal-popup .form-group input[type='file'],
.modal-popup .custom-file-label {
  width: 100%;
  max-width: 100%;
  display: block;
  box-sizing: border-box;
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.submit-btn {
  padding: 12px 25px;
  background: linear-gradient(0deg, #004e9f 0%, #006edf 100%) !important;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: Unbounded, sans-serif;
  font-size: 16px;
  font-weight: 400;
  box-shadow: 2px 2px 4px rgb(0 0 0 / 25%);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.page-item {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: white;
  font-size: 14px;
  font-family: Unbounded, sans-serif;
  font-weight: 300;
  line-height: 18px;
}

.page-item.current {
  background: white;
  color: #004e9f;
}

.page-item.dots {
  color: white;
  font-size: 16px;
  font-family: Inter, sans-serif;
  font-weight: 700;
  padding: 8px 0;
}

.show-more-container {
  display: flex;
  justify-content: center;
}

.show-more-btn {
  padding: 12px 35px;
  background: transparent !important;
  border: 1px solid white !important;
  box-shadow: 2px 2px 4px rgb(0 0 0 / 25%);
  border-radius: var(--radius-sm);
  color: #f5f5f5 !important;
  font-size: 16px;
  font-family: Unbounded, sans-serif;
  font-weight: 400;
  line-height: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
}

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 1400px) {
  .news-page-container {
    max-width: 1200px;
  }
}

@media (max-width: 1200px) {
  .news-page-container {
    max-width: 1000px;
  }

  .main-content-area {
    grid-template-columns: 220px 1fr;
    gap: 18px;
  }
}

@media (max-width: 992px) {
  .news-page-container {
    max-width: 900px;
  }

  .main-content-area {
    grid-template-columns: 200px 1fr;
    gap: 15px;
  }

  .sidebar {
    padding: 15px;
  }

  .news-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .news-card--featured,
  .news-card--text-full {
    grid-column: span 2;
  }

  .news-card--medium {
    grid-column: span 2;
  }
}

/* Mobile suggest button — hidden on desktop */
.mobile-suggest-btn {
  display: none;
}

@media (max-width: 768px) {
  .news-page-container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .main-content-area {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .sidebar {
    order: 2;
    padding: 12px;
  }

  .sidebar .suggest-news-btn {
    display: none;
  }

  .mobile-suggest-btn {
    display: flex;
    margin-bottom: 15px;
  }

  .news-feed-column {
    order: 1;
  }

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

  /* All cards single column on mobile */
  .news-card--featured,
  .news-card--medium,
  .news-card--standard,
  .news-card--text-full {
    grid-column: span 1;
  }

  /* Featured becomes vertical on mobile */
  .news-card--featured {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .news-card--featured .news-card__image {
    height: 200px;
  }

  .news-card--featured .news-card__body {
    padding: 20px;
  }

  .news-card--featured .news-card__title {
    font-size: 18px;
  }

  /* Text-full becomes vertical on mobile */
  .news-card--text-full .news-card__body {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .news-card--medium .news-card__image {
    height: 180px;
  }

  .news-card__title {
    font-size: 14px !important;
    -webkit-line-clamp: 2;
  }

  .news-card__date {
    font-size: 10px;
  }

  .news-card__category {
    font-size: 9px;
    padding: 2px 7px;
  }

  .news-card__excerpt {
    font-size: 11px;
    line-height: 1.4;
    -webkit-line-clamp: 3;
  }

  .delete-news-btn {
    font-size: 10px;
    padding: 3px 6px;
    top: 6px;
    right: 6px;
  }

  .search-bar-container {
    margin-bottom: 20px;
  }

  .search-input {
    font-size: 13px;
    padding: 8px 12px;
  }
}

@media (max-width: 360px) {
  .news-grid {
    gap: 8px;
  }

  .news-card__title {
    font-size: 12px !important;
  }

  .news-card__excerpt {
    font-size: 10px;
    -webkit-line-clamp: 2;
  }

  .search-input {
    font-size: 12px;
    padding: 6px 10px;
  }
}
