/* ==========================================================================
   HEMING TEXTILE — Fabrico-style theme styles
   ========================================================================== */

:root {
  --bg: #FAF8F5;
  --bg-soft: #F5F2EC;
  --surface: #FFFFFF;
  --text: #2C2A26;
  --text-muted: #6B6560;
  --accent: #B9A47B;
  --accent-light: #D4C8B0;
  --border: #E8E3DA;
  --shadow: 0 20px 60px rgba(44, 42, 38, 0.08);
  --font-serif: "Playfair Display", "Noto Serif", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 24px 0;
  transition: all 0.4s ease;
}

.navbar.scrolled {
  background: rgba(250, 248, 245, 0.96);
  backdrop-filter: blur(10px);
  padding: 14px 0;
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo .heming-logo-img {
  height: 42px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 40px;
  align-items: center;
}

.nav-links a {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links .current-menu-item > a::after,
.nav-links .current_page_item > a::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--text);
  transition: all 0.3s ease;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-soft);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
  filter: brightness(1.05) saturate(0.9);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(250, 248, 245, 0.4) 0%, rgba(250, 248, 245, 0.85) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
  padding: 120px 24px 80px;
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(42px, 8vw, 84px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-desc {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 40px;
  font-weight: 300;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  animation: float 2.5s ease-in-out infinite;
}

.scroll-hint::after {
  content: '';
  width: 1px;
  height: 40px;
  background: var(--accent);
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 36px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all 0.35s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent);
  color: var(--text);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
}

.btn-outline:hover {
  background: var(--text);
  color: var(--bg);
}

.btn-outline--light {
  border-color: var(--bg);
  color: var(--bg);
}

.btn-outline--light:hover {
  background: var(--bg);
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section {
  padding: 120px 0;
}

.section-header {
  max-width: 720px;
  margin-bottom: 64px;
}

.section-header--center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.section-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 20px;
}

.section-text {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.8;
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */
.about {
  background: var(--bg);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about-image {
  position: relative;
}

.about-image img {
  width: 100%;
  height: 600px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.about-image::before {
  content: '';
  position: absolute;
  top: -24px;
  left: -24px;
  right: 24px;
  bottom: 24px;
  border: 1px solid var(--accent-light);
  z-index: -1;
}

.about-content {
  padding-right: 40px;
}

.about-text {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 16px;
  line-height: 1.9;
}

.signature {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--accent);
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Products
   -------------------------------------------------------------------------- */
.products {
  background: var(--bg-soft);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.product-card {
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow);
}

.product-image {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  display: block;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-tag {
  position: absolute;
  top: 20px;
  left: 20px;
  background: var(--surface);
  padding: 6px 14px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}

.product-info {
  padding: 28px;
  border-top: 1px solid var(--border);
}

.product-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 8px;
}

.product-title a:hover {
  color: var(--accent);
}

.product-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Advantages
   -------------------------------------------------------------------------- */
.advantages {
  background: var(--bg);
}

.advantages-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}

.advantage-item {
  text-align: center;
  padding: 40px 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.3s ease;
}

.advantage-item:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow);
}

.advantage-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border: 1px solid var(--accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--accent);
}

.advantage-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.advantage-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Factory
   -------------------------------------------------------------------------- */
.factory {
  background: var(--text);
  color: var(--bg);
}

.factory-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.factory-content .section-label {
  color: var(--accent-light);
}

.factory-content .section-title {
  color: var(--bg);
}

.factory-content .section-text {
  color: rgba(250, 248, 245, 0.7);
  margin-bottom: 32px;
}

.factory-image img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  opacity: 0.9;
}

.factory-stats {
  display: flex;
  gap: 48px;
  margin-top: 40px;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 42px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(250, 248, 245, 0.6);
}

/* --------------------------------------------------------------------------
   CTA
   -------------------------------------------------------------------------- */
.cta {
  background: var(--bg-soft);
  text-align: center;
  padding: 140px 0;
}

.cta-eyebrow {
  margin-bottom: 16px;
}

.cta-title {
  font-family: var(--font-serif);
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 400;
  margin-bottom: 20px;
}

.cta-text {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 36px;
  font-size: 17px;
  line-height: 1.8;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  background: var(--text);
  color: var(--bg);
  padding: 80px 0 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}

.footer-brand img {
  height: 56px;
  width: auto;
  margin-bottom: 20px;
  filter: brightness(0) invert(1);
}

