/* FSIM.IT: the style sheet of the article pages. Long-form reading first. */

#reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 150; background: linear-gradient(90deg, var(--sky), #7DD3FC 55%, var(--amber-bright)); transform-origin: 0 50%; transform: scaleX(var(--progress, 0)); pointer-events: none; }

.container-article { max-width: 1180px; }
.article-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: clamp(24px, 4vw, 44px) 0 clamp(22px, 3vw, 36px); position: relative; overflow: hidden; }
.article-header::before { content: ''; position: absolute; inset: 0; background: radial-gradient(900px 300px at 85% -10%, color-mix(in srgb, var(--sky) 14%, transparent), transparent 70%); pointer-events: none; }
.article-header > .container { position: relative; }
.article-meta-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; font: 500 .82rem var(--mono); color: var(--muted); margin-bottom: 16px; }
.article-meta-top .reading-time, .article-meta-top time { display: inline-flex; align-items: center; gap: .45em; }
.article-header h1 { font-size: clamp(1.85rem, 4.4vw, 3.05rem); font-weight: 900; letter-spacing: -.035em; line-height: 1.08; max-width: 22em; margin-bottom: .4em; }
.article-subtitle { font-size: clamp(1.05rem, 1.8vw, 1.28rem); color: var(--muted); max-width: 46em; line-height: 1.5; margin-bottom: 1.1em; }
.article-byline { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--muted); font-size: .96rem; }
.article-byline strong { color: var(--heading); }
.byline-avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: #7DD3FC; font: 800 .8rem var(--mono); letter-spacing: .02em; flex: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.500px var(--amber-bright); }
.byline-avatar-lg { width: 56px; height: 56px; font-size: 1.05rem; }

