/* CSS RESET & NORMALIZE (mobile-first, flex layouts only) */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
  box-sizing: border-box;
}
html { box-sizing: border-box; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
*, *:before, *:after { box-sizing: inherit; }
body {
  min-height: 100vh;
  background: #FAF7F4;
  color: #263238;
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.03em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; border: 0; }
a {
  color: #8A8575;
  text-decoration: none;
  transition: color 0.24s cubic-bezier(.4,0,.2,1);
}
a:focus, a:hover {
  color: #AF8F6F;
  outline: none;
}
ul, ol { list-style: none; }
hr { border: none; border-top: 1px solid #E4E2DF; margin: 24px 0; }

/* TYPOGRAPHY */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 700;
  color: #263238;
}
h1 { font-size: 2.5rem; line-height: 1.2; margin-bottom: 20px; letter-spacing: 0.01em; }
h2 { font-size: 2rem; line-height: 1.23; margin-bottom: 16px; }
h3 { font-size: 1.5rem; line-height: 1.3; margin-bottom: 12px; }
h4 { font-size: 1.15rem; margin-bottom: 8px; }
p, li {
  font-family: 'Open Sans', Arial, sans-serif;
  color: #4F5756;
  font-size: 1rem;
  margin-bottom: 10px;
}
strong { color: #AF8F6F; font-weight: 700; }

/* CONTAINERS & SPACING */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: 18px;
  padding-right: 18px;
}
.section {
  margin-bottom: 60px;
  padding: 40px 20px;
  background: none;
}
.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: flex-start;
}
.text-section {
  margin-bottom: 16px;
  line-height: 1.8;
}

/* HERO SECTION */
.hero-section {
  background: #FDF6EC;
  border-radius: 0 0 28px 28px;
  padding-top: 48px;
  padding-bottom: 48px;
  box-shadow: 0 4px 28px 0 rgba(208,181,154,0.07);
}
.hero-section h1 {
  color: #A79277;
}
.hero-section p {
  margin-bottom: 28px;
  font-size: 1.1rem;
  color: #725A49;
}

/* FLEX UTILITY CLASSES */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.card {
  background: #FFFFFF;
  border-radius: 18px;
  box-shadow: 0 2px 12px 0 rgba(166,178,186,0.11);
  margin-bottom: 20px;
  padding: 32px 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: box-shadow 0.24s;
}
.card:hover {
  box-shadow: 0 6px 32px 0 rgba(175,143,111,0.13);
}
.content-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}
.text-image-section {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}
.testimonial-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: #FFFDF6;
  box-shadow: 0 2px 12px 0 rgba(175,143,111,0.08);
  margin-bottom: 24px;
  border-radius: 16px;
  position: relative;
  color: #263238;
  font-size: 1.07rem;
  flex-direction: column;
  min-width: 220px;
  max-width: 430px;
}
.testimonial-card span {
  color: #AF8F6F;
  font-weight: 700;
  font-size: 1rem;
  margin-top: 6px;
}
.feature-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
}
.feature-grid, .featured-books-list, .featured-new-books, .book-grid, .event-cards, .blog-post-cards, .feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 0 0 16px 0;
  padding: 0;
}
.feature-grid li, .featured-books-list li, .featured-new-books li, .book-grid li, .event-cards li, .blog-post-cards li, .feature-list li {
  background: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 2px 10px 0 rgba(175,143,111,0.06);
  padding: 22px 18px;
  margin-bottom: 20px;
  flex: 1 1 270px;
  min-width: 230px;
  transition: box-shadow .2s;
}
.feature-grid li img, .contact-details img {
  width: 28px;
  height: 28px;
  margin-right: 12px;
  vertical-align: middle;
}

/* NAVIGATION */
header {
  background: #FAF7F4;
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 50;
  box-shadow: 0 2px 8px 0 rgba(175,143,111,0.06);
}
header .container {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  height: 78px;
}
.logo { height: 44px; width: auto; margin-right: 10px; }
.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: 1;
}
.main-nav a {
  font-family: 'Merriweather', Georgia, serif;
  color: #78665B;
  font-size: 1rem;
  font-weight: 500;
  padding: 3px 7px;
  position: relative;
  border-radius: 7px;
  transition: background 0.2s, color 0.22s;
}
.main-nav a:hover, .main-nav a:focus {
  color: #AF8F6F;
  background: #faf3ed;
}
.cta-primary {
  background: #AF8F6F;
  color: #fff;
  padding: 10px 28px;
  border: none;
  border-radius: 22px;
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 2px 8px 0 rgba(175,143,111,0.09);
  transition: box-shadow .22s, background .2s;
  margin-left: 10px;
  display: inline-block;
  text-align: center;
}
.cta-primary:hover, .cta-primary:focus {
  background: #A79277;
  color: #FDF6EC;
  box-shadow: 0 4px 22px 0 rgba(175,143,111,0.15);
  outline: none;
}
.mobile-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: #FAF7F4;
  color: #AF8F6F;
  border: none;
  border-radius: 8px;
  width: 46px;
  height: 46px;
  cursor: pointer;
  margin-left: 10px;
  z-index: 201;
  transition: background 0.15s;
}
.mobile-menu-toggle:focus, .mobile-menu-toggle:hover {
  background: #FFEAD7;
}

