/*
Theme Name: Twenty Candles
Description: Premium minimalist e-commerce theme for Twenty Candles artisanal candle store.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: twenty-candles
*/

/* ─── Reset ─── */
.wp-site-blocks > footer {
  margin-block-start: 0;
}

/* ─── Equal-height cards ─── */
.equal-cards > .wp-block-column {
  display: flex;
  flex-direction: column;
  flex-grow: 0;
}
.equal-cards > .wp-block-column > .wp-block-group {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.equal-cards .cta-bottom {
  margin-top: auto;
  justify-content: center;
}

/* ─── Scroll reveal ─── */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Stagger children ─── */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  animation: tcFadeUp 0.55s ease forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.22s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.34s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.46s; }

@keyframes tcFadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Hero ─── */
.tc-hero {
  background: linear-gradient(140deg, #F8F3ED 0%, #EDE7DF 55%, #E2D8CE 100%);
  min-height: 88vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.tc-hero::before {
  content: '';
  position: absolute;
  top: -15%;
  right: -8%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(196,149,106,0.18) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}
.tc-hero::after {
  content: '';
  position: absolute;
  bottom: -12%;
  left: -6%;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(196,149,106,0.12) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
}

/* ─── Header ─── */
.tc-header {
  border-bottom: 1px solid rgba(46,42,57,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}
.tc-header .wp-block-site-title a {
  text-decoration: none;
  color: var(--wp--preset--color--foreground);
  transition: color 0.2s ease;
}
.tc-header .wp-block-navigation a {
  text-decoration: none;
  transition: color 0.2s ease;
}
.tc-header .wp-block-navigation a:hover {
  color: var(--wp--preset--color--accent);
}

/* ─── Uniform product photo framing ─── */
.wc-block-components-product-image .wc-block-components-product-image__image,
.wc-block-components-product-image img {
  aspect-ratio: 1 / 1 !important;
  object-fit: cover !important;
  width: 100% !important;
  height: auto !important;
}
.woocommerce div.product div.images .woocommerce-product-gallery__image,
.woocommerce div.product div.images .woocommerce-product-gallery__image img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 100%;
  height: auto;
}
.woocommerce div.product div.images .flex-control-thumbs li img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 100%;
  height: auto;
}

/* ─── WooCommerce overrides ─── */
.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2rem;
}
.woocommerce ul.products li.product {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  transition: transform 0.25s ease;
}
.woocommerce ul.products li.product:hover {
  transform: translateY(-5px);
}
.woocommerce ul.products li.product h2.woocommerce-loop-product__title {
  font-family: var(--wp--preset--font-family--poppins);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.woocommerce ul.products li.product .price {
  color: var(--wp--preset--color--accent);
}
.woocommerce ul.products li.product a.button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
  background-color: var(--wp--preset--color--foreground) !important;
  color: #fff !important;
  border-radius: 0 !important;
  font-family: var(--wp--preset--font-family--poppins);
  font-size: 0.7rem !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.75rem 1.5rem !important;
  transition: background-color 0.2s ease !important;
}
.woocommerce ul.products li.product a.button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
  background-color: var(--wp--preset--color--accent) !important;
  color: #fff !important;
}
.woocommerce div.product .product_title {
  font-family: var(--wp--preset--font-family--abril-fatface);
  font-weight: 400;
}
.woocommerce div.product p.price,
.woocommerce div.product span.price {
  color: var(--wp--preset--color--accent);
  font-size: 1.4rem;
}
.woocommerce div.product .single_add_to_cart_button {
  background-color: var(--wp--preset--color--foreground) !important;
  border-radius: 0 !important;
}
.woocommerce div.product .single_add_to_cart_button:hover {
  background-color: var(--wp--preset--color--accent) !important;
}
/* Outline button variant */
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--wp--preset--color--foreground);
  border: 1.5px solid var(--wp--preset--color--foreground);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--wp--preset--color--foreground);
  color: #fff;
}

/* ─── Newsletter form ─── */
.tc-newsletter-form {
  display: flex;
  gap: 0;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 500px;
  margin: 0 auto;
}
.tc-newsletter-form input[type="email"] {
  flex: 1;
  min-width: 220px;
  padding: 0.9rem 1.5rem;
  border: 1px solid rgba(248,243,237,0.2);
  background: rgba(248,243,237,0.08);
  color: #F8F3ED;
  font-family: var(--wp--preset--font-family--poppins);
  font-size: 0.9rem;
  outline: none;
}
.tc-newsletter-form input[type="email"]::placeholder {
  color: rgba(248,243,237,0.5);
}
.tc-newsletter-form button {
  background: var(--wp--preset--color--accent);
  color: #fff;
  border: none;
  padding: 0.9rem 1.75rem;
  font-family: var(--wp--preset--font-family--poppins);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}
.tc-newsletter-form button:hover {
  background: #b0834f;
}

/* ─── Footer list ─── */
.tc-footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tc-footer-list li {
  margin-bottom: 0.65rem;
}
.tc-footer-list li a {
  display: inline-block;
  color: rgba(248,243,237,0.6);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.2;
  transition: color 0.2s ease;
}
.tc-footer-list li a:hover {
  color: var(--wp--preset--color--accent);
}

/* ─── Values section accent mark ─── */
.tc-value-icon {
  display: inline-block;
  width: 40px;
  height: 2px;
  background-color: var(--wp--preset--color--accent);
  margin-bottom: 1.25rem;
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Mobile ─── */
@media (max-width: 781px) {
  .tc-hero {
    min-height: 70vh;
  }
  .tc-hero-inner {
    padding-top: 3.5rem !important;
    padding-bottom: 3.5rem !important;
  }
  .tc-hero-stats {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 2rem !important;
    margin-top: 2.5rem !important;
  }
  .tc-hero-stats > .wp-block-separator {
    display: none;
  }
  .woocommerce ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem;
  }
}

/* ─── Mobile nav: compact dropdown instead of fullscreen overlay ─── */
@media (max-width: 599px) {
  .tc-header .wp-block-navigation {
    /* core sets position:relative here, which would make the dropdown
       anchor to the nav/hamburger button instead of the full header */
    position: static;
  }
  .tc-header .wp-block-navigation__responsive-container.is-menu-open {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    bottom: auto;
    height: auto;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 12px 24px rgba(46,42,57,0.12);
  }
  .tc-header .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) {
    padding: 1.5rem clamp(1.25rem, 5vw, 3rem) 2rem;
  }
  .tc-header .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation__responsive-container-content {
    padding-top: 0;
  }
  .tc-header .wp-block-navigation__responsive-container-close {
    display: none;
  }
  html.has-modal-open {
    overflow: visible !important;
  }
}

/* ─── Phone ─── */
@media (max-width: 480px) {
  .tc-hero .wp-block-buttons {
    flex-wrap: wrap !important;
  }
  .tc-hero .wp-block-buttons .wp-block-button {
    width: 100%;
  }
  .tc-hero .wp-block-buttons .wp-block-button__link {
    width: 100%;
    text-align: center;
  }
  .tc-header .wp-block-site-title a {
    font-size: 1.6rem !important;
  }
}
