/* KHALDOUN — the Library and its articles in the main site's look (brief 261025 Phase 2; mockup
   approved 25 Oct 2026). Loaded after /style.css and /shell.css on the Library landing, the room
   pages and every article. Tokens follow the /cacao page: dark canvas, bone text, gold labels and
   buttons, Cormorant Garamond headings, Inter text; light mode maps onto /colours.css (--kh-*).
   Class prefix lx-. The article components (shortcodes) keep their lib-* classes. */
.lx {
  --lx-bg: #0d0d0b; --lx-bg-alt: #111109; --lx-card: #161613; --lx-band: #1a1a16;
  --lx-text: #f1ece5; --lx-soft: rgba(241,236,229,.82); --lx-muted: #a8a49b; --lx-dim: #6b6760;
  --lx-accent: #c9a96e; --lx-accent-dim: #8c7247;
  --lx-line: rgba(201,169,110,.15); --lx-line-soft: rgba(240,236,228,.08);
  --lx-head: 'Cormorant Garamond', Georgia, serif; --lx-body: 'Inter', system-ui, sans-serif;
  --page-accent: #c9a96e;
  background: var(--lx-bg); color: var(--lx-text);
}
:root[data-theme="light"] .lx {
  --lx-bg: var(--kh-bg); --lx-bg-alt: #ece4d9; --lx-card: var(--kh-surface); --lx-band: var(--kh-bg-alt);
  --lx-text: var(--kh-fg); --lx-soft: var(--kh-fg-soft); --lx-muted: var(--kh-muted); --lx-dim: rgba(35,31,32,.55);
  --lx-accent: var(--kh-accent); --lx-accent-dim: var(--kh-accent);
  --lx-line: var(--kh-line); --lx-line-soft: var(--kh-line-soft); --page-accent: var(--kh-accent);
}
/* Photo areas stay dark in both modes, as on /cacao. */
:root[data-theme="light"] .lx :is(.lx-hero, .lx-band) {
  --lx-text: #f1ece5; --lx-soft: rgba(241,236,229,.86); --lx-muted: #cfc8be; --lx-accent: #c9a96e;
}


.lx-label { display: block; font: 500 .65rem/1.4 var(--lx-body); letter-spacing: .2em; text-transform: uppercase; color: var(--lx-accent); margin-bottom: 1rem; }
.lx-meta { font: 400 .68rem/1.6 var(--lx-body); letter-spacing: .16em; text-transform: uppercase; color: var(--lx-muted); }
.lx-cta { display: inline-flex; gap: .5rem; font: 400 .78rem/1.4 var(--lx-body); letter-spacing: .15em; text-transform: uppercase;
  color: var(--lx-accent); border-bottom: 1px solid var(--lx-accent-dim); padding-bottom: 2px; text-decoration: none; }
.lx-cta:hover { color: var(--lx-text); border-color: var(--lx-text); }
.lx-btn { display: inline-block; font: 400 .75rem/1 var(--lx-body); letter-spacing: .18em; text-transform: uppercase;
  color: #0d0d0b; background: var(--lx-accent); padding: 1rem 2.5rem; text-decoration: none; }
:root[data-theme="light"] .lx .lx-btn { color: #f1ece5; }

/* ── Hero: full-bleed photograph, centred title (as /cacao and /munduk) ── */
.lx-hero { position: relative; min-height: min(82vh, 760px); display: grid; place-items: center; text-align: center;
  overflow: hidden; background: #080806; color: var(--lx-text); }
.lx-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.lx-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,8,6,.35) 0%, rgba(8,8,6,.15) 45%, rgba(13,13,11,.95) 100%); }
.lx-hero__body { position: relative; z-index: 1; padding: 7rem 1.5rem 5rem; max-width: 900px; }
.lx-crumb { font: 400 .65rem/1 var(--lx-body); letter-spacing: .2em; text-transform: uppercase; color: var(--lx-muted); margin-bottom: 2rem; }
.lx-crumb a { color: inherit; text-decoration: none; } .lx-crumb a:hover { color: var(--lx-text); }
.lx-crumb span { margin: 0 .7em; opacity: .6; }
.lx-hero h1 { font: 300 clamp(2.6rem, 6vw, 4.8rem)/1.08 var(--lx-head); letter-spacing: .005em; margin: 0 0 1.4rem; color: var(--lx-text); }
.lx-hero .lx-sub { font: italic 400 clamp(1.1rem, 1.7vw, 1.4rem)/1.5 var(--lx-head); color: var(--lx-muted); max-width: 40rem; margin: 0 auto 1.6rem; }

