@import url('./variables.css');

/* The existing 285 KB hero stays untouched. */
body { background-image: linear-gradient(var(--hero-overlay-start), var(--hero-overlay-end)), url('../Resources/IMG/Background.webp'); }
.section-nav a[aria-current="page"] { box-shadow: inset 0 -2px var(--accent-primary); font-weight: var(--weight-semibold); }
.notebook { position: relative; min-height: 26rem; }
.notebook > * { min-width: 0; overflow-wrap: anywhere; }
.introduction h1 { font-size: clamp(2rem, 4.5vw, 4.5rem); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.dust-layer { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: var(--z-overlay); }
.notebook:focus { outline: none; }
.notebook:focus-visible { outline: var(--focus-outline); outline-offset: var(--focus-offset); }
.whatsapp-identifier { font-family: var(--font-mono); font-size: var(--text-xl); }
html:not(.js) .menu-toggle { display: none; }
@media (max-width: 48rem) {
    html:not(.js) .site-header { flex-wrap: wrap; }
    html:not(.js) .header-tools { position: static; display: flex; max-height: none; }
}

/* Side arrows use real links, so keyboard and no-JS navigation still work. */
.page-controls { position: fixed; inset: var(--navigation-height, 6rem) 0 0; z-index: calc(var(--z-navigation) - 1); pointer-events: none; }
.page-controls a { position: absolute; top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; width: var(--control-min-size); height: var(--control-min-size); color: var(--ink); background: color-mix(in srgb, var(--surface-light) 25%, transparent); border-radius: var(--radius-round); pointer-events: auto; text-decoration: none; touch-action: pan-y; }
.page-controls a[rel="prev"] { left: var(--space-2); }
.page-controls a[rel="next"] { right: var(--space-2); }
.nav-chevron { display: block; width: 0.65rem; height: 0.65rem; border-top: 2px solid currentColor; border-right: 2px solid currentColor; opacity: var(--navigation-arrow-opacity); transition: opacity var(--duration-fast) var(--ease-standard); }
.page-controls a[rel="prev"] .nav-chevron { transform: rotate(-135deg); }
.page-controls a[rel="next"] .nav-chevron { transform: rotate(45deg); }
.page-controls a:hover, .page-controls a:focus-visible { background: var(--surface-light); }
.page-controls a:hover .nav-chevron, .page-controls a:focus-visible .nav-chevron, .page-controls a:active .nav-chevron { opacity: 1; }
.page-controls a:focus-visible { outline: var(--focus-outline); outline-offset: -3px; }
/* The open dropdown and its hamburger always take precedence over edge controls. */
.site-header.menu-open ~ .page-controls { visibility: hidden; }
@media (max-width: 48rem) {
    .page-controls a { top: 0; bottom: 0; transform: none; width: var(--navigation-edge-width); height: auto; border-radius: 0; background: transparent; }
    .page-controls a[rel="prev"] { left: 0; }
    .page-controls a[rel="next"] { right: 0; }
    .page-controls a:hover { background: transparent; }
    .page-controls a:focus-visible { background: color-mix(in srgb, var(--surface-light) 80%, transparent); }
    .introduction, .book-content { padding-inline: max(var(--page-padding), calc(var(--navigation-edge-width) + var(--space-1))); }
}

/* Desktop: ceil(44px × 1.4) = 62px targets; ceil(10.4px × 1.4) = 15px chevrons. */
@media (min-width: 48.001rem) {
    .page-controls a { width: var(--navigation-desktop-size); height: var(--navigation-desktop-size); }
    .nav-chevron { width: var(--navigation-desktop-chevron); height: var(--navigation-desktop-chevron); border-width: 3px; }
}
