/* ============================================================
 * components-controls.css
 *
 * Part of the brandolini year-site stylesheet, split out from
 * the original monolithic components.css on 2026-05-04 V2.0
 * when the file crossed the 600-line hard threshold.
 *
 * Loaded by the <page-head> directive — see ~/brandolini-build/inject.py.
 * Adding new rules: add them here if they fit the existing section,
 * or split off a new components-<thing>.css file if a coherent new
 * concern emerges.
 * ============================================================ */

/* --- footer --- */

.site-footer {
  max-width: 920px;
  margin: 64px auto 0;
  padding: 24px 28px 16px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-quiet);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer .quiet { color: var(--ink-quiet); }
.site-footer a {
  color: var(--ink-dim);
  text-decoration: none;
}
.site-footer a:hover { color: var(--accent-deep); }



  left: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 6px 0;
  z-index: 100;
  transition: top 0.15s ease;
}
.skip-link:focus, .skip-link:focus-visible {
  top: 0;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}



/* --- preferences UI wrapper --- */
/* .controls holds .toggles and .translate side-by-side at the right of the
   page header. Wraps to a new row on narrow viewports. */

.controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .page-header {
    align-items: flex-start;
  }
  .controls {
    width: 100%;
    justify-content: flex-end;
    margin-top: 8px;
  }
}

/* --- toggle widget --- */
/* Sits in the page header, right-aligned. Three cycle-buttons: scheme, size, font.
   Each click advances to the next value and persists to localStorage via
   /static/toggles.js. */

.toggles {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 5px;
  font-family: 'Atkinson Hyperlegible', sans-serif;
  font-size: 12px;
  color: var(--ink-dim);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  min-height: 32px;
}
.toggle:hover, .toggle:focus-visible {
  background: var(--bg-tint);
  border-color: var(--rule-strong);
  color: var(--ink);
  outline: none;
}
.toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.toggle .toggle-icon {
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  color: var(--accent-deep);
}
.toggle .toggle-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-quiet);
  white-space: nowrap;
}
.toggle:hover .toggle-label { color: var(--ink-dim); }



/* --- translate menu --- */

.translate {
  position: relative;
  font-family: 'Atkinson Hyperlegible', sans-serif;
  font-size: 13px;
}
.translate > summary {
  list-style: none;
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  color: var(--ink-dim);
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.translate > summary::-webkit-details-marker { display: none; }
.translate > summary::before {
  content: '🌐';
  font-size: 13px;
}
.translate > summary:hover, .translate[open] > summary {
  background: var(--bg-tint);
  border-color: var(--rule-strong);
  color: var(--ink);
}
.translate > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.translate nav {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(43, 37, 24, 0.18);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.translate nav a {
  padding: 8px 12px;
  color: var(--ink-dim);
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  transition: background 0.12s, color 0.12s;
  display: block;
}
.translate nav a:hover, .translate nav a:focus-visible {
  background: var(--accent-soft);
  color: var(--ink);
  outline: none;
}

/* Narrow viewports: toggle row stacks below breadcrumb if header wraps. */
@media (max-width: 600px) {
  .toggles, .translate { font-size: 11px; }
  .toggle { padding: 5px 8px; min-height: 30px; }
  .translate > summary { padding: 5px 10px; min-height: 30px; }
}

