/* ============================================
   Mahjracks.com Base CSS Framework
   Mobile-first, minimal, restrained design
   ============================================ */

/* ============================================
   CSS Reset / Normalize
   ============================================ */

/* Box sizing reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margins and padding */
* {
  margin: 0;
  padding: 0;
}

/* Improve text rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Make images responsive by default */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Inherit fonts for form controls */
input,
button,
textarea,
select {
  font: inherit;
}

/* Remove button styles */
button {
  background: none;
  border: none;
  cursor: pointer;
}

/* Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* ============================================
   Root CSS Variables
   ============================================ */

:root {
  /* Colors - Neutral and restrained */
  --color-background: #f9f7f4;  /* Off-white with warm undertone */
  --color-text: #2a2a2a;         /* Softened dark gray, not pure black */
  --color-text-muted: #6a6a6a;   /* Lighter gray for secondary text */
  --color-accent: #8b6f47;       /* Warm brown accent for links/CTAs */
  --color-accent-hover: #6d5636; /* Darker shade for hover states */
  
  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, 
                 "Helvetica Neue", Arial, sans-serif;
  --font-weight-normal: 400;
  --font-weight-bold: 600;
  
  /* Spacing - Generous whitespace */
  --space-xs: 0.5rem;    /* 8px */
  --space-sm: 1rem;      /* 16px */
  --space-md: 1.5rem;    /* 24px */
  --space-lg: 2rem;      /* 32px */
  --space-xl: 3rem;      /* 48px */
  --space-2xl: 4rem;     /* 64px */
  
  /* Layout */
  --content-max-width: 1200px;
  --content-comfortable-width: 65ch; /* Comfortable line length for reading */
  
  /* Touch targets */
  --min-touch-target: 44px; /* iOS Human Interface Guidelines minimum */
}

/* ============================================
   Base Typography
   ============================================ */

body {
  font-family: var(--font-family);
  font-weight: var(--font-weight-normal);
  font-size: 1rem;
  line-height: 1.6; /* Generous line height */
  color: var(--color-text);
  background-color: var(--color-background);
}

