/* ================================================================
   ATELIER BLACHERE — styles.css
   All of the site's design lives in this one file.

   HOW TO RESTYLE THE SITE:
   Change the settings in section 1. Every page uses these names,
   so one change updates the whole site.
   ================================================================ */


/* ================================================================
   1. SETTINGS — colors, font, sizes, spacing
   ================================================================ */
:root {
  /* ---- Colors ---- */
  --color-background: #FFFFFF;  /* page background */
  --color-text:       #1A1A1A;  /* main text and dark buttons */
  --color-quiet:      #6F6F6A;  /* prices, small labels, hints */
  --color-pale:       #C4C2BC;  /* tabs that aren't chosen */
  --color-photo:      #EDEBE7;  /* empty photo boxes (warm stone) */
  --color-line:       #E6E3DE;  /* thin dividers and field underlines */
  --color-on-dark:    #FFFFFF;  /* text on dark buttons */
  --color-stage:      #F6F4F0;  /* behind the 3D preview */

  /* ---- Font ---- */
  /* To try another font: load it in each page's <head>, then change this. */
  --font-main: 'Jost', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --weight-light:   300;        /* most text */
  --weight-regular: 400;        /* the logo */

  /* ---- Text sizes ---- */
  --text-tiny:   12px;          /* menu, labels, footer (in capitals) */
  --text-body:   16px;          /* normal sentences */
  --text-large:  23px;          /* quotes, short intro lines */
  --text-logo:   18px;          /* ATELIER BLACHERE */

  /* ---- Letter spacing (the airy, gallery feel) ---- */
  --spacing-caps: 2.5px;        /* small capital labels */
  --spacing-logo: 9px;          /* A T E L I E R   B L A C H E R E */

  /* ---- Spacing (gaps between things) ---- */
  --space-xs:   8px;
  --space-s:    16px;
  --space-m:    32px;
  --space-l:    64px;
  --space-xl:   128px;

  /* ---- Layout ---- */
  --page-max-width: max(70vw, 1100px);  /* about 70% of the screen (vw = % of screen width),
                                           but never narrower than 1100px on laptops */
  --page-side:      40px;       /* empty margin on the left and right */
  --grid-gap:       40px;       /* space between photos */

  /* ---- Photo shape (width / height) ---- */
  --photo-shape:      4 / 5;    /* slightly tall, like the reference */
  --photo-shape-wide: 16 / 9;   /* wide banner photos */
}


/* ================================================================
   2. BASICS — rules every page follows
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; }

/* Anything marked hidden stays hidden */
[hidden] { display: none !important; }

/* A soft fade between pages instead of a blink (in browsers that support it) */
@view-transition { navigation: auto; }

body {
  margin: 0;
  overflow-x: clip;               /* nothing may push the page sideways */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-main);
  font-weight: var(--weight-light);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; font-weight: var(--weight-light); }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--color-quiet); }

img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; background: none; border: 0; padding: 0; }

/* A thin outline when someone moves around with the keyboard */
:focus-visible { outline: 1px solid var(--color-text); outline-offset: 4px; }

/* Keeps content centered with margins on both sides */
.page {
  width: 100%;
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 0 var(--page-side);
}

main { flex: 1; padding-bottom: var(--space-xl); }

/* Small capital letters: menu, labels, buttons */
.caps {
  font-size: var(--text-tiny);
  letter-spacing: var(--spacing-caps);
  text-transform: uppercase;
}
.quiet { color: var(--color-quiet); }

/* Hidden on screen but still read aloud by screen readers */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}


/* ================================================================
   3. HEADER — name on the left, menu and bag on the right
   ================================================================ */
.header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  padding-top: 64px;            /* space above the name and menu */
  padding-bottom: 56px;         /* space between the header and the photos */
}

.logo {
  font-size: var(--text-logo);
  font-weight: var(--weight-regular);
  letter-spacing: var(--spacing-logo);
  text-transform: uppercase;
  white-space: nowrap;
}
.logo-short { display: none; }   /* "AB" — shown on phones only */

.header-right { display: flex; align-items: center; gap: 40px; }

.menu { display: flex; gap: 36px; }
.menu a { padding-bottom: 3px; border-bottom: 1px solid transparent; }
.menu a[aria-current="page"] { border-bottom-color: currentColor; }

/* The bag (cart) icon */
.bag-button { display: flex; align-items: center; gap: 6px; min-height: 44px; }
.bag-button svg { width: 18px; height: 18px; }


