/* noblitt-books — shared styles for the Cloudflare Pages landing site */

:root {
  --ink: #262626;
  --muted: #5A5A5A;
  --paper: #F7F4EE;
  --paper-2: #EFEBE3;
  --line: #D9D3C7;
  --white: #FFFFFF;
  --wellness: #3F6B14;
  --wellness-hover: #2F520F;
  --wellness-soft: #E8F0DC;
  --science: #0B1F2E;
  --science-hover: #07141D;
  --science-soft: #E6EBEE;
  --accent: var(--science);
  --accent-hover: var(--science-hover);
  --accent-soft: var(--science-soft);
  --shadow: 0 10px 28px rgba(11, 31, 46, 0.12);
  --radius: 10px;
  --font-sans: "Assistant", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Cairo", "Segoe UI", system-ui, -apple-system, sans-serif;
  --measure: 70rem;
}

.theme-wellness {
  --accent: var(--wellness);
  --accent-hover: var(--wellness-hover);
  --accent-soft: var(--wellness-soft);
}

.theme-science {
  --accent: var(--science);
  --accent-hover: var(--science-hover);
  --accent-soft: var(--science-soft);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: var(--ink);
  color: var(--white);
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
}

.skip:focus {
  top: 1rem;
}

.wrap {
  width: min(100% - 2rem, var(--measure));
  margin-inline: auto;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.5rem;
  padding: 1rem 0;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.logo span {
  display: inline-block;
  margin-left: 0.45rem;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.logo:hover {
  color: var(--accent);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  font-size: 1rem;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
}

/* Forward notice */

.forward-banner {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.forward-banner[hidden] {
  display: none !important;
}

.forward-banner .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.25rem;
  padding: 0.7rem 0;
}

.forward-msg {
  margin: 0;
  flex: 1 1 16rem;
  font-size: 1rem;
  color: var(--ink);
}

.forward-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.forward-go {
  min-height: 2.4rem;
  padding: 0.4rem 1.05rem;
}

.forward-stay {
  appearance: none;
  border: 1px solid var(--muted);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
}

.forward-stay:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.forward-stay[hidden] {
  display: none !important;
}

/* Main */

main {
  padding: 2.5rem 0 3.5rem;
}

.page-intro {
  max-width: 42rem;
  margin: 0 0 2.5rem;
}

.page-intro h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 5vw, 3.15rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.15rem;
}

/* Index sections */

.catalog + .catalog {
  margin-top: 3rem;
}

.catalog-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--ink);
}

.catalog-wellness .catalog-head {
  border-bottom-color: var(--wellness);
}

.catalog-science .catalog-head {
  border-bottom-color: var(--science);
}

.catalog-head h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.catalog-head h2 a {
  color: inherit;
  text-decoration: none;
}

.catalog-wellness .catalog-head h2 a:hover {
  color: var(--wellness);
}

.catalog-science .catalog-head h2 a:hover {
  color: var(--science);
}

.catalog-dest {
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.catalog-wellness .catalog-dest {
  color: var(--wellness);
}

.catalog-science .catalog-dest {
  color: var(--science);
}

.catalog-dest:hover {
  text-decoration: underline;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(11, 31, 46, 0.04);
  height: 100%;
}

.card:hover {
  box-shadow: var(--shadow);
}

.card-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-2);
  aspect-ratio: 2 / 3;
  padding: 1rem 1rem 0.5rem;
}

.card-cover img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  box-shadow: 0 6px 16px rgba(11, 31, 46, 0.16);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.05rem 1.15rem;
  flex: 1;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

.card-title a {
  color: var(--ink);
  text-decoration: none;
}

.card-title a:hover {
  color: var(--accent);
}

.card-byline,
.card-summary {
  margin: 0;
  font-size: 0.98rem;
}

.card-byline {
  color: var(--muted);
}

.card-summary {
  color: var(--ink);
  flex: 1;
}

.card-action {
  margin-top: 0.6rem;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
}

.coming-soon-label {
  margin-top: 0.6rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Book page */

.book-hero {
  display: grid;
  grid-template-columns: minmax(200px, 20rem) minmax(0, 1fr);
  gap: 2.5rem 3rem;
  align-items: start;
}

.cover-frame {
  margin: 0;
}

.cover-frame img {
  width: 100%;
  background: var(--paper-2);
  box-shadow: var(--shadow);
  border-radius: 2px;
}

.book-copy .kicker {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.book-copy h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.6vw, 2.55rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.45rem;
}

.subtitle {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.35;
  color: var(--muted);
}

.byline {
  margin: 0 0 1.15rem;
  font-size: 1.05rem;
  color: var(--ink);
}

.blurb {
  margin: 0 0 1.5rem;
  max-width: 40rem;
}

.blurb p {
  margin: 0 0 0.85rem;
}

.blurb p:last-child {
  margin-bottom: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.55rem 1.15rem;
  border-radius: 7px;
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--white);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn-secondary:hover {
  background: var(--ink);
  color: var(--white);
}

.btn-disabled {
  background: var(--paper-2);
  color: var(--muted);
  border-color: var(--line);
  cursor: default;
}

.back-link {
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
}

.back-link:hover {
  text-decoration: underline;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2rem;
  color: var(--muted);
  font-size: 0.98rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--ink);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
}

/* 404 */

.not-found {
  max-width: 36rem;
  padding: 2rem 0 4rem;
}

.not-found h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 0.75rem;
}

/* Responsive */

@media (max-width: 720px) {
  main {
    padding-top: 1.75rem;
  }

  .book-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 1.5rem;
  }

  .cover-frame {
    width: min(16.5rem, 70vw);
  }

  .blurb {
    margin-inline: auto;
  }

  .actions {
    justify-content: center;
  }

  .back-link {
    display: inline-block;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
