/* News pages (home, category, search, article). Builds on style.css. */

.page-loading { min-height: 50vh; display: grid; place-items: center; }
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--line);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.muted { color: var(--muted); }

/* ---------- Preview bar (before launch) ---------- */
.preview-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 14px;
  border-radius: 14px;
  background: rgb(242 153 74 / .18);
  border: 1px solid rgb(242 153 74 / .35);
  font-size: .85rem;
}
.preview-bar i { font-size: 18px; }
.preview-bar span { flex: 1; }
.preview-bar a { font-weight: 600; text-decoration: underline; }

/* ---------- Header additions ---------- */
a.nav-item { cursor: pointer; }
.nav-item.is-active { background: rgb(255 255 255 / .2); }
form.search:focus-within { background: rgb(255 255 255 / .2); }

/* ---------- Links in lists ---------- */
.story-link { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.story-link:hover .story-title { text-decoration: underline; text-underline-offset: 3px; }
.story-thumb-wrap {
  flex: none;
  width: 72px; height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: rgb(0 0 0 / .2);
}
.story-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.story-list.compact .story { padding: 12px 0; }
.story-list.compact .story-title { font-size: .9rem; }
html[lang="dv"] .story-list.compact .story-title { font-size: 1rem; }

/* Image placeholder when an article has no cover */
.no-cover {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 55%, transparent), rgb(0 0 0 / .25));
  color: rgb(255 255 255 / .7);
}
.no-cover i { font-size: 28px; }

/* ---------- Hero slider ---------- */
.panel-main.single { grid-template-columns: 1fr; }
.slider { display: flex; flex-direction: column; min-width: 0; }
.slides { position: relative; }
.slide { display: none; }
.slide.is-active { display: flex; flex-direction: column; animation: slideIn .5s ease; }
@keyframes slideIn { from { opacity: 0; } }
.slide .feature-media { flex: none; aspect-ratio: 16 / 10; min-height: 0; }
.slide .feature-media img { transition: transform .6s ease; }
.slide:hover .feature-media img { transform: scale(1.03); }
.slide:hover .feature-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.slide .meta .cat { color: var(--text); font-weight: 600; }

