/*
 * Global styles for the One Coil marketing site.
 *
 * The stylesheet is written in a mobile‑first approach. Desktop
 * enhancements are applied via media queries towards the end of the
 * file. Colours and spacing are defined as CSS variables for easy
 * theming. Adjust the variables at the top to change the visual
 * identity without touching every rule.
 */

:root {
  --color-bg: #fdfdfd;
  --color-text: #222;
  --color-accent: #000; /* Primary accent (used on buttons/nav) */
  --color-accent-light: #333;
  --color-highlight: #e6e6e6;
  --color-link: #1a0dab;
  --sidebar-width: 240px;
  --transition-speed: 0.3s;
  font-size: 16px;
  scroll-behavior: smooth;
}

/* Dark Mode */
/* :root[data-theme="dark"] {
  --color-bg: #0f0f0f;
  --color-text: #eaeaea;
  --color-accent: #ffffff;
  --color-accent-light: #cccccc;
  --color-highlight: #1f1f1f;
  --color-link: #8ab4f8;
} */

/*
 * Background carousel styling. This element sits fixed behind
 * page content and cycles through a series of grayscale images.
 * It is only inserted on the home page but rules are defined
 * globally. Each slide fades between one another and a semi‑
 * transparent overlay darkens the images for readability.
 */
#background-carousel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
}
#background-carousel .bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 2s ease-in-out;
  filter: grayscale(100%);
}
#background-carousel .bg-slide.active {
  opacity: 1;
}
#background-carousel .bg-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  line-height: 1.6;
  height: 100%;
  margin: 0;
}

/* Turn the body into a vertical flex container */
body {
  display: flex;
  flex-direction: column;
}

/* Let your main content grow to fill the available space */
main {
  flex: 1 0 auto;
}

a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  margin: 1.2em 0 0.5em;
  line-height: 1.3;
  color: var(--color-accent-light);
}

p {
  margin: 0 0 1em;
}

svg {
  max-width: 44px;
  width: 100%;
  height: 100%;
}

/* Utility classes */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--color-accent);
  color: #fff;
  border: none;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background var(--transition-speed);
  border-radius: 2px;
  font-size: 1rem;
}
.btn:hover,
.btn:focus {
  background: var(--color-accent-light);
  outline: none;
}

/* Header styles */
.logo-text {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 2px;
  color: var(--color-accent);
}

/* Logo image styles */
.logo-image {
  width: 100%;
  height: auto;
  display: block;
  max-width: 240px;
}
.logo-link {
  display: inline-block;
}
/* Visually hidden helper for accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.logo-text .star {
  color: var(--color-accent-light);
}

/* Mobile header */
.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid var(--color-highlight);
  z-index: 50;
}
.mobile-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* padding: 12px 16px;
     */
  padding: 8px 16px;
}
.mobile-menu-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-accent);
}
.mobile-cart {
  position: relative;
}
.cart-icon {
  width: 30px;
  height: 30px;
  border: 1px solid black;
  border-radius: 50px;
}
.cart-count {
  position: absolute;
  top: -4px;
  right: -10px;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 5px;
  border-radius: 12px;
  line-height: 1;
}

/* Mobile nav menu (hidden by default) */
.mobile-nav {
  display: none;
  background: #fff;
  border-top: 1px solid var(--color-highlight);
}
.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mobile-nav li {
  border-bottom: 1px solid var(--color-highlight);
}
.mobile-nav a {
  display: block;
  padding: 14px 16px;
  color: var(--color-accent-light);
  font-weight: 500;
}
.mobile-nav a:hover,
.mobile-nav a:focus {
  background: var(--color-highlight);
}

/* Desktop sidebar navigation */
.sidebar-nav {
  display: none; /* hidden on small screens */
}
.sidebar-inner {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-accent);
  color: #fff;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.sidebar-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-menu li + li {
  margin-top: 18px;
}
.sidebar-menu a {
  color: #eaeaea;
  text-decoration: none;
  font-size: 0.875rem;
  letter-spacing: 1px;
  transition: color var(--transition-speed);
}
.sidebar-menu a:hover,
.sidebar-menu a:focus {
  color: #fff;
}
.sidebar-logo {
  margin-bottom: 40px;
}

.sidebar-logo .logo-image {
  width: 160px;
  height: auto;
  display: block;
  filter: invert(100%);
}

.sidebar-cart {
  margin-top: 40px;
}

/* Main content wrapper */
main {
  padding-top: 60px;
  /* offset mobile header */
}

