/*
  Zweck: Kopf- und Rail-Komponenten der Kommandozentrale.
  Zielpfad: /home/mckiede/public_html/design/components.css
  Verantwortlich: mckie-Portal

  Page title: container query on #page-title only (not .header-brand),
  so font-size tracks the title column — not the full header incl. NAV sensor.
*/
.header-brand #page-title {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(0.48rem, 8.25cqi, 4.45rem);
  line-height: 0.88;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  text-transform: uppercase;
}

.header-controls {
  position: relative;
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  flex: 0 0 auto;
  width: 7rem;
  min-width: 7rem;
  height: 3.15rem;
  margin-top: 1rem;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--surface-accent);
  box-shadow:
    inset 0 0 0 var(--segment-line) var(--orange),
    0 0 0.45rem color-mix(in srgb, var(--orange) 28%, transparent);
}

.header-controls::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--wash-primary-18), transparent 58%);
  pointer-events: none;
}

.header-control {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--peach);
  cursor: pointer;
}

.header-control:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.header-control:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.header-control + .header-control {
  border-left: var(--segment-line-thin) solid color-mix(in srgb, var(--orange) 52%, transparent);
}

.header-control:hover,
.header-control:focus-visible {
  background: var(--wash-primary-24);
}

.header-control:first-child:hover,
.header-control:first-child:focus-visible {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.header-control:last-child:hover,
.header-control:last-child:focus-visible {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.sound-toggle.is-off {
  opacity: 0.55;
}

.sound-toggle.is-off .sound-wave {
  opacity: 0;
}

.sound-toggle.is-off::after {
  content: '';
  position: absolute;
  width: 2rem;
  height: 0.16rem;
  background: currentColor;
  transform: rotate(-35deg);
}

.control-icon {
  position: relative;
  width: 1.55rem;
  height: 1.55rem;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fullscreen-toggle .control-icon {
  fill: none;
}

.sound-wave {
  fill: none;
}

.rail-button {
  border: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: var(--rail-button-min-height);
  padding-top: var(--rail-button-pad-y);
  padding-right: var(--rail-button-pad-x-end);
  padding-bottom: var(--rail-button-pad-y);
  padding-left: var(--rail-button-pad-x-start);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  clip-path: none;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--tone) 26%, transparent), transparent 70%),
    linear-gradient(180deg, var(--wash-white-5), transparent), var(--surface-dark);
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-align: right;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow:
    inset -0.35rem 0 0 color-mix(in srgb, var(--tone) 44%, transparent),
    inset 0.18rem 0 0 var(--wash-white-8),
    inset 0 0 0 0.1rem color-mix(in srgb, var(--tone) 28%, transparent);
}

.rail-button::before {
  content: '';
  position: absolute;
  top: 0.45rem;
  left: 0.55rem;
  width: min(42%, 4rem);
  height: var(--segment-line);
  background: color-mix(in srgb, var(--tone) 72%, transparent);
  border-radius: var(--radius-pill);
}

.rail-button:hover,
.rail-button:focus-visible {
  filter: brightness(1.12);
  text-decoration: none;
  color: color-mix(in srgb, var(--green) 34%, var(--peach));
  text-shadow: 0 0 0.9rem color-mix(in srgb, var(--green) 42%, transparent);
  box-shadow:
    inset -0.35rem 0 0 color-mix(in srgb, var(--tone) 72%, transparent),
    inset 0.18rem 0 0 color-mix(in srgb, var(--green) 34%, transparent),
    inset 0 0 0 0.12rem color-mix(in srgb, var(--green) 28%, transparent),
    0 0 1.2rem color-mix(in srgb, var(--green) 18%, transparent);
}

.rail-button.active {
  outline: 0;
  box-shadow:
    inset -0.35rem 0 0 var(--tone),
    inset 0.18rem 0 0 var(--tone),
    inset 0 0 0 0.18rem color-mix(in srgb, var(--tone) 42%, transparent),
    0 0 0 0.08rem var(--wash-white-12);
}
