/**
 * SiteMax Quicknews — preset wrappers for the embeddable widget.
 *
 * Pair with /1/widget/quicknews.js. Each preset is a wrapper class around the
 * widget's target div ([data-smx-quicknews]). Drop the snippet on a page and
 * adjust copy/options to taste.
 *
 *   <link rel="stylesheet" href="/1/widget/quicknews-presets.css">
 *   <script src="/1/widget/quicknews.js" defer></script>
 *
 * Presets:
 *   .qn-banner     — slim horizontal announcement bar (one item)
 *   .qn-section    — full-width section with kicker/heading + 3-up grid
 *   .qn-spotlight  — single highlighted card, vertical
 *
 * Variables (--navy, --teal, etc.) are pulled from sitemax-vector.css when
 * loaded; literal fallbacks are provided so presets still render on pages
 * without the brand stylesheet.
 */

/* ── Shared resets / fallbacks for the inner widget ──────────────────────── */
.qn-preset-wrap [data-smx-quicknews] { width: 100%; }
.qn-preset-wrap .smx-qn-empty { display: none; }

/* ────────────────────────────────────────────────────────────────────────── *
 * BANNER — slim horizontal bar showing the newest item.
 * Use with: data-layout="card" data-limit="1" data-theme="dark"
 *           data-hide-when-empty
 * ────────────────────────────────────────────────────────────────────────── */
