/* News and Blog: themes/basic/newsroom/index.html (+ hero.html, card.html; shared with post.html).
   Header: hub-hero (section--index.css). Cards, topic bar, sidebar and search live here. */

/* the hero sits inside .contentView, whose containers are painted white (content.css) */
.nr-hero .container, .nr .nr-topics .container { background: none; }
.nr-hero .hub-hero__title { max-width: 22ch; }
.nr-hero__post-title { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 3.1rem) !important; line-height: 1.15 !important; max-width: 28ch !important; }
.nr-avatar {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(150deg, var(--saffron-300), var(--saffron-600)); color: var(--white);
  font-size: .7rem; font-weight: var(--weight-semibold);
}

/* ---- search in the header */
.nr-search {
  position: relative; display: flex; align-items: center; max-width: 560px; margin-top: var(--space-5);
  border-radius: var(--radius-pill); background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(8px); transition: background var(--duration), border-color var(--duration);
}
.nr-search:focus-within { background: rgba(255, 255, 255, .96); border-color: var(--saffron-500); }
.nr-search > i { position: absolute; left: 1.1rem; color: rgba(255, 255, 255, .7); pointer-events: none; }
.nr-search:focus-within > i { color: var(--stone-500); }
.nr-search input {
  flex: 1 1 auto; min-width: 0; height: 52px; padding: 0 .5rem 0 2.8rem; border: 0; background: none;
  color: var(--white); font-size: var(--text-base); outline: 0;
}
.nr-search input::placeholder { color: rgba(255, 255, 255, .7); }
.nr-search:focus-within input { color: var(--ink); }
.nr-search:focus-within input::placeholder { color: var(--stone-400); }
.nr-search__go {
  flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; margin-right: 5px; border: 0; border-radius: 50%;
  background: var(--saffron-500); color: var(--ink);
}

/* ---- topic bar (sticky under the header) */
.nr { background: linear-gradient(180deg, var(--saffron-50) 0, var(--white) 480px); padding-bottom: var(--space-8); }
.nr-topics {
  position: sticky; top: var(--header-h); z-index: 20; background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--stone-200);
}
.nr-topics__track { display: flex; gap: .45rem; overflow-x: auto; padding: .7rem 0; scrollbar-width: none; }
.nr-topics__track::-webkit-scrollbar { display: none; }
.nr-pill {
  flex: 0 0 auto; padding: .42rem .95rem; border-radius: var(--radius-pill); border: 1px solid var(--stone-200);
  background: var(--white); color: var(--stone-700); font-size: var(--text-sm); white-space: nowrap; text-decoration: none;
  transition: border-color var(--duration), background var(--duration), color var(--duration);
}
.nr-pill:hover { border-color: var(--saffron-500); color: var(--saffron-800); }
.nr-pill.is-active { background: var(--ink); border-color: var(--ink); color: var(--white); }

/* ---- layout */
.nr-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(1.5rem, 1rem + 2vw, 2.75rem); align-items: start; padding-top: var(--space-6); }
.nr-main { min-width: 0; }
.nr-side { display: flex; flex-direction: column; gap: var(--space-4); position: sticky; top: calc(var(--header-h) + 76px); }
.nr .nr-section-title {
  display: flex; align-items: center; gap: .6rem; margin: var(--space-7) 0 var(--space-4);
  font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: .1em; text-transform: uppercase; color: var(--saffron-700);
}
.nr .nr-section-title::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--stone-200); }
.nr .nr-section-title span { color: var(--stone-500); font-weight: var(--weight-regular); }
.nr-results { margin: 0 0 var(--space-4); color: var(--stone-600); font-size: var(--text-sm); }
.nr-results a { color: var(--color-link); }

/* ---- cards */
.nr-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
.nr-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 18px;
  background: var(--white); border: 1px solid var(--stone-200);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.nr-card:hover { transform: translateY(-3px); border-color: var(--saffron-300); box-shadow: 0 16px 36px rgba(146, 64, 14, .1); }