/* Headings */
h1 {
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

h2 {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
  margin-bottom: var(--space-sm);
}

h3 {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  line-height: 1.4;
  margin-bottom: var(--space-sm);
}

/* Paragraphs */
p {
  margin-bottom: var(--space-sm);
}

/* Links */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover,
a:focus {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* Lists */
ul,
ol {
  margin-bottom: var(--space-sm);
  padding-left: var(--space-md);
}

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

/* ============================================
   Layout Utilities
   ============================================ */

/* Centered content container with max-width */
.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

/* Comfortable reading width for text-heavy content */
.content-readable {
  max-width: var(--content-comfortable-width);
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   Spacing Utilities
   ============================================ */

/* Vertical spacing */
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }

/* Padding utilities */
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.py-sm { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.py-xl { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }

/* ============================================
   Button & CTA Styles
   ============================================ */

/* Base button style - touch-friendly */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  min-height: var(--min-touch-target);
  font-weight: var(--font-weight-bold);
  text-align: center;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

/* Primary button - for CTAs */
.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-background);
}

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

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

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

/* Secondary button - outline style */
.btn-secondary {
  background-color: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: var(--color-accent);
  color: var(--color-background);
  text-decoration: none;
}

.btn-secondary:active {
  background-color: var(--color-accent-hover);
  color: var(--color-background);
  border-color: var(--color-accent-hover);
}

.btn-secondary:visited {
  color: var(--color-accent);
}

.btn-secondary:hover:visited,
.btn-secondary:focus:visited,
.btn-secondary:active:visited {
  color: var(--color-background);
}

/* ============================================
   Mobile-First Responsive Foundation
   ============================================ */

/* Base: Mobile (single-column) - default above */

/* Tablet and up */
@media (min-width: 768px) {
  body {
    font-size: 1.125rem;
  }
  
  h1 {
    font-size: 2.5rem;
  }
  
  h2 {
    font-size: 2rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
  
  .container {
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

/* Desktop and up */
@media (min-width: 1024px) {
  h1 {
    font-size: 3rem;
  }
  
  h2 {
    font-size: 2.25rem;
  }
}

/* ============================================
   Header & Navigation
   ============================================ */

/* Header container */
.site-header {
  background-color: var(--color-background);
  border-bottom: 1px solid rgba(42, 42, 42, 0.1);
  padding: var(--space-md) 0;
}

/* Navigation layout - mobile first (stacked) */
.site-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
}

/* Logo/Brand */
.site-logo {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  text-decoration: none;
  margin-bottom: var(--space-xs);
}

.site-logo:hover,
.site-logo:focus {
  color: var(--color-accent);
  text-decoration: none;
}

/* Chinese direction characters in logo */
.direction-north {
  color: #2d862d; /* Green */
}

.direction-east {
  color: #c41e3a; /* Red */
}

.direction-west {
  color: #d4af37; /* Gold */
}

.direction-south {
  color: #000000; /* Black */
}

/* Four Woods text styling */
.brand-name {
  font-family: 'Copperplate', 'Copperplate Gothic Light', 'Palatino', serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Navigation links container */
.nav-links {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Navigation links */
.nav-links a {
  color: var(--color-text);
  font-weight: var(--font-weight-normal);
  padding: var(--space-xs) var(--space-sm);
  min-height: var(--min-touch-target);
  display: flex;
  align-items: center;
}

.nav-links a:hover,
.nav-links a:focus {
  color: var(--color-accent);
  text-decoration: none;
}

/* Desktop navigation - horizontal layout */
@media (min-width: 768px) {
  .site-nav {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .site-logo {
    margin-bottom: 0;
  }
  
  .nav-links {
    gap: var(--space-lg);
  }
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
  background-color: var(--color-background);
  border-top: 1px solid rgba(42, 42, 42, 0.1);
  padding: var(--space-xl) 0 var(--space-lg);
  margin-top: var(--space-2xl);
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
}

.footer-text {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin: 0;
}

.footer-cta {
  margin-top: var(--space-sm);
}

/* Desktop footer */
@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .site-footer {
    text-align: left;
  }
}

/* ============================================
   Helper Utilities
   ============================================ */

/* Text alignment */
.text-center {
  text-align: center;
}

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

.text-right {
  text-align: right;
}

/* Visual utilities */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   Home Page - Hero Section
   ============================================ */

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

/* Hero image - preserves intrinsic aspect ratio */
.hero-image {
  margin-bottom: var(--space-xl);
}

.hero-image img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Hero content */
.hero-content {
  max-width: var(--content-comfortable-width);
  margin-left: auto;
  margin-right: auto;
}

/* Hero title */
.hero-title {
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  margin-bottom: var(--space-md);
  text-align: center;
}

/* Value proposition */
.hero-value-proposition {
  font-size: 1.125rem;
  line-height: 1.6;
  margin-bottom: var(--space-lg);
  text-align: center;
  color: var(--color-text);
}

/* Craftsmanship bullets */
.hero-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-xl) 0;
}

.hero-bullets li {
  position: relative;
  padding-left: var(--space-md);
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.hero-bullets li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: var(--font-weight-bold);
}

/* Hero CTAs */
.hero-ctas {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
}

.hero-ctas .btn {
  width: 100%;
  max-width: 320px;
}

/* Tablet and up - two-column layout */
@media (min-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-value-proposition {
    font-size: 1.25rem;
  }
  
  .hero-ctas {
    flex-direction: row;
    justify-content: center;
  }
  
  .hero-ctas .btn {
    width: auto;
  }
}

/* Desktop and up */
@media (min-width: 1024px) {
  .hero-title {
    font-size: 3rem;
  }
}

/* ============================================
   Gallery Page
   ============================================ */

/* Gallery introduction section */
.gallery-intro {
  padding: var(--space-xl) 0 var(--space-lg);
  text-align: center;
}

.gallery-description {
  max-width: var(--content-comfortable-width);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-lg);
  font-size: 1.125rem;
  color: var(--color-text);
}

/* Gallery in-page navigation */
.gallery-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
  margin-top: var(--space-lg);
}

.gallery-nav .btn {
  width: 100%;
  max-width: 240px;
}

/* Tablet and up - horizontal navigation */
@media (min-width: 768px) {
  .gallery-nav {
    flex-direction: row;
    justify-content: center;
  }
  
  .gallery-nav .btn {
    width: auto;
  }
}

/* Gallery sections */
.gallery-section {
  padding: var(--space-2xl) 0;
  border-top: 1px solid rgba(42, 42, 42, 0.1);
}

.gallery-section:first-of-type {
  border-top: none;
}

.section-title {
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.section-description {
  max-width: var(--content-comfortable-width);
  margin-bottom: var(--space-xl);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.section-cta {
  margin-top: var(--space-xl);
  text-align: center;
}

/* ============================================
   Responsive Image Grid
   ============================================ */

/* Image grid using CSS Grid - mobile first (single column) */
.image-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
}

/* Grid item wrapper */
.image-grid-item {
  display: block;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  transition: opacity 0.15s ease;
}

.image-grid-item:hover,
.image-grid-item:focus {
  opacity: 0.9;
}

/* Images in grid - preserve aspect ratio */
.image-grid-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* Tablet - two columns */
@media (min-width: 768px) {
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
  }
}

/* Desktop - three columns */
@media (min-width: 1024px) {
  .image-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2xl);
  }
  
  .section-title {
    font-size: 2.5rem;
  }
}

/* ============================================
   About Page
   ============================================ */

/* About section */
.about-section {
  padding: var(--space-xl) 0 var(--space-2xl);
}

/* About content blocks */
.about-content {
  max-width: var(--content-comfortable-width);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-2xl);
}

