/* =====================================================================
   Velanoor — styles.css
   A calm, premium, modest-luxury design system.
   Palette: deep green, warm gold, cream, terracotta — with tints,
   shades, neutrals and soft layered surfaces.
   Fonts: Cormorant Garamond (display serif) + Poppins (sans).
   ===================================================================== */

/* =====================================================================
   1. DESIGN TOKENS  (change these, the whole site follows)
   ===================================================================== */
:root {
  /* ---- Brand core ---- */
  --green:        #0f4d3c;
  --green-dark:   #0a3327;
  --green-darker: #072319;
  --green-soft:   #136048;
  --green-700:    #0d4436;
  --gold:         #c8952f;
  --gold-light:   #e6bc57;
  --gold-deep:    #a97a1e;
  --cream:        #faf6ec;
  --cream-2:      #f3ead4;
  --terracotta:   #b4451f;
  --terracotta-soft: #c96a45;

  /* ---- Ink & neutrals (warm-tinted greys) ---- */
  --ink:        #23281f;
  --ink-2:      #3d4438;   /* body text on light */
  --muted:      #5f6558;   /* secondary text */
  --muted-2:    #838a79;   /* captions / notes */
  --line:       rgba(15, 77, 60, 0.10);
  --line-2:     rgba(15, 77, 60, 0.18);

  /* ---- Surfaces ---- */
  --surface:      #ffffff;
  --surface-cream: var(--cream);
  --surface-tint:  #fcfaf3;   /* subtle off-white panel */
  --surface-sand:  #f6efe0;   /* warmer panel */
  --surface-green: linear-gradient(158deg, #10513f 0%, #0a3327 62%, #072319 100%);

  /* ---- Type scale (modular ~1.2, fluid where it matters) ---- */
  --fs-eyebrow: 0.78rem;
  --fs-xs:  0.8rem;
  --fs-sm:  0.9rem;
  --fs-base: 1rem;
  --fs-md:  1.075rem;
  --fs-lg:  clamp(1.15rem, 1.5vw, 1.3rem);
  --fs-xl:  clamp(1.4rem, 2.4vw, 1.85rem);
  --fs-2xl: clamp(1.9rem, 3.6vw, 2.6rem);
  --fs-3xl: clamp(2.3rem, 4.6vw, 3.2rem);
  --fs-hero: clamp(2.9rem, 8vw, 5.4rem);

  /* ---- Spacing scale (4 / 8px rhythm) ---- */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  /* ---- Radii ---- */
  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-pill: 999px;

  /* ---- Shadows (soft, layered) ---- */
  --sh-1: 0 1px 2px rgba(10,51,39,0.06), 0 2px 8px rgba(10,51,39,0.05);
  --sh-2: 0 2px 6px rgba(10,51,39,0.06), 0 10px 28px rgba(10,51,39,0.09);
  --sh-3: 0 6px 14px rgba(10,51,39,0.08), 0 22px 48px rgba(10,51,39,0.14);
  --sh-gold: 0 6px 18px rgba(200,149,47,0.30);
  --sh-inset-top: inset 0 1px 0 rgba(255,255,255,0.5);

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-1: 0.16s;
  --dur-2: 0.28s;
  --dur-3: 0.5s;

  /* ---- Layout ---- */
  --measure: 62ch;         /* readable text max-width */
  --container: 1140px;

  /* ---- Z-index tokens ---- */
  --z-header: 40;
  --z-reveal: 1;
  --z-popover: 55;
  --z-overlay: 60;
  --z-panel: 70;
  --z-toast: 90;

  /* ---- Fonts ---- */
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans:  "Poppins", system-ui, -apple-system, sans-serif;
  --sans-ar:  "Noto Naskh Arabic", "Poppins", system-ui, sans-serif;
  --serif-ar: "Noto Naskh Arabic", "Cormorant Garamond", Georgia, serif;
  --sans-am:  "Noto Sans Ethiopic", "Poppins", system-ui, sans-serif;
  --serif-am: "Noto Sans Ethiopic", "Cormorant Garamond", Georgia, serif;

  /* ---- Role fonts (admin-overridable via api/theme.php → set on :root by
     script.js). Defaults mirror --serif / --sans, but include the Noto
     families so Arabic & Amharic glyphs stay legible when an admin picks a
     Latin-only font for a role. If the theme API is unavailable these
     defaults keep the site looking exactly as before. ---- */
  --font-heading: "Cormorant Garamond", "Noto Naskh Arabic", "Noto Sans Ethiopic", Georgia, serif;
  --font-body:    "Poppins", "Noto Naskh Arabic", "Noto Sans Ethiopic", system-ui, -apple-system, sans-serif;
  --font-nav:     "Poppins", "Noto Naskh Arabic", "Noto Sans Ethiopic", system-ui, -apple-system, sans-serif;
  --font-button:  "Poppins", "Noto Naskh Arabic", "Noto Sans Ethiopic", system-ui, -apple-system, sans-serif;
}

/* =====================================================================
   2. BASE
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-2);
  background: var(--cream);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[lang="ar"] body { font-family: var(--sans-ar); }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4 { font-family: var(--serif-ar); }
html[lang="am"] body { font-family: var(--sans-am); }
html[lang="am"] h1, html[lang="am"] h2, html[lang="am"] h3, html[lang="am"] h4 { font-family: var(--serif-am); }

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.12;
  margin: 0;
  color: var(--green);
  letter-spacing: 0.005em;
}

p { margin: 0 0 var(--sp-4); }

a { color: var(--green); }

::selection { background: var(--gold-light); color: var(--green-darker); }

/* Accessible, consistent focus ring */
:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
  border-radius: 3px;
}
:focus:not(:focus-visible) { outline: none; }

