/* Codewheel Publishing website styles.
   Brand colours (from brand-sheet.md). Change them here and every page follows. */
:root {
  --navy: #1E2B3A;     /* ink navy: text, footer */
  --teal: #2E7D78;     /* cipher teal: links, buttons */
  --teal-dark: #23615D;
  --gold: #D4A24C;     /* brass gold: accent lines */
  --cream: #F3EEE4;    /* paper cream: page background */
  --white: #FFFFFF;
  --muted: #4A5866;
  --max: 1040px;
}

@font-face {
  font-family: "Outfit";
  src: url("/assets/fonts/Outfit-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--navy);
  font-family: "Outfit", "Segoe UI", Arial, sans-serif;
  font-size: 1.25rem;          /* 20 px: easy to read */
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--teal); text-underline-offset: 0.15em; }
a:hover { color: var(--teal-dark); }
a:focus-visible, .button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--white); padding: 8px 12px; z-index: 10; }

/* Header */
.site-header { background: var(--white); border-bottom: 4px solid var(--gold); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 24px; padding-top: 18px; padding-bottom: 18px;
}
.logo img { width: 280px; height: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px 28px; flex-wrap: wrap; }
.site-nav a {
  color: var(--navy); text-decoration: none; font-weight: 600; font-size: 1.2rem;
  padding: 4px 0; border-bottom: 3px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--teal); }

/* Text */
h1, h2, h3 { line-height: 1.2; font-weight: 700; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); margin-top: 1.6em; }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.lead { font-size: 1.4rem; color: var(--muted); max-width: 36em; }
main { padding: 40px 0 64px; }

/* Buttons */
.button {
  display: inline-block; background: var(--teal); color: var(--white); text-decoration: none;
  font-weight: 600; padding: 14px 26px; border-radius: 6px; font-size: 1.2rem;
}
.button:hover { background: var(--teal-dark); color: var(--white); }
.button.secondary { background: transparent; color: var(--teal); border: 2px solid var(--teal); }
.button.secondary:hover { background: var(--teal); color: var(--white); }

.notice {
  display: inline-block; background: var(--white); border-left: 5px solid var(--gold);
  padding: 10px 16px; font-weight: 600; margin: 0 0 1em;
}

/* "What we make" cards (home page) */
.types {
  list-style: none; padding: 0; margin: 16px 0 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
}
.types li {
  background: var(--white); padding: 22px 24px; border-radius: 8px; border-top: 5px solid var(--teal);
  box-shadow: 0 2px 10px rgba(30, 43, 58, 0.08);
}
.types h3 { margin-bottom: 0.3em; }
.types p { margin-bottom: 0.6em; }
.type-status { font-weight: 600; color: var(--muted); font-size: 1.05rem; }
.types a { font-weight: 600; }

/* Book card (home page and book list) */
.book-card {
  display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 32px;
  align-items: start; background: var(--white); padding: 28px; border-radius: 8px;
  box-shadow: 0 2px 10px rgba(30, 43, 58, 0.08); margin-top: 24px;
}
.book-card img { border-radius: 2px; box-shadow: 0 4px 14px rgba(30, 43, 58, 0.25); }
.book-card h2, .book-card h3 { margin-top: 0; }
.subtitle { color: var(--muted); font-size: 1.25rem; }

/* Book page */
.book-top {
  display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 40px; align-items: start;
}
.book-top .cover { box-shadow: 0 6px 20px rgba(30, 43, 58, 0.25); }
.facts { padding-left: 1.2em; }
.facts li { margin-bottom: 0.35em; }

.look-inside {
  list-style: none; padding: 0; margin: 16px 0 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
}
.look-inside a {
  display: block; background: var(--white); padding: 10px; border-radius: 6px; text-decoration: none;
  color: var(--navy); box-shadow: 0 2px 10px rgba(30, 43, 58, 0.08);
}
.look-inside a:hover { box-shadow: 0 4px 16px rgba(30, 43, 58, 0.2); }
.look-inside img { border: 1px solid #DDD6C8; }
.look-inside span { display: block; text-align: center; font-weight: 600; padding-top: 8px; font-size: 1.1rem; }
.hint { color: var(--muted); font-size: 1.05rem; }

/* Picture viewer (assets/js/lightbox.js) */
dialog.viewer {
  border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh;
}
dialog.viewer::backdrop { background: rgba(20, 28, 38, 0.85); }
dialog.viewer img { max-width: 96vw; max-height: 88vh; width: auto; background: var(--white); }
dialog.viewer button {
  display: block; margin: 10px auto 0; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--white); color: var(--navy); border: 0; border-radius: 6px; padding: 8px 22px;
}

/* Footer */
.site-footer { background: var(--navy); color: var(--cream); padding: 32px 0; font-size: 1.05rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; }
.site-footer img { width: 48px; height: 48px; }
.site-footer a { color: var(--cream); }
.site-footer p { margin: 0; }

/* Phones */
@media (max-width: 720px) {
  body { font-size: 1.15rem; }
  .logo img { width: 240px; }      /* brand minimum: 240 px */
  .book-card, .book-top { grid-template-columns: 1fr; }
  .book-card img, .book-top .cover { max-width: 280px; }
  .look-inside { grid-template-columns: 1fr; max-width: 360px; }
  .types { grid-template-columns: 1fr; }
  main { padding: 28px 0 48px; }
}
