/* =======================================================================
   KISURE ADVANCED CSS — v2.0
   Drop this file after kisure-redesign.css to apply all improvements.
   Add to layouts/app.blade.php: <link href="{{ asset('css/kisure-advanced.css') }}" rel="stylesheet">
   ======================================================================= */

/* -----------------------------------------------------------------------
   1. DESIGN TOKEN REFINEMENTS
   ----------------------------------------------------------------------- */

:root {
  /* Tighter, more polished shadow system */
  --shadow-sm:  0 2px  8px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(15, 23, 42, 0.04);
  --shadow-md:  0 8px 24px rgba(15, 23, 42, 0.10), 0 2px  8px rgba(15, 23, 42, 0.06);
  --shadow-lg:  0 20px 50px rgba(15, 23, 42, 0.14), 0 4px 16px rgba(15, 23, 42, 0.08);

  /* Slightly tighter border radii for a more professional, less "bubbly" look */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;

  /* Smooth header height variable used for sticky offset */
  --header-h: 5.5rem;
}

html[data-theme="dark"] {
  --shadow-sm:  0 2px  8px rgba(2, 8, 23, 0.28), 0 0 0 1px rgba(148, 163, 184, 0.08);
  --shadow-md:  0 8px 24px rgba(2, 8, 23, 0.36), 0 2px  8px rgba(2, 8, 23, 0.24);
  --shadow-lg:  0 20px 50px rgba(2, 8, 23, 0.48), 0 4px 16px rgba(2, 8, 23, 0.32);
}


/* -----------------------------------------------------------------------
   2. SMOOTH GLOBAL TRANSITIONS
   ----------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* -----------------------------------------------------------------------
   3. HEADER — sticky + glass effect
   ----------------------------------------------------------------------- */

.site-header {
  padding: 0.65rem 0 0;
  position: sticky;
  top: 0;
  z-index: 1040;
  /* subtle glass blur on header panel */
}

.site-header__bar {
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
  transition: box-shadow 0.22s ease, background 0.22s ease;
}

html[data-theme="dark"] .site-header__bar {
  background: rgba(7, 17, 31, 0.88);
  border-color: rgba(148, 163, 184, 0.12);
  box-shadow: 0 4px 18px rgba(2, 8, 23, 0.36);
}

/* Shrink a touch on scroll (handled via JS .is-scrolled class in kisure-redesign.js,
   but we can prepare both states here) */
.site-header.is-scrolled .site-header__bar {
  box-shadow: 0 6px 28px rgba(15, 23, 42, 0.13);
}

/* Nav link underline polish */
.header-menu-item__link {
  position: relative;
}

.header-menu-item__link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0.95rem;
  right: 0.95rem;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-strong));
  border-radius: 999px;
  transform: scaleX(0);
  transition: transform 0.22s ease;
}

.header-menu-item__link:hover::after,
.header-menu-item__link.is-active::after {
  transform: scaleX(1);
}

.header-menu-item__link.is-active {
  color: var(--bg-contrast);
}


/* -----------------------------------------------------------------------
   4. LAYOUT — CONTENT-GRID + SIDEBARS (THE MAIN FIX)
   ----------------------------------------------------------------------- */

/* 
   The core layout. Sidebar gets a fixed width so it never competes 
   with content, and aligns from the top of its grid cell.
*/
.content-grid {
  align-items: start;
  display: grid;
  gap: 1.35rem;
  grid-template-columns: minmax(0, 1fr) 22rem;
}

.content-grid > section,
.content-grid > aside {
  min-width: 0;
}

.content-grid > aside {
  align-self: start;
  width: 100%;
}

/* Article layout */
.article-shell {
  display: grid;
  gap: 1.35rem;
  grid-template-columns: minmax(0, 1fr) 21rem;
}

/* -----------------------------------------------------------------------
   STICKY SIDEBAR — THE KEY FIX
   
   Correct sticky sidebar behavior requires:
   1. position: sticky on the sidebar itself
   2. top = header height + breathing room
   3. max-height = viewport - header - breathing room
   4. overflow-y: auto so tall sidebars scroll independently
   ----------------------------------------------------------------------- */

