/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --app-bg: #f7fbff;
  --app-surface: #ffffff;
  --app-soft-blue: #e9f4ff;
  --app-blue: #2d7fc7;
  --app-blue-dark: #1f5f96;
}

body.app-body {
  background: linear-gradient(180deg, var(--app-bg) 0%, #ffffff 100%);
  color: #163047;
  min-height: 100vh;
}

.app-header {
  background-color: var(--app-surface);
  border-color: #d7e9fa !important;
  box-shadow: 0 8px 20px rgba(46, 126, 198, 0.08);
}

.admin-card {
  background: var(--app-surface);
  border: 1px solid #d7e9fa;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 8px 20px rgba(46, 126, 198, 0.08);
}

.admin-card--soft {
  background: var(--app-soft-blue);
}

.btn-primary {
  background-color: var(--app-blue);
  border-color: var(--app-blue);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--app-blue-dark);
  border-color: var(--app-blue-dark);
}

.article-generator-modal-body {
  min-height: 180px;
}

.article-generator-content {
  max-height: 60vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #f9fcff;
  border: 1px solid #d7e9fa;
  border-radius: 0.5rem;
  padding: 0.75rem;
}

.article-markdown-preview {
  background: #f9fcff;
  border: 1px solid #d7e9fa;
  border-radius: 0.5rem;
  padding: 1rem;
  color: #163047;
}

.article-markdown-preview > :first-child {
  margin-top: 0;
}

.article-markdown-preview > :last-child {
  margin-bottom: 0;
}

.article-markdown-preview pre {
  background: #eef6ff;
  border: 1px solid #d7e9fa;
  border-radius: 0.4rem;
  padding: 0.75rem;
  overflow: auto;
}

.article-markdown-preview code {
  background: #eef6ff;
  border-radius: 0.3rem;
  padding: 0.1rem 0.35rem;
}

.article-markdown-preview pre code {
  background: transparent;
  padding: 0;
}

.article-markdown-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  border: 1px solid #d7e9fa;
}

.article-markdown-preview--portal {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-size: 1.06rem;
  line-height: 1.9;
  color: #21384d;
}

.article-markdown-preview--portal p,
.article-markdown-preview--portal ul,
.article-markdown-preview--portal ol,
.article-markdown-preview--portal blockquote,
.article-markdown-preview--portal pre {
  margin-bottom: 1.35rem;
}

.article-markdown-preview--portal li + li {
  margin-top: 0.45rem;
}

.article-markdown-preview--portal h1,
.article-markdown-preview--portal h2,
.article-markdown-preview--portal h3,
.article-markdown-preview--portal h4 {
  color: #163047;
  line-height: 1.3;
  margin-top: 2.2rem;
  margin-bottom: 0.9rem;
}

.article-markdown-preview--portal h1 {
  font-size: 2rem;
}

.article-markdown-preview--portal h2 {
  font-size: 1.45rem;
}

.article-markdown-preview--portal h3 {
  font-size: 1.18rem;
}

.article-markdown-preview--portal h4 {
  font-size: 1.02rem;
}

.article-markdown-preview--portal a {
  color: var(--app-blue-dark);
}

.article-markdown-preview--portal blockquote {
  border-left: 3px solid #c6def5;
  padding-left: 1rem;
  color: #486780;
}

.article-markdown-preview--portal img {
  margin: 1.5rem 0;
}

.article-category-badge {
  background-color: #e9f4ff;
  color: #1f5f96;
}

.author-avatar-thumb {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid #d7e9fa;
}

.news-portal {
  color: #163047;
}

.article-page-header {
  margin: -3rem 0 1.5rem;
}

