/*
  Style sheet for the Starred Inkwell website

  This file defines the visual presentation for all pages in the site.  It
  includes a small CSS reset, a set of variables for colour and spacing,
  responsive navigation styles, section layouts, cards and forms.  The
  design takes cues from modern digital agencies while maintaining a
  distinct identity rooted in literature and nature.  Media queries at the
  bottom of the file adjust the layout on tablets and phones.
*/

/* Reset and global styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #fafafa;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* Colour palette variables */
:root {
  --primary: #0d3b3c; /* deep teal for headers and accents */
  --secondary: #b83031; /* warm red inspired by ink and autumn leaves */
  --highlight: #dba65a; /* golden highlight for buttons and links */
  --light: #ffffff;
  --dark-overlay: rgba(0, 0, 0, 0.5);
}

/* Utility classes */
.container {
  width: 90%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  margin: 0.5rem;
  border-radius: 4px;
  border: 2px solid var(--highlight);
  background-color: var(--highlight);
  color: var(--primary);
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.btn.outline {
  background-color: transparent;
  color: var(--light);
  border-color: var(--light);
}
.btn:hover {
  background-color: var(--secondary);
  border-color: var(--secondary);
  color: var(--light);
}

/* Header and navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 0.8rem 1.5rem;
  background: var(--dark-overlay);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--light);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2rem;
  font-weight: 500;
}

nav a {
  color: var(--light);
  position: relative;
  padding-bottom: 4px;
}
nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--highlight);
  transition: width 0.3s;
}
nav a:hover::after,
nav a:focus::after {
  width: 100%;
}

/* Mobile menu toggle */
#nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--light);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero section */
.hero-section {
  position: relative;
  height: 100vh;
  background-image: url('assets/bg4.webp');
  background-size: cover;
  background-position: center;
  color: var(--light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--dark-overlay);
  z-index: 0;
}
.hero-section * {
  z-index: 1;
}
.hero-section h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.hero-section p {
  font-size: 1.125rem;
  max-width: 800px;
  margin-bottom: 2rem;
}

/* Highlighted book section */
/* Featured books (highlight) section
   We reduce the gap between image and text so the cover sits closer to
   its description.  On smaller screens the layout becomes stacked. */
.highlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 4rem 0;
  background-image: url('assets/bg3.webp');
  background-size: cover;
  background-position: center;
  color: var(--light);
  position: relative;
}
.highlight::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--dark-overlay);
  z-index: 0;
}
.highlight > * {
  z-index: 1;
}
.highlight img {
  max-width: 380px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.highlight-content {
  max-width: 600px;
}
.highlight h2 {
  font-size: 1rem;
  letter-spacing: 2px;
  color: var(--highlight);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.highlight h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
}
.highlight p {
  margin-bottom: 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
}

/* Dots navigation for the highlight slider */
.highlight-dots {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.highlight-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.3s;
}
.highlight-dots .dot.active {
  background: var(--highlight);
}

/* Books grid */
#books-section {
  padding: 4rem 0;
  background: var(--light);
  color: var(--primary);
}
#books-section h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2.5rem;
}
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}
.book-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/*
  Book cover images should display the entire artwork without cropping.  By
  using `object-fit: contain` the full image is scaled down to fit within
  the available width while preserving the aspect ratio.  We avoid
  constraining the height so tall images aren’t zoomed in; instead they
  scale naturally with the width.  A subtle neutral background helps
  differentiate the image area from the white card and fills any unused
  space around the cover.
*/
.book-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  background-color: #f5f5f5;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  /* Remove explicit max-height so covers are never cropped.  The card
     height will grow to accommodate the full image. */
}
.book-card-content {
  padding: 1rem 1.5rem 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.book-card-content h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}
.book-card-content p {
  flex: 1;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.book-card-content a {
  align-self: flex-start;
  font-weight: bold;
  color: var(--secondary);
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s;
}
.book-card-content a:hover {
  border-color: var(--secondary);
}

/* Focus / What we publish section */
.focus-section {
  padding: 4rem 0;
  background-image: url('assets/bg1.webp');
  background-size: cover;
  background-position: center;
  color: var(--light);
  position: relative;
}
.focus-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Use a lighter overlay so text remains legible against the foliage.  A lower
     opacity than before brightens the section and lets more of the
     background shine through. */
  background: rgba(0, 0, 0, 0.3);
  z-index: 0;
}
.focus-section > * {
  z-index: 1;
}
.focus-section h2 {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 2.5rem;
  color: var(--highlight);
}
.focus-section p.description {
  text-align: center;
  margin: 0 auto 2rem;
  max-width: 700px;
  font-size: 1rem;
  color: var(--light);
}
.focus-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  list-style: none;
  font-size: 1.1rem;
}
.focus-list li {
  /* Slightly more opaque background to improve contrast while keeping
     the pill subtle against the leaves. */
  background: rgba(255, 255, 255, 0.3);
  padding: 1rem 1.5rem;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Authors section */
.authors-section {
  padding: 4rem 0;
  background: var(--light);
  color: var(--primary);
}
.authors-section h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2.5rem;
}
.author-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.author-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.author-card .avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}
.author-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.author-card p {
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Newsletter section */
.newsletter-section {
  padding: 4rem 0;
  background-image: url('assets/bg6.jfif');
  background-size: cover;
  background-position: center;
  color: var(--primary);
  position: relative;
}
.newsletter-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Light backdrop to ensure text is legible on the busy desktop image */
  background: rgba(255,255,255,0.9);
  z-index: 0;
}
.newsletter-section > * {
  z-index: 1;
}
.newsletter-section h2 {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 2.5rem;
  color: var(--primary);
}
.newsletter-section p {
  text-align: center;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1rem;
  color: var(--primary);
}
.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
}
.newsletter-form input[type="text"],
.newsletter-form input[type="email"] {
  padding: 0.75rem 1rem;
  border: 2px solid var(--primary);
  border-radius: 4px;
  flex: 1 1 200px;
  font-size: 1rem;
}
.newsletter-form button {
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: var(--light);
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}
.newsletter-form button:hover {
  background: var(--secondary);
}