.sticky-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  max-height: calc(100vh - var(--header-h) - 2rem);
  overflow-y: auto;
  overflow-x: hidden;
  /* hide scrollbar visually but keep functionality */
  scrollbar-width: thin;
  scrollbar-color: rgba(14, 165, 164, 0.25) transparent;
}

.sticky-sidebar::-webkit-scrollbar {
  width: 4px;
}

.sticky-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sticky-sidebar::-webkit-scrollbar-thumb {
  background: rgba(14, 165, 164, 0.25);
  border-radius: 999px;
}

/* Article sidebar rail */
.article-rail {
  display: grid;
  gap: 1rem;
  height: fit-content;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  max-height: calc(100vh - var(--header-h) - 2rem);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(14, 165, 164, 0.25) transparent;
}

.article-rail::-webkit-scrollbar {
  width: 4px;
}

.article-rail::-webkit-scrollbar-track {
  background: transparent;
}

.article-rail::-webkit-scrollbar-thumb {
  background: rgba(14, 165, 164, 0.25);
  border-radius: 999px;
}


/* -----------------------------------------------------------------------
   5. SURFACE CARDS — refined elevation
   ----------------------------------------------------------------------- */

.surface-card,
.site-panel {
  background: var(--bg-elevated);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
}

/* Subtle lift on interactive cards */
a.surface-card:hover,
article.surface-card[data-card-link]:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(14, 165, 164, 0.18);
  transform: translateY(-2px);
}

html[data-theme="dark"] a.surface-card:hover,
html[data-theme="dark"] article.surface-card[data-card-link]:hover {
  border-color: rgba(79, 209, 197, 0.18);
}


/* -----------------------------------------------------------------------
   6. NEWS CARDS — sharper, more editorial look
   ----------------------------------------------------------------------- */

.news-card {
  cursor: pointer;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.news-card__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.news-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.news-card:hover .news-card__media img {
  transform: scale(1.06);
}

.news-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.1rem 1.2rem 1.2rem;
  flex: 1;
}

.news-card__title {
  color: var(--bg-contrast);
  font-family: var(--font-display);
  font-size: 1.13rem;
  line-height: 1.22;
  margin: 0;
  /* Clamp to 3 lines for visual consistency */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card__excerpt {
  color: var(--text-soft);
  font-size: 0.93rem;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card__footer {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
}

.news-card__cta {
  align-items: center;
  color: var(--primary-strong);
  display: inline-flex;
  font-size: 0.84rem;
  font-weight: 800;
  gap: 0.4rem;
  transition: gap 0.18s ease;
}

.news-card:hover .news-card__cta {
  gap: 0.65rem;
}


/* -----------------------------------------------------------------------
   7. HERO SECTION — stronger editorial presence
   ----------------------------------------------------------------------- */

.hero-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}

.hero-story {
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 30rem;
}

/* Full-bleed hero image with gradient overlay */
.hero-story__media {
  position: absolute;
  inset: 0;
  aspect-ratio: unset;
  border-radius: 0;
}

.hero-story__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero-story:hover .hero-story__media img {
  transform: scale(1.04);
}

.hero-story__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(7, 17, 31, 0.82) 0%,
    rgba(7, 17, 31, 0.38) 50%,
    rgba(7, 17, 31, 0.12) 100%
  );
  border-radius: inherit;
}

.hero-story__content {
  position: relative;
  z-index: 2;
  align-self: end;
  padding: 2rem 1.8rem 1.8rem;
  gap: 0.7rem;
  display: grid;
}

.hero-story__content .story-title {
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.hero-story__content .story-meta {
  color: rgba(255, 255, 255, 0.78);
}

/* Story tiles in hero sidebar */
.story-tiles {
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.story-tile {
  align-items: center;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  padding: 0.9rem;
}

.story-tile__media {
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4/3;
  flex-shrink: 0;
}

.story-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.story-tile:hover .story-tile__media img {
  transform: scale(1.06);
}

.story-tile__content .story-title--sm {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* -----------------------------------------------------------------------
   8. SECTION HEADING — more refined
   ----------------------------------------------------------------------- */

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.section-heading h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.65rem);
  margin: 0;
  line-height: 1.1;
}

.section-heading h4 {
  font-size: 1.05rem;
  margin: 0;
}

.section-heading p {
  color: var(--text-soft);
  font-size: 0.92rem;
  margin: 0.3rem 0 0;
}

.site-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.site-kicker::before {
  content: "";
  width: 2.2rem;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), transparent);
  border-radius: 999px;
  flex-shrink: 0;
}