.slider-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.slider-dots { display: flex; gap: 6px; }
.dot {
  width: 8px; height: 8px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: rgb(255 255 255 / .35);
  cursor: pointer;
  transition: width .25s, background-color .25s;
}
.dot.is-active { width: 24px; background: #fff; }
.slider-arrows { display: flex; gap: 6px; }

/* ---------- Side panel tabs ---------- */
button.tab { border: 0; background: none; padding: 0; cursor: pointer; transition: color .2s; }
button.tab:hover { color: var(--text); }
.news-side .story-list { margin-top: 6px; }

@media (max-width: 1180px) {
  .panel-side.news-side { display: flex; }
}

/* ---------- Sections & cards ---------- */
.news-section { margin-top: 16px; padding: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.see-all { font-size: .85rem; color: var(--muted); transition: color .2s; }
.see-all:hover { color: var(--text); }
.page-title { font-size: clamp(1.4rem, 3vw, 1.9rem); }
html[lang="dv"] .page-title { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }

.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 16px; }
.card { display: flex; flex-direction: column; min-width: 0; }
.card-media { aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: rgb(0 0 0 / .2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-meta { margin-top: 10px; }
.card-title { margin-top: 4px; font-size: 1rem; font-weight: 600; line-height: 1.35; letter-spacing: -.01em; }
html[lang="dv"] .card-title, [lang="dv"] .card-title { font-weight: 400; font-size: 1.1rem; line-height: 1.65; letter-spacing: 0; }
.card:hover .card-title { text-decoration: underline; text-underline-offset: 3px; }

.btn-more {
  width: fit-content;
  margin: 24px auto 4px;
  height: 42px;
  padding: 0 22px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass-strong);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s;
  display: flex;
  align-items: center;
}
.btn-more:hover { background: rgb(255 255 255 / .22); }
.btn-more:disabled { opacity: .6; }

.empty-state { padding: 56px 20px; display: grid; justify-items: center; gap: 10px; text-align: center; color: var(--muted); }
.empty-state i { font-size: 34px; color: var(--faint); }
.empty-state > p:first-of-type { color: var(--text); font-size: 1.05rem; }

/* ---------- Article ---------- */
.article { padding: clamp(20px, 3vw, 36px); min-width: 0; }
.article .meta { margin-top: 0; }
.article .meta-tag:hover { text-decoration: underline; }
.article-title {
  margin-top: 10px;
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.025em;
}
.article.is-dv .article-title { font-family: var(--font-dv); font-weight: 400; line-height: 1.6; letter-spacing: 0; font-size: clamp(2rem, 4vw, 3rem); }
.article-lead { margin-top: 14px; font-size: 1.15rem; color: rgb(255 255 255 / .78); line-height: 1.6; }
.article.is-dv .article-lead { font-family: var(--font-dv); font-size: 1.25rem; line-height: 1.9; }
.article-byline { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: .9rem; color: var(--muted); }
.article-byline i { font-size: 18px; }
.article-cover { margin-top: 22px; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }

.prose { margin-top: 26px; font-size: 1.08rem; line-height: 1.8; color: rgb(255 255 255 / .92); max-width: 72ch; }
.article.is-dv .prose { font-family: var(--font-dv); font-size: 1.22rem; line-height: 2.1; }
.article.is-en .prose { font-family: var(--font-en); }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 1.45em; line-height: 1.35; font-weight: 600; margin-top: 1.6em; }
.prose h3 { font-size: 1.2em; font-weight: 600; margin-top: 1.4em; }
.article.is-dv .prose h2, .article.is-dv .prose h3 { font-weight: 400; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose strong, .prose b { font-weight: 700; }
.prose ul, .prose ol { padding-inline-start: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .4em; }
.prose blockquote {
  padding: 4px 18px;
  border-inline-start: 3px solid var(--accent);
  color: rgb(255 255 255 / .8);
  font-size: 1.1em;
}
.prose img { border-radius: 14px; margin: 1.4em 0; width: 100%; height: auto; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2em 0; }
.prose figcaption { font-size: .85em; color: var(--muted); margin-top: -.8em; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 28px; }
.tag {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--glass-strong);
  font-size: .82rem;
  transition: background-color .2s;
}
.tag:hover { background: rgb(255 255 255 / .22); }

.share-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.share-label { font-size: .9rem; color: var(--muted); }
.share-bar .social-links { margin-top: 0; }
.share-bar button {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: var(--glass-strong);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  transition: background-color .2s;
}
.share-bar button:hover { background: rgb(255 255 255 / .24); }
.share-bar button.is-done { background: var(--primary); }

/* ---------- Footer ---------- */
.site-footer {
  max-width: 1320px;
  margin: 0 auto 20px;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 24px;
  align-items: center;
  border: 1px solid var(--glass-border);
  border-radius: 26px;
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}
.footer-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.footer-brand strong { display: block; font-size: 1.05rem; }
.footer-brand p { font-size: .85rem; color: var(--muted); }
.footer-bottom {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: .8rem;
  color: var(--faint);
}
.footer-bottom a { display: inline-flex; align-items: center; gap: 6px; }
.footer-bottom a:hover { color: var(--text); }
.site-footer .social-links { margin-top: 0; }

/* ---------- Responsive ---------- */
/* Matches the .frame zoom in style.css. */
@media (min-width: 1181px) and (max-width: 1439px) {
  .site-footer { zoom: .88; }
}
@media (max-width: 1100px) {
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-spacer { display: none; }
  /* Categories become a scrollable row under the header instead of disappearing. */
  .header .nav-pill {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .header .nav-pill::-webkit-scrollbar { display: none; }
  .header .nav-item { white-space: nowrap; }
}
@media (max-width: 640px) {
  .news-section { padding: 14px; border-radius: 20px; }
  .card-grid { gap: 16px 12px; }
  .site-footer { margin: 0 10px 10px; grid-template-columns: 1fr; border-radius: 20px; padding: 18px; }
  .footer-bottom { flex-wrap: wrap; }
  .article { border-radius: 20px; }
  .slide .feature-media { aspect-ratio: 4 / 3; }
}
@media (max-width: 420px) {
  .card-grid { grid-template-columns: 1fr; }
}
