/* --------------------
   Global Base Styles
-------------------- */

html, body {
  height: 100%;
  margin: 0;
  overflow-y: auto;
}

body {
  background-color: #fdf6e3;
  background-image: url("https://www.transparenttextures.com/patterns/paper-fibers.png");
  font-family: "EB Garamond", serif;
  color: #3a3a3a;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: url("https://www.transparenttextures.com/patterns/asfalt-dark.png");
  opacity: 0.025;
}

/* --------------------
   Site Header / Navbar
-------------------- */

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

.site-name a,
.site-nav a {
  font-family: 'EB Garamond', serif;  /* same as poems */
  font-size: 1.35rem;                 /* match poem body */
  line-height: 1.55;
  letter-spacing: 0.03em;
  color: #3a3a3a;                     /* same as poem text */
  text-decoration: none;
  text-transform: none;               /* no uppercase */
  margin-left: 1.5rem;
}

.site-name a:hover,
.site-nav a:hover {
  text-decoration: underline;         /* only underline on hover */
  color: #3a3a3a;                     /* keep same color as poem */
}


/* --------------------
   Main Content Wrapper
-------------------- */

main {
  padding-top: 6rem; /* space for fixed header */
}

/* --------------------
   Poetry Layout
-------------------- */

.poems {
  width: 100%;
}

.poem {
  min-height: 75vh;
  display: flex;
  align-items: center;
}

.poem.left {
  justify-content: flex-start;
  padding-left: 12vw;
}

.poem.center {
  justify-content: center;
}

.poem.right {
  justify-content: flex-end;
  padding-right: 12vw;
}

.poem-text {
  max-width: 50ch;
  font-size: 1.35rem;
  line-height: 1.55;
  letter-spacing: 0.03em;
  white-space: pre-wrap; /* preserve markdown line breaks */
}

.poem-text a {
  color: #3a3a3a;
  text-decoration: underline;
}

.poem-text a:hover {
  color: #000;
}

.poem-text-link {
  font-family: 'EB Garamond', serif;  /* same as poems */
  font-size: 1.35rem;                 /* same as poems */
  line-height: 1.55;                  /* same as poems */
  letter-spacing: 0.03em;             /* same as poems */
  color: #3a3a3a;                     /* same as poems */
  text-decoration: none;              /* clean look */
}

.poem-text-link:hover {
  text-decoration: underline;         /* only underline on hover */
}

.collection-text-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
    text-transform: lowercase;
}

.collection-text-link:hover {
    text-decoration: underline;
}

/* NAV BAR HEADER FADE LOGIC */

#site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem 2rem;
  background: transparent;
  opacity: 1;
  transition: opacity 30s linear;
  pointer-events: auto;
  z-index: 1000;
  box-sizing: border-box;
}

/* Faded state */
#site-header.hidden {
  opacity: 0;
}

/* IMPORTANT: disable fade when user interacts */
#site-header:hover {
  transition: 1s;   /* ← this is the key */
  opacity: 1;
}


/* --------------------
   Product Page Text
-------------------- */

.product-text {
  font-family: 'EB Garamond', serif; /* same as poems */
  font-size: 1.35rem;                /* same as poems */
  color: #3a3a3a;                    /* same as poems */
  letter-spacing: 0.03em;            /* same as poems */
  line-height: 1.45;                 /* slightly tighter than poems */
  margin: 0;                          /* remove extra spacing around paragraphs */
}

.product-text p {
  margin: 0 0 0.3rem 0;              /* tight spacing between lines */
  line-height: 1.65;                 /* consistent line spacing */
}

