/* Book Haven Bookstore — site stylesheet
   Colors: Palette 1 (Task 1) — Inkwell Blue #2E4057, Intensity Indigo #EE583F,
   Dusty Rose #F7B3CC, Aged Gold #C7B65E, Parchment White #FFF7EE.
   Font color: Bookish Black #131C26. Typography Option 2: Arial for headings,
   Calibri for body, Comfortaa as a small accent. */

@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;700&display=swap');

:root {
  --inkwell-blue: #2E4057;
  --intensity-indigo: #EE583F;
  --dusty-rose: #F7B3CC;
  --aged-gold: #C7B65E;
  --parchment-white: #FFF7EE;
  --bookish-black: #131C26;
}

/* Base */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Calibri, 'Segoe UI', sans-serif;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--bookish-black);
  background-color: #fff;
}

h1, h2, h3, h4 {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--inkwell-blue);
  line-height: 1.25;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.7rem; }

a {
  color: var(--inkwell-blue);
}

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

/* One boxed content width used everywhere: 1100px.
   Sections are boxed by default; full-width bands (hero, why-us, ...)
   override this and box their inner content instead. */

main > section {
  max-width: 1100px;
  margin: 7rem auto;
  padding: 0 1.5rem;
}

.boxed {
  max-width: 1100px;
  margin: 0 auto;
}

/* Keep titles close to the paragraph that follows them */
h1, h2 {
  margin-bottom: 0.5rem;
}

/* Buttons: warm accent color from the palette, used site-wide */

button,
.button {
  display: inline-block;
  padding: 0.55rem 1.4rem;
  border: none;
  border-radius: 6px;
  background-color: var(--intensity-indigo);
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  background-color: #d34630;
}

/* Secondary look for reset buttons so they don't compete with submit */
button[type="reset"] {
  background-color: transparent;
  color: var(--inkwell-blue);
  text-decoration: underline;
}

/* Gray placeholder boxes for images we don't have yet */

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  background-color: #e5e2dd;
  border-radius: 8px;
  color: #6b6b6b;
  font-family: Arial, Helvetica, sans-serif;
}

.section-subtitle {
  margin-top: 0;
  color: #4a5560;
}

/* Header: full-width bar, boxed content */

.site-header {
  padding: 0.6rem 1.5rem;
  background-color: #fff;
  border-bottom: 1px solid #e0ddd8;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.page-title {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  color: var(--inkwell-blue);
}

.nav-list {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  text-decoration: none;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--inkwell-blue);
}

.nav-list a:hover {
  color: var(--intensity-indigo);
}

/* Hero: full-width parchment band right under the header, boxed content */

.hero {
  max-width: none;
  margin: 0 0 7rem;
  padding: 3.5rem 1.5rem;
  background-color: var(--parchment-white);
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* Photo hero variant: blurred bookshelf photo (course sample image) as the
   background, with a dark overlay and white text for readability */
.hero-photo {
  position: relative;
  overflow: hidden;
}

/* The Home hero is taller than the other pages' banners */
.hero-tall {
  padding-top: 7rem;
  padding-bottom: 7rem;
}

.hero-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("images/hero-bookshelf.jpg") center / cover no-repeat;
  filter: blur(5px);
  transform: scale(1.06); /* hides the soft edges the blur creates */
}

.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(19, 28, 38, 0.55);
}

.hero-photo .hero-inner {
  position: relative;
  z-index: 1;
}

.hero-photo .hero-text {
  max-width: 640px;
  color: #fff;
}

.hero-photo h1 {
  font-size: 2.7rem;
  color: #fff;
}

.hero-photo p {
  font-size: 1.15rem;
}

.hero-photo .card-title {
  color: #fff;
}

.hero-buttons {
  margin-top: 2rem;
}

.hero-text {
  flex: 1;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
}

/* Two-column text + image sections (About/Welcome, Events intro) */