/* ================================================================
   4. BAG DROPDOWN — opens under the bag icon
   ================================================================ */
.bag {
  position: absolute;
  top: calc(100% - 48px);        /* just under the bag icon */
  right: var(--page-side);
  z-index: 20;
  width: 360px;
  background: var(--color-background);
  border: 1px solid var(--color-line);
  padding: var(--space-m);
}
.bag-close { display: none; float: right; min-height: 32px; }   /* phones only */

.bag-item {
  display: flex; align-items: center; gap: var(--space-s);
  padding: var(--space-s) 0;
  border-bottom: 1px solid var(--color-line);
}
.bag-item .photo { width: 56px; flex-shrink: 0; }
.bag-item-name { flex: 1; display: flex; flex-direction: column; }
.bag-remove { color: var(--color-quiet); min-width: 32px; min-height: 32px; }
.bag-total { display: flex; justify-content: space-between; padding: var(--space-s) 0; }
.bag-empty { padding: var(--space-s) 0 var(--space-m); color: var(--color-quiet); }
.bag-orders {
  display: flex; justify-content: space-between;
  margin-top: var(--space-m); padding-top: var(--space-s);
  border-top: 1px solid var(--color-line);
}


/* ================================================================
   5. PHOTOS — a warm empty box until a real photo is added
   ================================================================ */
.photo {
  width: 100%;
  aspect-ratio: var(--photo-shape);
  background: var(--color-photo);
  overflow: hidden;
}
.photo.wide { aspect-ratio: var(--photo-shape-wide); }
.photo img { width: 100%; height: 100%; object-fit: cover; }

/* Photos gently dim when you point at them */
a .photo img, a .photo { transition: opacity .3s; }
a:hover .photo { opacity: .88; }


/* ================================================================
   6. PHOTO GRIDS — Home, Shop, Archive
   ================================================================ */
.grid {
  display: grid;
  gap: var(--grid-gap);
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* Home */
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* Shop, Archive */

/* Shop: extra air between the pieces */
.shop-grid { column-gap: 80px; row-gap: 120px; padding: var(--space-m) var(--space-m) 0; }
.shop-grid .label { margin-top: 20px; }

/* Name and price under a Shop photo */
.label {
  display: flex; justify-content: space-between; gap: var(--space-s);
  margin-top: var(--space-s);
}


/* ================================================================
   7. PIECE PAGE — one big photo, details beside it
   ================================================================ */
.piece {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--space-l);
  align-items: end;
}
.piece-photos { display: flex; flex-direction: column; gap: var(--space-s); }
.piece-photos .photo { max-height: calc(100vh - 200px); }   /* photo + details fit on one screen */
.piece-nav { display: flex; align-items: center; gap: var(--space-s); }
.piece-nav button { min-width: 32px; min-height: 32px; }

.piece-details { display: flex; flex-direction: column; gap: var(--space-m); max-width: 360px; }
.piece-details dl { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.piece-details dd { margin: 0; }
.piece-note { min-height: 20px; }


/* ================================================================
   8. BUTTONS AND LINKS
   ================================================================ */
/* Solid dark button: "Add to bag", "Make your order" */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 var(--space-l);
  background: var(--color-text);
  color: var(--color-on-dark);
  font-size: var(--text-tiny);
  letter-spacing: var(--spacing-caps);
  text-transform: uppercase;
}
.button:hover { opacity: .85; color: var(--color-on-dark); }
.button.full { width: 100%; padding: 0; }

/* Quiet underlined link */
.text-link { padding-bottom: 3px; border-bottom: 1px solid currentColor; }


/* ================================================================
   9. FORMS — a small label above a thin underline
   ================================================================ */
.form { display: flex; flex-direction: column; gap: var(--space-m); }

.field { display: flex; flex-direction: column; gap: 4px; }
.field label {
  font-size: var(--text-tiny);
  letter-spacing: var(--spacing-caps);
  text-transform: uppercase;
  color: var(--color-quiet);
}
.field input,
.field textarea {
  font: inherit;
  font-size: 17px;               /* 16px or more stops phones from zooming in */
  color: var(--color-text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-line);
  border-radius: 0;
  height: 44px;
  padding: 0;
}
.field textarea { height: 120px; padding-top: 10px; resize: vertical; }
.field input:focus,
.field textarea:focus { outline: none; border-bottom-color: var(--color-text); }
.field-error { font-size: 14px; min-height: 0; }