[hidden] { display: none !important; }

/* =====================================================================
   3. DECORATIVE HERITAGE BANDS
   ===================================================================== */
.tibeb-band,
.footer-band {
  height: 26px;
  background: url("assets/hero-band.svg") repeat-x center / auto 26px;
}
.divider {
  height: 22px;
  background: url("assets/tibeb-pattern.svg") repeat-x center / auto 22px;
  opacity: 0.55;
  margin: 0;
}

/* =====================================================================
   4. BUTTONS
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.8rem 1.7rem;
  border-radius: var(--r-pill);
  font-family: var(--font-button);
  font-weight: 500;
  font-size: var(--fs-sm);
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease),
              box-shadow var(--dur-2) var(--ease),
              background var(--dur-2) var(--ease),
              color var(--dur-2) var(--ease),
              border-color var(--dur-2) var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: #fff;
  box-shadow: var(--sh-gold);
  border-color: rgba(255,255,255,0.15);
}
.btn-primary:hover {
  background: linear-gradient(180deg, var(--gold-light), var(--gold-deep));
  box-shadow: 0 10px 26px rgba(200,149,47,0.42);
}

.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: var(--cream);
  border-color: rgba(230, 188, 87, 0.55);
}
.btn-ghost:hover { background: rgba(230, 188, 87, 0.14); border-color: var(--gold-light); }

.btn-outline {
  background: transparent;
  color: var(--green);
  border-color: var(--line-2);
}
.btn-outline:hover { background: var(--green); color: var(--cream); border-color: var(--green); }

/* =====================================================================
   5. HEADER  (sticky, condenses on scroll)
   ===================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 0.85rem clamp(1rem, 4vw, 2rem);
  background: rgba(250, 246, 236, 0.72);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: padding var(--dur-2) var(--ease),
              background var(--dur-2) var(--ease),
              box-shadow var(--dur-2) var(--ease),
              border-color var(--dur-2) var(--ease);
}
.site-header.condensed {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  background: rgba(250, 246, 236, 0.92);
  border-bottom-color: var(--line);
  box-shadow: 0 6px 24px rgba(10,51,39,0.07);
}

.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand-logo {
  border-radius: 10px;
  transition: width var(--dur-2) var(--ease), height var(--dur-2) var(--ease);
}
.site-header.condensed .brand-logo { width: 34px; height: 34px; }
.brand-name {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--green);
  letter-spacing: 0.01em;
  line-height: 1;
}

.main-nav {
  margin-left: auto;
  display: flex;
  gap: 1.6rem;
  flex-wrap: wrap;
}
.main-nav a {
  text-decoration: none;
  color: var(--green-700);
  font-family: var(--font-nav);
  font-size: var(--fs-sm);
  font-weight: 450;
  letter-spacing: 0.01em;
  position: relative;
  padding: 0.15rem 0;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--terracotta));
  border-radius: 2px;
  transition: width var(--dur-2) var(--ease);
}
.main-nav a:hover::after,
.main-nav a:focus-visible::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 0.5rem; }

/* Sign in / Admin pill — reads on the light header. Default: gold outline
   + green text; logged-in admin (.is-admin): filled green + cream text.
   Symmetric padding + inline-flex → works unchanged in RTL. */
.btn-auth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--gold);
  background: rgba(255, 255, 255, 0.55);
  color: var(--green);
  font-family: var(--font-button);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease),
              box-shadow var(--dur-1) var(--ease);
}
.btn-auth:hover {
  background: var(--gold);
  color: var(--green-darker);
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: var(--sh-gold);
}
/* Logged-in admin: filled green, cream text. */
.btn-auth.is-admin {
  background: var(--green-darker);
  color: var(--cream);
  border-color: var(--green-darker);
}
.btn-auth.is-admin:hover {
  background: var(--green);
  border-color: var(--green);
  color: var(--cream);
  box-shadow: var(--sh-2);
}