.nr-card__media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--stone-100); }
.nr-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.nr-card:hover .nr-card__media img { transform: scale(1.04); }
.nr-card__ph { display: grid; place-items: center; width: 100%; height: 100%; background: linear-gradient(150deg, #fffbeb, var(--saffron-100)); color: var(--saffron-600); font-size: 2.2rem; }
.nr-card__count {
  position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem;
  border-radius: var(--radius-pill); background: rgba(28, 25, 23, .7); color: var(--white); font-size: var(--text-xs);
}
.nr-card__flag {
  position: absolute; left: 14px; top: 14px; padding: .28rem .75rem; border-radius: var(--radius-pill);
  background: var(--saffron-500); color: var(--ink); font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: .06em; text-transform: uppercase;
}
.nr-card__body { display: flex; flex-direction: column; gap: .5rem; padding: var(--space-4); flex: 1 1 auto; }
.nr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; color: var(--stone-500); font-size: var(--text-xs); }
.nr-meta time { color: var(--saffron-700); font-weight: var(--weight-semibold); }
.nr .nr-card__title { margin: 0; font-size: 1.05rem; font-weight: var(--weight-semibold); line-height: 1.4; }
.nr-card__title a { color: var(--ink); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nr-card__title a::after { content: ""; position: absolute; inset: 0; }   /* whole card opens the post */
.nr-card:hover .nr-card__title a { color: var(--saffron-800); }
.nr-card__text { margin: 0; color: var(--stone-600); font-size: var(--text-sm); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nr-card__by { display: flex; align-items: center; gap: .45rem; margin-top: auto; padding-top: .4rem; color: var(--stone-600); font-size: var(--text-xs); text-transform: capitalize; }

/* the featured (first) story: picture beside the text */
.nr-card--featured { display: grid; grid-template-columns: 1.25fr 1fr; }
.nr-card--featured .nr-card__media { aspect-ratio: auto; min-height: 340px; }
.nr-card--featured .nr-card__body { justify-content: center; padding: clamp(1.25rem, 1rem + 1.5vw, 2.25rem); gap: .75rem; }
.nr .nr-card--featured .nr-card__title { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); font-weight: var(--weight-semibold); line-height: 1.25; }
.nr-card--featured .nr-card__title a { -webkit-line-clamp: 4; }
.nr-card--featured .nr-card__text { font-size: var(--text-base); -webkit-line-clamp: 4; }
.nr-card--featured .nr-card__by { margin-top: .5rem; }

.nr-more { display: flex; justify-content: center; margin-top: var(--space-6); }
.nr-btn {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 46px; padding: 0 1.5rem; border-radius: var(--radius-pill);
  border: 1px solid var(--stone-300); background: var(--white); color: var(--ink); font-weight: var(--weight-semibold); font-size: var(--text-sm); text-decoration: none;
  transition: border-color var(--duration), background var(--duration);
}
.nr-btn:hover { border-color: var(--saffron-500); background: var(--saffron-50); color: var(--saffron-800); }
.nr-btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
.nr-empty { padding: var(--space-8) var(--space-4); text-align: center; color: var(--stone-500); background: var(--white); border: 1px dashed var(--stone-300); border-radius: 20px; }
.nr-empty i { font-size: 2rem; color: var(--saffron-500); }

/* ---- sidebar */
.nr-box { background: var(--white); border: 1px solid var(--stone-200); border-radius: 18px; padding: var(--space-4); }
.nr .nr-box__title { display: flex; align-items: center; gap: .45rem; margin: 0 0 var(--space-3); font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: .08em; text-transform: uppercase; color: var(--saffron-700); }
.nr-ranked { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.nr-ranked li + li { border-top: 1px solid var(--stone-100); }
.nr-ranked a { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: .7rem; align-items: center; padding: .65rem 0; text-decoration: none; }
.nr-ranked__n { color: var(--saffron-300); font-size: 1.5rem; font-weight: var(--weight-light); line-height: 1; }
.nr-ranked__t { color: var(--ink); font-size: var(--text-sm); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nr-ranked a:hover .nr-ranked__t, .nr-ranked a[aria-current] .nr-ranked__t { color: var(--saffron-800); }
.nr-ranked img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }
.nr-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.nr-tag {
  display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: var(--radius-pill);
  background: var(--saffron-50); border: 1px solid var(--saffron-100); color: var(--saffron-800); font-size: var(--text-xs); text-decoration: none;
}
.nr-tag span { color: var(--stone-500); }
.nr-tag:hover, .nr-tag.is-active { background: var(--saffron-100); border-color: var(--saffron-300); }
.nr-ad:empty { display: none; }
.nr-ad img { max-width: 100%; height: auto; border-radius: 14px; }

/* ---- sizes */
@media (max-width: 1199.98px) {
  .nr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  .nr-layout { grid-template-columns: minmax(0, 1fr); }
  .nr-side { position: static; }
  .nr-card--featured { grid-template-columns: 1fr; }
  .nr-card--featured .nr-card__media { min-height: 0; aspect-ratio: 16 / 9; }
}
@media (max-width: 575.98px) {
  .nr-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .nr-search input { height: 48px; }
  .nr-layout { padding-top: var(--space-4); }
}
@media (prefers-reduced-motion: reduce) {
  .nr-card, .nr-card__media img { transition: none; }
}
