/* Articles: the list, the article page, the maps in them (articlemap.js) and the editor in Beheer. Tokens: site.css. */

.article-page { max-width: 820px; }
.article-page .sub { margin: 0; color: var(--muted); font-size: 16px; }
.muted { color: var(--muted); }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.back { margin: 0; font-size: 13px; }
.back a { color: var(--muted); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* list */
.article-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.article-card { display: flex; flex-direction: column; gap: 6px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; }
.article-card:hover { border-color: var(--line2); }
.article-card h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 28px; letter-spacing: -.01em; }
.article-card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.article .meta, .article-card .meta { font-size: 13px; color: var(--muted); }

/* the article */
.article { display: flex; flex-direction: column; gap: 22px; }
.article-head { display: flex; flex-direction: column; gap: 10px; }
.article-head h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 5vw, 52px); line-height: 1.05; letter-spacing: -.02em; text-wrap: balance; }
.article .lede { margin: 0; font-size: 19px; line-height: 1.5; color: var(--muted); }
.article-body { font-size: 17px; line-height: 1.7; }
.article-body > * { margin: 0 0 1.1em; }
.article-body h2 { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.15; letter-spacing: -.01em; margin: 1.6em 0 .5em; }
.article-body h3 { font-size: 21px; margin: 1.4em 0 .4em; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.article-body blockquote { margin-left: 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--line2); color: var(--muted); }
.article-body img { max-width: 100%; height: auto; border-radius: 8px; }
.article-body table { border-collapse: collapse; width: 100%; font-size: 15px; }
.article-body th, .article-body td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.article-body code { font-family: var(--mono); font-size: .9em; background: var(--hover); padding: 1px 5px; border-radius: 4px; }
.article-body pre { background: var(--hover); padding: 12px 14px; border-radius: 8px; overflow-x: auto; }
.article-body pre code { background: none; padding: 0; }
.article-figure { margin: 1.6em 0; }
.article-figure figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); line-height: 1.45; }

/* a map in an article */
.am { display: flex; flex-direction: column; gap: 8px; width: 100%; font-size: 13px; line-height: 1.4; }
.am-stage { position: relative; width: 100%; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.am-map { position: absolute; inset: 0; }
.am-swipe { position: absolute; top: 0; bottom: 0; width: 0; z-index: 4; pointer-events: none; }
.am-swipe::before { content: ''; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; box-shadow: 0 0 4px rgba(0, 0, 0, .5); }
.am-swipe.movable { pointer-events: auto; cursor: ew-resize; width: 24px; margin-left: -12px; touch-action: none; }
.am-swipe.movable::before { left: 11px; }
.am-handle { position: absolute; top: 50%; left: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #fff; color: #222; box-shadow: 0 1px 6px rgba(0, 0, 0, .45); }
.am-swipe:not(.movable) .am-handle { width: 28px; height: 28px; margin: -14px 0 0 -14px; opacity: .85; }
.am-swipe:focus-visible .am-handle { outline: 2px solid var(--accent); outline-offset: 2px; }
.am-chip { position: absolute; top: 8px; z-index: 5; max-width: 44%; padding: 5px 9px; border-radius: 6px; background: rgba(13, 19, 24, .78); color: #fff; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.am-chip-left { left: 8px; }
.am-chip-right { right: 8px; }
.am-zoom { position: absolute; right: 8px; bottom: 8px; z-index: 5; display: flex; flex-direction: column; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.am-zoom button { width: 36px; height: 36px; border: 0; background: var(--surface); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; }
.am-zoom button + button { border-top: 1px solid var(--line); }
.am-zoom button:hover { background: var(--hover); }
.am .ol-scale-line { left: 8px; bottom: 8px; }
.am-popup { position: relative; z-index: 6; width: min(320px, 78vw); max-height: 300px; overflow: auto; padding: 10px 12px; background: var(--surface); color: var(--ink); border-radius: 8px; box-shadow: var(--shadow); font-size: 12.5px; }
.am-popup.am-popup-tall { width: min(380px, 84vw); max-height: min(70vh, 520px); }
.am-popup h3 { margin: 0 24px 6px 0; font-size: 14px; }
.am-popup .popup-layer { color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.am-popup table { border-collapse: collapse; width: 100%; }
.am-popup th { text-align: left; vertical-align: top; padding: 2px 8px 2px 0; color: var(--muted); font-weight: 600; white-space: nowrap; }
.am-popup td { padding: 2px 0; }
.am-popup-close { position: absolute; top: 4px; right: 6px; width: 28px; height: 28px; border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.am-below { display: flex; flex-direction: column; gap: 6px; }
.am-link { align-self: flex-start; font-size: 13px; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.am-legend { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.am-legend > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.am-legend-row { display: inline-flex; align-items: center; gap: 6px; }
.am-legend-row i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #888; }
.am-attribution { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.45; }

/* admin: list */
.admin-articles { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-articles th { text-align: left; padding: 8px 10px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line2); }
.admin-articles td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-articles .actions { text-align: right; white-space: nowrap; }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: var(--danger); }

/* admin: editor */
.editor-form { display: flex; flex-direction: column; gap: 32px; }
.ed-section { display: flex; flex-direction: column; gap: 14px; }
.ed-section h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 26px; letter-spacing: -.01em; }
.ed-section p { margin: 0; }
.inp.area { height: auto; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.inp.body { font-family: var(--mono); font-size: 14px; min-height: 360px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 1px 0 0; flex: none; }
.maps-editor { display: flex; flex-direction: column; gap: 22px; }
.ed-map { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ed-map-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ed-map-head h3 { margin: 0 auto 0 0; font-size: 16px; }
.ed-map-body { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 20px; padding: 16px; align-items: start; }
.ed-controls { display: flex; flex-direction: column; gap: 14px; }
.ed-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.ed-row .field { flex: 1 1 110px; min-width: 0; }
.ed-row .field.grow { flex: 2 1 160px; }
.ed-fieldset { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ed-fieldset legend { padding: 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ed-fieldset input[type="range"] { width: 100%; accent-color: var(--accent); }
.ed-fieldset .btn { align-self: flex-start; }
.ed-preview-wrap { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ed-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; position: sticky; bottom: 0; padding: 14px 0; background: var(--bg); border-top: 1px solid var(--line); }
.ed-delete { align-self: flex-start; }

@media (max-width: 860px) {
    .ed-map-body { grid-template-columns: 1fr; }
    .ed-preview-wrap { position: static; }
}

/* a borehole profile in an article: a panel with the facts and the profile (borehole.js), open to everybody */
.article-borehole-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; font-size: 14px; line-height: 1.5; color: var(--ink); overflow-x: auto; }
.article-borehole-panel .bhp-title { margin: 0 0 8px; font-family: var(--serif); font-weight: 400; font-size: 24px; letter-spacing: -.01em; }
.article-borehole-panel table { border-collapse: collapse; width: 100%; max-width: 460px; }
.article-borehole-panel th { text-align: left; vertical-align: top; width: 9.5em; padding: 2px 18px 2px 0; color: var(--muted); font-weight: 600; white-space: nowrap; }
.article-borehole-panel td { padding: 2px 0; }
.article-borehole-panel .bh { font-size: 13px; }