/* Icon buttons (share, cart) share a look */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.55);
  color: var(--green);
  padding: 0.5rem 0.7rem;
  border-radius: var(--r-pill);
  cursor: pointer;
  font-family: var(--sans);
  font-size: var(--fs-sm);
  line-height: 1;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.icon-btn:hover { background: var(--green); color: var(--cream); border-color: var(--green); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .icon-btn-label { font-size: var(--fs-sm); font-weight: 500; }

.cart-toggle {
  border: none;
  background: var(--green);
  color: var(--cream);
  padding: 0.55rem 0.85rem;
  border-radius: var(--r-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.cart-toggle:hover { background: var(--green-soft); transform: translateY(-1px); }
.cart-toggle svg { width: 19px; height: 19px; }
.cart-count {
  background: var(--gold);
  color: #fff;
  border-radius: var(--r-pill);
  min-width: 20px;
  height: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* Language switcher */
.lang-switcher {
  display: flex;
  gap: 0.1rem;
  align-items: center;
  background: rgba(243, 234, 212, 0.7);
  border: 1px solid rgba(200, 149, 47, 0.35);
  border-radius: var(--r-pill);
  padding: 0.18rem;
}
.lang-btn {
  border: none;
  background: transparent;
  color: var(--green-700);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.62rem;
  border-radius: var(--r-pill);
  cursor: pointer;
  line-height: 1.1;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.lang-btn:hover { background: rgba(15, 77, 60, 0.08); }
.lang-btn.active {
  background: var(--green);
  color: var(--cream);
  box-shadow: var(--sh-1);
}
.lang-btn[lang="ar"] { font-family: var(--sans-ar); }
.lang-btn[lang="am"] { font-family: var(--sans-am); }

/* =====================================================================
   6. HERO  (layered, composed)
   ===================================================================== */
.hero {
  position: relative;
  isolation: isolate;
  background: var(--surface-green);
  color: var(--cream);
  padding: clamp(4rem, 10vw, 7rem) clamp(1.2rem, 5vw, 2rem) 0;
  overflow: hidden;
}
/* soft radial glows for depth */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 420px at 78% -8%, rgba(230,188,87,0.22), transparent 60%),
    radial-gradient(700px 500px at 12% 108%, rgba(180,69,31,0.18), transparent 60%);
  z-index: -2;
}
/* faint heritage pattern layer */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/tibeb-pattern.svg") repeat center / auto 120px;
  opacity: 0.05;
  z-index: -1;
  pointer-events: none;
}
.hero-inner {
  max-width: 880px;
  margin: 0 auto;
  padding-bottom: clamp(3.5rem, 8vw, 6rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  color: var(--gold-light);
  margin: 0 0 1.3rem;
  padding: 0.4rem 1rem;
  border: 1px solid rgba(230,188,87,0.35);
  border-radius: var(--r-pill);
  background: rgba(230,188,87,0.06);
}
.hero-title {
  font-size: var(--fs-hero);
  font-weight: 600;
  margin: 0 0 1.1rem;
  color: #fff;
  letter-spacing: 0.01em;
  line-height: 1.02;
  text-shadow: 0 2px 30px rgba(0,0,0,0.25);
}
.hero-tagline {
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  color: var(--gold-light);
  margin: 0 0 1rem;
}
.hero-tagline-sub {
  display: block;
  font-family: var(--sans);
  font-style: normal;
  font-size: var(--fs-md);
  font-weight: 300;
  line-height: 1.7;
  color: rgba(250,246,236,0.82);
  max-width: 56ch;
  margin: 0 auto 2.2rem;
}
.hero-cta { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }

/* =====================================================================
   7. SECTIONS  (rhythm & headings)
   ===================================================================== */
.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.2rem, 5vw, 2rem);
}
.section-head { text-align: center; margin-bottom: clamp(2rem, 5vw, 3.2rem); }
.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  color: var(--gold-deep);
  margin: 0 0 0.7rem;
}
.section-head h2 { font-size: var(--fs-3xl); color: var(--green); }
.section-rule {
  display: block;
  width: 64px; height: 3px;
  margin: 1rem auto 0;
  background: linear-gradient(90deg, var(--gold), var(--terracotta));
  border-radius: 3px;
}
.section-sub {
  color: var(--muted);
  margin: 1rem auto 0;
  max-width: var(--measure);
  font-size: var(--fs-md);
}

/* =====================================================================
   8. ABOUT / STORY  (editorial)
   ===================================================================== */
