/* styles.css — Layout and structure for Bridger User Guide
   Theme colors come from current_theme.css (copied from light.css or dark.css at runtime) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    padding: 0;
}

/* --- Page layout --- */

.page-header {
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-light);
    padding: 12px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-header h1 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0;
}

.page-header .nav-links {
    display: flex;
    gap: 16px;
    font-size: 13px;
}

.page-header .nav-links a {
    color: var(--text-link);
    text-decoration: none;
}

.page-header .nav-links a:hover {
    text-decoration: underline;
}

.content {
    max-width: 820px;
    margin: 0 auto;
    padding: 32px 32px 64px 32px;
}

/* --- Typography --- */

h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 32px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
}

h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 24px 0 8px 0;
}

h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 20px 0 6px 0;
}

p {
    margin: 0 0 14px 0;
}

.subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 0 28px 0;
}

/* --- Links --- */

a {
    color: var(--text-link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Lists --- */

ul, ol {
    margin: 0 0 14px 24px;
}

li {
    margin-bottom: 6px;
}

/* --- Code --- */

code {
    font-family: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    background-color: var(--bg-code);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--text-code);
}

pre {
    background-color: var(--bg-code);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 14px 16px;
    margin: 0 0 16px 0;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
}

pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

/* --- Tables --- */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 16px 0;
    font-size: 13px;
}

th {
    background-color: var(--bg-header);
    text-align: left;
    padding: 8px 12px;
    font-weight: 600;
    border-bottom: 2px solid var(--border-medium);
    color: var(--text-heading);
}

td {
    padding: 7px 12px;
    border-bottom: 1px solid var(--border-light);
}

tr:hover {
    background-color: var(--bg-hover);
}

/* --- Callouts / Tips --- */

.tip, .note, .warning {
    padding: 12px 16px;
    border-radius: 4px;
    margin: 0 0 16px 0;
    font-size: 13px;
    line-height: 1.55;
}

.tip {
    background-color: var(--bg-tip);
    border-left: 4px solid var(--accent-tip);
}

.note {
    background-color: var(--bg-note);
    border-left: 4px solid var(--accent-note);
}

.warning {
    background-color: var(--bg-warning);
    border-left: 4px solid var(--accent-warning);
}

.callout-label {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

/* --- Keyboard shortcuts --- */

kbd {
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-size: 12px;
    background-color: var(--bg-header);
    border: 1px solid var(--border-medium);
    border-radius: 3px;
    padding: 2px 6px;
    box-shadow: 0 1px 0 var(--border-light);
}

/* --- Definition lists (shortcut tables, feature lists) --- */

dl {
    margin: 0 0 16px 0;
}

dt {
    font-weight: 600;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-size: 13px;
    margin-top: 10px;
    color: var(--text-heading);
}

dd {
    margin: 2px 0 0 20px;
    color: var(--text-secondary);
}

/* --- Images --- */

img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    margin: 8px 0 16px 0;
}

.img-caption {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin: -10px 0 16px 0;
}

/* --- Navigation footer (prev/next chapter links) --- */

.chapter-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 48px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    font-size: 13px;
}

.chapter-nav a {
    color: var(--text-link);
    text-decoration: none;
}

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

.chapter-nav .prev::before {
    content: "\2190\00a0";
}

.chapter-nav .next::after {
    content: "\00a0\2192";
}

/* --- TOC page specifics --- */

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-list li {
    margin: 0;
    padding: 0;
}

.toc-list a {
    display: block;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: var(--text-primary);
    transition: background-color 0.15s;
}

.toc-list a:hover {
    background-color: var(--bg-hover);
}

.toc-chapter-number {
    display: inline-block;
    width: 36px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
}

.toc-chapter-title {
    font-weight: 600;
    color: var(--text-heading);
}

.toc-chapter-desc {
    display: block;
    margin-left: 36px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.toc-section-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 18px 16px 6px 16px;
}

/* --- Responsive video embed --- */

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 0 0 16px 0;
    border-radius: 4px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* --- Annotated images with hover hotspots --- */

.annotated-image {
    position: relative;
    display: inline-block;
    margin: 8px 0 16px 0;
    max-width: 100%;
}

.annotated-image img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0;
}

.hotspot {
    position: absolute;
    cursor: help;
    border: 1px solid transparent;
    border-radius: 3px;
    transition: border-color 0.15s, background-color 0.15s;
}

.hotspot:hover {
    border-color: var(--text-link);
    background-color: rgba(100, 180, 255, 0.1);
}

.hotspot-tip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-header);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 10;
    pointer-events: none;
}

/* Allow wrapping on longer tooltips */
.hotspot-tip.wrap {
    white-space: normal;
}

.hotspot:hover .hotspot-tip {
    display: block;
}

/* Position variants for hotspots near edges */
.hotspot-tip.tip-left {
    left: 0;
    transform: none;
}

.hotspot-tip.tip-right {
    left: auto;
    right: 0;
    transform: none;
}

.hotspot-tip.tip-below {
    bottom: auto;
    top: calc(100% + 6px);
}

/* Side-positioned tooltips — appear beside the hotspot */
.hotspot-tip.tip-right-side {
    bottom: auto;
    top: 50%;
    left: calc(100% + 8px);
    transform: translateY(-50%);
}

.hotspot-tip.tip-left-side {
    bottom: auto;
    top: 50%;
    left: auto;
    right: calc(100% + 8px);
    transform: translateY(-50%);
}
