/* ============================================================
   THIMBLE & THREAD UPHOLSTERY — SITE STYLESHEET
   ============================================================
   A note on the system, for whoever maintains this next:

   PALETTE
     --color-cream      #F8F4EC  page background, warm and soft
     --color-linen       #EFE6D8  section backgrounds, card fills
     --color-taupe-line  #D9CBB4  hairlines, borders, the "stitch" color
     --color-charcoal    #33312C  primary text, primary buttons
     --color-charcoal-70 rgba    softened charcoal for secondary text
     --color-leather     #8C6A4B  warm accent — links, highlights, focus

   TYPE
     Display:  'Fraunces'   — a soft, characterful serif with real
               personality at large sizes. Used sparingly, for
               headings and the signature pulled quotes only.
     Body:     'Inter'      — quiet, highly legible workhorse for
               paragraphs, nav, labels, forms.

   SIGNATURE ELEMENT
     The "stitch line": a dashed rule (border-style: dashed, evenly
     spaced) used as a section divider, card outline-on-hover, and
     button underline. It is the one motif borrowed directly from
     the craft itself — an upholsterer's hand-stitched seam — and
     it appears nowhere else as decoration.
   ============================================================ */

/* ---------- Font import ---------- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600&display=swap');

/* ---------- Tokens ---------- */
:root {
  --color-cream: #f8f4ec;
  --color-linen: #efe6d8;
  --color-taupe-line: #d9cbb4;
  --color-charcoal: #33312c;
  --color-charcoal-70: rgba(51, 49, 44, 0.7);
  --color-charcoal-45: rgba(51, 49, 44, 0.45);
  --color-leather: #8c6a4b;
  --color-leather-dark: #6f5239;
  --color-white: #fffdf9;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3rem;
  --space-xl: 5.5rem;

  --radius-sm: 2px;
  --radius-md: 4px;

  --max-width: 1180px;

  --transition: 200ms ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--color-cream);
  color: var(--color-charcoal);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 var(--space-sm);
  color: var(--color-charcoal);
}

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 600; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.3rem; }

p {
  margin: 0 0 var(--space-sm);
  color: var(--color-charcoal-70);
  max-width: 60ch;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-leather);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

/* Visually-hidden helper, for accessible labels we don't want to show */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Keyboard focus visibility, kept everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--color-leather);
  outline-offset: 3px;
}

/* ---------- Layout shell ---------- */
.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.section {
  padding-block: var(--space-xl);
}

.section--linen {
  background-color: var(--color-linen);
}

.section-head {
  max-width: 640px;
  margin-bottom: var(--space-lg);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

/* ---------- Signature stitch divider ---------- */
.stitch-divider {
  border: none;
  border-top: 2px dashed var(--color-taupe-line);
  margin: 0;
}

.stitch-rule {
  display: block;
  width: 64px;
  height: 0;
  border-top: 2px dashed var(--color-leather);
  margin-bottom: var(--space-md);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--color-cream);
  border-bottom: 1px solid var(--color-taupe-line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-sm);
}

.logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.logo span {
  color: var(--color-leather);
}

.main-nav ul {
  display: flex;
  gap: var(--space-md);
}

.main-nav a {
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding-bottom: 4px;
  border-bottom: 2px dashed transparent;
  transition: border-color var(--transition), color var(--transition);
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--color-leather);
  border-bottom-color: var(--color-leather);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  padding: 0.85rem 1.9rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

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

.btn-primary:hover {
  background-color: var(--color-leather-dark);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-charcoal);
  border-color: var(--color-charcoal);
}

.btn-outline:hover {
  border-color: var(--color-leather);
  color: var(--color-leather);
}

/* ---------- Hero ---------- */
.hero {
  padding-block: var(--space-xl);
}

.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}

.hero-copy p {
  font-size: 1.08rem;
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

.hero-media {
  position: relative;
}

.hero-media img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 2px dashed var(--color-leather);
  border-radius: var(--radius-md);
  pointer-events: none;
  z-index: -1;
  top: 14px;
  left: 14px;
}

/* ---------- About snippet ---------- */
.about-snippet .container {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--space-lg);
  align-items: center;
}

.about-snippet img {
  border-radius: var(--radius-md);
  height: 340px;
  width: 100%;
  object-fit: cover;
}