.about {
  background:
    linear-gradient(180deg, transparent, rgba(243,234,212,0.35) 40%, transparent),
    transparent;
}
.about-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.about-text p { margin: 0 0 1.15rem; font-size: var(--fs-md); color: var(--ink-2); max-width: var(--measure); }
.about-text p:first-child::first-letter {
  font-family: var(--serif);
  font-size: 3.4rem;
  font-weight: 600;
  color: var(--gold-deep);
  float: left;
  line-height: 0.78;
  padding: 0.1rem 0.6rem 0 0;
}
.about-badges {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 1.8rem 0 0;
}
.about-badges li {
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--green);
  padding: 0.45rem 1rem;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
  box-shadow: var(--sh-1);
}
.about-art { position: relative; display: flex; justify-content: center; }
.about-art::before {
  content: "";
  position: absolute;
  inset: -6% -6% -6% -6%;
  background: radial-gradient(closest-side, rgba(200,149,47,0.16), transparent 72%);
  z-index: 0;
}
.about-art-frame {
  position: relative;
  z-index: 1;
  padding: 2rem;
  background: var(--surface-green);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  border: 1px solid rgba(230,188,87,0.25);
}
.about-art-frame img { margin: 0 auto; width: 200px; height: 200px; filter: drop-shadow(0 8px 20px rgba(0,0,0,0.3)); }

/* =====================================================================
   9. SHOP / PRODUCTS
   ===================================================================== */
.product-grid { display: flex; flex-direction: column; gap: clamp(3rem, 6vw, 4.5rem); }

.category-head { text-align: center; margin-bottom: clamp(1.5rem, 3vw, 2.2rem); }
.category-title {
  font-size: var(--fs-xl);
  color: var(--green);
  position: relative;
  display: inline-block;
  padding-bottom: 0.5rem;
}
.category-title::after {
  content: "";
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: 0;
  width: 42px; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--terracotta));
  border-radius: 3px;
}
.category-intro { color: var(--muted); margin: 0.8rem auto 0; max-width: 60ch; font-size: var(--fs-sm); }

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: clamp(1.1rem, 2.5vw, 1.8rem);
}

.product-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  transition: transform var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-out);
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--sh-3);
  border-color: rgba(200,149,47,0.4);
}
.product-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(160deg, var(--cream-2), #efe3c6);
  border-bottom: 1px solid var(--line);
}
.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-3) var(--ease-out);
}
.product-card:hover .product-media img { transform: scale(1.06); }
.product-tag {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(180,69,31,0.94);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.28rem 0.7rem;
  border-radius: var(--r-pill);
  backdrop-filter: blur(2px);
  box-shadow: var(--sh-1);
}

/* per-card share affordance, top-right */
.product-share {
  position: absolute;
  top: 10px; right: 10px;
  width: 34px; height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,0.9);
  color: var(--green);
  cursor: pointer;
  box-shadow: var(--sh-1);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease),
              background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.product-card:hover .product-share,
.product-share:focus-visible { opacity: 1; transform: translateY(0); }
.product-share:hover { background: var(--green); color: var(--cream); }
.product-share svg { width: 17px; height: 17px; }

.product-body { padding: 1.2rem 1.2rem 1.35rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.product-title { font-size: 1.4rem; color: var(--green); line-height: 1.1; }
.product-desc { font-size: var(--fs-sm); color: var(--muted); flex: 1; margin: 0; line-height: 1.6; }
.product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
}
.product-price { font-family: var(--serif); font-size: 1.55rem; font-weight: 600; color: var(--terracotta); }
.btn-buy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--green);
  color: var(--cream);
  border: none;
  padding: 0.6rem 1.15rem;
  border-radius: var(--r-pill);
  font-family: var(--font-button);
  font-weight: 500;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.btn-buy:hover { background: var(--green-soft); transform: translateY(-2px); box-shadow: var(--sh-2); }
.btn-buy svg { width: 15px; height: 15px; }

/* =====================================================================
   10. COMMISSIONS
   ===================================================================== */