.hero-figure { margin: clamp(18px, 3vw, 32px) 0 0; }
.hero-figure img { width: 100%; border-radius: 16px; box-shadow: var(--shadow-lift); background: var(--navy); aspect-ratio: 16 / 9; object-fit: cover; }
.hero-figure figcaption, .article-body figcaption { margin-top: 10px; font-size: .85rem; color: var(--muted); text-align: center; line-height: 1.45; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: clamp(28px, 5vw, 64px); align-items: start; padding-top: clamp(26px, 4vw, 46px); padding-bottom: 20px; }
.toc-sidebar { order: 2; position: sticky; top: calc(var(--header-h) + 62px); max-height: calc(100vh - var(--header-h) - 86px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.toc-box { border-left: 2px solid var(--border); padding-left: 16px; }
.toc-title { display: flex; align-items: center; gap: .55em; font: 700 .74rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; cursor: pointer; list-style: none; }
.toc-title::-webkit-details-marker { display: none; }
.toc-list, .toc-list ol { list-style: none; margin: 0; padding: 0; }
.toc-list > li { margin-bottom: 2px; }
.toc-list a { display: block; padding: 5px 10px; margin-left: -18px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: .88rem; line-height: 1.35; transition: color .12s, border-color .12s; }
.toc-list ol a { padding-left: 24px; font-size: .82rem; }
.toc-list ol { display: none; }
.toc-list li.is-open > ol, .no-js .toc-list ol { display: block; }
.toc-list a:hover { color: var(--heading); }
.toc-list a.is-active { color: var(--link); border-left-color: var(--sky); font-weight: 650; }

.article-body { min-width: 0; max-width: 46rem; font-size: 1.125rem; line-height: 1.75; overflow-wrap: break-word; }
.article-body h2 { font-size: clamp(1.45rem, 2.8vw, 1.85rem); margin: 2.300em 0 .7em; padding-top: 1.100em; border-top: 1px solid var(--border); position: relative; }
.article-body h2::before { content: ''; position: absolute; top: -2px; left: 0; width: 56px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--sky), var(--amber-bright)); }
.article-body h3 { font-size: clamp(1.16rem, 2vw, 1.32rem); margin: 1.900em 0 .55em; letter-spacing: -.012em; }
.article-body h4 { font-size: 1.05rem; margin: 1.600em 0 .4em; }
.article-body h2, .article-body h3 { scroll-margin-top: calc(var(--header-h) + 62px); }
.h-anchor { margin-left: .4em; color: var(--border-strong); text-decoration: none; font-weight: 500; opacity: 0; transition: opacity .12s; }
h2:hover .h-anchor, h3:hover .h-anchor, .h-anchor:focus { opacity: 1; color: var(--link); }
.article-body p { margin: 0 0 1.150em; }
.article-body li { margin-bottom: .5em; }
.article-body li > ul, .article-body li > ol { margin: .5em 0 .2em; }
.article-body strong { color: var(--heading); font-weight: 700; }
.article-body a { font-weight: 550; }
.article-body code { font: 500 .86em var(--mono); background: var(--sunken); border: 1px solid var(--border); border-radius: 5px; padding: .08em .36em; color: var(--heading); white-space: nowrap; }
html[data-theme='dark'] .article-body code { color: #7DD3FC; }
.code-block { background: #0B1120; color: #CBD5E1; border: 1px solid #1F2937; border-radius: 12px; padding: 16px 18px; overflow-x: auto; font: 500 .86rem/1.55 var(--mono); margin: 1.500em 0; }
.code-block code { background: none; border: 0; padding: 0; color: inherit; white-space: pre; font: inherit; }
.article-body blockquote { margin: 1.500em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--border-strong); color: var(--muted); font-style: italic; }
.math { font-family: 'Cambria Math', 'STIX Two Math', 'Latin Modern Math', Georgia, 'Times New Roman', serif; font-size: 1.06em; white-space: nowrap; }
.math sub, .math sup { font-size: .72em; line-height: 0; }
.math-block { display: block; text-align: center; font-size: 1.2em; margin: .4em 0; padding: 14px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; }
.article-subtitle code { font: 500 .88em var(--mono); background: var(--sunken); border: 1px solid var(--border); border-radius: 5px; padding: .05em .32em; }
.soon { border-bottom: 1px dotted var(--border-strong); cursor: help; }
.stars { color: var(--amber-bright); letter-spacing: .08em; white-space: nowrap; }
.mark { display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; border-radius: 50%; font-size: .8em; font-weight: 800; margin-right: .25em; vertical-align: .05em; }
.mark-yes { background: #DCFCE7; color: #166534; }
.mark-no { background: #FEE2E2; color: #991B1B; }
html[data-theme='dark'] .mark-yes { background: rgba(34, 197, 94, .2); color: #86EFAC; }
html[data-theme='dark'] .mark-no { background: rgba(239, 68, 68, .2); color: #FCA5A5; }

.executive-summary { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--sky); border-radius: 0 var(--radius) var(--radius) 0; padding: 22px 26px 8px; box-shadow: var(--shadow); font-size: 1.06rem; }
.article-body .executive-summary h2 { font: 700 .76rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--link); margin: 0 0 .9em; padding: 0; border: 0; }
.article-body .executive-summary h2::before { display: none; }
html[data-theme='dark'] .article-body .executive-summary h2 { color: var(--sky); }

/* Tables */
.table-wrap { margin: 1.700em 0; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); scrollbar-width: thin; }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: .9rem; line-height: 1.5; }
.table-wrap table:has(th:nth-child(4)) { min-width: 700px; }
.table-wrap table:has(th:nth-child(6)) { min-width: 920px; }
.table-wrap th, .table-wrap td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.table-wrap thead th { background: var(--navy); color: #F1F5F9; font: 700 .76rem var(--mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; border-bottom: 0; position: sticky; top: 0; }
.table-wrap thead th strong { color: inherit; }
.table-wrap tbody th { font-weight: 650; color: var(--heading); background: color-mix(in srgb, var(--subtle) 55%, transparent); min-width: 9.5em; }
.table-wrap tbody tr:last-child > * { border-bottom: 0; }
.table-wrap tbody tr:hover td { background: color-mix(in srgb, var(--subtle) 45%, transparent); }
.table-wrap code { white-space: normal; }
.ta-center { text-align: center !important; }
.ta-right { text-align: right !important; }

/* Callouts */
.callout { margin: 1.700em 0; padding: 18px 22px 4px 22px; border-radius: var(--radius); border: 1px solid; border-left-width: 4px; font-size: 1.02rem; line-height: 1.65; }
.callout-title { display: flex; align-items: center; gap: .6em; font: 700 .78rem var(--mono); letter-spacing: .09em; text-transform: uppercase; margin: 0 0 .7em !important; }
.callout-title::before { content: ''; width: 20px; height: 20px; flex: none; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.callout-tip { background: #EFF6FF; border-color: #BFDBFE; border-left-color: #0284C7; --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21h4'/%3E%3Cpath d='M12 3a6 6 0 0 0-3.500 10.900c.6.500 1 1.200 1 2.100h5c0-.9.400-1.600 1-2.100A6 6 0 0 0 12 3z'/%3E%3C/svg%3E"); }
.callout-tip .callout-title { color: #0369A1; }
.callout-warn { background: #FFFBEB; border-color: #FDE68A; border-left-color: #D97706; --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.500 2.500 20h19z'/%3E%3Cpath d='M12 10v4.500M12 17.200v.300'/%3E%3C/svg%3E"); }
.callout-warn .callout-title { color: #B45309; }
.callout-tech { background: #F8FAFC; border-color: #CBD5E1; border-left-color: #475569; --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 16.500 13.500-13.500 4.500 4.500L7.500 21z'/%3E%3Cpath d='m7 12.500 2 2M10 9.500l2 2M13 6.500l2 2'/%3E%3C/svg%3E"); }
.callout-tech .callout-title { color: #334155; }
html[data-theme='dark'] .callout-tip { background: rgba(56, 189, 248, .08); border-color: rgba(56, 189, 248, .25); border-left-color: #38BDF8; }
html[data-theme='dark'] .callout-tip .callout-title { color: #7DD3FC; }
html[data-theme='dark'] .callout-warn { background: rgba(245, 158, 11, .08); border-color: rgba(245, 158, 11, .28); border-left-color: #F59E0B; }
html[data-theme='dark'] .callout-warn .callout-title { color: #FBBF24; }
html[data-theme='dark'] .callout-tech { background: rgba(148, 163, 184, .08); border-color: rgba(148, 163, 184, .25); border-left-color: #94A3B8; }
html[data-theme='dark'] .callout-tech .callout-title { color: #CBD5E1; }

/* Figures */
.article-body figure { margin: 2em 0; }
.diagram img, .photo img { width: 100%; border-radius: 14px; box-shadow: var(--shadow-lift); background: #0B1120; }
.zoomable { display: block; position: relative; cursor: zoom-in; border-radius: 14px; }
.zoomable::after { content: ''; position: absolute; right: 12px; bottom: 12px; width: 38px; height: 38px; border-radius: 10px; background: rgba(15, 23, 42, .78) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20.500 20.500-4.400-4.400M8 11h6M11 8v6'/%3E%3C/svg%3E") center / 20px no-repeat; border: 1px solid rgba(255, 255, 255, .25); opacity: 0; transition: opacity .15s; }
.zoomable:hover::after, .zoomable:focus-visible::after { opacity: 1; }

/* The practical guide */
.checklist-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 26px 14px; margin: 2.600em 0 0; box-shadow: var(--shadow); position: relative; }
.checklist-section::before { content: 'CHECKLIST'; position: absolute; top: -11px; right: 20px; font: 700 .68rem var(--mono); letter-spacing: .16em; background: var(--amber-bright); color: #1C1203; padding: 3px 10px; border-radius: 6px; }
.article-body .checklist-section h2 { border-top: 0; margin-top: .5em; padding-top: .6em; }
.article-body .checklist-section h2::before { display: none; }
.checklist-section > ol { list-style: none; padding: 0; counter-reset: step; }
.checklist-section > ol > li { counter-increment: step; position: relative; padding: 4px 0 4px 52px; margin-bottom: 14px; min-height: 38px; }
.checklist-section > ol > li::before { content: counter(step); position: absolute; left: 0; top: 2px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #7DD3FC; font: 700 .9rem var(--mono); }
.checklist-section > ol[start] > li::before { content: counter(step); }

/* Questions */
.faq-section { margin-top: 2.600em; }
.faq-item { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-bottom: 10px; overflow: hidden; }
.faq-item summary { list-style: none; cursor: pointer; padding: 16px 52px 16px 20px; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: ''; position: absolute; right: 20px; top: 50%; width: 10px; height: 10px; border-right: 2.500px solid var(--muted); border-bottom: 2.500px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .18s; }
.faq-item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq-item summary:hover h3 { color: var(--link); }
.article-body .faq-item h3 { display: inline; font-size: 1.08rem; margin: 0; line-height: 1.4; }
.faq-answer { padding: 0 20px 6px; font-size: 1.03rem; }
.faq-item[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 14px; }

/* The foot of the article */
.article-footer { margin-top: 3em; }
.sources { font-size: .95rem; color: var(--muted); }
.article-body .sources h2 { font-size: 1.15rem; }
.author-box { display: flex; gap: 18px; align-items: flex-start; margin-top: 2.200em; padding: 22px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 1rem; }
.article-body .author-box h3 { margin: 0 0 .35em; font-size: 1.12rem; }
.author-box p { margin: 0 0 .6em; color: var(--muted); line-height: 1.6; }
.author-box p strong { color: var(--heading); }
.author-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .92rem; }
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.pn { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-decoration: none; transition: border-color .15s, transform .15s; }
.pn:hover { border-color: var(--sky); transform: translateY(-2px); }
.pn-next { text-align: right; }
.pn-label { font: 700 .7rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pn-title { font-weight: 700; color: var(--heading); line-height: 1.3; font-size: .98rem; }
.related-articles { margin: clamp(36px, 6vw, 64px) 0 clamp(48px, 7vw, 84px); padding-top: clamp(28px, 4vw, 44px); border-top: 1px solid var(--border); }
.related-articles h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); margin-bottom: 1em; }
.card-grid-related { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

@media (max-width: 1080px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .toc-sidebar { order: 0; position: static; max-height: none; }
  .toc-box { border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; background: var(--surface); }
  .toc-box:not([open]) .toc-title { margin: 0; }
  .toc-list a { margin-left: 0; }
  .article-body { max-width: none; }
}
@media (max-width: 600px) {
  .article-body { font-size: 1.06rem; line-height: 1.72; }
  .executive-summary { padding: 18px 18px 4px; }
  .checklist-section { padding: 6px 16px 10px; }
  .checklist-section > ol > li { padding-left: 46px; }
  .author-box { flex-direction: column; }
  .prev-next { grid-template-columns: 1fr; }
  .pn-next { text-align: left; }
  .callout { padding: 16px 16px 2px; }
}
@media print {
  #reading-progress, .toc-sidebar, .related-articles, .prev-next, .author-links { display: none !important; }
  .article-layout { display: block; }
  .faq-item { break-inside: avoid; }
}
