/* Long-form reading pages: the guide library, articles, About and the route map.
   Colours come only from the :root tokens in site.css; pages/tests.py checks this. */

/* ---------- Articles ---------- */
.article-answer { color: var(--fg); font-size: 1.0625rem; line-height: 1.6; font-weight: 500; }
.article-related { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.prose .article-related h2 { margin: 0; font: 650 .875rem/1.4 var(--sans); letter-spacing: -.01em; }
.article-related ul { margin-top: .6rem; }
.operator-card { padding-top: 1rem; border-top: 2px solid var(--gold); font-size: .9375rem; }
.operator-card > * + * { margin-top: .45rem; }
.operator-name { color: var(--fg); font-weight: 650; }
.operator-location { color: var(--fg-3); font-size: .875rem; }

/* ---------- Guide library ---------- */
.library-tools { position: relative; max-width: 30rem; }
.library-tools input { width: 100%; min-height: 2.9rem; padding: .6rem 6.25rem .6rem .95rem; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--fg); font: 400 .9375rem/1.4 var(--sans); }
.library-tools input::placeholder { color: var(--fg-3); }
.library-tools input:focus { border-color: var(--fg); outline: 2px solid var(--accent-line); outline-offset: 1px; }
.library-tools p { position: absolute; right: .85rem; top: 50%; transform: translateY(-50%); margin: 0; color: var(--fg-3); font-size: .75rem; font-weight: 500; pointer-events: none; }
.library-group + .library-group { margin-top: 2.25rem; }
.prose .library-group h2 { margin: 0; font-size: clamp(1.6rem, 1.3rem + .8vw, 2rem); }
.library-grid { display: grid; margin-top: .65rem; border-top: 1px solid var(--border-strong); }
.prose .library-card { display: grid; gap: .2rem; padding: .85rem .35rem; border-bottom: 1px solid var(--border); color: var(--fg-2); text-decoration: none; transition: background-color .15s; }
.prose .library-card:hover { background: var(--subtle); }
.prose .library-card h3 { margin: 0; font-family: var(--display); font-size: 1.3rem; font-weight: 600; color: var(--deep); transition: color .15s; }
.library-card p { font-size: .875rem; line-height: 1.5; color: var(--fg-3); }
.prose .library-card:hover h3 { color: var(--accent); }
.library-empty { padding-block: 1rem; border-top: 1px solid var(--border); color: var(--fg-3); font-size: .875rem; }