.commissions-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  background: var(--surface-green);
  color: var(--cream);
  border-radius: var(--r-xl);
  padding: clamp(1.8rem, 4vw, 3rem);
  box-shadow: var(--sh-3);
  border: 1px solid rgba(230,188,87,0.2);
  position: relative;
  overflow: hidden;
}
.commissions-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/tibeb-pattern.svg") repeat center / auto 100px;
  opacity: 0.05;
  pointer-events: none;
}
.commissions-text { position: relative; z-index: 1; }
.commissions-card h3 { font-size: var(--fs-xl); margin-bottom: 0.7rem; color: #fff; }
.commissions-card p { color: rgba(250,246,236,0.86); max-width: 48ch; }
.commissions-list { padding-left: 1.2rem; margin: 1.1rem 0 1.7rem; }
.commissions-list li { margin-bottom: 0.5rem; color: rgba(250,246,236,0.9); }
.commissions-art { position: relative; z-index: 1; }
.commissions-art img { border-radius: var(--r-md); box-shadow: var(--sh-3); }

/* =====================================================================
   11. LINK HUB
   ===================================================================== */
.link-hub {
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.link-btn {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  text-decoration: none;
  color: var(--green);
  font-weight: 500;
  box-shadow: var(--sh-1);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease),
              transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.link-btn:hover {
  background: var(--green);
  color: var(--cream);
  transform: translateY(-2px);
  box-shadow: var(--sh-2);
}
.link-btn .link-icon { font-size: 1.3rem; }

/* =====================================================================
   12. CONTACT
   ===================================================================== */
.contact-card {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: clamp(2rem, 5vw, 3rem);
  border: 1px solid var(--line-2);
  box-shadow: var(--sh-2);
}
.contact-card p { color: var(--muted); }
.contact-card .btn { margin: 1.1rem 0; }
.contact-note { color: var(--muted-2); font-size: var(--fs-sm); margin: 0; }

/* =====================================================================
   13. FOOTER + IMPRESSUM
   ===================================================================== */
.site-footer { background: var(--green-darker); color: var(--cream); margin-top: var(--sp-7); }
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 3.5rem) clamp(1.2rem, 5vw, 2rem);
  text-align: center;
}
.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--serif);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #fff;
}
.footer-share {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  margin: 0 auto 2rem;
}
.footer-share-label {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: var(--fs-xs);
  color: rgba(230,188,87,0.85);
}
.footer-share-row { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }
.impressum {
  max-width: 580px;
  margin: 0 auto 1.6rem;
  background: rgba(255,255,255,0.045);
  border: 1px dashed rgba(230,188,87,0.5);
  border-radius: var(--r-md);
  padding: 1.3rem 1.5rem;
  text-align: left;
  font-size: var(--fs-sm);
  color: rgba(250,246,236,0.85);
}
.impressum h4 { color: var(--gold-light); margin-bottom: 0.5rem; font-size: 1.1rem; }
.impressum-hint { color: var(--gold-light); font-style: italic; font-size: var(--fs-xs); }
.footer-copy { font-size: var(--fs-xs); color: rgba(250,246,236,0.6); }

/* =====================================================================
   14. SHARE  (buttons, popover menu, toast)
   ===================================================================== */
/* Circular platform buttons used in footer + fallback menu */
.share-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(230,188,87,0.4);
  background: rgba(255,255,255,0.06);
  color: var(--cream);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--dur-1) var(--ease), background var(--dur-1) var(--ease),
              color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.share-chip:hover { transform: translateY(-2px); background: var(--gold); color: #fff; border-color: var(--gold); }
.share-chip svg { width: 19px; height: 19px; }

/* Fallback popover menu (desktop / unsupported browsers) */
.share-menu {
  position: fixed;
  z-index: var(--z-popover);
  min-width: 232px;
  max-width: min(92vw, 300px);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  padding: 0.9rem;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transform-origin: top center;
  pointer-events: none;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease-out);
}
.share-menu.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.share-menu-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--green);
  margin: 0 0 0.2rem;
  padding: 0 0.2rem;
}
.share-menu-name {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin: 0 0 0.7rem;
  padding: 0 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}
.share-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.2rem;
  border: none;
  background: transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  text-decoration: none;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 0.68rem;
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.share-opt:hover { background: var(--surface-sand); transform: translateY(-1px); }
.share-opt-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.share-opt-icon svg { width: 20px; height: 20px; }
/* brand-ish tints (kept muted/on-brand, not garish) */
.share-opt-icon.whatsapp { background: #1faf54; }
.share-opt-icon.telegram { background: #2ca5e0; }
.share-opt-icon.x        { background: #1a1a1a; }
.share-opt-icon.facebook { background: #2f6fd6; }
.share-opt-icon.pinterest{ background: #c8262f; }
.share-opt-icon.email    { background: var(--green); }
.share-opt-icon.copy     { background: var(--gold-deep); }
.share-menu-note {
  margin: 0.7rem 0.2rem 0;
  font-size: 0.62rem;
  color: var(--muted-2);
  line-height: 1.4;
  text-align: center;
}

/* Toast (link copied) */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(16px);
  z-index: var(--z-toast);
  background: var(--green-darker);
  color: var(--cream);
  padding: 0.7rem 1.2rem;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 500;
  box-shadow: var(--sh-3);
  border: 1px solid rgba(230,188,87,0.4);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease-out);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 17px; height: 17px; color: var(--gold-light); }

/* =====================================================================
   15. CART SLIDE-IN
   ===================================================================== */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 35, 25, 0.55);
  backdrop-filter: blur(2px);
  z-index: var(--z-overlay);
  opacity: 1;
}
.cart-panel {
  position: fixed;
  top: 0; right: 0;
  width: min(420px, 92vw);
  height: 100%;
  background: var(--cream);
  z-index: var(--z-panel);
  transform: translateX(100%);
  transition: transform var(--dur-2) var(--ease-out);
  display: flex;
  flex-direction: column;
  box-shadow: -14px 0 50px rgba(0,0,0,0.28);
}
.cart-panel.open { transform: translateX(0); }
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.3rem 1.5rem;
  background: var(--surface-green);
  color: var(--cream);
}
.cart-header h3 { color: #fff; font-size: 1.5rem; }
.cart-close {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--cream);
  width: 34px; height: 34px;
  border-radius: var(--r-pill);
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-1) var(--ease);
}
.cart-close:hover { background: rgba(255,255,255,0.18); }
.cart-items { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }

.cart-empty {
  text-align: center;
  color: var(--muted);
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  line-height: 1.7;
}
.cart-empty-icon {
  width: 64px; height: 64px;
  color: var(--gold);
  opacity: 0.65;
  margin-bottom: 0.4rem;
}
.cart-empty-icon svg { width: 100%; height: 100%; }

.cart-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}
.cart-item img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }
.cart-item-title { font-weight: 500; font-size: var(--fs-sm); color: var(--green); }
.cart-item-price { font-size: var(--fs-xs); color: var(--terracotta); }
.cart-qty { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.4rem; }
.cart-qty button {
  width: 26px; height: 26px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--green);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.cart-qty button:hover { background: var(--green); color: var(--cream); border-color: var(--green); }
.cart-qty span { min-width: 20px; text-align: center; font-weight: 500; }
.cart-item-remove {
  background: none;
  border: none;
  color: var(--terracotta);
  cursor: pointer;
  font-size: var(--fs-xs);
  text-decoration: underline;
  padding: 0;
}
.cart-item-remove:hover { color: var(--green); }
.cart-footer { padding: 1.3rem 1.5rem; border-top: 1px solid var(--line); background: var(--surface); }
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.1rem;
  font-size: var(--fs-md);
}
.cart-total-row strong { font-family: var(--serif); font-size: 1.6rem; color: var(--green); }
.cart-checkout { width: 100%; }
.cart-note { font-size: var(--fs-xs); color: var(--muted-2); text-align: center; margin: 0.8rem 0 0; }

/* =====================================================================
   16. SCROLL REVEAL
   ===================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }

/* =====================================================================
   17. RESPONSIVE
   ===================================================================== */
@media (max-width: 860px) {
  .about-grid, .commissions-card { grid-template-columns: 1fr; }
  .about-art { order: -1; }
  .main-nav { display: none; }
}
@media (max-width: 560px) {
  .hero { padding-top: 3rem; }
  .brand-name { font-size: 1.3rem; }
  .icon-btn .icon-btn-label { display: none; }
  .share-menu-grid { grid-template-columns: repeat(3, 1fr); }
}

/* =====================================================================
   18. REDUCED MOTION
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  * , *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .product-card:hover { transform: none; }
  .product-card:hover .product-media img { transform: none; }
}

/* =====================================================================
   18b. SHOP LOADING / ERROR STATES  (API-backed catalog)
   ===================================================================== */
.shop-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: clamp(3rem, 8vw, 5rem) 1rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.shop-state p { margin: 0; max-width: 46ch; font-size: var(--fs-md); }
.shop-spinner {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 3px solid var(--line-2);
  border-top-color: var(--gold);
  animation: shop-spin 0.8s linear infinite;
}
@keyframes shop-spin { to { transform: rotate(360deg); } }
.shop-state-error { color: var(--terracotta); }
.shop-state-error .btn { color: #fff; }

/* FREE badge (shown in place of a price on free items) */
.product-free {
  color: var(--green);
  background: rgba(15, 77, 60, 0.08);
  border: 1px solid var(--line-2);
  padding: 0.15rem 0.7rem;
  border-radius: var(--r-pill);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

/* Download button reuses .btn-buy but is an <a> — keep it link-clean */
a.btn-buy { text-decoration: none; }
a.btn-buy[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }

/* Discreet admin link in the footer */
.footer-admin { margin: 0.4rem 0 0; }
.footer-admin a {
  color: rgba(250, 246, 236, 0.45);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.footer-admin a:hover { color: rgba(230, 188, 87, 0.85); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .shop-spinner { animation-duration: 0.001ms !important; }
}

/* =====================================================================
   19. RTL (Arabic) OVERRIDES
   ===================================================================== */
[dir="rtl"] { text-align: right; }

[dir="rtl"] .main-nav { margin-left: 0; margin-right: auto; }
[dir="rtl"] .main-nav a::after { left: auto; right: 0; }

/* Cart slides from the LEFT in RTL */
[dir="rtl"] .cart-panel {
  right: auto;
  left: 0;
  transform: translateX(-100%);
  box-shadow: 14px 0 50px rgba(0, 0, 0, 0.28);
}
[dir="rtl"] .cart-panel.open { transform: translateX(0); }

/* Product badges/affordances mirror */
[dir="rtl"] .product-tag { left: auto; right: 12px; }
[dir="rtl"] .product-share { right: auto; left: 10px; }

/* Drop-cap floats right in RTL */
[dir="rtl"] .about-text p:first-child::first-letter { float: right; padding: 0.1rem 0 0 0.6rem; }

/* Lists indent from the right */
[dir="rtl"] .commissions-list { padding-left: 0; padding-right: 1.2rem; }

/* Impressum stays a left-aligned German legal block */
[dir="rtl"] .impressum { text-align: right; }
[dir="rtl"] .impressum p { direction: ltr; text-align: left; }

/* =====================================================================
   20. DESIGN STUDIO  (composer + live preview + community gallery)
   Built entirely from the shared design tokens above.
   ===================================================================== */
.ds-studio {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(1.5rem, 4vw, 2.6rem);
  align-items: start;
}

/* --- Composer panel --- */
.ds-composer {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-2);
  padding: clamp(1.4rem, 3vw, 2rem);
}
.ds-composer-title,
.ds-submit-title {
  font-size: var(--fs-lg);
  color: var(--green);
  margin: 0 0 1.1rem;
}
.ds-field { margin-bottom: 1.1rem; }
.ds-field > label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--green-700);
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}
.ds-select,
.ds-input {
  width: 100%;
  font-family: var(--sans);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  background: var(--surface-tint);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 0.6rem 0.8rem;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
html[lang="ar"] .ds-select, html[lang="ar"] .ds-input { font-family: var(--sans-ar); }
html[lang="am"] .ds-select, html[lang="am"] .ds-input { font-family: var(--sans-am); }
.ds-select:focus,
.ds-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 149, 47, 0.18);
}
textarea.ds-input { resize: vertical; min-height: 2.6rem; line-height: 1.5; }
.ds-input-sm { padding: 0.5rem 0.7rem; margin-bottom: 0.5rem; }
.ds-note { display: block; color: var(--muted-2); font-size: var(--fs-xs); margin-top: 0.35rem; }

