/* ==========================================================================
   STYLES.CSS — controls how the site LOOKS.
   This is a minimal starter so we can preview in dark mode.
   In Step 3 we'll build the real design system together.
   ========================================================================== */

/* CSS variables: named values we can reuse everywhere.
   Want a different background color? Change it once, here. */
:root {
  --bg: #0e1116 ;
  --surface: #151a21;
  --border: #232b36;
  --text: #e8eaee;
  --muted: #98a2b0;
  --accent: #adadad;
  --accent-hover: #ffffff; /* highlights, links, buttons */
}


html {
  scroll-behavior: smooth; /* clicking a nav link glides instead of jumping */
}

body {
  margin: 0; /* browsers add a default margin around the page — we don't want it */
  background: var(--bg);
  color: var(--text);
  font-family: "Montserrat", system-ui, sans-serif;
  line-height: 1.6;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

h2 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: center;
}

p {
  font-size: 1.05rem;
  max-width: 65ch;
  margin-right: auto;
  margin-left: auto;
}

.nav-links{
  display: flex;
  justify-content: center;
  gap: 30px;
  font-size: 1.25rem;
  padding-top: 30px;
  
}

/* Temporary layout so the hero preview looks intentional.
   (Flexbox centers the content — we'll cover it properly in Step 3.) */
.hero {
  font-size: 1.25rem;
  color: var(--muted);
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
}

.section {
  max-width: 880px;
  margin: 0 auto;
  background-color: var(--surface);
  border-radius: 10px;
  padding: 10px;
  padding-top: 1px;
  text-align: center;
  margin-top: 30px;
  margin-bottom: 30px;
}
.button{
  float: right;
  padding-right: 10px;
  width: fit-content;
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  justify-items: center;
  align-items: start;
  gap: 24px;

  width: 100%;
  max-width: 900px;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 20px;
}

.series-card {
  min-width: 0;
  padding: 8px;
  box-sizing: border-box;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transform: translateY(0) scale(1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.series-card:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.series-cover {
  display: block;
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 5px;
}

.series-card h3 {
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 8px 0 2px;
}

.series-dialog{
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  box-sizing: border-box;
  width: min(700px, calc(100% - 32px));
  max-width: 700px;
  max-height: 84vh;
  overflow-y: auto;
  margin: auto;
}



.series-dialog::backdrop{
  background: rgba(0, 0, 0, 0.6)
}

.series-dialog-content{
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.series-dialog-content > .series-cover {
  display: block;
  flex: 0 0 150px;
  width: 150px;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 6px;
}

.series-dialog-info {
  flex: 1;
  min-width: 0;
}

.series-dialog-info h3 {
  margin-top: 0;
  text-align: left;
}

.series-dialog-info p {
  text-align: left;
  margin: 0;
}

.series-dialog form{
  margin-top: 20px;
}

.series-dialog button{
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
}

.footer {
width: 100%;
box-sizing: border-box;
padding: 16px 0px;
text-align: right;
}
.footer p {
  max-width: none;
  margin: 0;
  padding-right: 20px;
}

/* Links get our accent color */
a {
  color: var(--accent);
  transition: color 0.2s ease;
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  transition: color 0.1s ease;
  cursor: pointer;
}

.series-card,
.book-card {
  font: inherit;
  cursor: pointer;
}

.series-card {
  width: 100%;
}

.book-card {
  display: block;
  min-width: 0;
  width: 100%;
  padding: 8px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.book-card:focus-visible,
.series-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.books-selection {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border)
}

.books-selection > h3 {
  text-align: left;
  margin: 0 0 18px;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(120px, 1fr)
  );
  gap: 18px;
}

.book-cover {
  display: block;
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 5px;
}

.book-card h4 {
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 8px 0 2px;
  overflow-wrap: anywhere;
}

.book-series-name {
  color: var(--muted);
  font-size: 0.85rem;
}

.book-dialog {
  width: min(700px, calc(100% - 32px));
}

.book-dialog .series-dialog-content > .series-cover {
  flex-basis: 150px;
  width: 150px;
}

.dialog-actions {
  margin-top: 20px;
}

@media (max-width: 480px) {
  .books-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .book-dialog .series-dialog-content > .series-cover {
    flex-basis: 100px;
    width: 100px;
  }
}