/* A small grey note for things that aren't connected yet */
.preview-note { font-size: 14px; color: var(--color-quiet); }


/* ================================================================
   10. SIMPLE PAGES — About, Contact, Your orders
   ================================================================ */
.intro { font-size: var(--text-large); line-height: 1.5; max-width: 560px; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-l);
  align-items: start;
}
.stack { display: flex; flex-direction: column; gap: var(--space-m); }

.narrow { max-width: 440px; margin: 0 auto; }

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

/* About: the text beside the portrait */
.about-text { align-self: center; }

/* About: client photos with their quotes, drifting very slowly, edge to edge.
   Pauses when someone points at it. Change the speed with --drift-time. */
.carousel {
  --drift-time: 180s;               /* higher = slower */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: var(--space-xl);
  overflow: hidden;
}
.carousel-track { display: flex; gap: var(--space-m); width: max-content; animation: drift var(--drift-time) linear infinite; }
.carousel:hover .carousel-track { animation-play-state: paused; }
@keyframes drift { to { transform: translateX(calc(-50% - var(--space-m) / 2)); } }
@media (prefers-reduced-motion: reduce) { .carousel-track { animation: none; } }

.slide { width: 440px; margin: 0; display: flex; flex-direction: column; gap: var(--space-s); }
.slide .photo { aspect-ratio: 3 / 2; }          /* a wide rectangle */
.slide blockquote { margin: 0; font-size: 17px; line-height: 1.5; }

/* Contact: the form stays narrow */
.contact-form { width: 100%; max-width: 400px; }

.done { text-align: center; padding: var(--space-l) 0; display: flex; flex-direction: column; gap: var(--space-s); }


/* ================================================================
   11. FOOTER — one thin line at the bottom of every page
   ================================================================ */
.footer {
  padding-top: var(--space-l);
  padding-bottom: 56px;
  text-align: center;
  color: var(--color-quiet);
}
.footer span { margin: 0 14px; }


/* ================================================================
   12. CUSTOM PAGE — heading, tabs, list, button
   ================================================================ */
.custom {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: var(--space-l);
}

.custom-intro { display: flex; flex-direction: column; gap: 14px; }
.custom-intro h1 { font-size: 17px; letter-spacing: 5px; font-weight: 500; }   /* the heading: bolder */
.custom-intro p { font-size: 11px; letter-spacing: 2.5px; color: var(--color-quiet); }   /* the subheading: small and grey */

.custom-pick { display: flex; flex-direction: column; align-items: center; margin-top: 112px; }

/* Category tabs, with thin lines between them: | CABINETRY | TABLES | */
.tabs { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
.tabs button {
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--color-pale);
  padding: 0 20px;
  min-height: 32px;
  border-left: 1px solid var(--color-pale);
  line-height: 1;
  transition: color .2s;
}
.tabs button:last-child { border-right: 1px solid var(--color-pale); }
.tabs button:hover { color: var(--color-quiet); }
.tabs button[aria-selected="true"] { color: var(--color-text); }

/* The pieces: a tight list in capitals, lined up under the chosen tab */
.piece-list {
  align-self: stretch;
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 8px;
  margin-top: var(--space-m);
  padding-left: 21px;             /* the script lines it up under the chosen tab */
  min-height: 120px;              /* keeps things from jumping between tabs */
}
.piece-list .choice {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--color-text);
  min-height: 0;
  padding-bottom: 2px;
}
.piece-list .choice:hover { color: var(--color-quiet); }

/* Greyed out and asleep until a piece is chosen */
.custom-start { margin-top: var(--space-l); transition: opacity .4s; }
.custom-start[aria-disabled="true"] { opacity: .22; cursor: default; }


/* ================================================================
   13. ORDER BUILDER — 3D drawing on the left, steps on the right
   ================================================================ */
.custom + .builder {
  margin-top: var(--space-xl);
  scroll-margin-top: var(--space-m);   /* a little room above it when it scrolls into view */
  animation: fade-in .5s ease-out;
}
@keyframes fade-in { from { opacity: 0; } }

.builder {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--space-l);
  align-items: start;
}

.stage {
  position: sticky;
  top: var(--space-m);
  aspect-ratio: 5 / 4;
  background: var(--color-stage);
  cursor: grab;
  touch-action: none;
}
.stage:active { cursor: grabbing; }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage-note { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }

.panel { display: flex; flex-direction: column; gap: 48px; padding-top: 4px; }
.panel-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-s); }
.panel h2 { font-size: 14px; }