/* ── Reading view ── */
.lx-read { padding: 5rem 0 6rem; }   /* no side padding: it is the full-width container */
.lx-col, .lx-faq, .lx-foot { max-width: calc(680px + 3rem); padding-left: 1.5rem; padding-right: 1.5rem; margin-left: auto; margin-right: auto; }
.lx-standfirst { font: italic 400 clamp(1.25rem, 2vw, 1.55rem)/1.55 var(--lx-head); color: var(--lx-muted); text-align: center;
  padding-bottom: 2.6rem; margin-bottom: 3rem; border-bottom: 1px solid var(--lx-line); }
.lx-article h2 { font: 400 clamp(1.7rem, 2.6vw, 2.3rem)/1.2 var(--lx-head); color: var(--lx-text); margin: 3.6rem 0 1.2rem; }
.lx-article h2:first-child { margin-top: 0; }
.lx-article h3 { font: 400 clamp(1.3rem, 2vw, 1.6rem)/1.3 var(--lx-head); color: var(--lx-text); margin: 2.4rem 0 .8rem; }
.lx-article p, .lx-article li { font-size: 1.0625rem; line-height: 1.85; color: var(--lx-soft); }
.lx-article p + p { margin-top: 1.2em; }
.lx-article > p:first-child::first-letter, .lx-article > h2:first-child + p::first-letter { float: left; font: 400 4.2em/.82 var(--lx-head); color: var(--lx-accent); margin: .08em .1em 0 0; }
.lx-article strong { font-weight: 500; color: var(--lx-text); }
.lx-article em { font-style: italic; }
.lx-article a { color: var(--lx-accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.lx-article ul, .lx-article ol { margin: 1.2em 0 1.2em 1.3em; } .lx-article li + li { margin-top: .5em; }
.lx-article li::marker { color: var(--lx-accent); }

/* The article components (shortcodes) in this look */
.lx-article .lib-lead { font: 400 clamp(1.3rem, 2vw, 1.55rem)/1.55 var(--lx-head); color: var(--lx-text); }
.lx-article .lib-callout { background: var(--lx-card); border-left: 2px solid var(--lx-accent); padding: 1.4rem 1.6rem; margin: 2.2rem 0; }
.lx-article .lib-callout p { font-size: 1rem; }
.lx-article .lib-quote { margin: 2.4rem 0; padding-left: 1.6rem; border-left: 1px solid var(--lx-line); }
.lx-article .lib-quote p { font: italic 400 1.35rem/1.55 var(--lx-head); color: var(--lx-text); }
.lx-article cite { display: block; margin-top: .8rem; font: normal 400 .68rem/1.4 var(--lx-body); letter-spacing: .16em; text-transform: uppercase; color: var(--lx-muted); }
.lx-article .lib-pull { margin: 3.4rem -2rem; text-align: center; padding: 2.4rem 0; border-top: 1px solid var(--lx-line); border-bottom: 1px solid var(--lx-line); }
.lx-article .lib-pull p { font: italic 300 clamp(1.7rem, 3vw, 2.4rem)/1.3 var(--lx-head); color: var(--lx-text); }
.lx-article figure { margin: 2.6rem 0; }
.lx-article figure img { width: 100%; height: auto; }
.lx-article figcaption { margin-top: .7rem; font: 400 .72rem/1.5 var(--lx-body); letter-spacing: .06em; color: var(--lx-muted); }
/* Full width = the reading area's width, which excludes the scrollbar (100vw includes it: on Windows
   the page then scrolled sideways). .lx-read is a size container, so 100cqi is its inner width. */
.lx-read { container-type: inline-size; overflow-x: clip; }
.lx-article .lib-fullbleed { width: 100cqi; position: relative; left: 50%; margin-left: -50cqi; }
@supports not (width: 1cqi) { .lx-article .lib-fullbleed { width: 100%; left: 0; margin-left: 0; } }
.lx-article .lib-fullbleed figcaption { max-width: 680px; margin: .7rem auto 0; padding: 0 1.5rem; }
.lx-article .lib-multi { display: grid; gap: .8rem; margin: 2.6rem 0; }
.lx-article .lib-multi--2 { grid-template-columns: 1fr 1fr; } .lx-article .lib-multi--3 { grid-template-columns: repeat(3, 1fr); }
.lx-article .lib-multi figure, .lx-article .lib-gallery figure { margin: 0; }
.lx-article .lib-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin: 2.6rem 0; }
.lx-article .lib-divider { border: 0; height: 1rem; margin: 3rem auto; width: 5rem; background:
  linear-gradient(var(--lx-accent), var(--lx-accent)) center / 100% 1px no-repeat; position: relative; }
.lx-article .lib-divider::after { content: "◆"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -52%);
  font-size: .55rem; color: var(--lx-accent); background: var(--lx-bg); padding: 0 .6rem; }