/* ---------- Route map (Getting there) ---------- */
.map-band { padding-block: clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--border); background: var(--subtle); }
.map-band .pilgrim-map { max-width: 48rem; margin-inline: auto; }
.pilgrim-map { min-width: 0; padding: clamp(1rem, 2.5vw, 1.5rem); border: 1px solid var(--gold); border-radius: var(--r-lg); background: var(--surface); color: var(--fg-2); }
.pilgrim-map-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.pilgrim-map h2 { font-size: clamp(1.35rem, 1.15rem + .6vw, 1.65rem); }
.map-compass { width: 1.4rem; height: 2.2rem; flex: none; fill: none; stroke: var(--fg-3); stroke-width: 1.2; }
.map-compass text { fill: var(--fg); stroke: none; font: 700 13px var(--sans); }
.map-controls { display: flex; gap: .4rem; margin-top: 1.1rem; padding: .25rem; border-radius: var(--r-md); background: var(--subtle); }
.map-controls button { flex: 1; min-height: 2.75rem; padding: .5rem .4rem; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--fg-2); font: 600 .8125rem/1.3 var(--sans); cursor: pointer; transition: background-color .15s, color .15s; }
.map-controls button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
.map-controls button:hover:not([aria-pressed="true"]) { color: var(--fg); }
.map-canvas { width: 100%; height: auto; overflow: visible; margin-block: .75rem; }
.map-woods { fill: var(--map-wood); stroke: none; }
.map-context-roads { fill: none; stroke: var(--map-road); stroke-width: 1; }
.map-route { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.map-route-bed { stroke: var(--surface); stroke-width: 6; }
.map-route-line { stroke: var(--map-route); stroke-width: 2; opacity: .75; }
.map-route:not([data-map-route="road"]) .map-route-line { stroke-dasharray: 3 4; }
.map-route.is-selected .map-route-line { stroke: var(--accent); stroke-width: 3; opacity: 1; }
.map-route-flow { visibility: hidden; stroke: var(--surface); stroke-width: 3.5; stroke-dasharray: 2 34; animation: pilgrim-route-flow 3s linear infinite; animation-play-state: paused; }
.is-animating .map-route.is-selected .map-route-flow { visibility: visible; animation-play-state: running; }
@keyframes pilgrim-route-flow { to { stroke-dashoffset: -36; } }
.map-route-end { stroke: var(--fg-2); stroke-width: 1.5; fill: var(--surface); }
.map-route.is-selected .map-route-end { fill: var(--accent); stroke: var(--accent); }
.map-pin-halo { fill: var(--surface); }
.map-pin { fill: var(--fg); }
.map-pin-number { fill: var(--surface); font: 700 12px var(--sans); }
.map-landmark--tirumala .map-pin { fill: var(--accent); }
.map-place-label { fill: var(--fg); font: 600 16px var(--sans); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.map-landmark--tirumala .map-place-label { font: 650 22px var(--sans); fill: var(--fg); }
.map-temple-label { font: 400 14px var(--sans); fill: var(--fg-3); }
.map-scale { fill: var(--fg-3); font: 500 13px var(--sans); }
.map-scale path { fill: none; stroke: var(--fg-3); stroke-width: 1.2; }
.map-route-info { padding-top: 1rem; border-top: 1px solid var(--border); }
.map-route-detail + .map-route-detail { margin-top: 1rem; }
.map-route-detail[hidden] + .map-route-detail { margin-top: 0; }
.map-route-summary { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.map-route-summary h3 { font-size: 1.0625rem; }
.map-route-summary > p { color: var(--fg); font: 650 1.25rem/1.2 var(--sans); white-space: nowrap; }
.map-route-summary > p span { color: var(--fg-3); font-size: .8125rem; font-weight: 500; }
.map-route-note { min-height: 3.2em; margin-top: .35rem; font-size: .9375rem; line-height: 1.6; }
.map-guide-link { display: inline-block; margin-top: .5rem; color: var(--accent); font-size: .875rem; font-weight: 600; }
.map-motion-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .3rem 1rem; padding-block: .5rem; color: var(--fg-3); font-size: .8125rem; }
.map-motion { min-height: 2.75rem; padding: .5rem 0; border: 0; background: transparent; color: var(--fg-2); font: 600 .8125rem var(--sans); text-decoration: underline; text-underline-offset: .25em; cursor: pointer; }
.map-places { border-block: 1px solid var(--border); font-size: .875rem; }
.map-places summary { display: flex; align-items: center; justify-content: space-between; min-height: 2.75rem; color: var(--fg); font-weight: 600; cursor: pointer; list-style: none; }
.map-places summary::-webkit-details-marker { display: none; }
.map-places summary > span { color: var(--fg-3); font-size: 1.2rem; transition: transform .2s var(--ease); }
.map-places[open] summary > span { transform: rotate(45deg); }
.map-places ol { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem 1rem; padding: .25rem 0 1rem; list-style: none; }
.map-places a { display: flex; align-items: baseline; gap: .6rem; min-height: 2.75rem; padding-block: .5rem; color: var(--fg-2); line-height: 1.5; text-decoration: none; }
.map-places a:hover { color: var(--fg); text-decoration: underline; }
.map-places a > span:first-child { color: var(--fg); font-weight: 700; }
.map-external { color: var(--fg-3); }
.map-credit { padding-top: .8rem; color: var(--fg-3); font-size: .8125rem; line-height: 1.6; }
.map-credit p + p { margin-top: .3rem; }
.map-credit a { color: var(--fg-2); }

@media (max-width: 480px) {
  .map-controls button { font-size: .8125rem; }
  .map-place-label { display: none; }
  .map-landmark--tirumala .map-place-label { display: block; font-size: 36px; }
  .map-temple-label { display: none; }
  .map-pin { r: 16px; }
  .map-pin-halo { r: 22px; }
  .map-pin-number { font-size: 19px; }
  .map-scale { font-size: 20px; }
  .map-route-line { stroke-width: 3; }
  .map-route.is-selected .map-route-line { stroke-width: 4; }
  .map-places ol { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .article-answer { font-size: 1.0625rem; }
}
