/* Shared template for Oso Creek Studios content pages (e.g. www/apps/<app>/index.html).
   Black header bar with the studio link and app name, content area, trademark footer.
   Follows the visitor's light/dark system setting; the header is black in both. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1f2328;
  --muted: #6e7781;
  --rule: #d8dee4;
  --header-bg: #000000;
  --header-fg: #ffffff;
  --header-muted: #8c959f;
  --content-width: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f2328;
    --fg: #f0f2f4;
    --muted: #a5adb6;
    --rule: #3d444d;
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
}

/* Header ------------------------------------------------------------------ */

.site-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: var(--header-bg);
  color: var(--header-fg);
}

.site-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--header-fg);
  font-weight: 600;
  text-decoration: none;
}

.site-header .brand:hover,
.site-header .brand:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-header .brand img {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 6px; /* the icon has a white background; round it into a tile */
}

.site-header .sep {
  color: var(--header-muted);
}

.site-header .app-name {
  font-weight: 400;
}

/* Header menu (top right) --------------------------------------------------- */

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.site-nav a,
.site-nav summary {
  color: var(--header-fg);
  text-decoration: none;
  cursor: pointer;
}

.site-nav > a:hover,
.site-nav > a:focus-visible,
.site-nav summary:hover,
.site-nav summary:focus-visible,
.site-nav [aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.menu { position: relative; }

.menu summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.menu summary::-webkit-details-marker { display: none; }

/* Small down arrow; flips when open. */
.menu summary::after {
  content: "";
  border: 4px solid transparent;
  border-top-color: currentColor;
  margin-top: 4px;
}

.menu[open] summary::after {
  border-top-color: transparent;
  border-bottom-color: currentColor;
  margin-top: -4px;
}

.menu-list {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 10;
  min-width: 180px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: var(--header-bg);
  border: 1px solid #30363d;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.menu-list a {
  display: block;
  padding: 8px 16px;
  white-space: nowrap;
}

.menu-list a:hover,
.menu-list a:focus-visible {
  background: #1f2328;
  text-decoration: none;
}

.menu-list .divider {
  margin: 6px 0;
  border-top: 1px solid #30363d;
}

/* Content ----------------------------------------------------------------- */

main {
  flex: 1;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 32px 16px 48px;
}

main h1 {
  margin: 0 0 16px;
  font-size: 1.75rem;
  line-height: 1.25;
}

main section { margin-top: 32px; }

main h2 {
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
  font-size: 1.25rem;
  line-height: 1.3;
}

main h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.4;
}

main p { margin: 0 0 16px; }

/* Official App Store badge: shown unaltered, at least 40px tall per Apple's guidelines. */
.store-badge {
  display: inline-block;
  line-height: 0;
}

.store-badge img {
  display: block;
  width: auto;
  height: 48px;
}

.store-version {
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--muted);
}

main a { color: inherit; text-underline-offset: 3px; }

.link-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list li {
  border-bottom: 1px solid var(--rule);
}

.link-list a {
  display: block;
  padding: 12px 0;
  font-size: 1.125rem;
  text-decoration: none;
}

.link-list a:hover,
.link-list a:focus-visible {
  text-decoration: underline;
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
  padding: 16px;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
}

sup {
  font-size: 0.6em;
  line-height: 0;
}
