/* Transformer attention notes — shared stylesheet */

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

body {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 17px;
    line-height: 1.7;
    color: #222;
    background: #fff;
    margin: 0;
    padding: 0 1rem 4rem;
}

.page-wrap {
    max-width: 880px;
    margin: 0 auto;
}

header {
    padding: 2.5rem 0 1rem;
    border-bottom: 2px solid #ddd;
    margin-bottom: 1.5rem;
}

header h1 {
    font-size: 1.9rem;
    margin: 0 0 0.3rem;
    font-weight: normal;
}

header .subtitle {
    color: #555;
    margin: 0;
    font-size: 1rem;
}

nav {
    margin: 1rem 0 2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.9rem;
}

nav a {
    margin-right: 1.5rem;
    color: #2255aa;
    text-decoration: none;
}

nav a:hover { text-decoration: underline; }

section { margin-bottom: 3rem; }

hr.section-rule {
    border: none;
    border-top: 1px solid #ccc;
    margin: 2rem 0 1.5rem;
}

h2 {
    font-size: 1.35rem;
    font-weight: bold;
    margin: 0 0 0.2rem;
}

.section-summary {
    color: #555;
    margin: 0 0 1.5rem;
    font-size: 0.97rem;
}

/* Figure rows */
.fig-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

/* Controls (slider, dropdown) */
.controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin: 0.5rem 0 0.8rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.95rem;
}

.controls label { color: #444; }

.controls input[type="range"] {
    width: 220px;
    cursor: pointer;
}

.controls select {
    padding: 0.25rem 0.5rem;
    font-size: 0.93rem;
    border: 1px solid #bbb;
    border-radius: 3px;
    cursor: pointer;
    background: white;
}

.temp-val {
    font-variant-numeric: tabular-nums;
    min-width: 2.5rem;
    color: #333;
}

.preset-desc {
    color: #CC0000;
    font-style: italic;
    font-size: 0.95rem;
    margin: 0.3rem 0 0.8rem;
    min-height: 1.4em;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Explanation text */
.explanation { margin-top: 1.5rem; }
.explanation p { margin: 0 0 1rem; }
.explanation ul { margin: 0 0 1rem 1.5rem; padding: 0; }
.explanation li { margin-bottom: 0.4rem; }

/* Key takeaways */
.takeaways ol { margin: 0.5rem 0 0 1.5rem; padding: 0; }
.takeaways li { margin-bottom: 0.8rem; }

/* Flow diagram */
.flow-img {
    width: 100%;
    max-width: 860px;
    height: auto;
    display: block;
    margin: 1rem auto;
}

/* ── Notebook page: sidebar + content layout ──────────────────────────── */
.layout {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

.layout .page-wrap {
    margin: 0;
    flex: 1;
    min-width: 0;
}

.sidebar {
    position: sticky;
    top: 2rem;
    align-self: flex-start;
    width: 155px;
    flex-shrink: 0;
    padding: 2.5rem 1rem 2rem 0;
    border-right: 1px solid #ddd;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

.sidebar-title {
    font-weight: 600;
    color: #666;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.6rem;
}

.sidebar a {
    display: block;
    color: #2255aa;
    text-decoration: none;
    padding: 0.3rem 0;
    margin: 0;
}

.sidebar a:hover { text-decoration: underline; }

.sidebar-home {
    color: #555 !important;
    font-size: 0.82rem;
    padding-bottom: 0.6rem !important;
    margin-bottom: 0.6rem;
    border-bottom: 1px solid #ddd;
}

/* Index page notebook list */
.notebook-list {
    list-style: none;
    margin: 1.5rem 0;
    padding: 0;
}
.notebook-list li {
    padding: 0.6rem 0;
    border-bottom: 1px solid #eee;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.notebook-list a { color: #2255aa; text-decoration: none; font-weight: 500; }
.notebook-list a:hover { text-decoration: underline; }
.notebook-list .coming-soon { color: #999; }
