/* ==========================================================================
   Mikayla's Stitches — shared stylesheet
   Used by both catalog.html and info.html.

   DESIGN-CHANGE MAINTENANCE: every color, font, spacing unit, border
   radius, and the "stitch" dashed-line style used across the site is
   defined ONCE below, in this single :root block. To change the palette,
   fonts, or the stitch motif's look, edit ONLY this block — nothing else
   in this file (or in catalog.html / info.html) hardcodes a color, a
   font-family, a radius, or a dash pattern. That's the whole point: a
   future style change should never require reading past this comment.
   ========================================================================== */

:root {
  /* ---- Palette ---- */
  --cream:       #FFFFFF;  /* page background */
  --cream-deep:  #F4F1EA;  /* card / image-placeholder backgrounds */
  --ink:         #3A342E;  /* primary text color */
  --ink-soft:    #6B6459;  /* secondary/muted text color */
  --rose:        #C97B84;  /* announcement bar background */
  --rose-deep:   #B36470;  /* accent color: hover states, active/selected states */
  --sage:        #8B9A7D;  /* reserved accent - currently used only for the small "Choose your design" card flag */

  /* ---- Fonts ---- */
  --font-heading: 'Lora', serif;       /* headings, product/design names */
  --font-body:    'DM Sans', sans-serif; /* body text, labels, buttons, inputs */

  /* ---- Base spacing scale (rem) ---- */
  --space-1: 0.4rem;
  --space-2: 0.6rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 2.5rem;

  /* ---- Border radii ---- */
  --radius-sm:   5px;   /* inputs, buttons, motif thumbnails */
  --radius-md:   6px;   /* card photos, modal photos */
  --radius-lg:   10px;  /* modal window, Instagram CTA block */
  --radius-pill: 999px; /* the "Follow on Instagram" pill button */

  /* ---- "Stitch" motif: the site's one signature decorative element,
     a dashed running-stitch line. Used in exactly three places:
     (1) card photo frames + the nav badge's circular border,
     (2) the motif-picker's selected-design indicator,
     (3) the current-page nav underline.
     Two color variants and two rendering mechanisms are needed because
     CSS's native `border: Npx dashed color` (used for #1/#2, real
     borders) can't produce the same precise dash/gap lengths as the
     repeating-linear-gradient background trick (used for #3, an
     underline) - both are kept in sync here so a palette change only
     ever touches this block. */
  --stitch-color-strong: var(--rose-deep);        /* bold stitch: badge border, motif-selected border */
  --stitch-color-soft:   rgba(58, 52, 46, 0.18);  /* quiet stitch: resting card-photo frame, info-page section dividers */
  --stitch-width:        2px;                     /* thickness for border-based stitches (badge, card frame, motif thumb) */
  --stitch-width-soft:   1px;                     /* thickness for the quieter card-photo-frame / divider stitch */
  --stitch-underline-color: var(--ink);           /* nav "current page" underline color */
  --stitch-underline-dash:  5px;                  /* underline dash length */
  --stitch-underline-gap:   4px;                  /* underline gap length */

  /* ---- Overlay ---- */
  --overlay-scrim: rgba(58, 52, 46, 0.45); /* modal backdrop dim - same hue as --ink, at partial opacity */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: var(--font-heading);
  font-weight: 600;
  margin: 0;
}

a { color: inherit; }

/* ---- Announcement bar ---- */
.announcement {
  background: var(--rose);
  color: var(--cream);
  text-align: center;
  font-size: 0.85rem;
  padding: var(--space-2) var(--space-3);
  letter-spacing: 0.02em;
}

/* ---- Nav ---- */
nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.2rem;
  padding: var(--space-4) var(--space-4);
}

.badge-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--cream-deep);
  border: var(--stitch-width) dashed var(--stitch-color-strong);
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 0.6rem;
  line-height: 1.1;
  color: var(--rose-deep);
  text-align: center;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.6rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  padding-bottom: 3px;
}

