/* ==========================================================================
   Kete list (kete.html) + single post (post.html). Builds on css/site.css
   (tokens, trunk, limb, blade, board, book/entry, prose, chip, field, modal).
   Page-local only: the hut book of posts, the post article, loading and
   not-found states.
   ========================================================================== */

/* ---------- what the kete is: one statement on the sand band, a crozier beside it ---------- */
.kete-about { padding-top: clamp(40px, 5vw, 76px); padding-bottom: clamp(40px, 5vw, 76px); }
.kete-about .limb-marker { top: clamp(48px, 6vw, 90px); }
@media (min-width: 761px) { .kete-about .limb-label { top: clamp(40px, 5vw, 76px); } }
.kete-lead {
    max-width: 23em;
    font-size: clamp(1.3rem, 2.5vw, 2.1rem); line-height: 1.4;
    color: var(--forest);
}
/* a short section: keep the frond inside it (mobile keeps the site.css size) */
@media (min-width: 761px) { .kete-about .frond--bottom { width: min(17vw, 230px); } }

/* ---------- posts section (the filter bar is .filter-bar in site.css) ---------- */
.kete-posts-limb { padding-top: clamp(56px, 8vw, 120px); }
.kete-posts-limb .limb-marker { top: clamp(64px, 9vw, 134px); }
@media (min-width: 761px) { .kete-posts-limb .limb-label { top: clamp(56px, 8vw, 120px); } }
.kete-count {
    margin: clamp(22px, 3vw, 40px) var(--edge) 10px var(--col);
    position: relative; z-index: 2;
    font-size: .95rem; font-weight: 500; color: var(--muted);
}
.kete-count:empty { display: none; }

/* ---------- the hut book: ruled entries running out from the trunk ---------- */
.kete-book { max-width: 1120px; margin-right: var(--edge); }
.kete-book .entry {
    grid-template-columns: clamp(110px, 12vw, 160px) minmax(0, 1fr);
    padding-left: calc(var(--pw) + var(--gap));
    transition: background .25s ease;
}
.kete-book .entry--photo { grid-template-columns: clamp(110px, 12vw, 160px) minmax(0, 1fr) clamp(120px, 20vw, 260px); }
.kete-book a.entry:hover { background: rgba(168, 196, 176, .16); }
.kete-book a.entry:focus-visible { outline-offset: -3px; }
.kete-book .entry-date { display: flex; flex-direction: column; gap: .15em; line-height: 1.25; }
.entry-day { font-weight: 500; color: var(--forest); }
.entry-year { font-size: .9rem; }
.entry-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: .35em 1.2em;
    margin-top: .95em;
    font-size: .92rem; color: var(--muted); overflow-wrap: anywhere;
}
.entry-cat { display: inline-flex; align-items: center; gap: .45em; font-weight: 500; color: var(--forest); }
.entry-cat i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--cat, var(--sage)); }
.entry-more { font-weight: 500; color: var(--forest); border-bottom: 2px solid var(--sage); transition: border-color .2s; }
a.entry:hover .entry-more { border-color: var(--terracotta); }
.kete-book .entry-photo { align-self: start; min-height: 0; aspect-ratio: 4 / 3; padding: 0; margin: clamp(18px, 2.4vw, 30px) 0 clamp(18px, 2.4vw, 30px) 14px; }

/* ---------- post modal (kete.html) ---------- */
.modal .post-cat { margin-bottom: .9em; }
.modal .post-meta { margin: 0 0 1.4em; padding-bottom: 1.1em; border-bottom: 1px solid var(--clay); color: var(--muted); }
.modal .prose { max-width: none; }