/* ---------- Card grid (services preview, services page) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.card {
  background-color: var(--color-white);
  border: 1px solid var(--color-taupe-line);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: border-color var(--transition), transform var(--transition);
}

.card:hover {
  border-color: var(--color-leather);
  transform: translateY(-3px);
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--color-linen);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
  font-family: var(--font-display);
  color: var(--color-leather);
  font-size: 1.1rem;
}

.card-price {
  display: inline-block;
  margin-top: var(--space-xs);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-leather);
  font-weight: 600;
}

.card-link {
  display: inline-block;
  margin-top: var(--space-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 2px dashed var(--color-charcoal);
}

.card-link:hover {
  color: var(--color-leather);
  border-color: var(--color-leather);
}

/* ---------- Testimonials ---------- */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.testimonial {
  text-align: center;
  padding: var(--space-md);
  border-top: 2px dashed var(--color-taupe-line);
  border-bottom: 2px dashed var(--color-taupe-line);
}

.testimonial blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  font-style: italic;
  color: var(--color-charcoal);
  margin: 0 0 var(--space-md);
  line-height: 1.4;
}

.testimonial cite {
  font-style: normal;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-charcoal-45);
}

.testimonial-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: var(--space-md);
}

.testimonial-dots .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--color-leather);
  background-color: transparent;
}

.testimonial-dots .dot.is-active {
  background-color: var(--color-leather);
}

/* ---------- Services page: detail list ---------- */
.service-list {
  display: grid;
  gap: var(--space-md);
}

.service-row {
  display: grid;
  grid-template-columns: 1.4fr 2.2fr auto;
  gap: var(--space-md);
  align-items: start;
  padding-block: var(--space-md);
  border-bottom: 1px dashed var(--color-taupe-line);
}

.service-row:first-child {
  border-top: 1px dashed var(--color-taupe-line);
}

.service-row h3 {
  margin-bottom: 0.3rem;
}

.service-tag {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-leather);
  font-weight: 600;
}

.service-price {
  white-space: nowrap;
  text-align: right;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-charcoal);
  align-self: center;
}

.service-price small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--color-charcoal-45);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Why Us page ---------- */
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.value-item h3 {
  font-size: 1.1rem;
}

.materials-list li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: var(--space-xs);
  color: var(--color-charcoal-70);
}

.materials-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--color-leather);
}

/* FAQ accordion (native <details>) */
.faq-list {
  border-top: 1px dashed var(--color-taupe-line);
}

.faq-item {
  border-bottom: 1px dashed var(--color-taupe-line);
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-family: var(--font-body);
  font-size: 1.4rem;
  color: var(--color-leather);
  transition: transform var(--transition);
  flex-shrink: 0;
  margin-left: var(--space-sm);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  padding-bottom: 1.2rem;
  max-width: 70ch;
  
}

.faq-item li, .faq-item ul {
  padding-bottom: 1.2rem;
  max-width: 70ch;
  color: var(--color-charcoal-70);
}

/* ---------- Gallery page ---------- */
.gallery-intro {
  max-width: 640px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

/*
  Each card is a positioned container so the caption
  can be pinned to the bottom over the image.
  aspect-ratio keeps every card the same height
  regardless of the source image dimensions — swap
  the ratio to 4/3 or 16/9 to taste.
*/
.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background-color: var(--color-linen);  /* shows while image loads */
  cursor: default;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 400ms ease;
}

.gallery-item:hover img {
  transform: scale(1.03);
}

/* Semi-transparent title bar pinned to the bottom */
.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem var(--space-sm);
  background-color: rgba(51, 49, 44, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.gallery-caption h3 {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-white);
  margin: 0;
}

/* Hidden state — items start invisible and off-layout */
.gallery-item--hidden {
  display: none;
}

/* Fades in when JS removes --hidden and adds --visible */
.gallery-item--visible {
  display: block;
  animation: fadeUp 320ms ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* Load More button area */
.gallery-load-more {
  display: flex;
  justify-content: center;
  margin-top: var(--space-lg);
}

.load-more-count {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0.6;
}

/* ---------- Contact card grid ---------- */
.contact-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

/* Cards that are links get full hover treatment */
a.contact-card,
.contact-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background-color: var(--color-white);
  border: 1px solid var(--color-taupe-line);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-decoration: none;
  color: var(--color-charcoal);
  transition: border-color var(--transition), transform var(--transition);
}