.nav-links a.current {
  color: var(--ink);
  background-image: repeating-linear-gradient(
    90deg,
    var(--stitch-underline-color) 0 var(--stitch-underline-dash),
    transparent var(--stitch-underline-dash) calc(var(--stitch-underline-dash) + var(--stitch-underline-gap))
  );
  background-position: bottom;
  background-repeat: repeat-x;
  background-size: 100% 2px;
}

footer {
  text-align: center;
  padding: var(--space-3) var(--space-4) var(--space-6);
  color: var(--ink-soft);
  font-size: 0.8rem;
}

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

/* ==========================================================================
   Catalog page
   ========================================================================== */

.catalog-heading {
  text-align: center;
  padding: var(--space-1) var(--space-4) var(--space-4);
}

.catalog-heading h2 { font-size: 1.5rem; }

.grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--space-5);
}

.card {
  cursor: pointer;
  background: transparent;
}

.card-photo {
  aspect-ratio: 1 / 1;
  background: var(--cream-deep);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  margin-bottom: var(--space-2);
}

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

.card-photo::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: var(--stitch-width-soft) dashed var(--stitch-color-soft);
  border-radius: 4px;
  pointer-events: none;
  transition: border-color 0.15s ease;
}

.card:hover .card-photo::after { border-color: var(--stitch-color-strong); }

.card-name {
  font-size: 1.05rem;
  margin-bottom: 0.15rem;
}

.card-price {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.motif-flag {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--sage);
  font-weight: 500;
}

/* ---- Instagram CTA ---- */
.insta-cta {
  max-width: 1100px;
  margin: var(--space-3) auto 4rem;
  text-align: center;
  background: var(--cream-deep);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-4);
}

.insta-cta h2 { font-size: 1.25rem; margin-bottom: var(--space-1); }
.insta-cta p { color: var(--ink-soft); font-size: 0.88rem; margin-bottom: var(--space-4); }

.insta-cta a.follow-btn {
  display: inline-block;
  background: var(--ink);
  color: var(--cream);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.8rem 1.8rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
}

.insta-cta a.follow-btn:hover { background: var(--rose-deep); }

/* ---- Modal ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay-scrim);
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-6) var(--space-3);
  overflow-y: auto;
  z-index: 100;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--cream);
  max-width: 760px;
  width: 100%;
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

.modal-photos img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--cream-deep);
}

.modal-name {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

.modal-price {
  color: var(--rose-deep);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.modal-desc {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: var(--space-4);
}

.field-group {
  margin-bottom: 1.3rem;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin-bottom: var(--space-1);
}

select, input[type="text"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.6rem 0.7rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--ink);
}

/* Motif picker */
.motif-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: var(--space-2);
}

.motif-option {
  position: relative;
  cursor: pointer;
  text-align: center;
}

.motif-thumb {
  aspect-ratio: 1/1;
  background: var(--cream-deep);
  border-radius: var(--radius-sm);
  border: var(--stitch-width) solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--ink-soft);
  transition: border-color 0.15s ease, border-style 0.15s ease;
}

.motif-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.motif-option.selected .motif-thumb {
  border-style: dashed;
  border-color: var(--stitch-color-strong);
  background: var(--cream);
}

.motif-num {
  font-size: 0.68rem;
  color: var(--ink-soft);
  margin-top: 0.25rem;
  display: block;
}

.order-btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem var(--space-4);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  margin-top: var(--space-1);
}

.order-btn:hover { background: var(--rose-deep); }

.order-hint {
  font-size: 0.75rem;
  color: var(--ink-soft);
  text-align: center;
  margin-top: var(--space-1);
}

@media (max-width: 620px) {
  .modal-body { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Info page
   ========================================================================== */

main {
  max-width: 560px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) 5rem;
}

main h1 {
  font-size: 1.7rem;
  text-align: center;
  margin-bottom: var(--space-6);
}

.block {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: var(--stitch-width-soft) dashed var(--stitch-color-soft);
}

.block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.block h2 {
  font-size: 1.1rem;
  margin-bottom: var(--space-2);
}

.block p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

.block a.email-link {
  color: var(--rose-deep);
  font-weight: 600;
  text-decoration: none;
}

.block a.email-link:hover { text-decoration: underline; }
