/*
Theme Name: Loom
Theme URI: https://loomerugs.com
Author: Loom Rugs
Author URI: https://loomerugs.com
Description: A minimal, heritage-inspired WooCommerce theme for handmade rug artisans. Built with semantic HTML5, zero bloat, and full LLM/AI-search compatibility.
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: loom
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6

WooCommerce support: Yes
Rank Math SEO compatible: Yes
*/

/* ============================================
   CSS VARIABLES & RESET — Loomé Brand
   ============================================ */
:root {
  /* Loomé brand palette */
  --loom-gold: #C4A96B;
  --loom-gold-dark: #A88B4A;
  --loom-gold-light: #D9C89A;
  --loom-cream: #FAF7F2;
  --loom-cream-dark: #F2EDE4;
  --loom-brown: #2C2416;
  --loom-brown-light: #4A3F2E;
  --loom-brown-muted: #7A6E5A;
  --loom-text: #3D3426;
  --loom-text-secondary: #6B5F4F;
  --loom-text-muted: #9E9180;
  --loom-border: #E8E0D4;
  --loom-white: #FFFFFF;

  /* Background hierarchy */
  --color-bg: var(--loom-cream);
  --color-surface: var(--loom-white);
  --color-surface-alt: var(--loom-cream-dark);

  /* Text hierarchy */
  --color-text: var(--loom-text);
  --color-text-secondary: var(--loom-text-secondary);
  --color-text-muted: var(--loom-text-muted);

  /* Accent */
  --color-accent: var(--loom-gold);
  --color-accent-dark: var(--loom-gold-dark);

  /* Typography — Montserrat matches Loomé logo geometric sans */
  --font-brand: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 8rem;

  --radius: 0px;
  --max-width: 1280px;
  --transition: 0.25s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-text);
  background-color: var(--color-bg);
  font-weight: 400;
}

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

a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

a:hover {
  color: var(--loom-gold-dark);
}

/* ============================================
   TYPOGRAPHY — Semantic hierarchy for LLMs
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
  color: var(--loom-brown);
  text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); letter-spacing: -0.01em; }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.15rem; font-weight: 500; font-family: var(--font-sans); color: var(--loom-brown); }

p {
  margin-bottom: var(--space-md);
  text-wrap: pretty;
  color: var(--color-text-secondary);
}

/* ============================================
   LAYOUT CONTAINERS
   ============================================ */
.loom-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.loom-section {
  padding: var(--space-2xl) 0;
}

.loom-section-sm {
  padding: var(--space-xl) 0;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--loom-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.site-title {
  font-family: var(--font-brand);
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--loom-brown);
}

.site-title a {
  color: var(--loom-brown);
}

.site-title a:hover {
  color: var(--loom-gold);
}

/* Primary Navigation */
.primary-navigation ul {
  display: flex;
  list-style: none;
  gap: var(--space-lg);
}

.primary-navigation a {
  font-family: var(--font-brand);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  padding: 0.5rem 0;
  position: relative;
}

.primary-navigation a:hover,
.primary-navigation .current-menu-item a {
  color: var(--loom-gold);
}

.primary-navigation a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--loom-gold);
  transition: width var(--transition);
}

.primary-navigation a:hover::after {
  width: 100%;
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header-actions a {
  font-family: var(--font-brand);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.header-actions a:hover {
  color: var(--loom-gold);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--loom-brown);
  margin: 6px 0;
  transition: var(--transition);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
  background: var(--color-surface);
  padding: var(--space-3xl) 0 var(--space-2xl);
  text-align: center;
}

.hero-section h1 {
  max-width: 800px;
  margin: 0 auto var(--space-md);
  color: var(--loom-brown);
}

.hero-section .lead {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-lg);
  line-height: 1.9;
}

.hero-image {
  margin-top: var(--space-xl);
}

.hero-image img {
  width: 100%;
  max-height: 70vh;
  object-fit: cover;
}

/* CTA Button */
.loom-button,
.woocommerce button.button,
.woocommerce a.button,
.button {
  display: inline-block;
  background: var(--loom-gold);
  color: var(--loom-white);
  border: none;
  padding: 1rem 2.5rem;
  font-family: var(--font-brand);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  border-radius: var(--radius);
  text-align: center;
}

.loom-button:hover,
.woocommerce button.button:hover,
.woocommerce a.button:hover,
.button:hover {
  background: var(--loom-gold-dark);
  color: var(--loom-white);
  transform: translateY(-2px);
}

.loom-button-outline {
  background: transparent;
  color: var(--loom-brown);
  border: 1.5px solid var(--loom-brown);
}

.loom-button-outline:hover {
  background: var(--loom-brown);
  color: var(--loom-white);
}

/* ============================================
   PROCESS / CRAFTSMANSHIP SECTIONS
   (Abbas Carpets inspired)
   ============================================ */
.process-section {
  background: var(--color-surface);
}

.process-step {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
  padding: var(--space-xl) 0;
}

.process-step:nth-child(even) .process-content {
  order: 2;
}

.process-step:nth-child(even) .process-media {
  order: 1;
}