/* -----------------------------------------------------------------------
   9. SIDEBAR PANELS — polished interior
   ----------------------------------------------------------------------- */

.sidebar-stack {
  display: grid;
  gap: 1rem;
}

.sidebar-item {
  align-items: start;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.18s ease;
}

.sidebar-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar-item:hover {
  opacity: 0.8;
}

.headline-index {
  align-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-radius: 12px;
  color: #fff;
  display: inline-flex;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  height: 2rem;
  justify-content: center;
  width: 2rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.headline-title {
  color: var(--bg-contrast);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 0.25rem;
}

.sidebar-muted {
  color: var(--text-faint);
  font-size: 0.78rem;
}


/* -----------------------------------------------------------------------
   10. NEWSLETTER CARD — refined
   ----------------------------------------------------------------------- */

.newsletter-card {
  background: linear-gradient(135deg, rgba(14, 165, 164, 0.07), rgba(249, 115, 22, 0.04));
  border-color: rgba(14, 165, 164, 0.16);
  padding: 1.35rem;
}

.newsletter-card--compact {
  padding: 1.2rem;
}

.newsletter-card__copy h3,
.newsletter-card__copy h4 {
  font-size: 1.08rem;
  margin: 0.35rem 0;
}

.newsletter-card__copy p {
  color: var(--text-soft);
  font-size: 0.89rem;
  margin: 0;
}

.newsletter-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.newsletter-form__row input {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(14, 165, 164, 0.18);
  border-radius: 14px;
  color: var(--bg-contrast);
  font-size: 0.9rem;
  min-height: 3rem;
  outline: none;
  padding: 0.75rem 1rem;
  width: 100%;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

html[data-theme="dark"] .newsletter-form__row input {
  background: rgba(15, 23, 42, 0.62);
}

.newsletter-form__row input:focus {
  border-color: rgba(14, 165, 164, 0.4);
  box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.1);
}

.newsletter-form .site-button {
  width: 100%;
}


/* -----------------------------------------------------------------------
   11. SUBMIT STORY CARD
   ----------------------------------------------------------------------- */

.submit-story-card {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.07), rgba(14, 165, 164, 0.04));
  border-color: rgba(249, 115, 22, 0.14);
  padding: 1.35rem;
}

.submit-story-card h3 {
  font-size: 1.1rem;
  margin: 0.3rem 0 0.5rem;
}

.submit-story-card p {
  color: var(--text-soft);
  font-size: 0.89rem;
  margin: 0 0 1rem;
}

.submit-story-card a {
  align-items: center;
  color: var(--accent);
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 800;
  gap: 0.45rem;
  transition: gap 0.18s ease;
}

.submit-story-card a:hover {
  gap: 0.7rem;
  color: var(--accent);
}


/* -----------------------------------------------------------------------
   12. STORY BADGE + MEDIA TYPE CHIP
   ----------------------------------------------------------------------- */

.story-badge {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--accent);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  gap: 0.4rem;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.75rem;
  text-transform: uppercase;
}

.story-badge--primary {
  background: rgba(14, 165, 164, 0.1);
  color: var(--primary-strong);
}

.story-badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.media-type-chip {
  align-items: center;
  background: rgba(7, 17, 31, 0.72);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  bottom: 0.75rem;
  color: #fff;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  gap: 0.4rem;
  left: 0.75rem;
  padding: 0.38rem 0.75rem;
  position: absolute;
  z-index: 2;
}

.media-type-chip--live {
  background: rgba(239, 68, 68, 0.88);
  animation: pulse-badge 2s ease-in-out infinite;
}

