/* Copyright (c) We Decide Canada
 * File: tts_bar.css
 * Purpose: Styles for the TTS control bar that appears below header.
 * Requires: global_theme.css + header.css
 */

/* The bar should visually match header */
.site_tts_bar {
  background: var(--color-bg);
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);

  /* Fixed height so --site-tts-bar-height matches reality. */
  height: var(--site-tts-bar-height);
  display: none; /* hidden unless TTS is enabled */
  box-sizing: border-box;

  /* Fixed under the fixed header */
  position: fixed;
  left: 0;
  right: 0;
  top: var(--site-header-height);
  z-index: 1190; /* above menu overlay (1150), below header (1200) */
}

/* When enabled, show it */
html[data-tts="on"] .site_tts_bar {
  display: block;
}

.site_tts_bar__inner {
  display: flex;
  align-items: center;
  gap: 10px;

  /* Ensure inner row uses full bar height so buttons can be vertically centered. */
  height: 100%;

  /* Symmetric vertical breathing room:
     bar height - 28px button = remaining => split top/bottom. */
  padding: 11px 16px;

  max-width: 100%;
  box-sizing: border-box;
}

/* Buttons: reuse header button look */
.site_tts_bar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  /* Make buttons share one row and fill width */
  flex: 1 1 0;
  min-width: 0;

  height: 28px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  background: transparent;
  text-decoration: none;
  font-weight: 600;
  font: inherit;
  cursor: pointer;

  /* Prevent overflow from long labels */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site_tts_bar__btn:hover,
.site_tts_bar__btn:focus-visible {
  border-color: var(--color-primary);
  outline: none;
}

/* Press highlight: ensure visible feedback while pressed (mouse down / touch). */
.site_tts_bar__btn:active {
  background: var(--ui-press-bg);
}

/* Active mode: keep highlighted AND keep text red */
.site_tts_bar__btn[aria-pressed="true"] {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Mobile tweaks */
@media (max-width: 640px) {
  .site_tts_bar__inner {
    gap: 8px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .site_tts_bar__btn {
    height: 28px;
  }
}
