/* ==========================================================================
   Tibetan Buddhism (buddhism.html) and The Buddha (buddha.html)
   Components ported from the sister site and redrawn with the TMBCC tokens in style.css.
   Loaded after style.css by those two pages only.
   ========================================================================== */

/* ---------- hero ---------- */
.phero--bud { min-height: min(84svh, 820px); }
.phero--bud::before { background: linear-gradient(180deg, rgba(10, 16, 40, .55) 0%, rgba(10, 16, 40, .12) 38%, rgba(12, 14, 26, .9) 100%); }
.phero--bud h1 { font-size: var(--t-hero); line-height: .98; max-width: none; margin-bottom: .6rem; text-shadow: 0 4px 40px rgba(0, 0, 0, .35); }
.phero--bud h1 .line { display: block; overflow: hidden; padding-bottom: .06em; }
.phero--bud h1 .line > span { display: inline-block; }
html:lang(mn) .phero--bud h1 { font-size: clamp(2.6rem, 1.3rem + 4.8vw, 5.6rem); }
html:lang(bo) .phero--bud h1 { font-size: clamp(2.1rem, 1.2rem + 3.4vw, 4.2rem); line-height: 1.3; }
.phero--bud .phero__tib { font: 400 clamp(1.2rem, 1rem + .9vw, 1.7rem)/1.6 var(--f-tib); color: var(--gold-hi); margin: 0 0 .9rem; letter-spacing: 0; }
html:lang(bo) .phero--bud .phero__tib { display: none; }   /* the heading already is this line */
.phero--bud .phero__sub { font: 700 var(--t-xs)/1.4 var(--f-body); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-hi); margin-bottom: .9rem; }
html:lang(mn) .phero--bud .phero__sub { letter-spacing: .12em; }
html:lang(bo) .phero--bud .phero__sub { font: 400 1.05rem/1.6 var(--f-tib); letter-spacing: 0; text-transform: none; }
.phero--bud .phero__cap { position: absolute; right: max(var(--gutter), (100% - var(--wrap)) / 2); bottom: clamp(1.2rem, 3vh, 2rem); max-width: 30ch; margin: 0; text-align: right; font-size: .76rem; line-height: 1.45; font-style: italic; color: rgba(255, 248, 236, .62); }
html:lang(bo) .phero--bud .phero__cap { font-style: normal; font-size: .85rem; }

/* ---------- article with sticky contents ---------- */
.bud-layout { display: grid; grid-template-columns: minmax(190px, 250px) minmax(0, 780px); justify-content: center; gap: clamp(2rem, 6vw, 6rem); align-items: start; position: relative; z-index: 1; }
.bud-aside { position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; }
.bud-aside__t { font: 700 var(--t-xs)/1 var(--f-body); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-deep); margin: 0 0 1rem; }
html:lang(mn) .bud-aside__t { letter-spacing: .14em; }
html:lang(bo) .bud-aside__t { font: 400 .95rem/1.4 var(--f-tib); letter-spacing: 0; text-transform: none; }
.toc { list-style: none; padding: 0; margin: 0; display: grid; gap: .1rem; border-left: 1px solid var(--line); }
.toc a { display: block; padding: .5rem 0 .5rem 1rem; margin-left: -1px; border-left: 2px solid transparent; text-decoration: none; font-size: .93rem; line-height: 1.35; color: var(--ink-soft); transition: color .3s, border-color .3s, padding-left .45s var(--ease-out); }
.toc a:hover { color: var(--red); }
.toc a.is-active { color: var(--maroon); border-color: var(--gold); padding-left: 1.25rem; font-weight: 700; }
html:lang(bo) .toc a { font-size: 1rem; line-height: 1.5; padding-block: .4rem; }
html:lang(bo) .toc a.is-active { font-weight: 400; }

.bud-prose > h2:first-child { margin-top: 0; }
.bud-prose h2 {  }
html:lang(bo) .bud-prose { font-size: 1.12rem; }
html:lang(bo) .bud-prose h2 { font-size: clamp(1.6rem, 1.25rem + 1.2vw, 2.3rem); }