/* Adjust main offset when sidebar is visible */
@media (min-width: 1000px) {
  main {
    margin-left: var(--sidebar-width);
    padding-top: 0;
  }
  .mobile-header {
    display: none;
  }
  .mobile-nav {
    display: none !important;
  }
  .sidebar-nav {
    display: block;
  }
  .cart-icon {
    width: 40px;
    height: 40px;
  }
  .cart-count {
    position: relative;
    top: -30px;
    right: 15px;
    background: white;
    color: #000;
  }
  .author-photo {
    /* max-width: 33vw; */
  }
}

/* Hero section */
.hero {
  position: relative;
  min-height: 85vh;
  overflow: hidden;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.hero .slides {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero .slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.6s ease-in-out;
}
.hero .slide.active {
  opacity: 1;
}
.hero .overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}
.hero .content {
  position: relative;
  z-index: 2;
  max-width: 600px;
}
.hero .content img {
  width: 260px;
  max-width: 80%;
  margin-bottom: 20px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}
.hero .content h1 {
  font-size: 2rem;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.hero .content p {
  font-size: 1rem;
  opacity: 0.85;
  margin-bottom: 20px;
}

/* Sections */
section {
  padding: 0;
}
section h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--color-highlight);
  padding-bottom: 6px;
}
.section-grid {
  display: grid;
  gap: 20px;
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.product-card {
  background: #fff;
  border: 1px solid var(--color-highlight);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* .product-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
} */
.product-card img {
  width: 100%;
  height: 225px;
  object-fit: cover;
}

.cart-form {
  max-width: 100% !important;
}

.product-card .card-body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.product-card .card-body h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.product-card .price {
  font-weight: 600;
  margin-bottom: 10px;
}
.product-card form {
  margin-top: auto;
}

/* Home - Values */
#values {
  color: #fff;
}

#values h2,
#values h3,
#values h4 {
  color: #fff;
}

/* Home - Benefits */
#benefits ul,
#benefits li,
#benefits h2 {
  color: #fff;
}

/* Authors - Page */
.author-photo {
  width: 100%;
  /* max-width: 300px; */
  max-width: 100%;
  display: block;
  margin: 0 auto;
  border-radius: 4px;
}

.author-h1 {
  margin-top: 4rem;
}

/* Forms */
form {
  max-width: 400px;
}
input[type="text"],
input[type="email"],
select {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 1px solid var(--color-highlight);
  border-radius: 2px;
  font-size: 1rem;
}

input {
  max-width: 90%;
}
label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}
input[type="submit"] {
  cursor: pointer;
}

/* Cart table */
.cart-table {
  width: 100%;
  border-collapse: collapse;
}
.cart-table th,
.cart-table td {
  padding: 10px;
  border-bottom: 1px solid var(--color-highlight);
  text-align: left;
}
.cart-table th {
  background: var(--color-highlight);
}
.cart-summary {
  margin-top: 20px;
}

/* Responsive cart table: stack rows and display labels on small screens */
@media (max-width: 600px) {
  .cart-table,
  .cart-table thead,
  .cart-table tbody,
  .cart-table th,
  .cart-table td,
  .cart-table tr {
    display: block;
  }
  .cart-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  .cart-table tr {
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--color-highlight);
    padding-bottom: 10px;
  }
  .cart-table td {
    border: none;
    position: relative;
    padding-left: 50%;
    padding-top: 10px;
    text-align: left;
  }
  .cart-table td:before {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 45%;
    white-space: nowrap;
    font-weight: 600;
    color: var(--color-accent-light);
    content: attr(data-label);
  }
  .cart-table td:last-child {
    padding-bottom: 10px;
  }
}

/* Lightbox for product images */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 90%;
  max-height: 90%;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.7);
}

.container h1 {
  margin: 2.2em 0 0.75em;
}

.container.about-book-container div:first-of-type {
  margin-bottom: 1rem;
}

/* Apply a subtle 3D tilt to standalone book images (used on
 * the About the Book page) */
.three-d-book {
  transform: perspective(800px) rotateY(-18deg) rotateX(8deg);
  /* filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.4)); */
  transition: transform 0.5s ease;
}
.three-d-book:hover,
.three-d-book:focus {
  transform: perspective(800px) rotateY(-12deg) rotateX(4deg);
}

/* Footer */
.site-footer {
  width: auto;
  background: var(--color-accent);
  color: #fff;
  padding: 16px;
  text-align: center;
  flex-shrink: 0;
  position: relative;
  bottom: 0;
}

.site-footer div p {
	margin-bottom: 0;
  font-size: 0.8rem;
}

.site-footer .back-to-top {
  color: #fff;
  text-decoration: underline;
}

