/* The Family Tree of Christianity — /traditions.
   A museum-quality parchment-and-gold exhibit: textured canvas, misty
   mountains, a gold sunrise, ornate double-bordered plaque cards, and
   glowing gold-leaf branches. Desktop is a wide poster; mobile becomes a
   vertical timeline (not a squeezed chart). Colors hardcoded to the
   site's antique palette. */

.tr-page {
  position: relative;
  min-height: 100vh;
  padding: 0 0 70px;
  color: #3a3327;
  font-family: 'Cormorant Garamond', serif;
  background: transparent; /* let the site's own background show through */
}

/* The decorative parchment/mountain layer is disabled so the site's real
   background shows behind the cards. Kept in the markup in case it's wanted
   again later. */
.tr-bg { display: none; }
.tr-bg-legacy { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.tr-bg-rays {
  position: absolute; inset: 0;
  background: radial-gradient(closest-side at 90% 5%, rgba(255,240,198,0.6), rgba(255,240,198,0.18) 45%, transparent 70%);
}
.tr-bg-sun {
  position: absolute; top: 34px; right: 60px; width: 64px; height: 64px; color: #caa350;
  opacity: 0.85;
}
.tr-bg-sun svg { width: 100%; height: 100%; }
.tr-bg-mtn { position: absolute; bottom: 0; width: 40%; max-width: 620px; height: auto; opacity: 0.5; }
.tr-bg-mtn--l { left: 0; }
.tr-bg-mtn--r { right: 0; transform: scaleX(-1); }
.tr-bg-mist {
  position: absolute; left: 0; right: 0; bottom: 0; height: 46%;
  background: linear-gradient(180deg, transparent, rgba(243,235,214,0.85) 78%, #ecdfbf);
}

.tr-hero, .tr-canvas-wrap, .tr-timeline, .tr-note,
#traditions-page > noscript { position: relative; z-index: 1; }

/* Hero */
.tr-hero { text-align: center; padding: 52px 20px 6px; }
.tr-hero-eyebrow {
  font-family: 'Cinzel', serif; font-size: 13px; letter-spacing: 0.34em;
  text-transform: uppercase; color: #a8823f; margin: 0 0 14px;
}
.tr-hero-title {
  font-family: 'Cinzel', serif; font-weight: 700; line-height: 1.06;
  font-size: clamp(32px, 5.4vw, 56px); margin: 0 0 6px;
  background: linear-gradient(180deg, #9a7a34 0%, #7a5e26 62%, #5f4a1e 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: #7a5e26;
  text-shadow: 0 1px 0 rgba(255,251,238,0.4);
}
.tr-hero-sub {
  font-size: clamp(17px, 2.4vw, 23px); font-style: italic; color: #6b5a34;
  margin: 0 auto; max-width: 640px;
}
.tr-flourish {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 18px auto 22px; max-width: 440px; color: #b8974e;
}
.tr-flourish::before, .tr-flourish::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, #c9a24e 40%, #c9a24e 60%, transparent);
}
.tr-flourish i { transform: translateY(1px); }

/* Search */
.tr-search-wrap {
  display: flex; align-items: center; gap: 10px; max-width: 460px; margin: 0 auto;
  background: rgba(251,246,234,0.92); border: 1.5px solid #b89a5c;
  box-shadow: 0 2px 10px rgba(90,70,30,0.08), inset 0 0 0 1px rgba(255,252,242,0.7);
  padding: 0 8px 0 14px;
}
.tr-search-wrap i { color: #a8823f; }
.tr-search {
  flex: 1; border: none; background: transparent; outline: none;
  font-family: 'Cormorant Garamond', serif; font-size: 18px; color: #3a3327; padding: 12px 4px;
}
.tr-search::placeholder { color: #a89a78; }
.tr-search-clear { border: none; background: transparent; color: #8a7f68; cursor: pointer; padding: 6px; line-height: 0; display: none; }
.tr-search-clear.show { display: inline-flex; }
.tr-hint { text-align: center; font-size: 16px; color: #7d7057; min-height: 24px; margin: 14px auto 0; padding: 0 16px; }
.tr-hint b { color: #a8823f; font-weight: 600; }

/* Legend + methodology row */
.tr-legend {
  display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center;
  margin: 10px auto 2px; padding: 0 16px; font-size: 14px; color: #6b6152;
}
.tr-legend span { display: inline-flex; align-items: center; gap: 7px; }
.tr-legend .dot { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,0.06); }
.tr-methodology-row { text-align: center; margin: 6px 0 0; }
.tr-methodology-btn {
  font-family: 'Cinzel', serif; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: #6b5a34; background: transparent; border: none; cursor: pointer;
  border-bottom: 1px solid #c9a24e; padding: 2px 2px 3px;
  display: inline-flex; align-items: center; gap: 6px;
}
.tr-methodology-btn:hover { color: #3a3327; border-color: #a8823f; }

/* Canvas */
.tr-canvas-wrap { overflow-x: auto; overflow-y: hidden; padding: 10px 0 4px; }
.tr-canvas { position: relative; }
.tr-connectors { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.tr-conn { fill: none; stroke: url(#tr-gold); stroke-width: 3; opacity: 0.9; stroke-linecap: round; }
.tr-conn-glow { fill: none; stroke: #f2dd9c; stroke-width: 9; opacity: 0.45; stroke-linecap: round; }
.tr-conn-influence { fill: none; stroke: #b39a5e; stroke-width: 2; opacity: 0.55; stroke-dasharray: 5 7; }
.tr-conn.lit { stroke: url(#tr-gold-bright); stroke-width: 4; opacity: 1; }
.tr-conn-glow.lit { stroke: #ffe9ab; stroke-width: 13; opacity: 0.8; }
.tr-conn.dim, .tr-conn-glow.dim, .tr-conn-influence.dim { opacity: 0.1; }

/* Plaque cards */
.tr-card {
  position: absolute; z-index: 2; box-sizing: border-box; min-height: 118px;
  background: linear-gradient(165deg, #faf3e2 0%, #f4ead0 62%, #efe2c4 100%);
  border: 1px solid #b8974e; border-radius: 7px;
  padding: 15px 16px 24px; text-align: center; cursor: pointer;
  box-shadow:
    inset 0 0 0 1px rgba(255,253,246,0.85),
    inset 0 0 0 4px #decb92,
    inset 0 1px 0 5px rgba(255,255,255,0.5),
    0 6px 18px rgba(90,68,28,0.16);
  transition: transform 150ms ease, box-shadow 180ms ease, opacity 180ms ease;
}
.tr-card::after {
  content: ''; position: absolute; left: 8px; right: 8px; top: 8px; bottom: 8px;
  border: 1px solid rgba(184,151,78,0.35); border-radius: 4px; pointer-events: none;
}
.tr-card:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px rgba(255,253,246,0.85), inset 0 0 0 4px #e6c96f, 0 12px 26px rgba(120,90,30,0.24); }
.tr-card-medallion {
  width: 40px; height: 40px; margin: 0 auto 8px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #a8823f;
  background: radial-gradient(circle at 40% 35%, #fbf4e2, #ecd9a9);
  box-shadow: inset 0 0 0 1px #d8bd7e, 0 1px 3px rgba(120,90,30,0.2);
}
.tr-card-medallion svg { width: 21px; height: 21px; }
.tr-card-name { font-family: 'Cinzel', serif; font-size: 15px; font-weight: 600; line-height: 1.16; color: #6b4f1e; margin: 0; }
.tr-card-name .num { color: #b8974e; }
.tr-card-date { font-family: 'Cinzel', serif; font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase; color: #a8823f; margin: 4px 0 7px; }
.tr-card-desc {
  font-size: 13.5px; line-height: 1.36; color: #5f5647; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tr-card-explore {
  position: absolute; left: 0; right: 0; bottom: 6px; margin: 0;
  font-family: 'Cinzel', serif; font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: #a8823f; opacity: 0; transition: opacity 150ms ease;
}
.tr-card:hover .tr-card-explore, .tr-card:focus-visible .tr-card-explore { opacity: 1; }

.tr-card--event { background: linear-gradient(165deg, #f6eed7 0%, #efe4c6 100%); }
.tr-card--event .tr-card-name { font-style: italic; }

.tr-card--outside {
  background: linear-gradient(165deg, #f4ebe1 0%, #eaddcf 100%); border-color: #b98f7e;
  box-shadow: inset 0 0 0 1px rgba(255,252,247,0.85), inset 0 0 0 4px #d9b8a6, 0 6px 18px rgba(90,50,30,0.14);
}
.tr-card--outside .tr-card-name { color: #7a4a3a; }
.tr-card--outside .tr-card-date { color: #9a6a5a; }
.tr-card--outside .tr-card-medallion { color: #9a6a5a; background: radial-gradient(circle at 40% 35%, #f7ece4, #e5c5b6); box-shadow: inset 0 0 0 1px #cfa892; }
.tr-card--outside::after { border-color: rgba(154,106,90,0.3); }
.tr-card-tag {
  display: inline-block; margin-top: 8px; font-family: 'Cinzel', serif; font-size: 9px;
  letter-spacing: 0.08em; text-transform: uppercase; color: #8a5a48;
  background: #ecd9cf; border: 1px solid #d8b6a6; padding: 2px 8px; border-radius: 3px;
}

/* Highlight states */
.tr-card.lit { box-shadow: inset 0 0 0 1px rgba(255,253,246,0.9), inset 0 0 0 4px #ecca6a, 0 0 0 3px rgba(200,160,60,0.35), 0 8px 22px rgba(120,90,30,0.24); }
.tr-card.selected { box-shadow: inset 0 0 0 1px rgba(255,253,246,0.9), inset 0 0 0 4px #dca934, 0 0 0 4px rgba(168,130,63,0.5), 0 10px 28px rgba(120,90,30,0.3); }
.tr-card.dim { opacity: 0.3; }

/* Restorationist divider */
.tr-divider { position: absolute; left: 5%; right: 5%; z-index: 2; text-align: center; }
.tr-divider .rule { border-top: 1px dashed #c2a37e; margin: 0 0 9px; }
.tr-divider p { font-family: 'Cinzel', serif; font-size: 12px; letter-spacing: 0.09em; text-transform: uppercase; color: #9a6a5a; margin: 0; }

/* Note plaque */
.tr-note {
  max-width: 380px; margin: 14px auto 0; text-align: center;
  background: linear-gradient(165deg, #faf3e2, #efe2c4); border: 1px solid #cdb987;
  box-shadow: inset 0 0 0 3px #e2d0a0, 0 4px 14px rgba(90,68,28,0.12); padding: 14px 20px;
}
.tr-note b { font-family: 'Cinzel', serif; color: #7a5e26; letter-spacing: 0.04em; }
.tr-note p { font-size: 14px; color: #6b6152; margin: 5px 0 0; line-height: 1.45; }

/* ---- Mobile vertical timeline (hidden on desktop) ---- */
.tr-timeline { display: none; max-width: 560px; margin: 8px auto 0; padding: 0 16px; position: relative; }
.tr-timeline::before { content: ''; position: absolute; left: 30px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(180deg, #d9bd76, #c9a24e); }
.tr-tl-item { position: relative; padding: 0 0 16px 56px; }
.tr-tl-dot {
  position: absolute; left: 20px; top: 20px; width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fbf4e2, #ecd9a9); color: #a8823f;
  display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px #d8bd7e, 0 1px 3px rgba(120,90,30,0.2);
}
.tr-tl-dot svg { width: 13px; height: 13px; }
.tr-tl-card {
  background: linear-gradient(165deg, #faf3e2, #efe2c4); border: 1px solid #b8974e; border-radius: 6px;
  box-shadow: inset 0 0 0 3px #decb92, 0 4px 12px rgba(90,68,28,0.14); padding: 13px 15px; cursor: pointer; text-align: left;
}
.tr-tl-card--outside { background: linear-gradient(165deg, #f4ebe1, #eaddcf); border-color: #b98f7e; box-shadow: inset 0 0 0 3px #d9b8a6, 0 4px 12px rgba(90,50,30,0.12); }
.tr-tl-name { font-family: 'Cinzel', serif; font-size: 16px; font-weight: 600; color: #6b4f1e; margin: 0; }
.tr-tl-card--outside .tr-tl-name { color: #7a4a3a; }
.tr-tl-date { font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: #a8823f; margin: 2px 0 6px; }
.tr-tl-desc { font-size: 15px; line-height: 1.4; color: #5f5647; margin: 0; }
.tr-tl-divider { margin: 6px 0 16px 56px; }
.tr-tl-divider .rule { border-top: 1px dashed #c2a37e; margin: 0 0 7px; }
.tr-tl-divider p { font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #9a6a5a; margin: 0; }

/* ---- Detail drawer ---- */
.tr-scrim { position: fixed; inset: 0; background: rgba(38,32,20,0.5); z-index: 1190; opacity: 0; visibility: hidden; transition: opacity 220ms ease, visibility 220ms; }
.tr-scrim.open { opacity: 1; visibility: visible; }
.tr-drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(430px, 94vw);
  background: linear-gradient(180deg, #f7f0de, #f2e8d0); border-left: 2px solid #b89a5c; z-index: 1200;
  transform: translateX(100%); transition: transform 260ms ease; overflow-y: auto;
  box-shadow: -14px 0 44px rgba(60,45,20,0.24);
}
.tr-drawer.open { transform: translateX(0); }
.tr-drawer-head { position: relative; padding: 24px 26px 16px; border-bottom: 1px solid #e2d5b8; background: linear-gradient(180deg, rgba(255,250,236,0.6), transparent); }
.tr-drawer-close { position: absolute; top: 14px; right: 14px; border: none; background: transparent; color: #8a7f68; cursor: pointer; padding: 4px; line-height: 0; }
.tr-drawer-close:hover { color: #2c2a26; }
.tr-drawer-medallion { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #a8823f; margin-bottom: 10px; background: radial-gradient(circle at 40% 35%, #fbf4e2, #ecd9a9); box-shadow: inset 0 0 0 1px #d8bd7e; }
.tr-drawer-medallion svg { width: 24px; height: 24px; }
.tr-drawer-name { font-family: 'Cinzel', serif; font-size: 24px; font-weight: 700; color: #6b4f1e; margin: 0 0 4px; line-height: 1.12; }
.tr-drawer-meta { font-family: 'Cinzel', serif; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: #a8823f; margin: 0; }
.tr-drawer-body { padding: 18px 26px 34px; }
.tr-drawer-summary { font-size: 17px; line-height: 1.5; color: #4a4335; margin: 0 0 16px; }
.tr-drawer-row { display: flex; gap: 10px; font-size: 15px; color: #5f5647; padding: 8px 0; border-top: 1px solid #e6d9bd; }
.tr-drawer-row .k { font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: #a8823f; min-width: 96px; padding-top: 2px; }
.tr-drawer-row .v { flex: 1; }
.tr-drawer h3 { font-family: 'Cinzel', serif; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: #7a5e26; margin: 20px 0 8px; }
.tr-drawer ul { margin: 0; padding-left: 18px; }
.tr-drawer li { font-size: 15px; color: #5f5647; line-height: 1.42; margin-bottom: 5px; }
.tr-callout { border-left: 3px solid #c9a24e; background: rgba(233,220,181,0.4); padding: 10px 14px; margin: 16px 0 0; }
.tr-callout .lbl { font-family: 'Cinzel', serif; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: #a8823f; display: block; margin-bottom: 3px; }
.tr-callout p { font-size: 15px; line-height: 1.45; color: #4a4335; margin: 0; }
.tr-callout--myth { border-left-color: #b98f7e; background: rgba(226,202,190,0.35); }
.tr-callout--myth .lbl { color: #9a6a5a; }
.tr-drawer-links { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.tr-drawer-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: 'Cinzel', serif; font-size: 13px; letter-spacing: 0.04em; color: #6b4f1e; background: #efe4ca; border: 1px solid #cdb987; padding: 12px 15px; text-decoration: none; transition: border-color 140ms ease, background 140ms ease; }
.tr-drawer-link:hover { border-color: #a8823f; background: #eaddbe; color: #6b4f1e; }
.tr-drawer-link i { color: #a8823f; }
.tr-drawer-trace {
  width: 100%; margin-top: 18px; font-family: 'Cinzel', serif; font-size: 13px;
  letter-spacing: 0.06em; text-transform: uppercase; color: #fbf6ea;
  background: #a8823f; border: none; padding: 13px; cursor: pointer; transition: background 140ms ease;
}
.tr-drawer-trace:hover { background: #8a6d2f; }
@media (max-width: 760px) { .tr-drawer-trace { display: none; } }

/* Methodology modal */
.tr-modal-scrim { position: fixed; inset: 0; background: rgba(38,32,20,0.55); z-index: 1210; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; visibility: hidden; transition: opacity 200ms ease, visibility 200ms; }
.tr-modal-scrim.open { opacity: 1; visibility: visible; }
.tr-modal { width: 100%; max-width: 540px; max-height: calc(100vh - 40px); overflow-y: auto; background: linear-gradient(180deg, #f8f1df, #f2e8d0); border: 1.5px solid #b89a5c; box-shadow: 0 18px 50px rgba(38,32,20,0.28); }
.tr-modal-head { position: relative; padding: 24px 28px 6px; text-align: center; }
.tr-modal-close { position: absolute; top: 14px; right: 14px; border: none; background: transparent; color: #8a7f68; cursor: pointer; padding: 4px; line-height: 0; }
.tr-modal-close:hover { color: #2c2a26; }
.tr-modal h2 { font-family: 'Cinzel', serif; font-size: 23px; font-weight: 700; color: #6b4f1e; margin: 0; }
.tr-modal-body { padding: 12px 28px 28px; }
.tr-modal-body p { font-size: 16px; line-height: 1.5; color: #4a4335; margin: 0 0 10px; }
.tr-modal-body ul { margin: 8px 0 0; padding-left: 20px; }
.tr-modal-body li { font-size: 15px; line-height: 1.45; color: #5f5647; margin-bottom: 7px; }

/* ---- Responsive: mobile switches to the timeline ---- */
@media (max-width: 760px) {
  .tr-canvas-wrap { display: none; }
  .tr-timeline { display: block; }
  .tr-hero { padding-top: 40px; }
  .tr-legend { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tr-card, .tr-drawer, .tr-scrim, .tr-conn, .tr-conn-glow, .tr-modal-scrim { transition: none; }
}
