/**
 * Website frame shared by every page (home, privacy policy, 404): reading
 * size, page width, the skip link, the button, the header and the footer.
 * Colors and the font come from theme.css; each page adds its own layout on
 * top.
 *
 * Type scale for the website, used by every page stylesheet:
 * 15px small text, 18px body, 21px subheads and lead, then the fluid section
 * title (30-44px) and hero title (42-58px). The hero's popup drawing keeps the
 * extension's own smaller sizes so it matches the real popup.
 */

/* --- Page tokens ---------------------------------------------------------- */

:root {
  --page-width: 1120px;
  --gutter: clamp(20px, 5vw, 64px);
}

/* --- Base ----------------------------------------------------------------- */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* theme.css sets the extension's compact 14px; a reading page needs more. */
body {
  font-size: 18px;
  line-height: 1.6;
}

h2,
h3,
ul,
ol,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 600;
  text-wrap: balance;
}

img {
  display: block;
}

.container {
  max-width: var(--page-width);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  box-sizing: border-box;
}

/* Hidden until focused, so keyboard users can jump past the header. */
.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 1;
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--primary);
  color: var(--on-primary);
}

.skip-link:focus {
  top: 16px;
}

.skip-link:hover {
  color: var(--on-primary);
}

/* --- Button --------------------------------------------------------------- */

/* The one filled button style: "Add to Chrome" on the home page and
   "Back to PlayStop" on the 404 page. */
.cta-button {
  height: 52px;
  padding: 0 28px;
  border-radius: 8px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
}

.cta-button:hover {
  background: var(--primary-hover);
  color: var(--on-primary);
}

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

.site-header {
  padding-top: 24px;
  padding-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 15px;
}

/* Vertical padding brings the tap target to 44px without moving the text. */
.site-nav a {
  padding: 10px 0;
  color: var(--text);
  font-weight: 400;
  text-decoration: none;
}

.brand:hover,
.site-nav a:hover {
  color: var(--primary);
}

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

.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  padding-top: 28px;
  padding-bottom: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  color: var(--muted);
  font-size: 15px;
}

.footer-credit {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

/* The email address is long; let it break rather than push the page sideways at 360 px. */
.footer-nav a {
  padding: 10px 0;
  overflow-wrap: anywhere;
}

/* The credit's name links to the author's site, styled like the footer links. */
.footer-credit a,
.footer-nav a {
  color: var(--text);
  text-underline-offset: 4px;
}

.footer-credit a:hover,
.footer-nav a:hover {
  color: var(--primary);
}
