/* ==========================================================================
   Malhara - site stylesheet
   Royal Jaipuri wares from Jaipur artisans

   Palette: the seven fixed Malhara colours, shared with Malhara House.
            No other hex values are used. Tints are made with opacity only.
   Type:    Cormorant Garamond for main headings (h1, h2) and the name only.
            Jost for everything else. Both are hosted in /assets/fonts.
   Motif:   "Gold as the thread". Running stitches in Heritage Gold are the
            one decorative idea: the quilted field, the stitched rules and
            the sewn-on labels that carry the words.
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/jost-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/cormorant-garamond-latin-wght-italic.woff2') format('woff2');
}
/* Holds only the glyphs for the one Hindi word on the site */
@font-face {
  font-family: 'Noto Serif Devanagari';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/noto-serif-devanagari-razai.woff2') format('woff2');
  unicode-range: U+0900-097F;
}

/* ---------- Tokens ---------- */
:root {
  /* Malhara brand palette (fixed) */
  --rani-pink:     #8B2040;   /* Primary: headings, buttons, links, feature panels */
  --royal-plum:    #5A1428;   /* Body text, dark surfaces, footer */
  --heritage-gold: #E2AC4A;   /* Eraa family accent: rules, badges, buttons, highlights on dark */
  --festive-rani:  #E75D87;   /* Bright accent for festivals and offers. Not used on the base site */
  --sandstone:     #D4956E;   /* Soft warm accent */
  --jaipur-sky:    #9DDDE5;   /* Light pop. Used once: the table linen panel */
  --ivory-silk:    #FBF0E8;   /* Background, and text on dark */

  --line:        rgba(139, 32, 64, 0.18);
  --line-strong: rgba(139, 32, 64, 0.38);

  --ff-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --ff-body:    'Jost', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ff-hindi:   'Noto Serif Devanagari', 'Kohinoor Devanagari', 'Nirmala UI', 'Noto Sans Devanagari', serif;

  --container: 1180px;
  --measure:   38rem;
  --gutter:    clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(3.5rem, 8vw, 6.5rem);

  /* The quilt: a diamond lattice of gold running stitches on Royal Plum.
     One 64px tile, eight stitches to each diagonal, gaps at every crossing. */
  --quilt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cdefs%3E%3CradialGradient id='g'%3E%3Cstop offset='0' stop-color='%238B2040' stop-opacity='.55'/%3E%3Cstop offset='1' stop-color='%238B2040' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cg fill='url(%23g)'%3E%3Ccircle cx='32' cy='0' r='25'/%3E%3Ccircle cx='32' cy='64' r='25'/%3E%3Ccircle cx='0' cy='32' r='25'/%3E%3Ccircle cx='64' cy='32' r='25'/%3E%3C/g%3E%3Cg fill='none' stroke='%23E2AC4A' stroke-width='1.5' stroke-linecap='round' stroke-dasharray='.56 .44' stroke-dashoffset='.78'%3E%3Cpath pathLength='8' d='M0 0L64 64'/%3E%3Cpath pathLength='8' d='M64 0L0 64'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--ff-body);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--royal-plum);
  background: var(--ivory-silk);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; height: auto; display: block; }
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; }
address { font-style: normal; }

a { color: var(--rani-pink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--royal-plum); }
:focus-visible { outline: 2px solid var(--rani-pink); outline-offset: 3px; border-radius: 1px; }

/* Cormorant Garamond for main headings and the name only */
h1, h2 {
  font-family: var(--ff-display);
  font-weight: 500;
  color: var(--rani-pink);
  line-height: 1.06;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 5.6vw, 4.5rem); line-height: 1.02; }
h2 { font-size: clamp(1.95rem, 3.6vw, 2.9rem); }

/* Everything else is Jost */
h3 {
  font-family: var(--ff-body);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--rani-pink);
  margin: 0 0 0.4em;
}