/* Four Noble Truths */
.truths { list-style: none; counter-reset: t; padding: 0; margin: 1.6rem 0 1.4rem; display: grid; gap: .8rem; }
.prose .truths li { counter-increment: t; display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: .15rem 1rem; margin: 0; padding: 1.05rem 1.2rem; border-radius: var(--r-m); background: var(--khata); box-shadow: 0 1px 0 var(--line), var(--shadow-s); }
.truths li::before { content: counter(t); grid-row: span 2; width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; background: var(--maroon); color: var(--gold-hi); font: 600 1.25rem/1 var(--f-display); }
.truths b { font: 600 1.3rem/1.25 var(--f-display); color: var(--maroon); }
.truths span { font-size: .98rem; line-height: 1.6; color: var(--ink-soft); }

/* Noble Eightfold Path */
.path8 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin: 0 0 2rem; }
.path8__group { position: relative; overflow: hidden; padding: 1.2rem 1.3rem 1.3rem; border-radius: var(--r-m); background: var(--night); color: #EDE6D6; }
.path8__group::after { content: ""; position: absolute; right: -36px; top: -36px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(closest-side, rgba(242, 210, 138, .2), transparent); }
.prose .path8__group h3 { font-size: 1.3rem; margin: 0 0 .55rem; color: var(--gold-hi); }
.prose .path8__group ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
.prose .path8__group li { margin: 0; font-size: .96rem; line-height: 1.45; color: rgba(237, 230, 214, .88); }
.path8__group li::before { content: "◦ "; color: var(--gold); }

/* Nalanda masters */
.prose .masters { list-style: none; padding: 0; margin: 1.4rem 0 2rem; border-top: 1px solid var(--line); }
.prose .masters li { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1rem; margin: 0; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.masters b { font: 600 1.25rem/1.3 var(--f-display); color: var(--maroon); }
.masters span { font-size: .98rem; line-height: 1.55; color: var(--ink-soft); }

/* figures */
.prose figure[data-lb] { cursor: zoom-in; }
.prose figure img { width: 100%; }
.fig-pair { max-width: 26rem; margin-inline: auto !important; text-align: center; }
.fig-pair img { box-shadow: var(--shadow); }
.figrow { display: grid; grid-template-columns: 1.35fr 1fr; gap: 1.2rem; margin: 2.2rem 0; align-items: start; }
.prose .figrow figure { margin: 0; }
.figrow img { aspect-ratio: 4 / 3; object-fit: cover; }
.figrow figure:last-child img { aspect-ratio: 3 / 4; object-position: 50% 30%; }
.prose figcaption { font-style: italic; line-height: 1.5; }
html:lang(bo) .prose figcaption { font-style: normal; font-size: .9rem; }

/* four schools */
.schools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin: 1.2rem 0 2rem; }
.schools > div { display: grid; align-content: start; gap: .35rem; padding: 1.15rem 1.25rem; border-radius: var(--r-m); background: var(--khata); box-shadow: 0 1px 0 var(--line), var(--shadow-s); transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out); }
.schools > div:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--gold), var(--shadow); }
.schools b { font: 600 1.35rem/1.2 var(--f-display); color: var(--maroon); }
.schools span { font-size: .96rem; line-height: 1.55; color: var(--ink-soft); }
.schools > div:last-child { background: var(--night); box-shadow: none; }
.schools > div:last-child b { color: var(--gold-hi); }
.schools > div:last-child span { color: rgba(237, 230, 214, .84); }

/* Tibetan / Mongolian names in display faces */
html:lang(bo) .truths b, html:lang(bo) .masters b, html:lang(bo) .schools b { font-family: var(--f-tib); font-weight: 400; font-size: 1.15rem; line-height: 1.55; }
html:lang(bo) .truths li::before { font-family: var(--f-display); }
html:lang(bo) .prose .path8__group h3 { font-size: 1.15rem; }
html:lang(bo) .truths span, html:lang(bo) .masters span, html:lang(bo) .schools span { line-height: 1.8; }
html:lang(mn) .prose .masters li { grid-template-columns: 10.5rem minmax(0, 1fr); }