@media (min-width: 600px) {
  .hero .content h1 {
    font-size: 2.5rem;
  }
  .hero .content p {
    font-size: 1.1rem;
  }
}

#values,
#benefits {
  padding: 0rem 0;
}

@media (min-width: 1000px) {
  /* Sections */
  .section {
    padding: 40px 0;
  }
  .hero .content h1 {
    font-size: 3rem;
  }
  .hero .content img {
    width: 320px;
  }

  .product-container {
    padding-bottom: 5rem;
  }

  #values {
    padding-top: 3rem;
  }
  #benefits {
    padding-bottom: 3rem;
  }

  .site-footer {
    display: none;
  }

  .sidebar-inner div,
  .sidebar-inner nav {
    flex: 1;
    text-align: center;
  }
  .footer-inner {
    display: flex;
    align-items: end;
    justify-content: center;
  }
  .home-hero h1 {
    font-size: 3rem;
  }
  .home-hero .hero-book {
    width: 360px;
  }

  .sidebar-logo .logo-image {
    width: 100%;
  }

  .logo-image {
    max-width: 100%;
  }

  /* On desktop screens where the sidebar is visible, reduce the
   container width by the sidebar width so the two elements fit */
  .container {
    width: calc(90% - var(--sidebar-width));
    max-width: calc(1200px - var(--sidebar-width));
  }

  .author-photo {
    margin: inherit;
  }
}

#qty {
  max-width: 3rem;
}

/* Home page hero overrides. When the home hero is present, we
 * hide the slide and overlay elements defined for the generic hero
 * and instead style the content more prominently with a 3D
 * perspective on the book. */
.home-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #000;
  padding: 0px 20px;
}
.home-hero .hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}
.home-hero .hero-book {
  width: 240px;
  max-width: 80%;
  margin: 0 auto 20px auto;
  transform: perspective(800px) rotateY(-20deg) rotateX(10deg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  display: block;
}
.home-hero h1 {
  font-size: 2rem;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 3px;
}
.home-hero p {
  font-size: 1rem;
  opacity: 0.95;
}
.home-hero .btn {
  margin-top: 20px;
}

@media (min-width: 600px) {
  .home-hero h1 {
    font-size: 2.6rem;
  }
  .home-hero p {
    font-size: 1.1rem;
  }
  .home-hero .hero-book {
    width: 300px;
  }
}

/* Extra‑large screens (e.g., 4K). Provide larger typography and
 * images so the design scales gracefully on very wide displays. */
@media (min-width: 1400px) {
  .home-hero h1 {
    font-size: 3.5rem;
  }
  .home-hero p {
    font-size: 1.25rem;
  }
  .home-hero .hero-book {
    width: 420px;
  }
}
@media (min-width: 2000px) {
  .home-hero h1 {
    font-size: 4rem;
  }
  .home-hero p {
    font-size: 1.4rem;
  }
  .home-hero .hero-book {
    width: 500px;
  }
}

/* Cookie banner */
#cookie-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #111;
  color: #fff;
  padding: 12px 16px;
  font-size: 14px;
  z-index: 9999;
}

#cookie-banner a {
  color: #8ab4f8;
  text-decoration: underline;
}

#cookie-banner button {
  background: #fff;
  color: #000;
  border: none;
  padding: 6px 12px;
  margin-top: 8px;
  cursor: pointer;
}

#cookie-banner button:hover {
  opacity: 0.85;
}

/* Legal / policy pages */
.legal-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 0 40px;
}

.legal-content .section-header h1 {
  margin-top: 1.5rem;
}

.legal-content .prose {
  font-size: 0.95rem;
  line-height: 1.7;
}

.legal-content .prose h2 {
  font-size: 1.1rem;
  margin-top: 2rem;
  border-bottom: none; /* remove section divider look */
  padding-bottom: 0;
}

.legal-content .prose p {
  margin-bottom: 1.2rem;
  color: var(--color-text);
}

/* Cookie banner – mobile default */
#cookie-banner {
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
}

/* Cookie banner – desktop */
@media (min-width: 1000px) {
  #cookie-banner {
    left: auto;
    right: 24px;
    bottom: 24px;
    max-width: 360px;
    text-align: left;
    border-radius: 6px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  }

  #cookie-banner p {
    margin-bottom: 12px;
  }

  #cookie-banner button {
    width: 100%;
  }

  .product-card img {
    height: auto;
  }
}

@media (max-width: 768px) {
  .product-card img {
    height: auto;
  }

  .container h1 {
    margin: 1em 0 0.75em;
  }
}