/* MOBILE MENU OVERLAY */
.mobile-menu {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(253,246,236,0.94);
  z-index: 205;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transform: translateX(100%);
  transition: transform 0.36s cubic-bezier(.77,0,.18,1);
  pointer-events: none;
  opacity: 0;
}
.mobile-menu.active {
  transform: translateX(0);
  pointer-events: auto;
  opacity: 1;
}
.mobile-menu-close {
  background: none;
  border: none;
  font-size: 2.2rem;
  color: #AF8F6F;
  align-self: flex-end;
  margin: 28px 32px 24px 0;
  cursor: pointer;
  transition: color 0.18s;
  z-index: 210;
}
.mobile-menu-close:hover {
  color: #A79277;
}
.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 26px;
  width: 100%;
  align-items: flex-start;
  padding: 0 44px;
}
.mobile-nav a {
  font-size: 1.22rem;
  padding: 10px 0;
  color: #725A49;
  border-radius: 8px;
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 600;
  transition: background .2s, color .2s;
}
.mobile-nav a:focus, .mobile-nav a:hover {
  background: #fff2de;
  color: #AF8F6F;
}

@media (min-width: 1025px) {
  .mobile-menu,
  .mobile-menu-toggle {
    display: none !important;
  }
}
@media (max-width: 1024px) {
  .main-nav {
    display: none;
  }
  .cta-primary {
    margin-right: 10px;
  }
}
@media (max-width: 768px) {
  header .container {
    height: 60px;
    padding: 0 10px;
  }
  .logo { height: 34px; }
  .section, .hero-section {
    padding: 28px 2vw 28px 2vw;
    margin-bottom: 38px;
  }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.35rem; }
  h3 { font-size: 1.10rem; }
  .feature-grid, .featured-books-list, .book-grid, .featured-new-books, .event-cards, .blog-post-cards, .feature-list {
    flex-direction: column !important;
    gap: 18px;
  }
  .testimonial-card { min-width: 0; max-width: 100%; }
  .footer-grid { flex-direction: column!important; gap: 34px; }
  .text-image-section { flex-direction: column !important; gap: 18px; }
}
@media (max-width: 520px) {
  .container { padding-left: 7px; padding-right: 7px; }
  .cta-primary { padding: 10px 10vw; font-size: 1rem; }
}

/* BOOK FILTERS & SELECTIONS */
.book-filters, .event-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  font-size: 1rem;
  margin-bottom: 18px;
}
.category-menu a {
  color: #AF8F6F;
  font-weight: 600;
  font-size: 1rem;
  margin: 0 3px;
  transition: color 0.13s;
}
.category-menu a:hover,
.category-menu a:focus {
  text-decoration: underline;
  color: #A79277;
}
.sort-options {
  background: #FAF7F4;
  border-radius: 8px;
  border: 1px solid #EDE7DD;
  color: #725A49;
  font-family: inherit;
  padding: 6px 12px;
  margin-left: 3px;
  font-size: 1rem;
  min-width: 90px;
}