.lead { font-size: clamp(1.13rem, 1.5vw, 1.28rem); line-height: 1.55; }
.measure { max-width: var(--measure); }

.skip-link {
  position: absolute; left: 0.75rem; top: -4rem; z-index: 100;
  background: var(--royal-plum); color: var(--ivory-silk);
  padding: 0.6rem 1rem; text-decoration: none;
}
.skip-link:focus { top: 0.75rem; color: var(--ivory-silk); outline-color: var(--heritage-gold); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }
.section--tight-top { padding-top: 0; }

/* A row of gold running stitches */
.stitch {
  display: block;
  height: 2px;
  border: 0;
  margin: 0;
  background: repeating-linear-gradient(90deg, var(--heritage-gold) 0 9px, transparent 9px 15px);
}
hr.stitch.container {
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(var(--container) - 2 * var(--gutter));
  margin-inline: auto;
  padding: 0;
}

/* Statement on the left, prose on the right: the page's basic rhythm */
.pair {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: start;
}
.pair > h2 { margin: 0; }
@media (max-width: 820px) {
  .pair { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ivory-silk);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.5rem;
}
.brand {
  font-family: var(--ff-display);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--rani-pink);
  text-decoration: none;
}
.brand:hover { color: var(--royal-plum); }

.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  display: inline-block;
  padding: 0.6rem 0.85rem;
  font-weight: 500;
  color: var(--royal-plum);
  text-decoration: none;
  background: repeating-linear-gradient(90deg, var(--heritage-gold) 0 7px, transparent 7px 12px) no-repeat 0.85rem calc(100% - 0.35rem) / 0 2px;
}
.nav-link:hover { color: var(--rani-pink); }
.nav-link[aria-current="page"] {
  color: var(--rani-pink);
  background-size: calc(100% - 1.7rem) 2px;
}
.nav .btn { margin-left: 0.6rem; }