.media-type-chip--ended {
  background: rgba(100, 116, 139, 0.82);
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.78; }
}


/* -----------------------------------------------------------------------
   13. AD SLOTS — clean, unobtrusive
   ----------------------------------------------------------------------- */

.ad-slot {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ad-slot-header {
  align-items: center;
  background: rgba(14, 165, 164, 0.04);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: center;
  padding: 0.35rem 1rem;
}

.ad-slot-label {
  color: var(--text-faint);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.ad-slot-content {
  min-height: 6rem;
  padding: 0.75rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* -----------------------------------------------------------------------
   14. ARTICLE PAGE IMPROVEMENTS
   ----------------------------------------------------------------------- */

.article-hero {
  display: grid;
  gap: 1.25rem;
  padding: 1.4rem;
}

.article-hero__media {
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.article-hero__title {
  font-size: clamp(1.8rem, 3.8vw, 3.2rem);
  line-height: 1.06;
  margin: 0;
  letter-spacing: -0.03em;
}

.article-hero__dek {
  color: var(--text-soft);
  font-size: 1.08rem;
  line-height: 1.65;
  margin: 0;
  max-width: 58ch;
}

.article-content-card {
  padding: 0 1.4rem 1.4rem;
}

.article-prose {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.9;
  max-width: 72ch;
}

.article-prose > * + * {
  margin-top: 1.3rem;
}

.article-prose h2 {
  font-size: 1.7rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.article-prose h3 {
  font-size: 1.3rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.article-prose a {
  color: var(--primary-strong);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(14, 165, 164, 0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.18s ease;
}

.article-prose a:hover {
  text-decoration-color: var(--primary);
}

.article-prose blockquote {
  background: rgba(14, 165, 164, 0.05);
  border-left: 3px solid var(--primary);
  border-radius: 0 16px 16px 0;
  margin: 0;
  padding: 1.2rem 1.5rem;
  font-style: italic;
  color: var(--text-soft);
}

.article-prose img {
  border-radius: 18px;
  max-width: 100%;
  height: auto;
}

/* Story meta in article */
.story-meta {
  align-items: center;
  color: var(--text-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-size: 0.85rem;
}

.story-meta .dot {
  background: var(--border-strong);
  border-radius: 999px;
  height: 3px;
  width: 3px;
  flex-shrink: 0;
}

/* Author card */
.article-author {
  align-items: center;
  display: grid;
  gap: 1.1rem;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 1.35rem;
}

.article-author__avatar {
  align-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-radius: 20px;
  color: #fff;
  display: inline-flex;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  height: 4rem;
  justify-content: center;
  width: 4rem;
  flex-shrink: 0;
}

/* Share chips */
.share-chip {
  align-items: center;
  background: rgba(14, 165, 164, 0.07);
  border: 1px solid rgba(14, 165, 164, 0.14);
  border-radius: 14px;
  color: var(--primary-strong);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.95rem;
  height: 2.65rem;
  justify-content: center;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  width: 2.65rem;
}

.share-chip:hover {
  background: rgba(14, 165, 164, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(14, 165, 164, 0.15);
}

/* Article navigation */
.article-nav-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.article-nav-card {
  align-items: center;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 1rem 1.1rem;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.article-nav-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.article-nav-card--reverse {
  grid-template-columns: minmax(0, 1fr) auto;
  text-align: right;
}

.article-nav-card__icon {
  align-items: center;
  background: rgba(14, 165, 164, 0.09);
  border-radius: 14px;
  color: var(--primary-strong);
  display: inline-flex;
  font-size: 0.95rem;
  height: 2.85rem;
  justify-content: center;
  width: 2.85rem;
  flex-shrink: 0;
  transition: background 0.18s ease;
}

.article-nav-card:hover .article-nav-card__icon {
  background: rgba(14, 165, 164, 0.16);
}


/* -----------------------------------------------------------------------
   15. LIVE STORY PILLS
   ----------------------------------------------------------------------- */

.live-story-pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  gap: 0.4rem;
  letter-spacing: 0.1em;
  padding: 0.38rem 0.8rem;
}

.live-story-pill.is-live {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.live-story-pill.is-live i {
  animation: pulse-badge 1.5s ease-in-out infinite;
  font-size: 0.55rem;
}

.live-story-pill.is-ended {
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-soft);
  border: 1px solid var(--border);
}


/* -----------------------------------------------------------------------
   16. SEARCH MODAL — improved
   ----------------------------------------------------------------------- */

.search-modal__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  margin: 5.5rem auto 0;
  max-width: 48rem;
  padding: 1.25rem;
  width: min(92vw, 48rem);
  animation: slideDown 0.22s ease forwards;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-0.75rem); }
  to   { opacity: 1; transform: translateY(0); }
}

.search-modal__form {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.search-modal__form input {
  background: rgba(14, 165, 164, 0.04);
  border: 1px solid rgba(14, 165, 164, 0.16);
  border-radius: 16px;
  min-height: 3.25rem;
  padding: 0.9rem 1.1rem;
  font-size: 1rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-modal__form input:focus {
  border-color: rgba(14, 165, 164, 0.38);
  box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.1);
}


/* -----------------------------------------------------------------------
   17. PAGINATION — clean + accessible
   ----------------------------------------------------------------------- */

.pagination-wrap {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  padding: 0.5rem 0;
}

.pagination {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.page-link,
.page-item span {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--bg-contrast);
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 700;
  height: 2.85rem;
  justify-content: center;
  min-width: 2.85rem;
  padding: 0 0.9rem;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.page-link:hover {
  background: rgba(14, 165, 164, 0.08);
  border-color: rgba(14, 165, 164, 0.2);
  color: var(--primary-strong);
  transform: translateY(-1px);
}

.page-item.active .page-link {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 14px rgba(14, 165, 164, 0.25);
}

.page-item.disabled .page-link,
.page-item.disabled span {
  color: var(--text-faint);
  opacity: 0.6;
  pointer-events: none;
}


/* -----------------------------------------------------------------------
   18. NEWS GRID — responsive layout logic
   ----------------------------------------------------------------------- */

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

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

/* When inside content-grid main section, respect available width */
.content-grid > section .news-grid,
.content-grid > section .news-grid--cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}


/* -----------------------------------------------------------------------
   19. FOOTER — elevated polish
   ----------------------------------------------------------------------- */

.footer-shell {
  padding: 0 0 2.5rem;
}

.footer-panel {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.4fr 1fr 1fr;
  padding: 2rem 2rem 1.5rem;
}

.footer-links {
  display: grid;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.18s ease, padding-left 0.18s ease;
}

.footer-links a:hover {
  color: var(--primary-strong);
  padding-left: 0.35rem;
}

.footer-bottom {
  align-items: center;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.84rem;
  gap: 0.8rem;
  justify-content: space-between;
  margin-top: 1rem;
  padding: 1rem 0.25rem 0;
}

.footer-socials a,
.back-top {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--bg-contrast);
  display: inline-flex;
  height: 2.7rem;
  justify-content: center;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
  width: 2.7rem;
}

.footer-socials a:hover,
.back-top:hover {
  background: rgba(14, 165, 164, 0.09);
  color: var(--primary-strong);
  transform: translateY(-2px);
}


/* -----------------------------------------------------------------------
   20. SCROLLBAR IMPROVEMENTS
   ----------------------------------------------------------------------- */

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.18);
  border-radius: 999px;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.2);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(14, 165, 164, 0.38);
}


/* -----------------------------------------------------------------------
   21. BUTTON SYSTEM — refined
   ----------------------------------------------------------------------- */

.site-button,
.btn-site {
  appearance: none;
  align-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border: 1px solid transparent;
  border-radius: 14px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  font-size: 0.9rem;
  gap: 0.5rem;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0 1.3rem;
  text-align: center;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.site-button:hover,
.btn-site:hover {
  box-shadow: 0 10px 24px rgba(14, 165, 164, 0.28);
  color: #fff;
  opacity: 0.92;
  transform: translateY(-1px);
}

.site-button:active {
  transform: translateY(0);
}

.site-button--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--bg-contrast);
}

.site-button--ghost:hover {
  background: rgba(14, 165, 164, 0.07);
  box-shadow: none;
  color: var(--bg-contrast);
}

.site-icon-button {
  align-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--bg-contrast);
  cursor: pointer;
  display: inline-flex;
  height: 2.9rem;
  justify-content: center;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  width: 2.9rem;
}

.site-icon-button:hover {
  background: rgba(14, 165, 164, 0.08);
  border-color: rgba(14, 165, 164, 0.2);
  color: var(--primary-strong);
}


/* -----------------------------------------------------------------------
   22. VIDEO SHOWCASE SECTION
   ----------------------------------------------------------------------- */

.video-showcase__grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
}

