/* global styles */

:root {
  /* Chrome-only for now but this will allow smooth size transitions */
  interpolate-size: allow-keywords;

  /* Palette from favicon.svg (toolbox icon) */
  --color-navy: #273b7a;
  --color-navy-midnight: #121149;
  --color-gold-pale: #fee187;
  --color-gold: #ffc61b;
  --color-amber: #eaa22f;
  --color-orange: #e09112;
  --color-coral: #ff5419;
  --color-terracotta: #d35933;
  --color-rust: #b54324;
  --color-burgundy: #930000;

  --accent-color: var(--color-gold);
  --border-accent: var(--color-navy);
  --link-accent: var(--color-coral);
  --text-body: var(--color-navy-midnight);
  --text-muted: #3d4678;
  --bg-app: #eceef8;
  --bg-panel: #f6f7fc;
  --bg-card: #ffffff;
  --focus-fill: rgba(255, 198, 27, 0.28);
  --border-subtle: #c8cee8;
}

html {
  box-sizing: border-box;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

body {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  background-color: var(--bg-app);
  color: var(--text-body);

  font-family: Futura, "Trebuchet MS", Arial, sans-serif;
  font-style: normal;
  font-variant: normal;
}

footer,
header {
  flex: 0;
  min-height: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  background-color: var(--bg-card);

  img {
    max-height: 40px;
    margin-right: 0.5em;
  }

  h1 {
    flex: 1;
    margin-right: 50px;
    text-align: center;
  }
}

header#main-head {
  justify-content: space-between;
  padding: 0 8px;
}

header {
  border-bottom: 1px solid var(--border-accent);
}

.header-identity {
  text-decoration: none;
  color: inherit;

  h1 {
    font-family: "Arial Black", "Arial Bold", Gadget, sans-serif;
    font-size: 24px;
  }
}

h1,
h2,
h3,
h4 {
  font-family: "Arial Black", "Arial Bold", Gadget, sans-serif;
  font-variant: common-ligatures small-caps;
}

#main-head > * {
  display: flex;
  flex-direction: row;
  align-items: center;
}

#logo {
  height: 40px;
  margin: 0 10px 0 5px;
}

#main-foot {
  border-top: 1px solid var(--border-accent);
  justify-content: center;
}

main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 80vh;
  max-width: 100vw;
  overflow: hidden;

  padding: 8px;
  overflow-y: auto;
  background-color: var(--bg-panel);
}

.btn,
button,
input[type="file"]::file-selector-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.25em 1em;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  font-variant: common-ligatures small-caps;
  text-decoration: none;

  img {
    height: 2em;
    width: 2em;
    margin: 0 0.25rem;
  }

  &:disabled {
    cursor: not-allowed;

    img {
      opacity: 0.5;
    }
  }

  &:not(:disabled):hover,
  &:not(:disabled):focus-visible {
    outline: var(--accent-color) auto 1px;
    background-color: var(--focus-fill);
  }
}

input[type="file"] {
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;

  &::file-selector-button {
    display: inline-flex;
  }

  &:not(:disabled):hover,
  &:not(:disabled):focus-visible {
    outline: var(--accent-color) auto 1px;

    &::file-selector-button {
      background-color: var(--focus-fill);
    }
  }
}

a.btn {
  &:not(:disabled):hover,
  &:not(:disabled):focus-visible {
    text-decoration: underline;
  }
}

a:focus-visible {
  outline: var(--accent-color) auto 1px;
}

/* util classes */

.u-hidden {
  display: none !important;
}

.u-flex {
  display: flex;
}

.u-flex-column {
  flex-direction: column;
}

.u-flex-1 {
  flex: 1;
}

.u-left {
  text-align: left;
}

.u-center {
  text-align: center;
}

.tool-hub {
  max-width: 36rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
  text-align: left;
  width: 100%;
}

.tool-hub--wide {
  max-width: min(100%, 52rem);
}

.tool-hub__intro {
  margin: 0 0 1.5rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.tool-hub__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tool-hub__item {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-card);
}

.tool-hub__list a {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--link-accent);
  text-decoration: none;
}

.tool-hub__list a:hover,
.tool-hub__list a:focus-visible {
  text-decoration: underline;
  color: var(--color-rust);
}

.tool-hub__desc {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: normal;
  line-height: 1.4;
}

.u-fill-width {
  width: -webkit-fill-available;
  width: 100%;
}

.u-fill-height {
  height: -webkit-fill-available;
  height: 100vh;
}

.u-stretch-height {
  height: -webkit-fill-available;
  height: 100%;
  flex: 1;
}

/* background scroll fix for dialogs */
dialog {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
}

/* responsive design tweaks (breakpoints adopted from Bootstrap) */

/* Small devices (e.g. phones, 575px and under) */
@media (max-width: 575px) {
  header > img {
    display: none;
  }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
  header > img {
    display: none;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  header > img {
    display: block;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  header > img {
    display: block;
  }
}

/* web component placeholders */
update-notification {
  display: none;
}

/* view transitions */

@view-transition {
  navigation: auto;
  types: slide, forwards;
}