a.contact-card:hover {
  border-color: var(--color-leather);
  transform: translateY(-3px);
}

.contact-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--color-linen);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-leather);
  margin-bottom: var(--space-sm);
  flex-shrink: 0;
}

.contact-card h3 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.contact-card p {
  font-size: 0.92rem;
  margin: 0;
  flex-grow: 1;           /* pushes the hint to the bottom */
}

.contact-card-hint {
  display: inline-block;
  margin-top: var(--space-sm);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-leather);
  border-bottom: 2px dashed var(--color-leather);
  padding-bottom: 1px;
}

/* Static (non-link) card — no hover, no hint */
.contact-card--static {
  cursor: default;
}

@media (max-width: 900px) {
  .contact-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ---------- Footer ---------- */
.site-footer {
  background-color: var(--color-charcoal);
  color: var(--color-cream);
  padding-block: var(--space-lg);
  margin-top: var(--space-xl);
}

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

.site-footer h4 {
  color: var(--color-cream);
  font-size: 0.95rem;
  margin-bottom: var(--space-sm);
}

.site-footer p,
.site-footer a {
  color: rgba(248, 244, 236, 0.65);
  font-size: 0.9rem;
}

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

.site-footer ul li {
  margin-bottom: 0.5rem;
}

.footer-bottom {
  border-top: 1px dashed rgba(248, 244, 236, 0.25);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  font-size: 0.78rem;
  color: rgba(248, 244, 236, 0.45);
  text-align: center;
}

/* Close button is only meaningful inside the mobile overlay */
.nav-close {
  display: none;
}

/* ---------- Hamburger toggle button ---------- */
.nav-toggle {
  display: none;               /* hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--color-charcoal);
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}

.nav-toggle:hover {
  color: var(--color-leather);
}

/* Three bars; the middle one fades out on open */
.nav-toggle .bar {
  display: block;
  height: 2px;
  background-color: currentColor;
  border-radius: 2px;
  transition: transform 250ms ease, opacity 150ms ease, width 200ms ease;
}

.nav-toggle .bar:nth-child(1) { width: 24px; }
.nav-toggle .bar:nth-child(2) { width: 18px; }   /* shorter — gives it personality */
.nav-toggle .bar:nth-child(3) { width: 24px; }

/* Animate into an X when open */
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  width: 24px;
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) {
  opacity: 0;
  width: 0;
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  width: 24px;
}

/* Prevent scroll when menu is open */
body.nav-is-open {
  overflow: hidden;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero .container,
  .about-snippet .container {
    grid-template-columns: 1fr;
  }

  .hero-media img,
  .about-snippet img {
    height: 300px;
  }

  .card-grid,
  .values-grid,
  .gallery-grid,
  .testimonial-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .service-row {
    grid-template-columns: 1fr;
  }

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

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

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

  /* Show the toggle, hide the nav by default */
  .nav-toggle {
    display: flex;
  }

  /* Reveal the close button only inside the overlay */
  .nav-close {
    display: block;
  }

  .main-nav {
    /* Full-screen overlay, slides down from the header */
    position: fixed;
    inset: 0;
    top: 0;          /* starts behind the header — JS sets data-open */
    background-color: var(--color-cream);
    z-index: 40;     /* sits below the sticky header (z-index 50) */
    display: flex;
    align-items: center;
    justify-content: center;

    /* Hidden state */
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity 220ms ease, transform 220ms ease;
  }

  .main-nav[data-open="true"] {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .main-nav ul {
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
  }

  .main-nav a {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 500;
    letter-spacing: 0.01em;
    border-bottom-width: 2px;
    padding-bottom: 6px;
  }

  /* Close (✕) button pinned to top-right of the overlay */
  .nav-close {
    position: absolute;
    top: 1.1rem;
    right: 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-charcoal);
    font-size: 2rem;
    line-height: 1;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: color var(--transition);
  }

  .nav-close:hover {
    color: var(--color-leather);
  }

  .card-grid,
  .values-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

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

  .section {
    padding-block: var(--space-lg);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