/* ---------- single post ---------- */
.post-back {
    display: inline-flex; align-items: center; gap: .4em;
    margin-bottom: clamp(18px, 3vw, 40px);
    font-weight: 500; color: var(--sage-light);
    border-bottom: 2px solid transparent; transition: color .2s, border-color .2s;
}
.post-back:hover { color: var(--ivory); border-color: var(--terracotta); }
.post-back svg, .post-all svg { flex: none; }
/* the pill itself is .tag in site.css */
.post-cat { display: block; width: fit-content; margin-bottom: 1.1em; padding: .14em 1.4em .14em .65em; }
.board .post-title { max-width: 18em; font-size: clamp(2rem, 4.8vw, 4rem); line-height: 1.02; overflow-wrap: anywhere; }
.post-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: .2em .8em;
    margin-top: 1.5em;
    font-size: clamp(.98rem, 1.3vw, 1.12rem); color: var(--sage-light); overflow-wrap: anywhere;
}
.post-cover {
    position: relative; z-index: 2;
    max-width: 980px; margin: 14px var(--edge) 0 var(--post);
}
.post-cover img { display: block; width: 100%; max-height: min(70vh, 560px); object-fit: cover; border-radius: 0 0 4px 0; }

.post-limb { padding-top: clamp(36px, 5vw, 72px); }
.post-limb .limb-marker { top: clamp(46px, 6vw, 86px); }
@media (min-width: 761px) { .post-limb .limb-label { top: clamp(36px, 5vw, 72px); } }
.post-body { max-width: 68ch; }
/* legacy plain-text posts and the editor both leave empty paragraphs behind */
.post-body p:empty { display: none; }
.post-body strong { color: var(--forest); }
.post-body img { margin-left: 0; }
.post-body blockquote { margin-left: 0; }

.post-files { max-width: 68ch; margin-top: clamp(32px, 4vw, 56px); padding-top: 1.4em; border-top: 1px solid var(--clay); }
.post-files-title { margin-bottom: .9em; font-size: .95rem; font-weight: 500; color: var(--muted); }
.post-files-list { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 26px; }
.post-files-list img { display: block; max-width: 100%; height: auto; border-radius: 4px; }
.post-file {
    display: inline-flex; align-items: center; gap: .5em; max-width: 100%;
    padding: 2px 0; border-bottom: 2px solid var(--sage);
    font-weight: 500; color: var(--forest); overflow-wrap: anywhere; transition: border-color .2s;
}
.post-file:hover { border-color: var(--terracotta); }
.post-file svg { flex: none; }
.post-all { align-items: center; gap: .5em; margin-top: clamp(36px, 5vw, 64px); margin-bottom: 0; }

/* ---------- loading + not found (post.html) ---------- */
.post-wait { min-height: 46vh; padding-top: clamp(56px, 8vw, 120px); padding-bottom: clamp(16px, 3vw, 48px); }
.post-wait .limb-marker, .post-missing .limb-marker { top: clamp(66px, 9vw, 136px); }
.post-missing { min-height: 56vh; padding-top: clamp(56px, 8vw, 120px); padding-bottom: clamp(72px, 10vw, 150px); }
@media (min-width: 761px) { .post-missing .limb-label { top: clamp(56px, 8vw, 120px); } }
.post-missing .desc { color: var(--bark); }
@media (min-width: 761px) { .post-missing .frond--bottom { width: min(20vw, 270px); } }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
    .kete-about.limb--frond-end { padding-bottom: 96px; }
    .kete-book { margin-right: 0; }
    .kete-book .entry, .kete-book .entry--photo { grid-template-columns: minmax(0, 1fr); padding-right: var(--edge); }
    .kete-book .entry > * { padding-left: 0; padding-right: 0; }
    .kete-book .entry-date { flex-direction: row; gap: .4em; padding-bottom: 0; font-size: .92rem; }
    .entry-year { font-size: inherit; }
    .kete-book .entry-main { padding-top: 8px; }
    .kete-book .entry-photo { grid-column: 1; aspect-ratio: 16 / 9; margin: 0 0 20px; }

    .post-cover { margin-right: 14px; }
    .post-missing.limb--frond-end { padding-bottom: 250px; }
}