/* The quiet "Saved" that fades in and out */
.saved-note { opacity: 0; transition: opacity .6s; }
.saved-note.show { opacity: 1; }

/* Step names along the top */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.steps button { color: var(--color-quiet); padding-bottom: 3px; border-bottom: 1px solid transparent; min-height: 28px; }
.steps button[aria-current="step"] { color: var(--color-text); border-bottom-color: currentColor; }

.step-body { min-height: 260px; }

/* Text choices: the chosen one is dark and underlined */
.choices { display: flex; flex-wrap: wrap; gap: 14px 32px; }
.choice { color: var(--color-quiet); padding-bottom: 3px; border-bottom: 1px solid transparent; min-height: 28px; }
.choice:hover { color: var(--color-text); }
.choice[aria-pressed="true"] { color: var(--color-text); border-bottom-color: currentColor; }

/* Wood samples */
.woods { display: flex; flex-wrap: wrap; gap: var(--space-m); }
.wood { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.wood-swatch {
  width: 76px; height: 76px; border-radius: 50%;
  outline: 1px solid transparent; outline-offset: 6px; transition: outline-color .2s;
}
.wood[aria-pressed="true"] .wood-swatch { outline-color: var(--color-text); }

/* Size sliders: a thin line with a small dark dot */
.slider { display: flex; flex-direction: column; gap: 10px; }
.slider-label { display: flex; justify-content: space-between; }
.slider input { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: transparent; margin: 0; }
.slider input::-webkit-slider-runnable-track { height: 1px; background: var(--color-line); }
.slider input::-moz-range-track { height: 1px; background: var(--color-line); }
.slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--color-text); margin-top: -6px; cursor: pointer; }
.slider input::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: var(--color-text); cursor: pointer; }

/* Back · Save for later · Next */
.step-nav button { white-space: nowrap; }
.step-nav {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-s);
  padding-top: var(--space-m); border-top: 1px solid var(--color-line);
}

.review { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.builder-done { padding-top: var(--space-l); }


/* ================================================================
   14. YOUR ORDERS
   ================================================================ */
.account-top { display: flex; justify-content: space-between; align-items: baseline; }
.account-row {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-s);
  padding: var(--space-s) 0; border-top: 1px solid var(--color-line);
}


/* ================================================================
   15. TABLETS
   ================================================================ */
@media (max-width: 1100px) {
  :root { --page-side: 40px; --grid-gap: 32px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-grid { column-gap: 56px; row-gap: 96px; padding: 0; }
  .menu { gap: 24px; }
}


/* ================================================================
   16. PHONES
   ================================================================ */
@media (max-width: 900px) {
  :root {
    --page-side:  20px;
    --grid-gap:   20px;
    --space-l:    40px;
    --space-xl:   80px;
    --text-large: 19px;
  }

  /* Header: name and bag on top, the menu in a row below, lined up on the left */
  .header { flex-wrap: wrap; row-gap: 18px; padding-top: 28px; padding-bottom: 28px; }
  .header-right { display: contents; }
  .logo { order: 1; }
  .bag-button { order: 2; margin-left: auto; }
  .menu { order: 3; width: 100%; flex-wrap: wrap; gap: 10px 18px; font-size: 11px; letter-spacing: 1.5px; }
  .logo-full { display: none; }
  .logo-short { display: inline; letter-spacing: 4px; }

  /* Bag becomes a full-width panel */
  .bag { position: fixed; top: 0; left: 0; right: 0; width: auto; border: 0; border-bottom: 1px solid var(--color-line); padding: 24px 20px; }
  .bag-close { display: block; }

  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 .label { flex-direction: column; gap: 0; margin-top: var(--space-xs); }
  .shop-grid { column-gap: var(--grid-gap); row-gap: var(--space-l); }
  .piece, .split, .builder { grid-template-columns: minmax(0, 1fr); gap: var(--space-m); }

  .slide { width: 280px; }

  .tabs button { font-size: 12px; letter-spacing: 2px; padding: 0 12px; }
  .custom { padding-top: var(--space-m); }
  .custom-pick { margin-top: var(--space-l); }
  .piece-list { align-items: center; padding-left: 0; }

  .stage { position: relative; top: 0; aspect-ratio: 1 / 1; }
  .step-body { min-height: 0; }
  .step-nav { flex-wrap: wrap; }
  .step-nav .button { order: 3; width: 100%; padding: 0; }
  .footer span { display: block; margin: 4px 0; }
  .footer .divider { display: none; }
}
