/* /learn section: calm white textbook pages. Reuses ui.css (fields, site footer); colours match the site. */
body.learn {
    margin: 0;
    font-family: Arial, sans-serif;
    color: #222;
    background: #ffffff;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.learn-main a { color: #004080; }

.learn-header { background: #004080; color: #fff; padding: 10px 16px; border-bottom: 4px solid #ccc; }
.learn-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff !important; text-decoration: none;
               font-size: 18px; font-weight: bold; }
.learn-brand img { width: 44px; height: auto; display: block; }

.learn-nav { background: green; padding: 6px 16px; position: sticky; top: 0; z-index: 1000;
             display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.learn-nav a { color: #fff; text-decoration: none; padding: 4px 10px; border-radius: 5px; font-size: 15px; }
.learn-nav a:hover, .learn-nav a:focus-visible { background: rgba(255, 255, 255, 0.18); }
.learn-nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.25); font-weight: bold; }
.learn-nav .learn-nav-home { margin-left: auto; }

.learn-main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 18px 16px 8px; box-sizing: border-box; }
.learn-intro h1 { color: #004080; font-size: 26px; margin: 4px 0 6px; }
.learn-intro p { margin: 0 0 12px; max-width: 70ch; color: #444; }
.learn-crumb { font-size: 13px; color: #666; margin: 0 !important; }

/* Index cards */
.learn-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 16px 0; }
.learn-card { display: flex; flex-direction: column; border: 1px solid #d8e0ea; border-radius: 10px;
              padding: 14px 16px; background: #fff; text-decoration: none; color: #222 !important;
              transition: border-color 0.15s, box-shadow 0.15s; }
a.learn-card:hover, a.learn-card:focus-visible { border-color: #004080; box-shadow: 0 2px 10px rgba(0, 64, 128, 0.12); }
.learn-card h2 { margin: 0 0 4px; font-size: 18px; color: #004080; }
.learn-card p { margin: 0 0 10px; font-size: 14px; color: #444; flex: 1; }
.learn-card-go { font-size: 14px; color: #004080; font-weight: bold; }
.learn-card.is-soon { background: #f7f9fb; border-style: dashed; }
.learn-card.is-soon h2 { color: #6b7a8c; }
.learn-soon { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: #6b7a8c; }
.learn-try { margin: 8px 0 16px; font-weight: bold; }

/* Tool layout: controls | chart */
.learn-tool { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 18px; align-items: start; }
.learn-controls { border: 1px solid #d8e0ea; border-radius: 10px; padding: 10px 14px; background: #fbfcfe; font-size: 14px; }
.learn-controls .ui-field { margin: 4px 0 8px; }
.learn-controls select { width: 100%; padding: 6px 8px; font-size: 14px; border: 1px solid #bbb; border-radius: 5px; }
.learn-controls fieldset { border: none; border-top: 1px solid #e3e8ef; margin: 8px 0 0; padding: 8px 0 2px; }
.learn-controls legend { font-weight: bold; font-size: 13px; color: #333; padding: 0 4px 0 0; }
.learn-controls legend select { width: auto; padding: 2px 4px; margin-left: 6px; font-weight: normal; }
/* Legend that carries a select (e.g. hydrocarbon type): keep the select on the text baseline and leave room below it */
.learn-controls legend.learn-legend-select { display: flex; align-items: center; gap: 8px; padding: 0 6px 0 0; margin-bottom: 6px; }
.learn-controls legend.learn-legend-select select { margin: 0; min-width: 96px; padding: 3px 6px; font-size: 13px; line-height: 1.2; }
.learn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.learn-pair.three { grid-template-columns: 1fr 1fr 1fr; }
.learn-pair[hidden] { display: none; }
.learn-pair label { display: block; font-size: 13px; color: #333; }
.learn-pair input { display: block; margin-top: 2px; width: 100%; box-sizing: border-box; padding: 5px 6px; font-size: 14px;
                    border: 1px solid #bbb; border-radius: 5px; }
.learn-toggle label { display: inline-block; margin: 2px 12px 2px 0; }
.learn-toggle input { vertical-align: middle; margin: 0 4px 0 0; }
.learn-slider { margin: 8px 0 4px; }
.learn-slider label { display: block; font-size: 13px; font-weight: bold; color: #333; }
.learn-slider output { font-family: Consolas, Menlo, monospace; font-weight: normal; color: #004080; float: right; padding-left: 6px; }
.learn-slider input[type=range] { width: 100%; margin: 4px 0 0; accent-color: #004080; }
.unit { font-weight: normal; color: #777; font-size: 12px; }
.learn-msg { margin: 8px 0 0; padding: 6px 8px; background: #fff4e5; border-left: 3px solid #e76f51; font-size: 13px; }
.learn-readout { margin: 8px 0 2px; font-size: 13px; color: #333; background: #f4f7fb; border-left: 3px solid #004080; padding: 6px 8px; }
.learn-readout:empty { display: none; }

.learn-output { min-width: 0; }
.learn-chart { position: relative; border: 1px solid #e3e8ef; border-radius: 10px; padding: 6px 6px 4px; background: #fff; }
.learn-chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rpt-chart { width: 100%; height: auto; display: block; font-family: Arial, sans-serif; }
.rpt-grid line { stroke: #edf0f4; stroke-width: 1; }
.rpt-frame { fill: none; stroke: #9aa7b5; stroke-width: 1; }
.rpt-tick { font-size: 12.5px; fill: #444; }
.rpt-axis-label { font-size: 13.5px; fill: #222; }
.rpt-cursor { stroke: #9aa7b5; stroke-dasharray: 3 3; }
.rpt-label { font-size: 15px; font-weight: bold; fill: #6b7a8c; }
.rpt-legend { display: flex; flex-wrap: wrap; gap: 2px 14px; padding: 2px 8px 4px; font-size: 13px; color: #333; }
.rpt-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.rpt-legend-item i { display: inline-block; width: 22px; border-top-width: 2.5px; }
.rpt-tip { position: absolute; top: 10px; pointer-events: none; background: rgba(255, 255, 255, 0.96);
           border: 1px solid #c9d3de; border-radius: 6px; padding: 4px 8px; font-size: 12px; line-height: 1.45;
           box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); white-space: nowrap; }

.learn-h3 { font-size: 15px; color: #004080; margin: 14px 0 4px; }
.learn-table { border-collapse: collapse; width: 100%; margin-top: 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.learn-table th, .learn-table td { border-bottom: 1px solid #e3e8ef; padding: 4px 8px; text-align: right; }
.learn-table thead th { background: #f4f7fb; color: #004080; font-weight: bold; }
.learn-table tbody th { text-align: left; font-weight: normal; color: #444; }
.learn-table-note { font-size: 12px; color: #777; margin: 4px 0 0; }

/* Text below the tool */
.learn-text { max-width: 820px; margin: 22px 0 0; }
.learn-text h2 { font-size: 18px; color: #004080; margin: 18px 0 4px; }
.learn-text p { margin: 0 0 8px; }
.learn-refs { margin: 0 0 8px; padding-left: 20px; font-size: 14px; }
.learn-refs li { margin: 0 0 3px; }
.learn-eq { overflow-x: auto; margin: 6px 0 !important; padding: 6px 0; }
.learn-eq math { font-size: 1.1em; }
/* Plain italic instead of Unicode math-italic code points: Greek renders even without a math font */
.learn-eq mi { text-transform: none; font-style: italic; }
.learn-eq mi[mathvariant="normal"] { font-style: normal; }

.learn-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 20px 0 4px;
                 padding: 12px 14px; border: 1px solid #d8e0ea; border-radius: 10px; background: #fbfcfe; }
.learn-btn { display: inline-block; background: #004080; color: #fff !important; text-decoration: none;
             padding: 8px 14px; border-radius: 6px; font-weight: bold; font-size: 14px; }
.learn-btn:hover, .learn-btn:focus-visible { background: #00305f; }
.learn-link { font-weight: bold; }
.learn-actions-note { flex-basis: 100%; margin: 0 !important; font-size: 12px; color: #777; }

.learn-cite { margin: 26px 0 6px; padding-top: 10px; border-top: 1px solid #e3e8ef; font-size: 13px; color: #555; }
.learn-cite p { margin: 0 0 4px; }

@media (max-width: 860px) {
    .learn-tool { grid-template-columns: 1fr; }
    .learn-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .learn-cards, .learn-chart-grid { grid-template-columns: 1fr; }
    .learn-nav .learn-nav-home { margin-left: 0; }
    .learn-intro h1 { font-size: 22px; }
}
