/* Shared stylesheet for exercise pages 1-6 (issue #103).
 * Canonical source: exercise2's former inline block; includes the
 * opt-in groups (.ascii-pipeline, .sources-section, .solution-section,
 * .comparison-table) used by a subset of pages. Page-specific deltas
 * stay inline in each page AFTER this sheet so they win the cascade. */
:root {
    --bg-light: #FCFCFC;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F7F5F2;
    --bg-surface: #F5F3F0;
    --warm-brown: #7b6852;
    --warm-brown-light: #958068;
    --warm-tan: #b6997b;
    --accent: #7b6852;
    --accent-light: #958068;
    --cream: #F5EDE0;
    --cream-light: #FFF8F0;
    --terracotta: #C4843E;
    --terracotta-light: #d49a5a;
    --olive: #4a7c2e;
    --olive-dark: #3d6825;
    --navbar-dark: #202536;
    --text-dark: #2c2930;
    --text-body: #3d3a42;
    --text-muted: #6b6570;
    --text-dim: #8a8490;
    --border-subtle: rgba(123, 104, 82, 0.15);
    --border-warm: rgba(123, 104, 82, 0.3);
}
* { box-sizing: border-box; }
body { font-family: 'Playfair Display', 'Georgia', serif; background-color: var(--bg-light); color: var(--text-dark); margin: 0; line-height: 1.65; }
h1, h2, h3, h4, h5 { font-family: 'Arvo', 'Georgia', serif; font-weight: 700; font-style: italic; letter-spacing: 0.01em; }