/* ---------- The Buddha: life timeline (words, not years) ---------- */
.timeline.btl { margin: 1.8rem 0 2.4rem; }
.timeline.btl::before { left: 9.6rem; top: .6rem; bottom: .6rem; width: 2px; margin-left: -1px; }
.prose .btl > li { position: relative; display: grid; grid-template-columns: 8.4rem minmax(0, 1fr); gap: 2.4rem; margin: 0; padding: 0 0 1.1rem; color: inherit; }
.btl > li::before { content: ""; position: absolute; left: calc(9.6rem - 7px); top: 1.15rem; width: 14px; height: 14px; transform: rotate(45deg); background: var(--paper); border: 2px solid var(--gold); }
.btl time { padding-top: .75rem; text-align: right; font: 600 1.3rem/1.2 var(--f-display); color: var(--red); overflow-wrap: anywhere; hyphens: auto; }
.btl > li > div { padding: .95rem 1.25rem 1.05rem; border-radius: var(--r-m); background: var(--khata); box-shadow: 0 1px 0 var(--line); }
.prose .btl h3 { font-size: 1.3rem; margin: 0 0 .3rem; }
.prose .btl p { margin: 0; font-size: .97rem; line-height: 1.6; color: var(--ink-soft); }
html:lang(bo) .btl time { font: 400 1rem/1.5 var(--f-tib); padding-top: .85rem; }
html:lang(bo) .prose .btl h3 { font-size: 1.15rem; }
html:lang(mn) .btl time { font-size: 1.15rem; }

/* twelve deeds */
.deeds { counter-reset: d; list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.6rem; }
.prose .deeds li { counter-increment: d; display: flex; gap: .9rem; align-items: baseline; margin: 0; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: 1.02rem; line-height: 1.45; }
.deeds li::before { content: counter(d, decimal-leading-zero); flex: none; min-width: 1.9rem; font: 600 1.15rem/1 var(--f-display); color: var(--gold-deep); }

/* ---------- quote band ---------- */
.quote-band { text-align: center; }
.quote-band .wrap--narrow { position: relative; z-index: 1; }
.quote-band svg.quote-band__mark { width: 46px; height: 46px; margin: 0 auto 1.2rem; color: var(--gold); }
.quote-band blockquote { margin: 0; }
.quote-band p { margin: 0 0 1.3rem; font: italic 500 clamp(1.5rem, 1.05rem + 1.8vw, 2.5rem)/1.32 var(--f-display); color: #FFF8EC; text-wrap: balance; }
.quote-band cite { font: 700 var(--t-xs)/1.5 var(--f-body); font-style: normal; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-hi); }
html:lang(mn) .quote-band p { font-size: clamp(1.35rem, 1rem + 1.4vw, 2.1rem); }
html:lang(mn) .quote-band cite { letter-spacing: .1em; }
html:lang(bo) .quote-band p { font: 400 clamp(1.2rem, 1rem + 1vw, 1.75rem)/1.75 var(--f-tib); }
html:lang(bo) .quote-band cite { font: 400 1rem/1.5 var(--f-tib); letter-spacing: 0; text-transform: none; }