.footer-brand p {
  color: rgba(250, 248, 245, 0.65);
  font-size: 14px;
  line-height: 1.8;
  max-width: 280px;
}

.footer-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 20px;
  color: var(--accent-light);
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: rgba(250, 248, 245, 0.65);
  font-size: 14px;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--bg);
}

.footer-bottom {
  border-top: 1px solid rgba(250, 248, 245, 0.15);
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(250, 248, 245, 0.5);
}

/* --------------------------------------------------------------------------
   Blog / posts
   -------------------------------------------------------------------------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.post-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow);
}

.post-thumb img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.post-body {
  padding: 28px;
}

.post-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 8px;
}

.post-title a:hover {
  color: var(--accent);
}

.post-meta {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.post-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.post-link {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-link:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Archive filters & pagination
   -------------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 48px;
}

.filter-chip {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.3s ease;
}

.filter-chip:hover,
.filter-chip.is-active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.pagination {
  margin-top: 64px;
  text-align: center;
}

.pagination .nav-links {
  display: inline-flex;
  gap: 8px;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  transition: all 0.3s ease;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* --------------------------------------------------------------------------
   Single product
   -------------------------------------------------------------------------- */
.single-product {
  padding-top: 160px;
}

.single-product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

/* Product gallery carousel — 3:4 image ratio */
.pg-carousel {
  position: relative;
}

.pg-viewport {
  position: relative;
  aspect-ratio: 3 / 4;
  max-height: 860px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.pg-track {
  display: flex;
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.pg-carousel.is-dragging .pg-track {
  transition: none;
}

.pg-slide {
  flex: 0 0 100%;
  height: 100%;
}

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

.pg-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

.pg-arrow:hover {
  background: var(--text);
  color: var(--bg);
}

.pg-prev {
  left: 16px;
}

.pg-next {
  right: 16px;
}

.pg-carousel.is-single .pg-arrow,
.pg-carousel.is-single .pg-dots {
  display: none;
}

/* Too many slides for a dot row — thumbs and arrows stay. */
.pg-carousel.is-many .pg-dots {
  display: none;
}

.pg-dots {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.pg-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
}

.pg-dot.is-active {
  background: #fff;
  transform: scale(1.45);
}

.pg-thumbs {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.pg-thumbs::-webkit-scrollbar {
  height: 4px;
}

.pg-thumbs::-webkit-scrollbar-track {
  background: transparent;
}

.pg-thumbs::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 2px;
}

.pg-thumb {
  flex: 0 0 auto;
  width: 60px;
  padding: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid transparent;
  opacity: 0.65;
  background: var(--surface);
  cursor: pointer;
  position: relative;
  transition: opacity 0.3s ease, border-color 0.3s ease;
}

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

.pg-thumb:hover {
  opacity: 1;
}

.pg-thumb.is-active {
  opacity: 1;
  border-color: var(--accent);
}

.pg-counter {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

/* Thumbnail overflow badge ("+N more") — added when there are more thumbs than fit. */
.pg-thumb.is-overflow {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.pg-thumb.is-overflow img {
  display: none;
}

/* Backwards compat: bare <img> in gallery (no carousel markup). */
.single-product-gallery img {
  width: 100%;
  max-height: 720px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.single-product-info {
  position: sticky;
  top: 100px;
}

.single-product-tax {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.single-product-tax a {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-light);
  padding: 6px 14px;
}

.single-product-title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 20px;
}

.single-product-excerpt {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 24px;
}

.entry-content {
  color: var(--text);
  line-height: 1.9;
  margin-bottom: 32px;
}

.entry-content h2,
.entry-content h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  margin: 24px 0 12px;
}

.entry-content p {
  margin-bottom: 16px;
}

.entry-content ul {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 16px;
}

.entry-content img {
  height: auto;
}

.single-product-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Page
   -------------------------------------------------------------------------- */
.page-section {
  padding-top: 180px;
  min-height: 60vh;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .about-grid,
  .factory-grid,
  .single-product-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .about-image img,
  .factory-image img {
    height: 420px;
  }

  .products-grid,
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .advantages-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .single-product-info {
    position: static;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .section {
    padding: 80px 0;
  }

  .products-grid,
  .post-grid {
    grid-template-columns: 1fr;
  }

  .advantages-grid {
    grid-template-columns: 1fr;
  }

  .factory-stats {
    flex-direction: column;
    gap: 24px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .about-content {
    padding-right: 0;
  }

  .single-product {
    padding-top: 140px;
  }
}