.article-page-header__inner {
  background: linear-gradient(140deg, #ffffff 0%, #f2f8ff 55%, #e8f2ff 100%);
  border: 1px solid #d7e9fa;
  border-top: 0;
  border-radius: 0 0 1.25rem 1.25rem;
  box-shadow: 0 14px 32px rgba(46, 126, 198, 0.12);
  padding: 1rem clamp(1.25rem, 4vw, 2.5rem) 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.article-page-header__brand {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.article-page-header__brand:hover {
  color: inherit;
}

.portal-header-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.news-hero__brand-top {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: space-between;
}

.portal-geo-switcher {
  flex: 0 0 auto;
}

.news-hero .portal-geo-switcher {
  margin-top: 0.25rem;
}

.portal-geo-switcher__toggle {
  align-items: center;
  background: #0d1117;
  border: 1px solid #0d1117;
  box-shadow: 0 10px 22px rgba(13, 17, 23, 0.14);
  color: #ffffff;
  display: inline-flex;
  height: 2.35rem;
  justify-content: center;
  min-width: 2.35rem;
  padding: 0;
  position: relative;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
  border-radius: 999px;
}

.portal-geo-switcher__toggle--global {
  min-width: 5.25rem;
  padding: 0 1rem;
}

.portal-geo-switcher__toggle--label {
  min-width: 0;
  padding: 0 1rem;
}

.portal-geo-switcher__toggle:hover,
.portal-geo-switcher__toggle:focus {
  background: #192231;
  border-color: #192231;
  box-shadow: 0 12px 24px rgba(13, 17, 23, 0.2);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
}

.portal-geo-switcher__toggle::after {
  display: none;
}

.portal-geo-switcher__toggle[aria-expanded="true"] {
  background: #ffffff;
  border-color: #0d1117;
  color: #0d1117;
}

.portal-geo-switcher__menu {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d7e9fa;
  border-radius: 1rem;
  box-shadow: 0 18px 42px rgba(46, 126, 198, 0.16);
  margin-top: 0.6rem;
  min-width: 14rem;
  padding: 0.45rem;
}

.portal-geo-switcher__menu-item {
  align-items: center;
  border-radius: 0.8rem;
  color: #163047;
  display: flex;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
}

.portal-geo-switcher__menu-item:hover,
.portal-geo-switcher__menu-item:focus {
  background: #eef6ff;
  color: #163047;
}

.portal-geo-switcher__menu-item.is-active,
.portal-geo-switcher__menu-item.is-active:focus,
.portal-geo-switcher__menu-item.is-active:hover {
  background: #0d1117;
  color: #ffffff;
}

.portal-geo-switcher__menu-code {
  align-items: center;
  background: #0d1117;
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  height: 2rem;
  justify-content: center;
  letter-spacing: 0.14em;
  min-width: 2rem;
  padding: 0 0.55rem;
  text-transform: uppercase;
}

.portal-geo-switcher__menu-item.is-active .portal-geo-switcher__menu-code {
  background: #ffffff;
  color: #0d1117;
}

.portal-geo-switcher__menu-name {
  font-size: 0.92rem;
  font-weight: 600;
}

.portal-geo-switcher__code {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.portal-geo-switcher__code--mobile {
  display: none;
}

.portal-geo-switcher__toggle-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-geo-switcher__toggle-label--mobile {
  display: none;
}

.portal-geo-switcher__menu-item--text {
  gap: 0;
  justify-content: flex-start;
}

.news-hero {
  background: linear-gradient(140deg, #ffffff 0%, #f2f8ff 55%, #e8f2ff 100%);
  border: 1px solid #d7e9fa;
  border-radius: 1.25rem;
  box-shadow: 0 14px 32px rgba(46, 126, 198, 0.12);
  padding: clamp(1.25rem, 2.3vw, 2rem);
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 2fr;
}

.news-kicker {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 1.35rem;
  color: var(--app-blue);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.news-kicker__logo {
  width: 2.35rem;
  height: 2.35rem;
  object-fit: contain;
}

.news-title {
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  line-height: 1.08;
  margin: 0;
}

.news-subtitle {
  color: #3f5b73;
  max-width: 52ch;
}

.news-hero__lead {
  background: #ffffff;
  border: 1px solid #d7e9fa;
  border-radius: 1rem;
  padding: 1.2rem;
  box-shadow: 0 8px 18px rgba(46, 126, 198, 0.08);
}

.news-hero__image {
  width: 100%;
  height: clamp(170px, 30vw, 230px);
  object-fit: cover;
  border-radius: 0.7rem;
  border: 1px solid #dceeff;
}

.news-hero__lead--empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.news-hero__lead--compact {
  padding: 1rem;
  border-radius: 0.9rem;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.news-hero__lead--compact:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(46, 126, 198, 0.12);
}

.news-hero__lead--compact .news-hero__image {
  height: 132px;
  border-radius: 0.6rem;
}

.news-hero__lead--compact .news-chip {
  font-size: 0.68rem;
  padding: 0.3rem 0.6rem;
}

.news-hero__lead--compact .news-article-link--lead {
  font-size: 1rem;
  line-height: 1.35;
}

.news-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #e9f4ff;
  color: #1f5f96;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-weight: 600;
}

.news-chip--link {
  text-decoration: none;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.news-chip--link:hover,
.news-chip--link:focus {
  background: #d7e9fa;
  color: #174a75;
  text-decoration: none;
}

.news-filter-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d7e9fa;
  border-radius: 999px;
  background: #ffffff;
  color: #486780;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.42rem 0.8rem;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.news-filter-pill:hover,
.news-filter-pill:focus {
  background: #f2f8fe;
  border-color: #9cc8ef;
  color: #1f5f96;
  text-decoration: none;
}

.news-filter-pill--active {
  background: #1f5f96;
  border-color: #1f5f96;
  box-shadow: 0 10px 20px rgba(46, 126, 198, 0.14);
  color: #ffffff;
}

.news-filter-pill--active:hover,
.news-filter-pill--active:focus {
  background: #174a75;
  border-color: #174a75;
  color: #ffffff;
}

.news-categories__grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.news-inline-link {
  color: inherit;
  font-size: inherit;
  font-weight: 400;
  text-decoration: none;
  vertical-align: baseline;
}

.news-inline-link:hover,
.news-inline-link:focus {
  color: var(--app-blue);
  text-decoration: underline;
}

.seo-pagination {
  margin-top: 1.5rem;
}

.seo-pagination__sentinel {
  block-size: 1px;
}

.seo-pagination__loading {
  color: #6c757d;
  display: none;
  font-size: 0.9rem;
  text-align: center;
}

.seo-pagination--loading .seo-pagination__loading {
  display: block;
}

.news-category-card {
  border: 1px solid #d7e9fa;
  border-radius: 0.9rem;
  background: #ffffff;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.news-category-card__meta-link {
  color: #6c757d;
  text-decoration: none;
}

.news-category-card__meta-link:hover {
  color: #1f5f96;
  text-decoration: underline;
}

.news-category-card--modal {
  min-height: 11.5rem;
  box-shadow: 0 10px 24px rgba(46, 126, 198, 0.08);
}

.news-category-card__count {
  color: #4f6980;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.news-categories-modal {
  border: 1px solid #d7e9fa;
  border-radius: 1.25rem;
  overflow: hidden;
  background: linear-gradient(180deg, #fafdff 0%, #ffffff 100%);
}

.news-categories-modal__header {
  border-bottom: 1px solid #d7e9fa;
  padding: 1.25rem 1.25rem 1rem;
}

.news-categories-modal__body {
  padding: 1.25rem;
}

.news-categories-modal__grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.news-categories-page {
  padding: 1.25rem;
}

.news-archive-section + .news-archive-section {
  margin-top: 1.5rem;
}

.news-archive-list {
  display: grid;
  gap: 0.75rem;
}

.news-archive-link {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d7e9fa;
  border-radius: 0.9rem;
  color: inherit;
  display: flex;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  text-decoration: none;
}

.news-archive-link:hover,
.news-archive-link:focus {
  border-color: #9cc8ef;
  box-shadow: 0 10px 24px rgba(46, 126, 198, 0.08);
  color: inherit;
}

.news-main {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
}

.news-main--article {
  align-items: start;
}

.news-feed-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.news-side-feed {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: minmax(0, 1fr);
}

.news-feed-card {
  border: 1px solid #d7e9fa;
  border-radius: 0.9rem;
  background: #ffffff;
  padding: 1rem;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.news-feed-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(46, 126, 198, 0.12);
}

.news-feed-card__meta {
  font-size: 0.75rem;
  color: #486780;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.news-article-link {
  color: inherit;
  text-decoration: none;
}

.news-article-link:hover {
  color: var(--app-blue-dark);
  text-decoration: underline;
}

.news-article-link--lead:hover {
  text-decoration: none;
}

.news-preview-markdown {
  overflow: hidden;
}

.news-preview-markdown > :first-child {
  margin-top: 0;
}

.news-preview-markdown > :last-child {
  margin-bottom: 0;
}

.news-preview-markdown--hero {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
}

.news-preview-markdown--card {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.news-panel {
  border: 1px solid #d7e9fa;
  border-radius: 0.9rem;
  background: #ffffff;
  padding: 1rem;
}

.news-article {
  max-width: 52rem;
}

.news-trending-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.news-trending-item {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: auto 1fr;
  align-items: start;
}

.news-trending-item__rank {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  background: #e9f4ff;
  color: #1f5f96;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.77rem;
}

.news-columnists {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.news-columnist-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
}

.news-columnist-card__avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  background: linear-gradient(140deg, #2d7fc7 0%, #6eaee3 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.news-footer {
  border-top: 1px solid #d7e9fa;
  padding-top: 1.35rem;
}

.news-footer__top {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.news-footer__bottom {
  border-top: 1px solid #e5f1fc;
  margin-top: 1rem;
  padding-top: 0.8rem;
  font-size: 0.83rem;
  color: #4f6980;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 992px) {
  .news-hero {
    grid-template-columns: 1fr;
  }

  .news-main {
    grid-template-columns: 1fr;
  }

  .news-footer__top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .news-categories__grid {
    grid-template-columns: 1fr 1fr;
  }

  .news-categories-modal__grid {
    grid-template-columns: 1fr 1fr;
  }

  .news-feed-grid {
    grid-template-columns: 1fr;
  }

  .news-footer__top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .article-page-header {
    margin-top: -3rem;
  }

  .article-page-header__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding-left: 1rem;
    padding-right: 1rem;
    justify-content: initial;
    gap: 0.5rem;
  }

  .article-page-header__brand {
    min-width: 0;
  }

  .article-page-header__brand .news-kicker {
    gap: 0.5rem;
    font-size: 1.05rem;
    min-width: 0;
    white-space: nowrap;
  }

  .article-page-header__brand .news-kicker__logo {
    width: 1.95rem;
    height: 1.95rem;
  }

  .portal-header-controls {
    justify-content: flex-end;
    width: auto;
    flex-wrap: nowrap;
    gap: 0.4rem;
  }

  .news-hero__brand-top {
    display: grid;
    align-items: center;
    gap: 0.5rem;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .news-hero__brand-top .portal-header-controls {
    justify-content: flex-end;
    width: auto;
    flex-wrap: nowrap;
    gap: 0.4rem;
  }

  .news-hero__brand-top .news-kicker {
    gap: 0.5rem;
    font-size: 1.05rem;
    min-width: 0;
    white-space: nowrap;
  }

  .news-hero__brand-top .news-kicker__logo {
    height: 1.95rem;
    width: 1.95rem;
  }

  .news-hero__brand-top .portal-geo-switcher__toggle {
    height: 2.15rem;
  }

  .portal-geo-switcher {
    margin-left: 0;
  }

  .portal-geo-switcher__toggle--global {
    min-width: 2.35rem;
    padding: 0;
  }

  .portal-geo-switcher__toggle--label {
    min-width: 0;
    padding: 0 0.8rem;
  }

  .portal-geo-switcher__toggle .portal-geo-switcher__code:not(.portal-geo-switcher__code--mobile) {
    display: none;
  }

  .portal-geo-switcher__code--mobile {
    display: block;
  }

  .portal-geo-switcher__toggle-label {
    display: none;
  }

  .portal-geo-switcher__toggle-label--mobile {
    display: block;
  }

  .news-categories-modal__grid {
    grid-template-columns: 1fr;
  }
}