/* --- Colour swatch row (brand swatches + native picker) --- */
.ds-swatches { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.ds-swatch {
  width: 30px; height: 30px;
  border-radius: var(--r-pill);
  border: 2px solid var(--surface);
  background: var(--sw, #ccc);
  box-shadow: 0 0 0 1px var(--line-2);
  cursor: pointer;
  padding: 0;
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.ds-swatch:hover { transform: translateY(-2px); }
.ds-swatch.active { box-shadow: 0 0 0 2px var(--gold-deep); transform: translateY(-1px); }
.ds-swatch-custom {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background:
    conic-gradient(from 0deg, #b4451f, #c8952f, #0f4d3c, #136048, #b4451f);
}
.ds-swatch-custom input[type="color"] {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  opacity: 0;
}

/* --- Preview + submit column --- */
.ds-side { display: flex; flex-direction: column; gap: 1.4rem; position: sticky; top: 90px; }
.ds-preview {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-2);
  padding: clamp(1rem, 3vw, 1.6rem);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ds-preview svg { width: 100%; height: 100%; border-radius: var(--r-lg); }

.ds-submit {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-2);
  padding: clamp(1.4rem, 3vw, 2rem);
}
.ds-submit-btn { width: 100%; margin-top: 0.4rem; }
.ds-submit-status,
.ds-comment-status { font-size: var(--fs-sm); margin: 0.7rem 0 0; min-height: 1.2em; }
.ds-submit-status.ok, .ds-comment-status.ok { color: var(--green); }
.ds-submit-status.err, .ds-comment-status.err { color: var(--terracotta); }

/* Honeypot: kept in the DOM for bots, hidden from humans + AT. */
.ds-hp {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- Community gallery --- */
.ds-gallery-head { text-align: center; margin: clamp(3rem, 6vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2.2rem); }
.ds-gallery-head h3 { font-size: var(--fs-xl); color: var(--green); }
.ds-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: clamp(1.1rem, 2.5vw, 1.8rem);
}
.ds-gallery .shop-state,
.ds-gallery .ds-empty { grid-column: 1 / -1; }
.ds-empty p {
  font-family: var(--serif);
  font-size: var(--fs-lg);
  font-style: italic;
  color: var(--muted);
}

.ds-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-out);
}
.ds-card:hover { transform: translateY(-4px); box-shadow: var(--sh-3); border-color: rgba(200,149,47,0.4); }
.ds-card-media {
  aspect-ratio: 1 / 1;
  background: linear-gradient(160deg, var(--cream-2), #efe3c6);
  border-bottom: 1px solid var(--line);
  padding: 0.9rem;
}
.ds-card-media svg { width: 100%; height: 100%; border-radius: var(--r-md); }
.ds-card-body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: 0.35rem; }
.ds-card-title { font-size: 1.25rem; color: var(--green); line-height: 1.15; }
.ds-card-author { font-size: var(--fs-xs); color: var(--muted); margin: 0; }
.ds-card-actions { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.5rem; }

.ds-vote {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface-tint);
  border: 1px solid var(--line-2);
  color: var(--green);
  padding: 0.4rem 0.8rem;
  border-radius: var(--r-pill);
  font-family: var(--sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.ds-vote:hover:not(:disabled) { background: var(--green); color: var(--cream); border-color: var(--green); transform: translateY(-1px); }
.ds-vote-arrow { font-size: 0.85rem; line-height: 1; }
.ds-vote.voted, .ds-vote:disabled {
  background: rgba(15, 77, 60, 0.08);
  color: var(--green);
  border-color: var(--gold);
  cursor: default;
}
.ds-comments-toggle {
  background: none;
  border: none;
  color: var(--green-700);
  font-family: var(--sans);
  font-size: var(--fs-sm);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0.4rem 0.2rem;
}
.ds-comments-toggle:hover { color: var(--terracotta); }

/* --- Comments --- */
.ds-comments { margin-top: 0.7rem; border-top: 1px solid var(--line); padding-top: 0.7rem; }
.ds-comments-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.7rem; }
.ds-comment {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  background: var(--surface-tint);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0.5rem 0.7rem;
}
.ds-comment-author { font-size: var(--fs-xs); font-weight: 600; color: var(--green); }
.ds-comment-body { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.5; }
.ds-comments-loading, .ds-comments-empty { font-size: var(--fs-sm); color: var(--muted-2); margin: 0; }
.ds-comments-empty.err { color: var(--terracotta); }
.ds-comment-form { display: flex; flex-direction: column; }
.ds-comment-btn { align-self: flex-start; padding: 0.5rem 1.2rem; }

@media (max-width: 860px) {
  .ds-studio { grid-template-columns: 1fr; }
  .ds-side { position: static; }
}

/* --- Design Studio RTL (Arabic) mirroring --- */
[dir="rtl"] .ds-field > label,
[dir="rtl"] .ds-card-title,
[dir="rtl"] .ds-card-author,
[dir="rtl"] .ds-comment { text-align: right; }
[dir="rtl"] .ds-comment-btn { align-self: flex-end; }
[dir="rtl"] .ds-note { text-align: right; }

/* =====================================================================
   21. LIVE CONTENT EDITOR  (admin-only ✏️ pencils + edit popover)
   Built from the shared design tokens. Completely invisible to normal
   visitors: pencils render only inside body.is-editable.
   ===================================================================== */

/* ✏️ Pencil affordance appended at the end of each editable element.
   Hidden by default; only shown for a logged-in admin. */
.edit-pencil {
  display: none;
  margin: 0 0.35em;
  padding: 0.05em 0.35em;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.7);
  color: var(--green);
  font-size: 0.7em;
  line-height: 1.4;
  cursor: pointer;
  vertical-align: middle;
  box-shadow: var(--sh-1);
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease);
}
body.is-editable .edit-pencil { display: inline-flex; align-items: center; }
.edit-pencil:hover { background: var(--gold-light); border-color: var(--gold); transform: translateY(-1px); }