.about-welcome,
.about-intro,
.events-intro,
.contact {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.about-text,
.events-text,
.contact-info {
  flex: 1;
}

.about-text p {
  text-align: justify;
}

.about-welcome .placeholder,
.about-intro .placeholder,
.events-intro .placeholder {
  flex: 1;
}

/* Real photos in the two-column sections, styled like the product cards */
.store-photo {
  flex: 1;
  min-width: 0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(19, 28, 38, 0.12);
}

/* Why us: full-width centered stats band */

.why-us {
  max-width: none;
  padding: 3.5rem 1.5rem;
  background-color: var(--parchment-white);
  text-align: center;
}

/* No stray heading margin inside the bands, so top/bottom padding reads equal */
.why-us h2,
.collaborations h2 {
  margin-top: 0;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 4rem;
  list-style: none;
  margin: 2.5rem 0;
  padding: 0;
}

.stats li {
  display: flex;
  flex-direction: column;
}

/* Big bold numbers; these will count up from zero with JS later (Task 3.1) */
.stat-number {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 2.8rem;
  font-weight: bold;
  line-height: 1.1;
  color: var(--inkwell-blue);
}

.stat-label {
  font-size: 0.95rem;
}

.perks {
  display: flex;
  justify-content: center;
  gap: 3rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-weight: bold;
  font-size: 0.9rem;
}

/* Product/pick cards and the Best Seller badge */

.card-grid {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.card {
  flex: 1;
  text-align: center;
}

/* Product images sit on a white card with a border and soft shadow,
   so transparent images don't look like they're floating */
.card-media {
  position: relative;
  background-color: #fff;
  border: 1px solid #e0ddd8;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(19, 28, 38, 0.12);
  padding: 0.8rem;
  transition: transform 0.15s ease;
}

.picks .card-media:hover {
  transform: scale(1.1);
}

.card-media img {
  display: block;
  width: 100%;
  border-radius: 6px;
}

.badge {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  padding: 0.15rem 0.6rem;
  background-color: var(--aged-gold);
  color: var(--bookish-black);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.8rem;
  border-radius: 4px;
}

.card-title {
  font-size: 1.05rem;
}

.picks,
.categories,
.collection,
.recommendation,
.past-events,
.collaborations {
  text-align: center;
}

/* Category search + pill links */

.category-search input,
.book-search input {
  width: 100%;
  max-width: 420px;
  padding: 0.55rem 1rem;
  border: 1px solid #c9c4bd;
  border-radius: 999px;
  font-family: inherit;
  font-size: 1rem;
}

/* The category search is the centerpiece of its section: bigger, centered text */
.category-search input {
  max-width: 600px;
  padding: 0.8rem 1rem;
  font-size: 1.05rem;
  text-align: center;
}


.category-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.category-list a {
  display: inline-block;
  padding: 0.35rem 1.1rem;
  border: 1px solid var(--inkwell-blue);
  border-radius: 999px;
  text-decoration: none;
}

.category-list a:hover {
  background-color: var(--dusty-rose);
}

/* Gallery: featured card in the hero, search bar row, product table */

.feature-card {
  flex-basis: 260px;
}

/* Search sits centered, View Cart floats off to the right of the same row */
.collection-bar {
  position: relative;
  margin: 1.5rem 0;
}

.book-search {
  text-align: center;
}

.view-cart {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.product-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 1.5rem;
}

.product-table .product {
  width: 33%;
  position: relative;
  padding: 1rem 1rem 4.5rem; /* bottom padding reserves space for the pinned button */
  border: 1px solid #e0ddd8;
  border-radius: 8px;
  vertical-align: top;
  text-align: center;
}

/* The cell already has a border, a second frame around the image reads as a double box */
.product .card-media {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* Reserve two lines for every title so the images line up across the row */
.product-title {
  min-height: 2.6em;
}

.product-desc {
  min-height: 3em;
}

/* Pin Add to Cart to the bottom of the cell, whatever the text height above it */
.product .add-to-cart {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
}

.read-more {
  display: inline-block;
  margin: 0 1rem 0.8rem 0;
  font-style: italic;
}

/* Our Recommendation: full-width parchment band like Why Us */
.recommendation {
  max-width: none;
  padding: 3.5rem 1.5rem;
  background-color: var(--parchment-white);
}

/* Media boxes that show the image as a background: it fills the box height
   and the sides crop automatically (keeps the book-cover format) */
.media-cover {
  background-size: cover;
  background-position: center;
  min-height: 220px;
}

.bg-book1 { background-image: url("images/Client3_Book1.png"); }
.bg-book2 { background-image: url("images/Client3_Book2.png"); }
.bg-book3 { background-image: url("images/Client3_Book3.png"); }

/* Feature row: image next to text (Our Recommendation, Book Reading) */

.feature-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  text-align: left;
}

/* Book reading is left-aligned, and the cover stretches to the text height */
.book-reading .feature-row {
  justify-content: flex-start;
  align-items: stretch;
}

.feature-row .card-media {
  flex-basis: 240px;
  flex-shrink: 0;
}

.feature-row-body {
  max-width: 480px;
}

.author {
  color: #4a5560;
  font-style: italic;
  margin-top: -0.6rem;
}

/* About page: contact form */

.contact-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  padding: 0.55rem 1rem;
  border: 1px solid #c9c4bd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
}

.form-actions {
  display: flex;
  justify-content: space-between;
}

.map-image {
  min-height: 320px;
}

/* Events page: past event cards */

.event-cards {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.event-card {
  flex: 1;
  display: flex;
  gap: 1.2rem;
  text-align: left;
}

.event-card .placeholder,
.event-card .card-media {
  flex-basis: 180px;
  flex-shrink: 0;
}

.collaborations {
  max-width: none;
  padding: 3.5rem 1.5rem;
  background-color: var(--parchment-white);
}

/* Footer */

.site-footer {
  margin-top: 3rem;
  padding: 2.5rem 1.5rem 1rem;
  background-color: var(--inkwell-blue);
  color: var(--parchment-white);
}

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

.site-footer h3,
.site-footer h4 {
  color: #fff;
  font-size: 1.05rem;
}

.footer-cols {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: 0.4rem;
}

.footer-logo {
  background-color: var(--parchment-white);
  border-radius: 6px;
  padding: 0.4rem;
}

/* Comfortaa is the small accent typeface from Typography Option 2 */
.slogan {
  font-family: Comfortaa, Arial, sans-serif;
  font-size: 0.95rem;
}

.social {
  display: flex;
  gap: 0.6rem;
}

.social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.social svg {
  display: block;
  width: 1.4rem;
  height: 1.4rem;
  fill: currentColor;
}

.social a:hover {
  transform: scale(1.1);
}

.newsletter {
  display: flex;
  gap: 0.5rem;
}

.newsletter input {
  flex: 1;
  padding: 0.45rem 0.9rem;
  border: none;
  border-radius: 6px;
  font-family: inherit;
}

.copyright {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.9rem;
}

/* Small screens: stack the columns instead of squeezing them */

@media (max-width: 720px) {
  .header-inner,
  .hero-inner,
  .about-welcome,
  .about-intro,
  .events-intro,
  .contact,
  .feature-row,
  .event-cards,
  .footer-cols {
    flex-direction: column;
    align-items: stretch;
  }

  /* Not enough room to float the cart button next to the search */
  .view-cart {
    position: static;
    transform: none;
    margin-top: 1rem;
  }

  .card-grid {
    flex-wrap: wrap;
  }

  .card {
    flex-basis: 45%;
  }

  .stats {
    gap: 2rem;
  }

  .perks {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .product-table .product {
    display: block;
    width: auto;
  }

  .product-table tr {
    display: block;
  }
}