/* ---------- eight auspicious symbols ---------- */
.syms { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.syms > li { display: flex; }
.sym { position: relative; isolation: isolate; overflow: hidden; width: 100%; min-height: 15.5rem; display: grid; justify-items: center; align-content: start; gap: .35rem; padding: 1.7rem 1.1rem 1.3rem; border: 0; border-radius: var(--r-l); background: var(--khata); box-shadow: 0 1px 0 var(--line), var(--shadow-s); text-align: center; transition: box-shadow .5s var(--ease-out), transform .5s var(--ease-out); }
.sym::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 50% 28%, rgba(242, 210, 138, .38), transparent 62%); opacity: 0; transition: opacity .6s var(--ease); }
.sym__icon { width: 74px; height: 74px; color: var(--gold-deep); transition: transform .8s var(--ease-out), color .4s; }
.sym__icon--knot { padding: 4px; }
.sym b { margin-top: .35rem; font: 600 1.3rem/1.2 var(--f-display); color: var(--ink); }
.sym__tib { font: 400 1.05rem/1.6 var(--f-tib); color: var(--ink-mute); }
.sym__p { max-height: 0; opacity: 0; transform: translateY(8px); overflow: hidden; font-size: .93rem; line-height: 1.5; color: var(--ink-soft); transition: max-height .6s var(--ease-out), opacity .45s var(--ease), transform .6s var(--ease-out); }
.sym:hover, .sym[aria-expanded="true"] { transform: translateY(-4px); box-shadow: 0 0 0 1px var(--gold), var(--shadow); }
.sym:hover::before, .sym[aria-expanded="true"]::before { opacity: 1; }
.sym:hover .sym__icon, .sym[aria-expanded="true"] .sym__icon { transform: scale(.8) translateY(-4px); color: var(--red); }
.sym[aria-expanded="true"] .sym__p { max-height: 16rem; opacity: 1; transform: none; }
@media (hover: hover) { .sym:hover .sym__p { max-height: 16rem; opacity: 1; transform: none; } }
html:lang(bo) .sym b { font: 400 1.15rem/1.5 var(--f-tib); }
html:lang(bo) .sym__tib { display: none; }   /* same words as the name */
html:lang(bo) .sym__p { font-size: .98rem; line-height: 1.75; }

/* ---------- practice cards ---------- */
.bud-ways .way { display: flex; flex-direction: column; }
.bud-ways .way p { flex: 1; }
.bud-ways .way .link-arrow svg { width: 18px; height: 18px; margin: 0; color: inherit; }
.flag-chips { display: flex; gap: 5px; height: 36px; margin-bottom: .8rem; }
.flag-chips i { width: 24px; height: 32px; border-radius: 2px 2px 5px 5px; box-shadow: inset 0 0 0 1px rgba(43, 26, 16, .14); transform-origin: top; animation: flag 4.5s ease-in-out infinite; }
.flag-chips i:nth-child(2) { animation-delay: -.6s; } .flag-chips i:nth-child(3) { animation-delay: -1.2s; }
.flag-chips i:nth-child(4) { animation-delay: -1.8s; } .flag-chips i:nth-child(5) { animation-delay: -2.4s; }
@keyframes flag { 0%, 100% { transform: skewX(0); } 50% { transform: skewX(-6deg); } }

/* ---------- The Buddha: four places, Saga Dawa note ---------- */
.places--4 .place { grid-column: span 3; min-height: 440px; margin: 0; }
.places--4 .place h3 { font-size: 1.6rem; }
html:lang(bo) .places--4 .place h3 { font-size: 1.3rem; }
html:lang(bo) .places--4 .place p { line-height: 1.7; }
.buddha-note { margin-top: 2.6rem; max-width: 48rem; padding-left: 1.4rem; border-left: 3px solid var(--gold); }
.buddha-note p { margin: 0 0 .6rem; font: italic 500 1.3rem/1.5 var(--f-display); color: var(--ink-soft); }
html:lang(bo) .buddha-note p { font: 400 1.08rem/1.8 var(--f-tib); }

