/* Blog, the shared Article Reader and the Homepage Featured carousel (Blog FS, Featured FS).
   Tokens come from jl-auth.css (the public layout). Text colors are the fixed three-color palette:
   production resolves White, Light Gray and Jamming.Live Red here, never from stored color values. */

:root {
  --jl-text-white: #ffffff;
  --jl-text-light-gray: #c9c9d1;
  --jl-text-red: var(--accent-bright, #ff2a2a);
  --jl-stage: #08080b;
}

.jl-c-white { color: var(--jl-text-white); }
.jl-c-light-gray { color: var(--jl-text-light-gray); }
.jl-c-jamming-red { color: var(--jl-text-red); }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.btn-auto { width: auto; }
.btn-red { background: linear-gradient(180deg, var(--accent-bright), var(--accent)); color: #fff; border-color: var(--accent); }
.btn-red:hover { filter: brightness(1.1); color: #fff; }
.btn-small { min-height: 42px; padding: 8px 16px; background: var(--panel-2); border-color: #4d535b; color: var(--ink); font-size: 0.95rem; white-space: nowrap; }
.btn-small:hover { border-color: #fff; color: #fff; }

/* ---- Public Blog ---- */
.bl-main { flex: 1; }
.bl-wrap { max-width: 1100px; margin: 0 auto; padding: 36px clamp(16px, 4vw, 40px) 64px; }
.bl-head h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: 0.01em; }

.bl-unavailable { margin: 20px 0; padding: 20px 22px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; background: var(--panel); }
.bl-unavailable h2 { margin: 0 0 6px; font-size: 1.25rem; }
.bl-unavailable p { margin: 0; color: var(--ink-soft); }

.bl-list { margin-top: 12px; }
.bl-row { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: 28px; padding: 28px 0; border-bottom: 1px solid var(--line); align-items: start; }
.bl-row:last-child { border-bottom: 0; }
.bl-row-image { display: block; aspect-ratio: 16 / 9; background: var(--jl-stage); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.bl-row-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.bl-row-text h2 { margin: 0 0 6px; font-size: clamp(1.25rem, 2.4vw, 1.65rem); line-height: 1.25; }
.bl-row-meta { margin: 0 0 12px; color: var(--ink-faint); font-size: 0.92rem; }
.bl-row-teaser { margin: 0 0 18px; color: var(--ink-soft); }
.bl-pager { display: flex; gap: 12px; justify-content: space-between; margin-top: 24px; }
.bl-pager a[rel="next"] { margin-left: auto; }

@media (max-width: 720px) {
  .bl-row { grid-template-columns: 1fr; gap: 16px; }
}

/* ---- Article Reader ---- */
html.jl-reader-open { overflow: hidden; }

.jl-reader { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.jl-reader-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.8); cursor: pointer; }
.jl-reader-panel { position: relative; display: flex; flex-direction: column; width: min(920px, 100%); max-height: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6); }
.jl-reader-panel:focus { outline: none; }
.jl-reader-close { position: absolute; top: 12px; right: 12px; z-index: 3; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(5, 5, 7, 0.82); color: #fff; font: inherit; font-size: 1.7rem; line-height: 1; cursor: pointer; text-decoration: none; }
.jl-reader-close:hover { border-color: #fff; background: #000; color: #fff; }
.jl-reader-body { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

@media (max-width: 700px) {
  .jl-reader { padding: 0; }
  .jl-reader-panel { width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; }
}

.jl-article { padding: 0 0 36px; }
.jl-article-hero { aspect-ratio: 16 / 9; background: var(--jl-stage); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.jl-article-hero img { display: block; width: 100%; height: 100%; object-fit: contain; }
.jl-article-title { margin: 26px clamp(18px, 4vw, 44px) 6px; font-size: clamp(1.6rem, 3.6vw, 2.3rem); line-height: 1.2; }
.jl-article-meta { margin: 0 clamp(18px, 4vw, 44px) 22px; color: var(--ink-faint); font-size: 0.95rem; }
.jl-article-text, .jl-article-additional { margin: 0 clamp(18px, 4vw, 44px); display: flow-root; font-size: 1.05rem; line-height: 1.7; color: var(--ink); }
.jl-article-text p, .jl-article-additional p { margin: 0 0 1.1em; }
.jl-article-additional { margin-top: 8px; }
.jl-article-cta { margin: 28px clamp(18px, 4vw, 44px) 0; }

/* The Second Image sits after the first paragraph; the rest of the text wraps around it (desktop / tablet), full width on a phone. */
.jl-article-second { margin: 4px 0 14px; max-width: 42%; }
.jl-article-second img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); background: var(--jl-stage); }
.jl-second-left { float: left; margin-right: 24px; }
.jl-second-right { float: right; margin-left: 24px; }

@media (max-width: 700px) {
  .jl-article-second { float: none; max-width: 100%; margin: 4px 0 18px; }
  .jl-second-left, .jl-second-right { margin-left: 0; margin-right: 0; }
}

/* ---- Homepage Featured carousel ---- */
.fc { margin: 0 auto; }
.fc-title { margin: 0 0 14px; font-size: clamp(1.4rem, 2.4vw, 1.8rem); }

.fc-frame { position: relative; }
.fc-stage { position: relative; aspect-ratio: 16 / 9; width: 100%; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: var(--jl-stage); container-type: inline-size; touch-action: pan-y; }
.fc-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 600ms ease, visibility 0s linear 600ms; }
.fc-slide.is-active { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 600ms ease; }
.fc-media { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--jl-stage); }
.fc-media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.fc-whole { position: absolute; inset: 0; z-index: 1; display: block; }
.fc-whole:focus-visible { outline-offset: -4px; }

.fc-overlay { position: absolute; inset: 0; z-index: 2; display: flex; padding: 4cqw; pointer-events: none; }
.fc-text { max-width: 72%; pointer-events: auto; overflow-wrap: anywhere; }
.fc-text p { margin: 0; white-space: pre-line; line-height: 1.3; font-weight: 600; }
.fc-text .btn { margin-top: 1.4cqw; pointer-events: auto; font-size: clamp(0.8rem, 1.7cqw, 1rem); min-height: 0; padding: 0.9cqw 2.2cqw; }

/* Nine fixed positions. */
.fc-pos-top-left, .fc-pos-top-center, .fc-pos-top-right { align-items: flex-start; }
.fc-pos-center-left, .fc-pos-center, .fc-pos-center-right { align-items: center; }
.fc-pos-bottom-left, .fc-pos-bottom-center, .fc-pos-bottom-right { align-items: flex-end; }
.fc-pos-top-left, .fc-pos-center-left, .fc-pos-bottom-left { justify-content: flex-start; text-align: left; }
.fc-pos-top-center, .fc-pos-center, .fc-pos-bottom-center { justify-content: center; text-align: center; }
.fc-pos-top-right, .fc-pos-center-right, .fc-pos-bottom-right { justify-content: flex-end; text-align: right; }

/* Fixed text sizes (one approved font). */
.fc-size-small .fc-text p { font-size: clamp(0.8rem, 1.7cqw, 1.1rem); }
.fc-size-medium .fc-text p { font-size: clamp(1rem, 2.7cqw, 1.7rem); }
.fc-size-large .fc-text p { font-size: clamp(1.25rem, 3.9cqw, 2.5rem); }
.fc-size-xlarge .fc-text p { font-size: clamp(1.5rem, 5.4cqw, 3.5rem); }

/* Readability treatments. */
.fc-treat-subtle_shadow .fc-text p { text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.9); }
.fc-treat-semi_transparent_dark_box .fc-text { background: rgba(5, 5, 7, 0.72); padding: 2.2cqw 2.8cqw; border-radius: 8px; }
.fc-treat-semi_transparent_light_box .fc-text { background: rgba(244, 241, 236, 0.84); padding: 2.2cqw 2.8cqw; border-radius: 8px; }

.fc-ctrl { position: absolute; top: 50%; z-index: 4; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.4); background: rgba(5, 5, 7, 0.72); color: #fff; font: inherit; font-size: 1.6rem; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.fc-ctrl:hover { border-color: #fff; background: #000; }
.fc-prev { left: 12px; }
.fc-next { right: 12px; }

.fc-bar { display: flex; align-items: center; gap: 16px; justify-content: center; margin-top: 12px; }
.fc-pause { min-height: 36px; padding: 6px 14px; border-radius: 8px; border: 1px solid #4d535b; background: var(--panel-2); color: var(--ink); font: inherit; font-size: 0.9rem; cursor: pointer; }
.fc-pause:hover { border-color: #fff; color: #fff; }
.fc-dots { display: flex; gap: 6px; align-items: center; }
.fc-dot { width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.fc-dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #5a5a66; transition: background 150ms; }
.fc-dot[aria-current="true"]::before { background: var(--accent-bright); }
.fc-dot:hover::before { background: #fff; }

@media (max-width: 700px) {
  .fc-ctrl { width: 38px; height: 38px; }
  .fc-prev { left: 6px; }
  .fc-next { right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .fc-slide, .fc-slide.is-active { transition: none; }
}

/* Controls only exist once the script has made them work. */
.fc:not(.is-ready) .fc-ctrl, .fc:not(.is-ready) .fc-bar { display: none; }