.order-link {
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.order-link:hover {
  border-bottom: 2px solid #3a3a3a;
}

/* --------------------
   Collections Grid
-------------------- */

.collections-wrapper {
  max-width: 50ch;
  margin: 4rem auto;
  padding: 0 1rem;
}

.collections-label {
  font-family: 'EB Garamond', serif;
  font-size: 1.35rem;
  font-style: italic;
  text-transform: lowercase;
  color: #3a3a3a;
  margin-bottom: 1rem;
}

.collection-item {
  text-align: left;
  text-decoration: none;
  color: #3a3a3a;
  font-family: 'EB Garamond', serif;
  font-size: 1.35rem;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  margin-bottom: 1rem;
  transition: color 0.3s ease, text-decoration 0.3s ease;
}

.collection-item:hover {
  color: #000;
  text-decoration: underline;
}

/* --------------------
   Store Grid Layout
-------------------- */

.store-wrapper {
  max-width: 1100px;
  margin: 6rem auto 4rem auto;
  padding: 0 2rem;
}

.store-label {
  font-family: 'EB Garamond', serif;
  font-size: 1.35rem;
  font-style: italic;
  text-transform: lowercase;
  color: #3a3a3a;
  margin-bottom: 2rem;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 3rem;
}

.store-item {
  text-decoration: none;
  color: #3a3a3a;
  transition: opacity 0.3s ease;
}

.store-item:hover .store-item-title {
  text-decoration: underline;
}

.store-item-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.store-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.store-item-info {
  text-align: left;
}

.store-item-title {
  font-family: 'EB Garamond', serif;
  font-size: 1.35rem;
  letter-spacing: 0.03em;
  line-height: 1.55;
  margin: 0 0 0.25rem 0;
  text-transform: uppercase;
}

.store-item-price {
  font-family: 'EB Garamond', serif;
  font-size: 1.35rem;
  letter-spacing: 0.03em;
  line-height: 1.55;
  margin: 0;
  color: #3a3a3a;
}

/* --------------------
   Product Detail Page
-------------------- */

.product-wrapper {
  max-width: 1100px;
  margin: 6rem auto 4rem auto;
  padding: 0 2rem;
  display: flex;
  gap: 4rem;
  align-items: flex-start;
}

.product-image {
  flex: 0 0 500px;
  width: 500px;
  height: 500px;
  overflow: hidden;
  border-radius: 4px;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-info {
  flex: 0 0 460px;
  text-align: left;
}

.product-title {
  margin: 0 0 1rem 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.product-description {
  margin: 0 0 0.8rem 0;
}

.product-stats {
  margin: 0 0 0.5rem 0;
  font-style: italic;
}

.product-content {
  margin: 1.5rem 0;
}

.product-content p {
  margin: 0 0 0.5rem 0;
}

.product-purchase {
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.product-price {
  font-family: 'EB Garamond', serif;
  font-size: 1.35rem;
  letter-spacing: 0.03em;
}

/* --------------------
   Checkout Button
-------------------- */

.checkout-btn {
  font-family: 'EB Garamond', serif;
  font-size: 1.35rem;
  letter-spacing: 0.03em;
  line-height: 1.55;
  color: #3a3a3a;
  background: transparent;
  border: none;
  border-bottom: 1px solid #3a3a3a;
  padding: 0 0 2px 0;
  cursor: pointer;
  transition: border-color 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

.checkout-btn:hover {
  border-bottom-width: 2px;
}

.checkout-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --------------------
   Checkout Page
-------------------- */

.checkout-wrapper {
  max-width: 50ch;
  margin: 4rem auto 4rem auto;
  padding: 0 2rem;
}

.checkout-page-title {
  font-family: 'EB Garamond', serif;
  font-size: 1.35rem;
  letter-spacing: 0.03em;
  line-height: 1.55;
  text-transform: uppercase;
  margin: 0 0 2.5rem 0;
}

.checkout-form {
  margin-top: 1.5rem;
}


/* --------------------
   Checkout Form
-------------------- */

.checkout-form {
  max-width: 100%;
}

.checkout-section {
  margin-bottom: 2rem;
}

.checkout-section-title {
  font-family: 'EB Garamond', serif;
  font-size: 1.35rem;
  font-style: italic;
  text-transform: lowercase;
  color: #3a3a3a;
  margin: 0 0 1rem 0;
  letter-spacing: 0.03em;
}

.form-row {
  margin-bottom: 1.5rem;
}

.form-row label {
  display: none;
}

.form-row input {
  width: 100%;
  padding: 0.5rem 0;
  font-family: 'EB Garamond', serif;
  font-size: 1.35rem;
  line-height: 1.55;
  color: #3a3a3a;
  background: transparent;
  border: none;
  border-bottom: 1px solid #3a3a3a;
  border-radius: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.form-row input::placeholder {
  color: #999;
  font-style: italic;
}

.form-row input:focus {
  outline: none;
  border-color: #3a3a3a;
}

.form-row-group {
  display: flex;
  gap: 1rem;
}

.form-row-group .form-row {
  flex: 1;
}

/* Card Element containers */
#card-number,
#card-expiry,
#card-cvc {
  padding: 0.5rem 0;
  border: none;
  border-bottom: 1px solid #3a3a3a;
  background: transparent;
}

/* Google Places Autocomplete styling */
.pac-container {
  font-family: 'EB Garamond', serif;
  background-color: #fdf6e3;
  border: 1px solid #3a3a3a;
  border-radius: 0;
  box-shadow: none;
  margin-top: 4px;
}

.pac-item {
  padding: 8px 12px;
  font-size: 1.1rem;
  color: #3a3a3a;
  border-top: none;
  cursor: pointer;
}

.pac-item:hover,
.pac-item-selected {
  background-color: #3a3a3a;
  color: #fdf6e3;
}

.pac-item-query {
  font-size: 1.1rem;
  color: inherit;
}

.pac-icon {
  display: none;
}

.pac-item-selected .pac-item-query {
  color: #fdf6e3;
}

.card-errors {
  font-family: 'EB Garamond', serif;
  font-size: 0.95rem;
  color: #8b0000;
  margin-top: 0.5rem;
  min-height: 1.2em;
}

/* Order Summary */
.order-summary {
  padding-top: 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-family: 'EB Garamond', serif;
  font-size: 1.35rem;
  color: #3a3a3a;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.summary-total {
  border-top: 1px solid #3a3a3a;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
  font-size: 1.35rem;
}

/* Payment Error */
.payment-error {
  font-family: 'EB Garamond', serif;
  font-size: 0.95rem;
  color: #8b0000;
  margin: 1rem 0;
  min-height: 1.2em;
}

/* Submit Button */
.checkout-submit {
  margin-top: 2rem;
  width: 100%;
  padding: 0.5rem 0;
  font-family: 'EB Garamond', serif;
  font-size: 1.35rem;
  font-style: italic;
  color: #3a3a3a;
  background: transparent;
  border: none;
  border-bottom: 1px solid #3a3a3a;
  cursor: pointer;
  text-align: left;
}

.checkout-submit:hover {
  border-bottom-width: 2px;
}

.btn-arrow {
  display: inline-block;
  position: relative;
  top: 2px;
}

/* Shipping note */
.product-shipping {
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  font-style: italic;
  color: #3a3a3a;
  opacity: 0.7;
}

/* --------------------
   Success Page
-------------------- */

.success-wrapper {
  max-width: 50ch;
  margin: 6rem auto;
  padding: 0 1rem;
}

.success-content {
  text-align: left;
}

.success-title {
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 2rem 0;
}

.success-poem {
  font-style: italic;
  margin: 0 0 2rem 0;
}

.success-poem p {
  margin: 0 0 0.3rem 0;
  line-height: 1.65;
}

.success-link {
  margin-top: 2rem;
}

/* --------------------
   Store Responsive
-------------------- */

@media (max-width: 1024px) {
  .product-wrapper {
    flex-direction: column;
    align-items: center;
  }

  .product-image {
    flex: none;
    width: 100%;
    max-width: 500px;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .product-info {
    flex: none;
    width: 100%;
    max-width: 500px;
  }
}

@media (max-width: 600px) {
  .store-grid {
    grid-template-columns: 1fr;
  }

  .store-wrapper,
  .product-wrapper,
  .checkout-wrapper {
    padding: 0 1rem;
  }

  .form-row-group {
    flex-direction: column;
    gap: 0;
  }
}