.process-content h2 {
  margin-bottom: var(--space-sm);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--loom-brown);
}

.process-content .step-number {
  font-family: var(--font-brand);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--loom-gold);
  margin-bottom: var(--space-xs);
  display: block;
}

.process-content p {
  color: var(--color-text-secondary);
  font-size: 1.05rem;
  line-height: 1.9;
}

.process-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4/3;
}

/* ============================================
   ABOUT / LEGACY SECTION
   ============================================ */
.about-hero {
  text-align: center;
  padding: var(--space-3xl) 0 var(--space-xl);
  background: var(--color-surface);
}

.about-hero h1 {
  font-size: clamp(3rem, 7vw, 5.5rem);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-md);
  color: var(--loom-brown);
}

.about-hero .legacy-text {
  max-width: 700px;
  margin: 0 auto;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  line-height: 1.9;
}

.about-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-top: var(--space-xl);
}

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

/* Stats / Trust signals */
.trust-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  padding: var(--space-xl) 0;
  text-align: center;
  border-top: 1px solid var(--loom-border);
  border-bottom: 1px solid var(--loom-border);
  margin: var(--space-xl) 0;
}

.trust-item .trust-number {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  color: var(--loom-gold);
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 400;
}

.trust-item .trust-label {
  font-family: var(--font-brand);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ============================================
   PRODUCT GRID (Shop/Category)
   ============================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.product-card {
  background: var(--color-surface);
  transition: transform var(--transition), box-shadow var(--transition);
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(44, 36, 22, 0.08);
}

.product-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  margin-bottom: var(--space-sm);
}

.product-card h3 {
  font-family: var(--font-brand);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: var(--loom-brown);
}

.product-card .price {
  font-size: 0.95rem;
  color: var(--loom-gold);
  font-weight: 500;
}

/* ============================================
   SINGLE PRODUCT
   ============================================ */
.product-single {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  padding: var(--space-xl) 0;
}

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

.product-info h1 {
  margin-bottom: var(--space-sm);
  color: var(--loom-brown);
}

.product-info .price {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  margin-bottom: var(--space-md);
  display: block;
  color: var(--loom-gold);
}

.product-meta {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--loom-border);
}

.product-meta dt {
  font-family: var(--font-brand);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-top: var(--space-sm);
}

.product-meta dd {
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* ============================================
   CONTENT PAGES
   ============================================ */
.page-content,
.entry-content {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-xl) 0;
}

.entry-content h2 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  color: var(--loom-brown);
}

.entry-content h3 {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  font-family: var(--font-brand);
  font-weight: 500;
  color: var(--loom-brown);
}

.entry-content ul,
.entry-content ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-md);
}

.entry-content li {
  margin-bottom: var(--space-xs);
  color: var(--color-text-secondary);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--loom-brown);
  color: var(--loom-cream-dark);
  padding: var(--space-xl) 0 var(--space-lg);
}

.site-footer a {
  color: var(--loom-cream-dark);
}

.site-footer a:hover {
  color: var(--loom-gold);
}

.site-footer h4 {
  color: var(--loom-gold);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-brand .site-title {
  font-family: var(--font-brand);
  font-size: 1.4rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--loom-white);
  margin-bottom: var(--space-sm);
}

.footer-brand p {
  font-size: 0.9rem;
  color: var(--loom-cream-dark);
  line-height: 1.7;
  opacity: 0.8;
}

.footer-nav h4 {
  font-family: var(--font-brand);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
  color: var(--loom-gold);
}

.footer-nav ul {
  list-style: none;
}

.footer-nav li {
  margin-bottom: var(--space-xs);
}

.footer-nav a {
  font-size: 0.9rem;
  color: var(--loom-cream-dark);
  opacity: 0.8;
}

.footer-nav a:hover {
  opacity: 1;
  color: var(--loom-gold);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(196, 169, 107, 0.2);
  font-size: 0.8rem;
  color: var(--loom-cream-dark);
  opacity: 0.6;
}

/* ============================================
   BREADCRUMBS (Schema-ready)
   ============================================ */
.breadcrumbs {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--loom-border);
  margin-bottom: var(--space-lg);
  font-family: var(--font-brand);
}

.breadcrumbs a {
  color: var(--color-text-secondary);
}

.breadcrumbs a:hover {
  color: var(--loom-gold);
}

.breadcrumbs .sep {
  margin: 0 0.5rem;
  color: var(--loom-gold);
}

/* ============================================
   UTILITIES
   ============================================ */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }

/* Gold accent text */
.text-gold { color: var(--loom-gold); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .primary-navigation {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--loom-border);
    padding: var(--space-md);
  }

  .primary-navigation.toggled {
    display: block;
  }

  .primary-navigation ul {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .process-step {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .process-step:nth-child(even) .process-content,
  .process-step:nth-child(even) .process-media {
    order: unset;
  }

  .product-single {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }

  .about-gallery {
    grid-template-columns: 1fr;
  }
}

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

  .trust-bar {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }

  .site-title {
    font-size: 1.2rem;
  }
}