.lx-article .lib-audio audio { width: 100%; }
.lx-article .lib-video { position: relative; aspect-ratio: 16 / 9; margin: 2.6rem 0; background: #080806; }
.lx-article .lib-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.lx-article .lib-cta { display: block; background: var(--lx-card); border: 1px solid var(--lx-line); padding: 1.8rem 2rem; margin: 2.8rem 0;
  text-decoration: none; text-align: center; }
.lx-article .lib-cta-text { display: block; font: 400 1.6rem/1.25 var(--lx-head); color: var(--lx-text); }
.lx-article .lib-cta-sub { display: block; margin-top: .6rem; font: 400 .72rem/1.4 var(--lx-body); letter-spacing: .16em; text-transform: uppercase; color: var(--lx-accent); }
.lx-article .lib-btn { display: inline-block; margin: 1rem 0; font: 400 .75rem/1 var(--lx-body); letter-spacing: .18em; text-transform: uppercase;
  color: #0d0d0b; background: var(--lx-accent); padding: 1rem 2.5rem; text-decoration: none; }
:root[data-theme="light"] .lx .lx-article .lib-btn { color: #f1ece5; }

.lx-faq { margin-top: 4rem; }
.lx-faq h2 { font: 400 1.8rem/1.2 var(--lx-head); margin-bottom: 1rem; }
.lx-faq details { border-bottom: 1px solid var(--lx-line); padding: 1rem 0; }
.lx-faq summary { cursor: pointer; font: 400 1.25rem/1.4 var(--lx-head); list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.lx-faq summary::after { content: "+"; color: var(--lx-accent); font-family: var(--lx-body); }
.lx-faq details[open] summary::after { content: "–"; }
.lx-faq details div { margin-top: .6rem; color: var(--lx-soft); line-height: 1.8; }

.lx-foot { margin-top: 4.5rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding-top: 2rem; border-top: 1px solid var(--lx-line); }

/* ── Cards (related articles, On the Table) ── */
.lx-section { padding: 6rem 1.5rem; }
.lx-section--band { background: var(--lx-band); }
.lx-section__head { text-align: center; max-width: 680px; margin: 0 auto 3rem; }
.lx-section__head h2 { font: 400 clamp(2rem, 3.5vw, 3rem)/1.2 var(--lx-head); }
.lx-section__head p { margin-top: 1rem; color: var(--lx-muted); font-size: .95rem; line-height: 1.8; }
.lx-cards { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.4rem; }
.lx-card { background: var(--lx-card); border: 1px solid var(--lx-line-soft); text-decoration: none; color: var(--lx-text); display: flex; flex-direction: column; transition: border-color .3s; }
.lx-card:hover { border-color: var(--lx-accent-dim); }
.lx-card img { aspect-ratio: 4 / 3; object-fit: cover; }
.lx-card__body { padding: 1.4rem 1.5rem 1.6rem; }
.lx-card h3 { font: 400 1.5rem/1.25 var(--lx-head); margin: 0 0 .6rem; }
.lx-card p { font-size: .9rem; line-height: 1.7; color: var(--lx-muted); }
.lx-card .lx-meta { display: block; margin-top: 1rem; }

/* ── Library landing ── */
.lx-intro { padding: 6rem 1.5rem; text-align: center; }
.lx-intro p { max-width: 680px; margin: 0 auto; font: 400 clamp(1.25rem, 2vw, 1.5rem)/1.65 var(--lx-head); color: var(--lx-soft); }
.lx-band { position: relative; min-height: 62vh; display: grid; place-items: center; text-align: center; overflow: hidden; background: #080806; color: var(--lx-text); }
.lx-band > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.lx-band__body { position: relative; z-index: 1; padding: 4rem 1.5rem; max-width: 760px; }
.lx-band h2 { font: 300 clamp(2.4rem, 5vw, 4rem)/1.1 var(--lx-head); margin-bottom: 1rem; }
.lx-band p { font: italic 400 clamp(1.1rem, 1.6vw, 1.35rem)/1.5 var(--lx-head); color: var(--lx-muted); }
.lx-room { padding: 4.5rem 1.5rem 6rem; }
.lx-room__inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 3rem; }
.lx-room__aside p { color: var(--lx-soft); line-height: 1.8; }
.lx-shelves { list-style: none; margin: 1.6rem 0 2rem; }
.lx-shelves li { border-top: 1px solid var(--lx-line-soft); padding: .7rem 0; font: 400 1.2rem/1.3 var(--lx-head); display: flex; justify-content: space-between; }
.lx-shelves li span { font: 400 .68rem/2 var(--lx-body); letter-spacing: .16em; text-transform: uppercase; color: var(--lx-muted); }
.lx-list { list-style: none; }
.lx-list a { display: grid; grid-template-columns: 1fr auto; gap: .3rem 1.5rem; padding: 1.3rem 0; border-top: 1px solid var(--lx-line-soft); text-decoration: none; color: var(--lx-text); }
.lx-list a:hover h3 { color: var(--lx-accent); }
.lx-list h3 { font: 400 1.45rem/1.25 var(--lx-head); transition: color .2s; }
.lx-list p { grid-column: 1 / -1; font-size: .9rem; color: var(--lx-muted); line-height: 1.6; }
.lx-list .lx-meta { align-self: center; }
.lx-soon { border: 1px dashed var(--lx-line); padding: 1.6rem; text-align: center; }
.lx-soon p { font: italic 400 1.25rem/1.5 var(--lx-head); color: var(--lx-muted); }

@media (max-width: 760px) {
  .lx-hero__body { padding: 6rem 1.25rem 4rem; }
  .lx-read { padding: 3.5rem 0 4.5rem; }
  .lx-col, .lx-faq, .lx-foot { padding-left: 1.25rem; padding-right: 1.25rem; }
  .lx-article .lib-pull { margin: 2.6rem 0; }
  .lx-article .lib-multi--3 { grid-template-columns: 1fr 1fr; }
  .lx-section { padding: 4.5rem 1.25rem; }
  .lx-room__inner { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ── Room pages ── */
.lx-shelf { max-width: 1100px; margin: 0 auto; padding: 0 0 4rem; scroll-margin-top: 80px; }
.lx-shelf__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--lx-line); padding-bottom: .9rem; margin-bottom: 1.6rem; }
.lx-shelf__head h2 { font: 400 clamp(1.8rem, 3vw, 2.4rem)/1.2 var(--lx-head); }
.lx-shelf__head p { color: var(--lx-muted); font-size: .9rem; }
.lx-others { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.lx-other { display: block; padding: 1.4rem 1.5rem; border: 1px solid var(--lx-line-soft); background: var(--lx-card); color: var(--lx-text); text-decoration: none; }
a.lx-other:hover { border-color: var(--lx-accent-dim); }
.lx-other h3 { font: 400 1.5rem/1.25 var(--lx-head); margin-top: .2rem; }
.lx-other .lx-meta { display: block; margin-top: .6rem; }
.lx-room-anchor { scroll-margin-top: 80px; }