.video-feature {
  overflow: hidden;
}

.video-feature__media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  position: relative;
}

.video-feature__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.video-feature:hover .video-feature__media img {
  transform: scale(1.04);
}

.video-play-badge {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  bottom: 50%;
  display: inline-flex;
  height: 3.5rem;
  justify-content: center;
  left: 50%;
  position: absolute;
  transform: translate(-50%, 50%);
  width: 3.5rem;
  color: var(--primary-strong);
  font-size: 1rem;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.video-feature:hover .video-play-badge {
  transform: translate(-50%, 50%) scale(1.1);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
}

.video-feature__body {
  padding: 1.1rem 1.2rem;
  display: grid;
  gap: 0.65rem;
}

.video-feature__body h3 {
  font-size: 1.15rem;
  line-height: 1.25;
  margin: 0;
}

.video-rail {
  display: grid;
  gap: 0.65rem;
  align-content: start;
}

.video-rail__item {
  aspect-ratio: 4/3;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

.video-rail__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.video-rail__item:hover img {
  transform: scale(1.06);
}

.video-rail__item span {
  align-items: center;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  bottom: 0.6rem;
  display: inline-flex;
  height: 2.2rem;
  justify-content: center;
  left: 0.6rem;
  position: absolute;
  width: 2.2rem;
  color: var(--primary-strong);
  font-size: 0.8rem;
}


/* -----------------------------------------------------------------------
   23. SKELETON LOADER — already present, small refinements
   ----------------------------------------------------------------------- */

.shimmer-block {
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.07) 25%,
    rgba(15, 23, 42, 0.03) 50%,
    rgba(15, 23, 42, 0.07) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 10px;
}

html[data-theme="dark"] .shimmer-block {
  background: linear-gradient(
    90deg,
    rgba(148, 163, 184, 0.1) 25%,
    rgba(148, 163, 184, 0.05) 50%,
    rgba(148, 163, 184, 0.1) 75%
  );
  background-size: 200% 100%;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* -----------------------------------------------------------------------
   24. TAGS / CHIPS
   ----------------------------------------------------------------------- */

.tag-chip,
.chip {
  align-items: center;
  background: rgba(14, 165, 164, 0.07);
  border: 1px solid rgba(14, 165, 164, 0.14);
  border-radius: 10px;
  color: var(--primary-strong);
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 700;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  transition: background 0.18s ease, transform 0.18s ease;
}

.tag-chip:hover,
.chip:hover {
  background: rgba(14, 165, 164, 0.14);
  transform: translateY(-1px);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}


/* -----------------------------------------------------------------------
   25. BACK TO TOP
   ----------------------------------------------------------------------- */

.back-to-top {
  align-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border: none;
  border-radius: 14px;
  bottom: 1.5rem;
  box-shadow: 0 8px 20px rgba(14, 165, 164, 0.28);
  color: #fff;
  display: flex;
  font-size: 1rem;
  height: 3rem;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 1.5rem;
  transform: translateY(0.5rem);
  transition: opacity 0.22s ease, transform 0.22s ease;
  width: 3rem;
  z-index: 900;
}

.back-to-top.is-visible,
.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  box-shadow: 0 12px 28px rgba(14, 165, 164, 0.36);
  transform: translateY(-2px);
}


/* -----------------------------------------------------------------------
   26. SECTION LINK
   ----------------------------------------------------------------------- */

.section-link {
  align-items: center;
  color: var(--primary-strong);
  display: inline-flex;
  font-size: 0.88rem;
  font-weight: 800;
  gap: 0.45rem;
  transition: gap 0.18s ease;
  white-space: nowrap;
}

.section-link:hover {
  gap: 0.7rem;
  color: var(--primary-strong);
}


/* -----------------------------------------------------------------------
   27. NOTIFICATION TOAST (latest live)
   ----------------------------------------------------------------------- */

.latest-live-toast {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  bottom: 5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  gap: 0.85rem;
  left: 1.5rem;
  max-width: 22rem;
  padding: 0.85rem 1rem;
  position: fixed;
  z-index: 900;
  animation: slideInLeft 0.3s ease forwards;
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-1rem); }
  to   { opacity: 1; transform: translateX(0); }
}