.nav-toggle {
  display: none;
  font: inherit;
  font-weight: 500;
  color: var(--rani-pink);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--ivory-silk);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gutter) 1.25rem;
  }
  .nav.is-open { display: flex; }
  .nav-link { padding: 0.85rem 0; background-position: 0 calc(100% - 0.5rem); }
  .nav-link[aria-current="page"] { background-size: 2.5rem 2px; }
  .nav .btn { margin: 0.75rem 0 0; align-self: flex-start; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  font-family: var(--ff-body);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  color: var(--ivory-silk);
  background: var(--rani-pink);
  border: 1.5px solid var(--rani-pink);
  border-radius: 2px;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.btn:hover { background: var(--royal-plum); border-color: var(--royal-plum); color: var(--ivory-silk); }

/* Text on gold is Royal Plum (6.5:1), never Rani Pink */
.btn--gold { background: var(--heritage-gold); border-color: var(--heritage-gold); color: var(--royal-plum); }
.btn--gold:hover { background: var(--royal-plum); border-color: var(--heritage-gold); color: var(--ivory-silk); }

.btn--quiet { background: transparent; border-color: var(--line-strong); color: var(--rani-pink); }
.btn--quiet:hover { background: var(--rani-pink); border-color: var(--rani-pink); color: var(--ivory-silk); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

/* ---------- The quilt and its label (page openers) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--royal-plum);
  padding-block: clamp(2.5rem, 9vw, 7rem);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--quilt);
  background-size: 64px 64px;
  background-position: center top;
}
.hero--page { padding-block: clamp(2rem, 6vw, 4.5rem); }

/* The words sit on an ivory label, sewn to the quilt */
.label {
  position: relative;
  max-width: 45rem;
  background: var(--ivory-silk);
  padding: clamp(1.9rem, 5vw, 3.75rem);
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18), 0 18px 40px rgba(0, 0, 0, 0.3);
}
.label::before {
  content: '';
  position: absolute;
  inset: clamp(0.55rem, 1.4vw, 0.9rem);
  border: 1.5px dashed var(--heritage-gold);
  border-radius: 1px;
  pointer-events: none;
}
.label > * { position: relative; }
.label h1 { margin-bottom: 0.45em; }
.label .lead { max-width: 34rem; }
.hero--page .label { max-width: 40rem; }

/* The one piece of motion: the quilt is sewn in, then the label settles */
@media (prefers-reduced-motion: no-preference) {
  .hero--home::before { animation: sew 1500ms cubic-bezier(0.3, 0.6, 0.2, 1) both; }
  .hero--home .label { animation: settle 700ms 450ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
}
@keyframes sew { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes settle { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- The word (dictionary entry) ---------- */
.entry-word {
  font-style: italic;
  font-weight: 400;
  font-size: clamp(4rem, 11vw, 8rem);
  line-height: 0.85;
  letter-spacing: -0.02em;
  margin: 0 0 0.3em;
}
.entry-meta { display: flex; align-items: baseline; gap: 0.9rem; margin: 0; color: var(--rani-pink); }
.entry-hindi { font-family: var(--ff-hindi); font-size: 1.7rem; line-height: 1.2; }
.entry-pos { font-size: 1rem; }

/* ---------- The range: fabric panels in place of photographs ---------- */
.range-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.range-head h2 { margin: 0; }
.range-head p { margin: 0; max-width: 30rem; }

.range-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(13.5rem, auto);
  gap: clamp(0.75rem, 1.6vw, 1.25rem);
}
.swatch {
  position: relative;
  display: flex;
  align-items: flex-end;
  grid-column: 8 / span 5;
  padding: clamp(0.75rem, 1.6vw, 1.1rem);
  overflow: hidden;
  border-radius: 2px;
}
.swatch--razai { grid-column: 1 / span 7; grid-row: 1 / span 3; }
@media (max-width: 820px) {
  .swatch, .swatch--razai { grid-column: 1 / -1; grid-row: auto; }
  .swatch--razai { min-height: 19rem; }
}

/* Fabric colours. Replace .fabric-art with an <img> when photographs arrive. */
.fabric--razai      { background: var(--royal-plum) var(--quilt) center / 64px 64px; color: var(--heritage-gold); }
.fabric--bedspreads { background: var(--rani-pink);  color: var(--heritage-gold); }
.fabric--cushions   { background: var(--sandstone);  color: var(--royal-plum); }
.fabric--linen      { background: var(--jaipur-sky); color: var(--royal-plum); }

/* In a swatch the drawing sits top right, clear of the label at bottom left */
.fabric-art {
  position: absolute;
  top: clamp(0.75rem, 1.6vw, 1.1rem);
  right: clamp(0.75rem, 1.6vw, 1.1rem);
  width: auto;
  height: 50%;
  max-width: 60%;
}
.fabric > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.swatch-label {
  position: relative;
  max-width: 19rem;
  color: var(--royal-plum);
  background: var(--ivory-silk);
  padding: 0.8rem 1.1rem 0.9rem;
  border-radius: 1px;
}
.swatch-label h3 { margin: 0 0 0.15em; }
.swatch-label h3 a { color: inherit; text-decoration: none; }
.swatch-label h3 a::after { content: ''; position: absolute; inset: -100vmax; }
.swatch-label p { margin: 0; font-size: 1rem; line-height: 1.45; }
.swatch:hover .swatch-label h3 a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.swatch:focus-within { outline: 2px solid var(--rani-pink); outline-offset: 3px; }
.swatch-label h3 a:focus-visible { outline: none; }

/* Range page: one row per range */
.range-item {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: center;
  padding-block: clamp(2rem, 5vw, 3.5rem);
  scroll-margin-top: 5rem;
}
.range-item h2 { margin-bottom: 0.35em; }
.range-panel { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 2px; }
.range-panel .fabric-art { top: 50%; right: auto; left: 50%; height: 70%; max-width: 70%; transform: translate(-50%, -50%); }
@media (max-width: 820px) {
  .range-item { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .range-panel { aspect-ratio: 16 / 9; }
}

/* ---------- Statement band ---------- */
.band { background: var(--rani-pink); color: var(--ivory-silk); padding-block: clamp(3.5rem, 8vw, 6rem); }
.band h2 {
  color: var(--ivory-silk);
  font-weight: 400;
  font-size: clamp(2rem, 4.6vw, 3.7rem);
  line-height: 1.1;
  max-width: 22ch;
  margin: 0;
}
.band p { max-width: var(--measure); margin-top: 1.5rem; }
.band a { color: var(--ivory-silk); }
.band a:hover { color: var(--heritage-gold); }
.band :focus-visible { outline-color: var(--heritage-gold); }

/* ---------- Two moods ---------- */
.moods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 5vw, 4.5rem);
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
}
.moods > div { padding-top: 1.4rem; background: repeating-linear-gradient(90deg, var(--heritage-gold) 0 9px, transparent 9px 15px) no-repeat top left / 100% 2px; }
@media (max-width: 700px) { .moods { grid-template-columns: minmax(0, 1fr); } }

/* ---------- What we hold to (dark) ---------- */
.plum { background: var(--royal-plum); color: var(--ivory-silk); }
.plum h2 { color: var(--ivory-silk); }
.plum h3 { color: var(--heritage-gold); }
.plum a { color: var(--ivory-silk); }
.plum a:hover { color: var(--heritage-gold); }
.plum :focus-visible { outline-color: var(--heritage-gold); }
.beliefs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.75rem, 4vw, 3rem) clamp(1.5rem, 5vw, 4.5rem);
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
}
.beliefs > div { padding-top: 1.4rem; background: repeating-linear-gradient(90deg, var(--heritage-gold) 0 9px, transparent 9px 15px) no-repeat top left / 100% 2px; }
@media (max-width: 700px) { .beliefs { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Prose pages ---------- */
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 0; }
.chapter { padding-block: clamp(2.25rem, 5vw, 4rem); }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.75rem, 4vw, 3.5rem);
}
.contact-grid > div { padding-top: 1.4rem; background: repeating-linear-gradient(90deg, var(--heritage-gold) 0 9px, transparent 9px 15px) no-repeat top left / 100% 2px; }
.contact-email { font-size: clamp(1.2rem, 2.2vw, 1.45rem); font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Closing call ---------- */
.closing .pair { align-items: center; }

/* ---------- Footer ---------- */
.site-footer { background: var(--royal-plum); color: var(--ivory-silk); padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; }
.site-footer a { color: var(--ivory-silk); text-decoration: none; }
.site-footer a:hover { color: var(--heritage-gold); text-decoration: underline; }
.site-footer :focus-visible { outline-color: var(--heritage-gold); }
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) repeat(3, minmax(0, 2.4fr));
  gap: clamp(1.75rem, 4vw, 3rem);
}
.footer-name { font-family: var(--ff-display); font-size: 2.2rem; font-weight: 500; line-height: 1; margin: 0 0 0.6rem; }
.footer-desc { max-width: 22rem; margin: 0; }
.footer-h { font-family: var(--ff-body); font-size: 1rem; font-weight: 600; line-height: 1.3; letter-spacing: 0; color: var(--heritage-gold); margin: 0 0 0.7rem; }
.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list li { margin-bottom: 0.45rem; }
.footer-legal { margin-top: clamp(2rem, 5vw, 3.25rem); padding-top: 1.5rem; font-size: 0.95rem; line-height: 1.6; background: repeating-linear-gradient(90deg, var(--heritage-gold) 0 9px, transparent 9px 15px) no-repeat top left / 100% 2px; }
.footer-legal p { margin: 0 0 0.35rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-grid > :first-child { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }
