/*  This file is part of the OmniDiff code diffing tool.
 *
 *  Copyright (C) 2026 Marko Ivankovic
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as published
 *  by the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with this program. If not, see <https://www.gnu.org/licenses/>.
 */

/* The strip above the viewer. style.css (the viewer's own) sizes html/body to the viewport and
   #app to 100% of it; here body becomes a column so the strip takes its height and the viewer
   the rest. Colours come from the viewer's variables so the two read as one page. */
body {
  display: flex;
  flex-direction: column;
}

#app {
  flex: 1;
  min-height: 0;
  height: auto;
}

#showcase {
  flex: none;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--chrome);
  background: var(--page-bg);
  color: var(--page-fg);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

#showcase code,
#showcase kbd {
  font: 12.5px/1 ui-monospace, "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
}

#showcase kbd {
  padding: 1px 4px;
  border: 1px solid var(--chrome);
  border-radius: 3px;
}

#showcase a {
  color: var(--accent);
}

.showcase-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.showcase-head .brand {
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.showcase-head .tagline {
  flex: 1 1 320px;
  opacity: 0.9;
}

/* Said before anything else on the page: nothing here runs a diff. */
.notice {
  margin: 8px 0 0;
  padding: 4px 10px;
  border-left: 3px solid var(--accent);
}

.showcase-head .install {
  padding: 3px 10px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  text-decoration: none;
}

.showcase-controls {
  margin-top: 8px;
}

.case-picker select {
  max-width: min(60vw, 520px);
  margin-left: 6px;
  padding: 3px 6px;
  font: inherit;
  color: var(--page-fg);
  background: var(--page-bg);
  border: 1px solid var(--chrome);
  border-radius: 4px;
}

.toggle {
  display: inline-flex;
  border: 1px solid var(--accent);
  border-radius: 4px;
  overflow: hidden;
}

.view-button {
  padding: 4px 12px;
  font: inherit;
  color: var(--page-fg);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.view-button + .view-button {
  border-left: 1px solid var(--accent);
}

.view-button.active {
  color: #000;
  background: var(--accent);
  font-weight: 600;
}

.view-button:focus-visible {
  outline: 2px solid var(--page-fg);
  outline-offset: -2px;
}

#case-stats {
  opacity: 0.85;
}

/* The keys' stand-in on a touch screen, which has no `M` to press. */
#touch-actions {
  display: none;
  margin: 8px 0 2px;
}

#touch-actions .view-button {
  border: 1px solid var(--accent);
  border-radius: 4px;
}

@media (hover: none), (max-width: 640px) {
  #touch-actions {
    display: block;
  }
}

.hint {
  margin: 2px 0 0;
  font-size: 12.5px;
  opacity: 0.8;
}

@media (max-width: 640px) {
  #showcase {
    font-size: 13px;
  }
  .showcase-head .tagline {
    flex-basis: 100%;
  }
}

/* A phone, or any short window: the strip alone can take most of the screen, so the page scrolls
   instead of squeezing the viewer, and the viewer keeps a usable height of its own below it. */
@media (max-width: 640px), (max-height: 600px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }
  #app {
    flex: none;
    height: 85vh;
    height: 85dvh;
  }
}