/* -----------------------------------------------------------------------
   28. RESPONSIVE BREAKPOINTS
   ----------------------------------------------------------------------- */

/* Large screens */
@media (max-width: 1399.98px) {
  .content-grid {
    grid-template-columns: minmax(0, 1fr) 21rem;
  }

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

/* Medium screens */
@media (max-width: 1199.98px) {
  .content-grid {
    grid-template-columns: minmax(0, 1fr) 19rem;
  }

  .article-shell {
    grid-template-columns: minmax(0, 1fr) 19rem;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .story-tiles {
    display: none; /* hero sidebar tiles hidden on medium */
  }

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

  .video-showcase__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .video-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .video-rail__item {
    aspect-ratio: 16/9;
  }
}

/* Tablet */
@media (max-width: 991.98px) {
  :root {
    --header-h: 4.5rem;
  }

  .site-shell,
  .site-shell--wide {
    width: min(100%, calc(100% - 1.25rem));
  }

  /* Sidebar collapses — no longer sticky */
  .content-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sticky-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .article-rail {
    position: static;
    max-height: none;
    overflow: visible;
  }

  /* Re-arrange sidebar items horizontally on tablet */
  .sidebar-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-header__nav {
    display: none;
  }

  .site-header__bar {
    grid-template-columns: auto auto;
  }

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

  .article-nav-grid {
    grid-template-columns: 1fr;
  }

  .site-promo {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* Mobile */
@media (max-width: 767.98px) {
  .site-main {
    padding: 1rem 0 3rem;
  }

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

  .sidebar-stack {
    grid-template-columns: 1fr;
  }

  .hero-story {
    min-height: 22rem;
  }

  .article-hero__title {
    font-size: 1.7rem;
  }

  .article-prose {
    font-size: 1rem;
  }

  .footer-panel {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem 1.25rem;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .newsletter-card,
  .newsletter-card--compact {
    padding: 1.1rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .story-tiles {
    display: none;
  }

  .search-modal__card {
    margin-top: 4rem;
    border-radius: 18px;
  }

  .latest-live-toast {
    bottom: 1rem;
    left: 0.75rem;
    right: 0.75rem;
    max-width: none;
  }

  .back-to-top {
    bottom: 1rem;
    right: 1rem;
  }

  .article-hero {
    padding: 1rem;
  }

  .article-content-card {
    padding: 0 1rem 1rem;
  }

  .news-card__title {
    font-size: 1.05rem;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .share-stack {
    gap: 0.4rem;
  }

  .story-meta {
    font-size: 0.8rem;
    gap: 0.5rem;
  }
}


/* -----------------------------------------------------------------------
   29. ACCESSIBILITY
   ----------------------------------------------------------------------- */

/* Visible keyboard focus */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* -----------------------------------------------------------------------
   30. PRINT STYLES
   ----------------------------------------------------------------------- */

@media print {
  .site-header,
  .sticky-sidebar,
  .article-rail,
  .ad-slot,
  .newsletter-card,
  .submit-story-card,
  .back-to-top,
  .latest-live-toast,
  .share-stack,
  .article-nav-grid,
  .full-article-autoload-section {
    display: none !important;
  }

  .article-shell,
  .content-grid {
    display: block;
  }

  .article-prose {
    max-width: 100%;
    font-size: 11pt;
    line-height: 1.6;
  }

  .surface-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