.qn-banner {
  background: linear-gradient(180deg,
              rgba(45, 212, 200, 0.07) 0%,
              rgba(45, 212, 200, 0.02) 100%);
  border-bottom: 1px solid rgba(45, 212, 200, 0.18);
  padding: 0.75rem 1.5rem;
}
.qn-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.qn-banner .smx-qn-list { gap: 0; }
.qn-banner .smx-qn-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0.35rem 0;
  transform: none !important;
}
.qn-banner .smx-qn-card:hover { transform: none !important; box-shadow: none !important; }
.qn-banner .smx-qn-thumb {
  width: 56px; height: 40px;
  margin: 0;
  flex-shrink: 0;
  border-radius: 4px;
}
.qn-banner .smx-qn-meta {
  display: inline-block;
  margin: 0;
  background: rgba(45, 212, 200, 0.14);
  color: var(--teal, #2DD4C8);
  padding: 0.18rem 0.55rem;
  border-radius: 3px;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  flex-shrink: 0;
}
.qn-banner .smx-qn-headline {
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0;
  flex: 1 1 200px;
  color: var(--white, #FFFFFF);
}
.qn-banner .smx-qn-body {
  display: none;   /* keep banner one-line — body lives in the linked page */
}
.qn-banner .smx-qn-links { margin: 0; flex-shrink: 0; }
.qn-banner .smx-qn-link {
  background: var(--teal, #2DD4C8) !important;
  color: var(--navy, #0A1628) !important;
  font-size: 0.78rem;
  padding: 0.4rem 0.85rem;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .qn-banner .smx-qn-meta { display: none; }
  .qn-banner .smx-qn-headline { font-size: 0.85rem; flex-basis: 100%; }
}

/* ────────────────────────────────────────────────────────────────────────── *
 * SECTION — full-width section with kicker/heading + 3-up card grid.
 * Use with: data-limit="3" data-theme="dark" data-hide-when-empty
 * ────────────────────────────────────────────────────────────────────────── */
.qn-section {
  padding: 4rem 1.5rem;
}
.qn-section-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.qn-section-head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 2.5rem;
}
.qn-section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--teal, #2DD4C8);
  margin-bottom: 1rem;
}
.qn-section-kicker::before {
  content: '';
  width: 24px; height: 1px;
  background: currentColor;
}
.qn-section-title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  color: var(--white, #FFFFFF);
  line-height: 1.15;
  margin: 0;
}
.qn-section-title .t { color: var(--teal, #2DD4C8); }
.qn-section-sub {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text, #C8D8EE);
  margin: 1rem auto 0;
}

.qn-section .smx-qn-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
.qn-section .smx-qn-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem 1.35rem;
}
.qn-section .smx-qn-thumb {
  height: 160px;
  margin-bottom: 0.85rem;
}
.qn-section .smx-qn-headline { font-size: 1.05rem; line-height: 1.3; }
.qn-section .smx-qn-body { font-size: 0.88rem; flex: 1 1 auto; }
.qn-section .smx-qn-links { margin-top: 1rem; }

@media (max-width: 900px) {
  .qn-section .smx-qn-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .qn-section { padding: 3rem 1rem; }
  .qn-section .smx-qn-list { grid-template-columns: 1fr; }
}

/* ────────────────────────────────────────────────────────────────────────── *
 * CAROUSEL — small horizontal cards in a swipeable row.
 * Use with: data-theme="dark" data-limit="6" data-hide-when-empty
 * Pair with /1/widget/quicknews-presets.js for arrow controls.
 * ────────────────────────────────────────────────────────────────────────── */
.qn-carousel {
  position: relative;
  padding: 3rem 0;
}
.qn-carousel-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.qn-carousel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.qn-carousel-head-text { flex: 1 1 320px; }
.qn-carousel-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--navy-mid, #0F2035);
  border: 1px solid rgba(45, 212, 200, 0.28);
  color: var(--white, #FFFFFF);
  padding: 0.32rem 0.8rem 0.32rem 0.45rem;
  border-radius: 100px;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.55rem;
  box-shadow: 0 0 0 4px rgba(45, 212, 200, 0.05);
}
.qn-carousel-kicker img {
  width: 16px; height: 16px;
  flex-shrink: 0;
  display: block;
}
.qn-carousel-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white, #FFFFFF);
  line-height: 1.3;
  margin: 0;
  display: inline;
}
.qn-carousel-title .t { color: var(--teal, #2DD4C8); }
/* Subtitle flows inline with the title in a single compact line */
.qn-carousel-sub {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text, #C8D8EE);
  margin: 0;
  display: inline;
}
.qn-carousel-title::after {
  content: ' — ';
  color: var(--muted, #7A9BBF);
  opacity: 0.55;
  font-weight: 400;
}

/* Arrow controls */
.qn-carousel-controls {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.qn-carousel-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(45, 212, 200, 0.08);
  border: 1px solid rgba(45, 212, 200, 0.25);
  color: var(--teal, #2DD4C8);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  transition: background 0.18s, border-color 0.18s, opacity 0.18s, transform 0.1s;
  padding: 0;
}
.qn-carousel-btn:hover {
  background: rgba(45, 212, 200, 0.16);
  border-color: rgba(45, 212, 200, 0.5);
}
.qn-carousel-btn:active { transform: scale(0.94); }
.qn-carousel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.qn-carousel-btn svg { width: 18px; height: 18px; }

/* Track — horizontal scroll with snap */
.qn-carousel-track {
  position: relative;
  overflow: hidden;
}
.qn-carousel [data-smx-quicknews] { display: block; }
.qn-carousel .smx-qn-list {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  overflow-x: auto;
  /* Smooth-scroll is handled per-call by the arrow buttons (scrollIntoView
     with behavior:'smooth'). We deliberately keep scroll-behavior at `auto`
     here — Chrome refuses to commit programmatic scrollLeft writes when the
     element has scroll-behavior:smooth set. */
  scroll-behavior: auto;
  scroll-padding-left: 0.25rem;
  padding: 0.25rem 0.25rem 1.25rem;   /* room for hover lift + scrollbar */
  margin: 0 -0.25rem;
  /* Hide scrollbar visually but keep functional */
  scrollbar-width: thin;
  scrollbar-color: rgba(45,212,200,0.3) transparent;
}
.qn-carousel .smx-qn-list::-webkit-scrollbar { height: 6px; }
.qn-carousel .smx-qn-list::-webkit-scrollbar-track { background: transparent; }
.qn-carousel .smx-qn-list::-webkit-scrollbar-thumb {
  background: rgba(45,212,200,0.25);
  border-radius: 3px;
}

/* Card — small, horizontal layout: thumb left, text right */
.qn-carousel .smx-qn-card {
  flex: 0 0 340px;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0.95rem;
  padding: 0.95rem 1.05rem;
  align-items: stretch;
  min-height: 120px;
}
.qn-carousel .smx-qn-thumb {
  width: 96px;
  height: 96px;
  margin: 0;
  border-radius: 6px;
  align-self: center;
}
/* When no image, the thumb element is absent — collapse the grid */
.qn-carousel .smx-qn-card:not(:has(.smx-qn-thumb)) {
  grid-template-columns: 1fr;
}
.qn-carousel .smx-qn-meta {
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.3rem;
}
.qn-carousel .smx-qn-headline {
  font-size: 0.92rem;
  line-height: 1.3;
  margin: 0 0 0.35rem;
  /* Clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.qn-carousel .smx-qn-body {
  font-size: 0.78rem;
  line-height: 1.5;
  margin: 0;
  /* Fade-out teaser — full content lives in the modal. Allow just over one
     line, then aggressively fade so any second-line glyphs vanish into the
     card background instead of being half-readable. */
  max-height: 1.8em;
  overflow: hidden;
  opacity: 0.85;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 25%, transparent 95%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 25%, transparent 95%);
}
.qn-carousel .smx-qn-body p { margin: 0; }
/* Hide inline link button on carousel cards — full content opens in modal */
.qn-carousel .smx-qn-links { display: none; }

/* Whole card is clickable — opens the modal */
.qn-carousel .smx-qn-card {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.qn-carousel .smx-qn-card:hover {
  transform: translateY(-2px);
  border-color: rgba(45, 212, 200, 0.4) !important;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
}

@media (max-width: 720px) {
  .qn-carousel { padding: 2.25rem 0; }
  .qn-carousel-controls { display: none; }   /* swipe-only on mobile */
  .qn-carousel .smx-qn-card {
    flex-basis: 85%;
    min-height: 110px;
    padding: 0.85rem 0.95rem;
  }
  .qn-carousel .smx-qn-thumb { width: 80px; height: 80px; }
  .qn-carousel .smx-qn-card { grid-template-columns: 80px 1fr; }
}

/* ────────────────────────────────────────────────────────────────────────── *
 * MODAL — opens when a carousel card is clicked.
 * Built lazily by quicknews-presets.js and reused for all cards.
 * ────────────────────────────────────────────────────────────────────────── */
.qn-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}
.qn-modal.is-open {
  opacity: 1;
  visibility: visible;
}
.qn-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 12, 24, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}
.qn-modal-card {
  position: relative;
  background: var(--navy-card, #111F38);
  border: 1px solid rgba(45, 212, 200, 0.18);
  border-radius: 14px;
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 3rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  transform: translateY(8px) scale(0.985);
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.qn-modal.is-open .qn-modal-card {
  transform: translateY(0) scale(1);
}
.qn-modal-close {
  position: absolute;
  top: 0.85rem; right: 0.85rem;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(10, 22, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--white, #FFFFFF);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  font-family: inherit;
  padding: 0;
}
.qn-modal-close:hover {
  background: rgba(45, 212, 200, 0.18);
  border-color: rgba(45, 212, 200, 0.5);
}
.qn-modal-close:active { transform: scale(0.94); }
.qn-modal-close svg { width: 18px; height: 18px; }

.qn-modal-content {
  overflow-y: auto;
  padding: 0;
}
.qn-modal-image {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
}
.qn-modal-body {
  padding: 1.5rem 1.75rem 1.75rem;
}
.qn-modal-meta {
  display: inline-block;
  background: rgba(45, 212, 200, 0.14);
  color: var(--teal, #2DD4C8);
  padding: 0.22rem 0.65rem;
  border-radius: 4px;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.85rem;
}
.qn-modal-headline {
  font-family: 'Poppins', sans-serif;
  font-size: 1.4rem;
  line-height: 1.25;
  font-weight: 700;
  color: var(--white, #FFFFFF);
  margin: 0 0 0.85rem;
}
.qn-modal-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text, #C8D8EE);
}
.qn-modal-text p { margin: 0 0 0.85rem; }
.qn-modal-text p:last-child { margin-bottom: 0; }
.qn-modal-text a { color: var(--teal, #2DD4C8); text-decoration: underline; }
.qn-modal-text ul,
.qn-modal-text ol { margin: 0 0 0.85rem 1.25rem; }
.qn-modal-text blockquote {
  border-left: 3px solid var(--teal, #2DD4C8);
  margin: 0.85rem 0;
  padding: 0.4rem 0.95rem;
  background: rgba(45, 212, 200, 0.06);
  border-radius: 0 6px 6px 0;
}

.qn-modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(45, 212, 200, 0.12);
}
.qn-modal-link {
  display: inline-block;
  background: var(--teal, #2DD4C8);
  color: var(--navy, #0A1628);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  transition: opacity 0.15s;
}
.qn-modal-link:hover { opacity: 0.85; }

@media (max-width: 600px) {
  .qn-modal { padding: 0.75rem; }
  .qn-modal-headline { font-size: 1.2rem; }
  .qn-modal-body { padding: 1.25rem 1.25rem 1.5rem; }
}

/* When modal is open, prevent body scroll */
body.qn-modal-open {
  overflow: hidden;
}

/* ────────────────────────────────────────────────────────────────────────── *
 * SPOTLIGHT — one highlighted card, vertical, centered.
 * Use with: data-layout="card" data-theme="dark" data-hide-when-empty
 * ────────────────────────────────────────────────────────────────────────── */
.qn-spotlight {
  max-width: 720px;
  margin: 2.5rem auto;
  padding: 0 1rem;
}
.qn-spotlight .smx-qn-card {
  padding: 1.75rem 2rem;
  border-radius: 14px;
}
.qn-spotlight .smx-qn-thumb {
  max-height: 280px;
  margin-bottom: 1.25rem;
}
.qn-spotlight .smx-qn-headline {
  font-size: 1.35rem;
  line-height: 1.25;
}
.qn-spotlight .smx-qn-body {
  font-size: 0.95rem;
  line-height: 1.7;
}
.qn-spotlight .smx-qn-links { margin-top: 1.25rem; }
.qn-spotlight .smx-qn-link {
  font-size: 0.85rem;
  padding: 0.55rem 1.1rem;
}
@media (max-width: 600px) {
  .qn-spotlight .smx-qn-card { padding: 1.25rem 1.25rem; }
  .qn-spotlight .smx-qn-headline { font-size: 1.15rem; }
}