/* ---------- next steps ---------- */
.bud-next--flush { padding-top: 0; }
.cta-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.cta-card { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: .7rem; padding: clamp(1.7rem, 4vw, 2.8rem); border-radius: var(--r-l); background: var(--khata); box-shadow: 0 1px 0 var(--line), var(--shadow-s); transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out); }
.cta-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cta-card h3 { font-size: var(--t-lg); margin: 0; }
.cta-card p { margin: 0 0 .6rem; color: var(--ink-soft); }
.cta-card .btn { margin-top: auto; }
.cta-card--dark { background: var(--night); color: #EDE6D6; box-shadow: none; }
.cta-card--dark::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(closest-side, rgba(242, 210, 138, .18), transparent); pointer-events: none; }
.cta-card--dark h3 { color: #FFF8E8; }
.cta-card--dark p { color: rgba(237, 230, 214, .78); }

/* ---------- image credits ---------- */
.credits-sec { padding-top: 0; padding-bottom: calc(var(--section) * .6); }
.credits { max-width: 46rem; font-size: .86rem; color: var(--ink-mute); }
.credits summary { cursor: pointer; padding: .4rem 0; font-weight: 700; color: var(--ink-soft); }
.credits summary:hover { color: var(--red); }
.credits ul { margin: .6rem 0 0; padding-left: 1.2rem; display: grid; gap: .35rem; }
html:lang(bo) .credits summary { font: 400 1rem/1.6 var(--f-tib); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .syms { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
  .places--4 .place { grid-column: span 6; min-height: 380px; }
}
@media (max-width: 1024px) {
  .bud-layout { grid-template-columns: minmax(0, 1fr); gap: 1.8rem; justify-content: stretch; }
  .bud-prose { max-width: 780px; }
  .bud-aside { position: static; min-width: 0; }
  .bud-aside__t { display: none; }
  /* contents become a row of chips you can swipe */
  .toc { display: flex; gap: .45rem; overflow-x: auto; border: 0; margin-inline: calc(-1 * var(--gutter)); padding: .2rem var(--gutter) .6rem; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent 100%); }
  .toc::-webkit-scrollbar { display: none; }
  .toc li { flex: none; }
  .toc a, .toc a.is-active { margin: 0; padding: .5rem .95rem; border: 1px solid var(--line); border-radius: 999px; background: var(--khata); font-size: .86rem; white-space: nowrap; }
  .toc a.is-active { border-color: var(--gold); color: var(--maroon); }
  html:lang(bo) .toc a { padding-block: .35rem; font-size: .95rem; }
  .syms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .path8 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .phero--bud { min-height: min(88svh, 760px); }
  .phero--bud .phero__cap { position: static; text-align: left; max-width: none; margin-top: 1.2rem; }
  .cta-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .phero--bud .phero__in { padding-bottom: 2rem; }
  .phero--bud p:not(.phero__cap):not(.phero__tib):not(.phero__sub) { font-size: 1.04rem; }
  .figrow, .schools, .deeds { grid-template-columns: minmax(0, 1fr); }
  .prose .masters li, html:lang(mn) .prose .masters li { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
  .prose .truths li { grid-template-columns: 2.2rem minmax(0, 1fr); gap: .1rem .85rem; padding: .95rem 1rem; }
  .truths li::before { width: 2.1rem; height: 2.1rem; font-size: 1.1rem; }
  .figrow figure:last-child img { aspect-ratio: 4 / 3; }
  .sym { min-height: 12.5rem; padding: 1.25rem .7rem 1.05rem; }
  .sym__icon { width: 56px; height: 56px; }
  .sym b { font-size: 1.12rem; }
  html:lang(bo) .sym b { font-size: 1.02rem; }
  .sym__p { font-size: .88rem; }
  .timeline.btl::before { left: 7px; }
  .prose .btl > li { grid-template-columns: minmax(0, 1fr); gap: .35rem; padding-left: 1.9rem; }
  .btl > li::before { left: 0; top: .3rem; }
  .btl time, html:lang(bo) .btl time { padding-top: 0; text-align: left; font-size: 1.1rem; }
  html:lang(bo) .btl time { font-size: 1rem; }
  .btl > li > div { padding: .85rem 1rem .95rem; }
  .places--4 .place { grid-column: span 12; min-height: 300px; }
  .quote-band svg.quote-band__mark { width: 38px; height: 38px; }
  .buddha-note { padding-left: 1rem; }
  .buddha-note p { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sym, .sym__icon, .sym__p, .schools > div, .cta-card, .toc a { transition: none; }
  .flag-chips i { animation: none; }
}

/* teachings cards: keep titles clear of the big numerals */
.bud-pillars .pillar h3 { padding-right: 2.8rem; }
html:lang(bo) .bud-pillars .pillar h3 { font-size: 1.2rem; }