/* Backdrop behind the edit dialog (also the click-outside close target). */
.edit-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: rgba(7, 35, 25, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease);
}
.edit-backdrop.open { opacity: 1; }

/* The edit dialog: centred, scrollable, four language textareas. */
.edit-popover {
  position: fixed;
  z-index: var(--z-panel);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%) scale(0.98);
  width: min(560px, 92vw);
  max-height: min(88vh, 720px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  padding: clamp(1.2rem, 3vw, 1.8rem);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease-out);
}
.edit-popover.open { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }

.edit-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}
.edit-popover-title { font-size: var(--fs-xl); color: var(--green); margin: 0; }
.edit-popover-close {
  flex: none;
  width: 34px; height: 34px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface-tint);
  color: var(--green);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.edit-popover-close:hover { background: var(--green); color: var(--cream); border-color: var(--green); }

.edit-fields { display: flex; flex-direction: column; gap: 1rem; }
.edit-field { display: block; }
.edit-field-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--green-700);
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}
.edit-field-label[lang="ar"] { font-family: var(--sans-ar); }
.edit-field-label[lang="am"] { font-family: var(--sans-am); }
.edit-textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  background: var(--surface-tint);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 0.6rem 0.8rem;
  line-height: 1.55;
  resize: vertical;
  min-height: 3rem;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.edit-textarea[lang="ar"] { font-family: var(--sans-ar); }
.edit-textarea[lang="am"] { font-family: var(--sans-am); }
.edit-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 149, 47, 0.18);
}

.edit-status { font-size: var(--fs-sm); margin: 0.8rem 0 0; min-height: 1.2em; }
.edit-status.err { color: var(--terracotta); }

.edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

/* RTL: mirror the header and action row for Arabic. */
[dir="rtl"] .edit-actions { justify-content: flex-start; }
[dir="rtl"] .edit-field-label { text-align: right; }

@media (prefers-reduced-motion: reduce) {
  .edit-popover, .edit-backdrop { transition-duration: 0.001ms !important; }
}