/* SEARCH BAR */
.search-bar {
  margin-bottom: 18px;
  display: flex;
}
.search-bar input[type="text"] {
  width: 100%;
  padding: 10px 18px;
  border: 1px solid #E1DED6;
  border-radius: 12px;
  font-size: 1rem;
  background: #FFFDF6;
  outline: none;
  transition: border .19s;
}
.search-bar input[type="text"]:focus { border: 1.5px solid #AF8F6F; }

/* CTA SECTION */
.cta-section {
  background: #FFFDF6;
  border-radius: 22px;
  box-shadow: 0 2px 15px 0 rgba(175,143,111,0.06);
  padding: 44px 20px 35px 20px;
  margin-bottom: 60px;
  text-align: center;
}
.cta-section h2 { color: #A79277; }
.cta-section p { color: #725A49; }

/* NEWSLETTER SIGNUP & SOCIALS */
.newsletter-signup {
  margin: 18px 0 10px 0;
  background: #FAF4E3;
  border-radius: 13px;
  padding: 16px 12px;
  box-shadow: 0 0 0 0 rgba(0,0,0,0.00);
}
.social-links {
  display: flex;
  gap: 14px;
  align-items: center;
}
.social-links a {
  display: flex;
  padding: 4px;
  background: #F3E3D3;
  border-radius: 50%;
  transition: background 0.17s;
}
.social-links a:focus, .social-links a:hover {
  background: #EDD1B4;
}
.social-links img {
  width: 28px; height: 28px;
}

/* FOOTER */
footer {
  background: #F3E9DE;
  padding: 32px 0 0 0;
  margin-top: 60px;
}
.footer-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 38px;
  justify-content: space-between;
}
.footer-grid div, .footer-grid nav {
  flex: 1 1 220px;
  min-width: 180px;
}
.footer-grid img {
  height: 38px;
  margin-bottom: 10px;
}
.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-grid ul li a {
  color: #725A49;
  font-size: 1rem;
  transition: color 0.13s;
}
.footer-grid ul li a:hover, .footer-grid ul li a:focus {
  color: #AF8F6F;
}
.footer-social-newsletter {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 22px;
}
.copyright {
  text-align: center;
  margin: 0;
  padding: 28px 0 18px 0;
  font-size: 0.96rem;
  color: #8A8575;
  background: transparent;
}

/* TESTIMONIALS & BLOCKQUOTES */
blockquote {
  background: #FDF6EC;
  color: #554533;
  font-style: italic;
  border-left: 4px solid #AF8F6F;
  padding: 18px 18px 18px 24px;
  margin: 10px 0 14px 0;
  border-radius: 10px;
}

/* CONTACT DETAILS + HOURS */
.contact-details, .store-hours, .map {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.contact-details p, .store-hours p, .map p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 0;
  color: #725A49;
}
.map {
  flex-direction: column;
  gap: 7px;
}

/* BUTTONS */
button,
input[type="button"],
input[type="submit"] {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1rem;
  color: #FFF;
  background: #AF8F6F;
  border: none;
  border-radius: 22px;
  padding: 9px 20px;
  cursor: pointer;
  margin-top: 10px;
  margin-bottom: 8px;
  box-shadow: 0 2px 9px 0 rgba(175,143,111,0.10);
  transition: background 0.18s, box-shadow 0.2s;
}
button:focus, button:hover {
  background: #A79277;
  outline: none;
}

/* LISTS / DETAILS */
ul li, ol li {
  margin-bottom: 12px;
  padding-left: 2px;
}

/* TAGS, QUICK SUMMARIES */
.category-tags,
.quick-summaries, .short-reviews {
  margin-top: 10px;
  margin-bottom: 0;
  padding: 6px 10px;
  background: #FFF1DF;
  border-radius: 10px;
  font-size: 0.97rem;
  color: #A79277;
  font-style: italic;
}

/* Animations */
.cta-primary,
button,
.mobile-menu,
.mobile-menu-close {
  transition-property: background, color, transform, box-shadow, opacity;
  transition-duration: 0.21s, 0.21s, 0.36s, 0.22s, 0.22s;
  transition-timing-function: cubic-bezier(.77,0,.18,1), cubic-bezier(.77,0,.18,1), cubic-bezier(.77,0,.18,1), cubic-bezier(.77,0,.18,1), cubic-bezier(.77,0,.18,1);
}

/* COOKIE CONSENT BANNER STYLES */
.cookie-banner {
  position: fixed;
  left: 0; bottom: 0; width: 100vw;
  background: #FFF8F0;
  z-index: 9999;
  box-shadow: 0 -2px 25px 0 rgba(92,66,52,0.07);
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 22px;
  justify-content: space-between;
  padding: 22px 6vw 22px 6vw;
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 1.01rem;
  color: #725A49;
  opacity: 0;
  pointer-events: none;
  transform: translateY(120%);
  transition: opacity 0.3s, transform 0.34s cubic-bezier(.77,0,.18,1);
}
.cookie-banner.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.cookie-banner-text {
  flex: 2 1 400px;
  min-width: 140px;
  margin-right: 18px;
}
.cookie-banner-buttons {
  flex: 1 1 180px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}
.cookie-btn {
  background: #AF8F6F;
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 9px 20px;
  margin: 2px 0;
  font-family: 'Merriweather',Georgia,serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.19s;
}
.cookie-btn:focus, .cookie-btn:hover {
  background: #A79277;
  color: #e9dfd4;
}
.cookie-btn.secondary {
  background: #F3E9DE;
  color: #725A49;
  border: 1px solid #E1DED6;
}
.cookie-btn.secondary:focus, .cookie-btn.secondary:hover {
  background: #FFF1DF;
  color: #AF8F6F;
}

@media (max-width: 700px) {
  .cookie-banner { flex-direction: column; padding: 18px 2vw 18px 2vw; gap: 15px; }
  .cookie-banner-buttons { justify-content: flex-start; }
}

/* COOKIE PREFERENCES MODAL */
.cookie-modal-overlay {
  position: fixed;
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(38,50,56,0.21);
  z-index: 10100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(.77,0,.18,1);
}
.cookie-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.cookie-modal {
  background: #FFFDF6;
  border-radius: 18px;
  padding: 38px 36px 28px 36px;
  max-width: 390px;
  width: 90vw;
  box-shadow: 0 8px 52px 0 rgba(38,50,56,0.08);
  color: #263238;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.cookie-modal h2 {
  color: #AF8F6F;
  margin-bottom: 8px;
}
.cookie-modal-category {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 13px;
  font-weight: 500;
  color: #725A49;
}
.cookie-toggle {
  width: 38px;
  height: 20px;
  background: #F3E9DE;
  border-radius: 10px;
  display: inline-block;
  position: relative;
  vertical-align: middle;
  cursor: pointer;
  transition: background 0.2s;
}
.cookie-toggle.checked { background: #AF8F6F; }
.cookie-toggle input[type="checkbox"] {
  display: none;
}
.cookie-toggle-slider {
  position: absolute;
  left: 2px; top: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.16s cubic-bezier(.6,0,.27,1);
}
.cookie-toggle.checked .cookie-toggle-slider {
  left: 20px;
}
.cookie-modal .cookie-btn {
  width: 100%;
  margin-top: 18px;
}
.cookie-modal-close {
  position: absolute;
  top: 8px; right: 9px;
  font-size: 1.45rem;
  background: transparent;
  border: none;
  color: #AF8F6F;
  cursor: pointer;
}
.cookie-modal-close:focus, .cookie-modal-close:hover { color: #A79277; }

/* UTILITY */
.mt-20 { margin-top: 20px!important; }
.mb-20 { margin-bottom: 20px!important; }
.d-flex { display: flex; }
.flex-col { flex-direction: column; }
.wrap { flex-wrap: wrap; }
.gap-20 { gap: 20px; }
.align-center { align-items: center; }

/* SOFT PASTEL THEME COLOR ACCENTS */
::-webkit-scrollbar { width: 9px; background: #FAF7F4; }
::-webkit-scrollbar-thumb {
  background: #EDD1B4;
  border-radius: 7px;
}
::-webkit-scrollbar-thumb:hover {
  background: #AF8F6F;
}

/* MICROINTERACTIONS */
.card, .feature-grid li, .featured-books-list li, .featured-new-books li, .book-grid li, .event-cards li, .blog-post-cards li, .feature-list li {
  transition: box-shadow 0.16s, background 0.13s;
}
.card:hover, .feature-grid li:hover, .featured-books-list li:hover, .featured-new-books li:hover, .book-grid li:hover, .event-cards li:hover, .blog-post-cards li:hover, .feature-list li:hover {
  box-shadow: 0 8px 28px 0 rgba(175,143,111,0.09);
  background: #FFF6ED;
}

/* ERROR/INFO/SUCCESS BANNERS */
.info-banner, .success-banner, .error-banner {
  padding: 14px 14px 14px 30px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 1.02rem;
}
.info-banner { background: #FDF6EC; color: #A79277; border-left: 6px solid #EDD1B4; }
.success-banner { background: #E0F6E0; color: #429263; border-left: 6px solid #8DC98D; }
.error-banner { background: #FFE8E6; color: #B9472C; border-left: 6px solid #FFBCAA; }

/* PAGE SPECIFIC SECTIONS (BORDERS) */
.highlights-section {
  background: #F5ECE5;
  border-radius: 17px;
  box-shadow: 0 2px 10px 0 rgba(175,143,111,0.05);
  margin-bottom: 60px;
}
.features-section {
  background: #FAF4E3;
  border-radius: 19px;
  margin-bottom: 60px;
}
.testimonials-section {
  background: #FFF9F2;
  border-radius: 16px;
  margin-bottom: 60px;
}

/* FORMS (Newsletter Input Styles) */
.newsletter-signup input[type=email], .newsletter-signup input[type=text] {
  border-radius: 12px;
  border: 1px solid #EDE7DD;
  font-size: 1rem;
  padding: 10px 18px;
}

/* DEFENSIVE EDGE CASES */
@media (max-width: 360px) {
  .cookie-banner { font-size: 0.95rem; padding-left: 1vw; padding-right: 1vw; }
  .cta-primary { font-size: 0.95rem; }
}

/* Hide visually but keep accessible for screen readers */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
