/* Fuzzi Fi Journal — loaded only on Journal pages. Uses the tokens defined in styles.css. */

/* Page head (landing, categories, 404) */
.jhead { padding: calc(var(--header-h) + 1.75rem) 0 1.5rem; background: radial-gradient(60% 80% at 85% 0%, #fff6e6 0%, rgba(255, 246, 230, 0) 70%); }
.jhead h1 { font-size: clamp(2.1rem, 4.4vw, 3.1rem); margin-bottom: 0.4em; max-width: 22ch; }
.jintro { color: var(--muted); font-size: clamp(1.05rem, 1.4vw, 1.18rem); max-width: 40rem; }

/* Breadcrumbs */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 1.25rem; padding: 0; font-size: 0.88rem; color: var(--subtle); }
.crumbs li + li::before { content: '›'; margin-right: 0.35rem; color: var(--subtle); }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 700; }
.crumbs a:hover { color: var(--coral); }
.crumbs [aria-current] { color: var(--subtle); }

/* Language switch */
.jlang { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 800; font-size: 0.92rem; color: var(--green-text); text-decoration: none; margin: 0.25rem 0 0; }
.jlang::before { content: ''; width: 18px; height: 18px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12.87 15.07-2.54-2.51.03-.03A17.52 17.52 0 0 0 14.07 6H17V4h-7V2H8v2H1v2h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2zm-2.62 7 1.62-4.33L19.12 17z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12.87 15.07-2.54-2.51.03-.03A17.52 17.52 0 0 0 14.07 6H17V4h-7V2H8v2H1v2h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2zm-2.62 7 1.62-4.33L19.12 17z'/%3E%3C/svg%3E") center / contain no-repeat; }
.jlang:hover { color: var(--coral); }

/* Topic navigation */
.jtopics ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0 0; padding: 0; }
.jtopics a {
  display: inline-block; padding: 0.5rem 1rem; border-radius: 999px; text-decoration: none; font-weight: 800; font-size: 0.92rem;
  color: var(--navy); background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.jtopics a:hover { color: var(--coral); }
.jtopics a[aria-current] { background: var(--navy); border-color: var(--navy); color: #fff; }

/* Sections */
.jfeatured { padding: 1rem 0 0.5rem; }
.jlatest, .jrelated { padding: 2.5rem 0 4.5rem; }
.jsection-title { font-size: clamp(1.4rem, 2.4vw, 1.8rem); margin-bottom: 1.25rem; }

/* Cards: the whole card is clickable through its title link */
.jgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.jcard {
  position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform 0.25s ease, box-shadow 0.25s ease;
}
@media (hover: hover) { .jcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); } }
.jcard:focus-within { outline: 3px solid var(--blue); outline-offset: 3px; }
.jcard-media { aspect-ratio: 16 / 9; background: var(--meadow); overflow: hidden; }
.jcard-media img { width: 100%; height: 100%; object-fit: cover; }
.jcard-body { display: flex; flex-direction: column; flex: 1; padding: 1.1rem 1.25rem 1.25rem; }
.jcard-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 0.6rem; }
.jcard-title { font-size: 1.12rem; line-height: 1.3; margin: 0 0 0.5rem; }
.jcard-title a { color: var(--navy); text-decoration: none; }
.jcard-title a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.jcard-title a:focus-visible { outline: none; }
.jcard-excerpt { color: var(--muted); font-size: 0.94rem; margin: 0 0 0.9rem; flex: 1; }
.jcat {
  position: relative; z-index: 2; display: inline-block; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none; padding: 0.22rem 0.65rem; border-radius: 999px;
}
.jcat--green { background: var(--green-tint); color: var(--green-text); }
.jcat--blue { background: var(--blue-tint); color: #3f6fc4; }
.jcat--coral { background: var(--coral-tint); color: #c4473a; }
.jcat--lavender { background: var(--lavender-tint); color: #6f52b8; }
.jflag { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--coral); }
.jmeta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; color: var(--subtle); font-size: 0.86rem; font-weight: 700; }

/* Featured card */
.jcard--featured { display: grid; grid-template-columns: 1.15fr 1fr; }
.jcard--featured .jcard-media { aspect-ratio: auto; min-height: 320px; }
.jcard--featured .jcard-body { padding: 2rem 2.25rem; justify-content: center; }
.jcard--featured .jcard-title { font-size: clamp(1.45rem, 2.6vw, 2rem); line-height: 1.18; }
.jcard--featured .jcard-excerpt { font-size: 1.02rem; flex: 0 0 auto; }

/* Subtle call to action */
.jcta {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1.25rem; align-items: center; margin-top: 2.5rem; padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #fff 0%, #fff6f2 100%); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.jcta img { border-radius: 16px; }
.jcta h2 { font-size: 1.12rem; margin: 0 0 0.2rem; }
.jcta p { margin: 0; color: var(--muted); font-size: 0.94rem; }

/* Article */
.jarticle-wrap { padding-top: calc(var(--header-h) + 1.75rem); }
.post-head { max-width: 50rem; }
.post-head h1 { font-size: clamp(2rem, 4.2vw, 3rem); margin: 0 0 0.45em; }
.post-dek { color: var(--muted); font-size: clamp(1.08rem, 1.5vw, 1.25rem); margin-bottom: 1rem; }
.post-meta { margin-bottom: 0.5rem; }
.post-cover { margin: 1.75rem auto 2.25rem; }
.post-cover img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.post-layout { display: grid; grid-template-columns: 220px minmax(0, 46rem); gap: 3rem; align-items: start; justify-content: center; }
.post-toc { position: sticky; top: calc(var(--header-h) + 1rem); font-size: 0.9rem; }
.post-toc-title { font-weight: 800; color: var(--navy); margin-bottom: 0.5rem; }
.post-toc ol { list-style: none; margin: 0; padding: 0 0 0 0.85rem; border-left: 2px solid var(--border); display: grid; gap: 0.45rem; }
.post-toc a { color: var(--muted); text-decoration: none; font-weight: 700; line-height: 1.35; display: block; }
.post-toc a:hover { color: var(--coral); }

.post-body { font-size: 1.075rem; line-height: 1.75; color: var(--text); }
.post-body > p:first-of-type { font-size: 1.15rem; color: var(--navy); }
.post-body h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); margin: 2.4rem 0 0.8rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.post-body h3 { font-size: 1.18rem; margin: 1.8rem 0 0.6rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.post-body ul, .post-body ol { padding-left: 1.3rem; }
.post-body li { margin-bottom: 0.45rem; }
.post-body li::marker { color: var(--coral); }
.post-body a { color: var(--green-text); text-decoration-thickness: 1px; text-underline-offset: 2px; font-weight: 700; }
.post-body a:hover { color: var(--coral); }
.post-body blockquote, .post-body .note {
  margin: 1.5rem 0; padding: 1rem 1.25rem; background: var(--green-tint); border-left: 4px solid var(--green); border-radius: 0 14px 14px 0; color: var(--navy);
}
.post-body blockquote p:last-child { margin-bottom: 0; }
.post-body table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.95rem; display: block; overflow-x: auto; }
.post-body th, .post-body td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--border); vertical-align: top; min-width: 8rem; }
.post-body thead th { background: var(--cream); color: var(--navy); font-weight: 800; }
.post-disclosure { background: var(--coral-tint); padding: 0.85rem 1.1rem; border-radius: 14px; font-size: 0.92rem; }
.post-sources { margin-top: 2.75rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: 0.93rem; }
.post-sources h2 { font-size: 1.2rem; margin-top: 0; }
.post-sources li { margin-bottom: 0.35rem; color: var(--muted); }
.post-sources a { font-weight: 700; overflow-wrap: anywhere; }
.post-disclaimer { margin-top: 1.5rem; font-size: 0.9rem; color: var(--subtle); }

/* 404 */
.jnotfound { min-height: 60vh; }
.jnotfound-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.btn--ghost { background: var(--card); color: var(--navy); border: 1px solid var(--border); box-shadow: var(--shadow); }
.btn--ghost:hover { background: var(--cream); color: var(--coral); }

@media (max-width: 1000px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .post-toc { position: static; margin-bottom: 1.5rem; padding: 1rem 1.25rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
  .post-toc ol { border-left: 0; padding-left: 0; }
  .jgrid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .jcard--featured { grid-template-columns: 1fr; }
  .jcard--featured .jcard-media { min-height: 0; aspect-ratio: 16 / 9; }
  .jcard--featured .jcard-body { padding: 1.25rem 1.25rem 1.5rem; }
  .jcta { grid-template-columns: 1fr; text-align: left; }
  .jcta img { width: 48px; height: 48px; }
  .post-body { font-size: 1.04rem; }
}
@media (max-width: 600px) {
  .jgrid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .jcard { transition: none; }
  .jcard:hover { transform: none; }
}