.navbar { background: var(--navbar-dark) !important; border-bottom: 1px solid rgba(255,255,255,0.08); padding: 0.8rem 1rem; backdrop-filter: blur(10px); }
.navbar-brand { font-family: 'Arvo', serif; font-size: 1.5rem; font-weight: 700; font-style: italic; color: #FFFFFF !important; letter-spacing: 0.02em; }
.navbar-brand span { color: var(--warm-tan); }
.navbar .nav-link { color: rgba(255,255,255,0.7) !important; font-family: 'Playfair Display', serif; font-weight: 500; padding: 0.5rem 1rem !important; font-size: 0.9rem; letter-spacing: 0.03em; text-transform: uppercase; transition: color 0.2s; }
.navbar .nav-link:hover { color: #FFFFFF !important; }

.exercise-hero { background: linear-gradient(135deg, #f7f3ef 0%, #efe8e0 50%, #f7f3ef 100%); color: #2c2930; padding: 3.5rem 0 3rem; border-bottom: 3px solid var(--accent); position: relative; overflow: hidden; }
.exercise-hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: radial-gradient(ellipse at 20% 50%, rgba(123,104,82,0.1) 0%, transparent 60%), radial-gradient(ellipse at 80% 50%, rgba(123,104,82,0.06) 0%, transparent 60%); pointer-events: none; }
.exercise-badge { display: inline-block; background: var(--accent); color: #FFFFFF; padding: 0.35rem 1.2rem; border-radius: 2px; font-family: 'Playfair Display', serif; font-size: 0.8rem; font-weight: 700; margin-bottom: 1.2rem; letter-spacing: 0.12em; text-transform: uppercase; }
.exercise-hero h1 { font-size: 2.8rem; margin-bottom: 0.6rem; font-weight: 700; font-style: italic; color: #2c2930; }
.exercise-hero .lead { color: rgba(44,41,48,0.7); font-size: 1.05rem; }

.exercise-content { padding: 2.5rem 0; }
.step-card { background: var(--bg-card); border-radius: 4px; padding: 1.75rem 2rem; margin-bottom: 1.5rem; border: 1px solid var(--border-subtle); border-left: 3px solid var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s; }
.step-card:hover { border-color: var(--border-warm); box-shadow: 0 4px 16px rgba(0,0,0,0.1); transform: translateY(-1px); }
.step-number { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; background: var(--accent); color: #FFFFFF; border-radius: 50%; font-family: 'Playfair Display', serif; font-weight: 700; font-size: 0.85rem; margin-right: 0.85rem; }
.step-card h4 { display: inline; font-size: 1.25rem; vertical-align: middle; color: var(--text-dark); font-style: italic; }

pre { background: #2c2930; color: #e0dce4; padding: 1.2rem 1.4rem; border-radius: 4px; font-family: 'JetBrains Mono', monospace; font-size: 0.83rem; overflow-x: auto; margin: 1rem 0; border: 1px solid rgba(123,104,82,0.2); }
pre .comment { color: #6a9955; } pre .command { color: #d4a853; } pre .string { color: #ce9178; }
code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(123, 104, 82, 0.08);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.88em;
    color: var(--accent, #7b6852);
}
pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
}

.info-box { background: rgba(33,150,243,0.06); border-left: 3px solid #4a90c4; padding: 1rem 1.25rem; border-radius: 0 4px 4px 0; margin: 1rem 0; color: #2a5a82; }
.info-box strong { color: #1e4d73; }
.warning-box { background: rgba(255,152,0,0.06); border-left: 3px solid #c48a30; padding: 1rem 1.25rem; border-radius: 0 4px 4px 0; margin: 1rem 0; color: #7a5518; }
.warning-box strong { color: #6b4910; }
/* #417: scoped modifier only — the base .warning-box rule above must stay icon-less so every
   other warning-box on the site (exercises 1-6, trainer) is visually unaffected. */
.warning-box.has-icon { display: flex; align-items: flex-start; gap: 0.6rem; }
.warning-box.has-icon::before { content: "\2757"; color: #c48a30; flex-shrink: 0; line-height: 1.5; }
.success-box { background: rgba(74,124,46,0.06); border-left: 3px solid var(--olive); padding: 1rem 1.25rem; border-radius: 0 4px 4px 0; margin: 1rem 0; color: #3a6320; }
.success-box strong { color: #2d5018; }

.sidebar-meta { background: var(--bg-card); border-radius: 4px; padding: 1.5rem; border: 1px solid var(--border-subtle); box-shadow: 0 2px 8px rgba(0,0,0,0.06); position: sticky; top: 80px; }
.sidebar-meta h5 { color: var(--accent); font-size: 1.05rem; margin-bottom: 1rem; font-style: italic; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-subtle); }
.sidebar-meta ul { list-style: none; padding: 0; margin: 0; }
.sidebar-meta li { padding: 0.45rem 0; border-bottom: 1px solid rgba(123,104,82,0.08); font-size: 0.88rem; color: var(--text-body); }
.sidebar-meta li:last-child { border-bottom: none; }
.sidebar-meta li strong { color: var(--text-muted); min-width: 90px; display: inline-block; }
.sidebar-meta a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
.sidebar-meta a:hover { color: var(--accent-light); }

/* #277: the .footer rules that used to live here are gone with the markup —
   the exercise pages include data/partials/footer.html and /public/css/footer.css
   styles it, like every other page. */

.exercise-nav { display: flex; gap: 0.5rem; margin-top: 2rem; flex-wrap: wrap; }
.exercise-nav a { flex: 1; min-width: 80px; text-align: center; padding: 0.65rem 0.4rem; background: var(--bg-card); border-radius: 3px; text-decoration: none; color: var(--text-muted); border: 1px solid var(--border-subtle); font-family: 'Playfair Display', serif; font-weight: 500; font-size: 0.88rem; transition: all 0.25s; letter-spacing: 0.02em; }
.exercise-nav a:hover { border-color: var(--accent); color: var(--accent); background: var(--bg-card-hover); }
.exercise-nav a.active { background: var(--accent); color: #FFFFFF; border-color: var(--accent); font-weight: 700; }

.comparison-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.comparison-table th { background: rgba(123,104,82,0.08); padding: 0.6rem 1rem; text-align: left; font-size: 0.85rem; border-bottom: 2px solid var(--accent); color: var(--text-dark); }
.comparison-table td { padding: 0.5rem 1rem; border-bottom: 1px solid var(--border-subtle); font-size: 0.85rem; color: var(--text-body); }

.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    padding: 4px 10px;
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    letter-spacing: 1px;
    transition: border-color 0.3s;
}
.lang-toggle:hover { border-color: rgba(255,255,255,0.5); }
.lang-toggle .lang-sep { opacity: 0.4; }

.ascii-pipeline { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; line-height: 1.4; white-space: pre; color: #e0dce4; }

/* Sources section */
.sources-section { background: var(--bg-card); border-radius: 4px; padding: 1.75rem 2rem; margin-top: 2rem; margin-bottom: 1.5rem; border: 1px solid var(--border-subtle); border-left: 3px solid var(--warm-tan); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.sources-section h4 { font-size: 1.25rem; color: var(--text-dark); font-style: italic; margin-bottom: 1rem; }
.sources-section ul { list-style: none; padding: 0; margin: 0; }
.sources-section li { padding: 0.5rem 0; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 0.6rem; }
.sources-section li:last-child { border-bottom: none; }
.sources-section a { color: var(--accent); text-decoration: none; font-weight: 500; transition: color 0.2s; }
.sources-section a:hover { color: var(--terracotta); text-decoration: underline; }
.sources-section .source-icon { flex-shrink: 0; width: 18px; height: 18px; color: var(--text-muted); }

.solution-section { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.solution-section summary { background: rgba(76, 175, 80, 0.08); border-left: 3px solid #4CAF50; padding: 1rem 1.25rem; cursor: pointer; font-weight: 700; border-radius: 0 4px 4px 0; list-style: none; }
.solution-section summary::-webkit-details-marker { display: none; }
.solution-section summary::before { content: "\25B6  "; font-size: 0.75rem; transition: transform 0.2s; display: inline-block; }
.solution-section[open] summary::before { transform: rotate(90deg); }
.solution-section .solution-body { background: var(--bg-card); border: 1px solid var(--border-subtle); border-top: none; border-radius: 0 0 4px 4px; padding: 1.75rem 2rem; }

.copy-btn {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1;
}
pre:hover .copy-btn,
div:hover > .copy-btn {
    opacity: 1;
}