.about-content:last-child {
  margin-bottom: 0;
}

.about-content h2 {
  font-size: 1.75rem;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.about-content p {
  font-size: 1.125rem;
  line-height: 1.7;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

/* About image - preserves intrinsic aspect ratio */
.about-image {
  margin: var(--space-xl) 0;
  border-radius: 4px;
  overflow: hidden;
}

.about-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Desktop styling */
@media (min-width: 768px) {
  .about-content h2 {
    font-size: 2rem;
  }
  
  .about-content p {
    font-size: 1.25rem;
  }
}

/* ============================================
   Contact Page
   ============================================ */

/* Contact section */
.contact-section {
  padding: var(--space-xl) 0 var(--space-2xl);
}

/* Primary contact method */
.contact-primary {
  max-width: var(--content-comfortable-width);
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.contact-intro {
  font-size: 1.125rem;
  line-height: 1.7;
  margin-bottom: var(--space-xl);
  color: var(--color-text);
}

/* Primary CTA container */
.contact-cta-primary {
  margin: var(--space-xl) 0;
}

/* Large button variant for prominent CTA */
.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
  min-height: 56px;
}

/* Reassurance text */
.contact-reassurance {
  font-size: 1rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: var(--space-md);
}

/* Desktop styling */
@media (min-width: 768px) {
  .contact-intro {
    font-size: 1.25rem;
  }
  
  .btn-large {
    font-size: 1.25rem;
    padding: 1.25rem 2.5rem;
  }
}

/* Secondary contact method - form */
.contact-secondary {
  max-width: var(--content-comfortable-width);
  margin-left: auto;
  margin-right: auto;
  margin-top: var(--space-2xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid rgba(42, 42, 42, 0.1);
}

.contact-secondary-heading {
  font-size: 1.25rem;
  font-weight: var(--font-weight-normal);
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: var(--space-xl);
}

/* Contact form styles */
.contact-form {
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.form-optional {
  font-weight: var(--font-weight-normal);
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  min-height: var(--min-touch-target);
  font-size: 1rem;
  border: 2px solid rgba(42, 42, 42, 0.2);
  border-radius: 4px;
  background-color: var(--color-background);
  color: var(--color-text);
  transition: border-color 0.15s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font-family);
  line-height: 1.6;
}

.form-submit {
  text-align: center;
  margin-top: var(--space-xl);
}

/* Desktop form styling */
@media (min-width: 768px) {
  .contact-secondary-heading {
    font-size: 1.5rem;
  }
}

/* Contact information display */
.contact-info {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid rgba(42, 42, 42, 0.1);
  text-align: center;
}

.contact-info h3 {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.contact-info p {
  margin-bottom: var(--space-xs);
  color: var(--color-text);
  line-height: 1.6;
}

.contact-info a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

.contact-info a:hover,
.contact-info a:focus {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* ============================================
   Wood Detail Pages
   ============================================ */

/* Wood introduction section */
.wood-intro {
  padding: var(--space-2xl) 0 var(--space-xl);
  text-align: center;
}

.wood-intro h1 {
  font-size: 2.5rem;
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.wood-description {
  max-width: var(--content-comfortable-width);
  margin-left: auto;
  margin-right: auto;
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-text);
}

/* Wood gallery section */
.wood-gallery {
  padding: var(--space-2xl) 0;
  border-top: 1px solid rgba(42, 42, 42, 0.1);
}

.wood-gallery h2 {
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  text-align: center;
  margin-bottom: var(--space-xl);
  color: var(--color-text);
}

.image-caption {
  margin-top: var(--space-sm);
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Wood characteristics section */
.wood-characteristics {
  padding: var(--space-2xl) 0;
  background-color: rgba(139, 111, 71, 0.05);
}

.wood-characteristics h2 {
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  text-align: center;
  margin-bottom: var(--space-xl);
  color: var(--color-text);
}

.characteristics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  max-width: 960px;
  margin: 0 auto;
}

.characteristic {
  padding: var(--space-lg);
  background-color: var(--color-background);
  border-radius: 4px;
}

.characteristic h3 {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-sm);
  color: var(--color-accent);
}

.characteristic p {
  color: var(--color-text);
  line-height: 1.6;
}

/* Tablet and up - 2 columns */
@media (min-width: 768px) {
  .characteristics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .wood-intro h1 {
    font-size: 3rem;
  }
}

/* Wood CTA section */
.wood-cta {
  padding: var(--space-2xl) 0;
  text-align: center;
}

.wood-cta h2 {
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.wood-cta p {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
}

.cta-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: center;
}

.cta-buttons .btn {
  width: 100%;
  max-width: 300px;
}

/* Desktop - horizontal buttons */
@media (min-width: 768px) {
  .cta-buttons {
    flex-direction: row;
    justify-content: center;
  }
  
  .cta-buttons .btn {
    width: auto;
  }
}