/* Contact section */
.contact-section {
  padding: 4rem 0;
  background-image: url('assets/bg5.webp');
  background-size: cover;
  background-position: center;
  color: var(--light);
  position: relative;
}
.contact-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Further lighten the contact overlay so the background scene is more visible
     while keeping form fields legible. */
  background: rgba(0, 0, 0, 0.2);
  z-index: 0;
}
.contact-section > * {
  z-index: 1;
}
.contact-section h2 {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 2.5rem;
  color: var(--highlight);
}
.contact-section p.description {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.contact-info {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1rem;
}
.contact-info a {
  color: var(--highlight);
  text-decoration: underline;
}
.contact-form {
  display: flex;
  flex-direction: column;
  max-width: 600px;
  margin: 0 auto;
  gap: 1rem;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  /* Light background ensures form fields stand out against the darker
     contact backdrop. */
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary);
}
.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}
.contact-form button {
  padding: 0.75rem 1.5rem;
  background: var(--highlight);
  color: var(--primary);
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}
.contact-form button:hover {
  background: var(--secondary);
  color: var(--light);
}

/* Footer */
footer {
  background: var(--primary);
  color: var(--light);
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.875rem;
}
footer a {
  color: var(--highlight);
  text-decoration: underline;
  margin: 0 0.5rem;
}

/* Instagram section */
.instagram-section {
  padding: 4rem 0;
  background: var(--light);
  color: var(--primary);
  text-align: center;
}
.instagram-section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--highlight);
}
.instagram-feed {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  border: 0;
  min-height: 480px;
  /* Avoid overflow on smaller screens */
}

/* Legal pages (privacy/terms) spacing */
.legal-page {
  padding-top: 6rem; /* account for fixed header */
  padding-bottom: 4rem;
  color: var(--primary);
}
.legal-page h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--highlight);
}
.legal-page h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}
.legal-page p,
.legal-page li {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}
.legal-page ul {
  list-style: disc inside;
  padding-left: 1rem;
}

/* Cookie consent banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--primary);
  color: var(--light);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  /* Hidden by default; shown via JS if consent not yet given */
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
}
.cookie-banner.show {
  transform: translateY(0);
}
.cookie-banner p {
  margin: 0;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.4;
}
.cookie-banner .cookie-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.cookie-banner button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.3s;
}
.cookie-banner button.accept {
  background: var(--highlight);
  color: var(--primary);
}
.cookie-banner button.essential {
  background: transparent;
  border: 1px solid var(--highlight);
  color: var(--highlight);
}
.cookie-banner button.accept:hover {
  background: var(--secondary);
  color: var(--light);
}
.cookie-banner button.essential:hover {
  background: var(--highlight);
  color: var(--primary);
}

/* Media queries for responsiveness */
@media (max-width: 900px) {
  .highlight {
    flex-direction: column;
    text-align: center;
  }
  .highlight img {
    max-width: 200px;
    margin-bottom: 1.5rem;
  }
  nav ul {
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .hero-section h1 {
    font-size: 2.5rem;
  }
  .hero-section p {
    font-size: 1rem;
  }
  /* Mobile navigation styles */
  nav ul {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    background: var(--primary);
    padding: 1rem 0;
    display: none;
    gap: 1rem;
  }
  nav ul.show {
    display: flex;
  }
  #nav-toggle {
    display: block;
  }
}


/* --- Instagram embed card --- */
.instagram-section {
  padding: 3rem 0;
  background: var(--bg); /* same as site background */
  color: var(--primary);
}
.instagram-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.06);
  padding: 1rem;
}
.insta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0 1rem 0;
}
.insta-title {
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--primary);
}
.insta-link {
  font-size: 0.9rem;
  color: var(--highlight);
  text-decoration: none;
}
.insta-link:hover { text-decoration: underline; }
.instagram-feed {
  width: 100%;
  max-width: 1100px;
  height: 680px;
  margin: 0 auto;
  display: block;
  background: #fff;
}
.insta-fallback {
  text-align: center;
  margin-top: 0.75rem;
}
/* Responsive height adjustments */
@media (max-width: 1024px) {
  .instagram-feed { height: 600px; }
}
@media (max-width: 768px) {
  .instagram-feed { height: 540px; }
}
@media (max-width: 480px) {
  .instagram-feed { height: 500px; }
}

.highlight-content { max-width: 700px; }
.highlight p { line-height: 1.35; }
