/* =====================================================================
   DOCUMENTS  -  /documents/documents.css
   Warm paper, serif type, the site's red. Each document is a sheet of
   paper; ones with several pages have a few more sheets peeking out
   behind, which fan out a little when you point at them.
   ===================================================================== */

:root {
    --dc-ink: #1b1a17;
    --dc-muted: #6b665c;
    --dc-faint: #9a948a;
    --dc-rule: #e4dfd5;
    --dc-wash: #f7f4ee;
    --dc-paper: #ffffff;
    --dc-accent: #8a2b1d;
    --dc-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", Times, serif;
    --dc-ease: cubic-bezier(.2, .7, .2, 1);
    --dc-card: 210px;
}

.site-title, .site-title:visited { color: inherit; text-decoration: none; }

main.dc-main {
    display: block;
    grid-template-columns: none;
    width: 100%;
    max-width: 1600px;
    margin: 6px auto 0;
    padding: 0 4px 30px;
    box-sizing: border-box;
    font-family: var(--dc-serif);
    color: var(--dc-ink);
}
main.dc-main p { color: inherit; margin: 0; font-size: inherit; }
main.dc-main article { border-right: 0; padding: 0; margin: 0; }
main.dc-main *, main.dc-main *::before, main.dc-main *::after { box-sizing: border-box; }
main.dc-main h3 { margin: 0; }
.dc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- the top */
.dc-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: 32px;
    row-gap: 12px;
    padding: 10px 0 20px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--dc-rule);
}
.dc-hero > p { grid-column: 1; opacity: 0; transform: translateY(8px); transition: opacity 0.7s var(--dc-ease), transform 0.7s var(--dc-ease); }
.dc-hero.is-in > p { opacity: 1; transform: none; }
.dc-hero.is-in > p:nth-child(2) { transition-delay: 0.08s; }
.dc-hero.is-in > p:nth-child(3) { transition-delay: 0.16s; }
html:not(.js) .dc-hero > p { opacity: 1; transform: none; }
main.dc-main .dc-kicker { margin: 0 0 -10px; font-size: 0.72rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--dc-accent); }
main.dc-main .dc-title { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2rem); font-style: italic; line-height: 1.15; }
main.dc-main .dc-intro { max-width: 36em; margin: -6px 0 0; font-size: 0.95rem; line-height: 1.5; color: var(--dc-muted); }
.dc-stats { grid-column: 2; grid-row: 1 / span 3; align-self: end; display: flex; margin: 0; padding: 0; }
.dc-stats > div { padding: 0 14px; border-left: 1px solid var(--dc-rule); text-align: right; }
.dc-stats > div:first-child { border-left: 0; }
.dc-stats dd { margin: 0; font-size: 1.45rem; font-style: italic; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dc-stats dt { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dc-faint); }

/* ---------------------------------------------------------------- search, subjects, order */
.dc-toolbar {
    position: sticky; top: 0; z-index: 5;
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
    padding: 10px 0;
    background: linear-gradient(#faf8f4 80%, rgba(250, 248, 244, 0));
}
.dc-search { position: relative; flex: 0 1 260px; }
.dc-search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--dc-faint); stroke-width: 1.8; stroke-linecap: round; }
.dc-search input {
    width: 100%; padding: 9px 14px 9px 36px; border: 1px solid var(--dc-rule); border-radius: 999px; background: var(--dc-paper);
    font: 0.95rem var(--dc-serif); color: var(--dc-ink); outline: none; transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.dc-search input:focus { border-color: var(--dc-accent); box-shadow: 0 0 0 4px rgba(138, 43, 29, 0.08); }
.dc-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; }
.dc-chips button {
    display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px;
    border: 1px solid var(--dc-rule); border-radius: 999px; background: var(--dc-paper); color: var(--dc-muted);
    font: 0.9rem var(--dc-serif); cursor: pointer; transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.dc-chips button:hover { color: var(--dc-ink); border-color: var(--c); }
.dc-chips button:active { transform: scale(0.97); }
.dc-chips button[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #fff; }
.dc-chips button[aria-pressed="true"] .dc-dot { background: #fff; }
.dc-chips small { font-size: 0.72rem; opacity: 0.7; font-variant-numeric: tabular-nums; }
.dc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.dc-sort select {
    padding: 7px 30px 7px 12px; border: 1px solid var(--dc-rule); border-radius: 999px; background: var(--dc-paper);
    font: 0.9rem var(--dc-serif); color: var(--dc-ink); cursor: pointer;
}
.dc-status { min-height: 1.2em; margin: 2px 0 6px !important; font-size: 0.85rem; font-style: italic; color: var(--dc-faint) !important; }

/* ---------------------------------------------------------------- sections */
.dc-group { margin: 18px 0 38px; }
.dc-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--dc-rule); position: relative; }
.dc-group-head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 56px; height: 2px; background: var(--c); border-radius: 2px; }
main.dc-main .dc-group-title { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: normal; font-style: italic; }
.dc-group-meta { font-size: 0.82rem; color: var(--dc-faint); white-space: nowrap; }
.dc-sep { margin: 0 6px; color: var(--dc-rule); }
main.dc-main .dc-group-about { margin: 6px 0 2px; font-size: 0.92rem; color: var(--dc-muted); max-width: 46em; }

/* ---------------------------------------------------------------- the cards */
.dc-list[data-size="small"] { --dc-card: 170px; }
.dc-list[data-size="large"] { --dc-card: 260px; }
.dc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--dc-card), 1fr));
    gap: 34px 26px;
    padding: 22px 6px 4px;
    align-items: start;
}
.dc-card { position: relative; opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--dc-ease), transform 0.6s var(--dc-ease); transition-delay: calc(var(--i) * 45ms); }
.dc-card.is-in { opacity: 1; transform: none; }
html:not(.js) .dc-card { opacity: 1; transform: none; }
.dc-link { display: block; color: inherit; text-decoration: none; outline: none; border-radius: 4px; }
.dc-link:focus-visible .dc-paper { box-shadow: 0 0 0 3px var(--dc-paper), 0 0 0 5px var(--dc-accent); }

.dc-paper {
    position: relative;
    aspect-ratio: var(--r, 0.77);
    background: var(--dc-paper);
    border-radius: 3px;
    box-shadow: 0 1px 1px rgba(40, 30, 10, 0.08), 0 8px 18px -10px rgba(40, 30, 10, 0.35);
    transition: transform 0.45s var(--dc-ease), box-shadow 0.45s var(--dc-ease);
    z-index: 1;
}
.dc-paper::after {                                  /* a thin line of the subject's colour along the top */
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c); border-radius: 3px 3px 0 0; opacity: 0.9;
}
.dc-paper img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; border-radius: 3px; display: block; }
.dc-noimg {
    position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; text-align: center;
    background: linear-gradient(160deg, #fbf8f1, #f1ebdd); font-size: 1.05rem; font-style: italic; color: var(--dc-muted); border-radius: 3px;
}
/* more pages: two sheets behind */
.has-stack .dc-link { position: relative; isolation: isolate; }
.has-stack .dc-link::before, .has-stack .dc-link::after {
    content: ""; position: absolute; inset: 0; aspect-ratio: var(--r, 0.77); height: auto;
    background: #fbf9f4; border-radius: 3px; box-shadow: 0 1px 1px rgba(40, 30, 10, 0.08), 0 6px 14px -10px rgba(40, 30, 10, 0.3);
    transition: transform 0.5s var(--dc-ease);
}
.has-stack .dc-link::before { transform: translate(5px, 4px) rotate(1.4deg); }
.has-stack .dc-link::after { transform: translate(9px, 7px) rotate(2.6deg); z-index: -1; background: #f5f1e8; }
.dc-card:hover .dc-paper, .dc-link:focus-visible .dc-paper { transform: translateY(-6px) rotate(-0.6deg); box-shadow: 0 2px 2px rgba(40, 30, 10, 0.06), 0 22px 34px -18px rgba(40, 30, 10, 0.5); }
.has-stack:hover .dc-link::before { transform: translate(10px, 0) rotate(3deg); }
.has-stack:hover .dc-link::after { transform: translate(18px, 2px) rotate(5.5deg); }

.dc-src, .dc-new, .dc-pin, .dc-open { position: absolute; z-index: 2; }
.dc-src {
    left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px;
    border-radius: 999px; background: rgba(255, 255, 255, 0.92); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    font: 600 0.66rem/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dc-muted);
}
.dc-src svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dc-src-pdf { color: var(--dc-accent); }
.dc-src-drive { color: #1a73e8; }
.dc-new {
    top: 10px; left: -6px; padding: 2px 10px 2px 8px; background: var(--dc-accent); color: #fff;
    font: 600 0.66rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 0.1em; text-transform: uppercase;
    border-radius: 2px 3px 3px 0; box-shadow: 0 2px 6px rgba(138, 43, 29, 0.35);
}
.dc-new::after { content: ""; position: absolute; left: 0; bottom: -5px; border-top: 5px solid #5e1c12; border-left: 6px solid transparent; }
.dc-pin { top: 8px; right: 8px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.94); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); }
.dc-pin svg { width: 14px; height: 14px; fill: #c2384f; animation: dc-beat 3.2s ease-in-out infinite; transform-origin: center; }
@keyframes dc-beat { 0%, 70%, 100% { transform: scale(1); } 78% { transform: scale(1.22); } 86% { transform: scale(0.96); } 92% { transform: scale(1.12); } }
.dc-open {
    inset: auto 8px 8px auto; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
    border-radius: 999px; background: var(--dc-ink); color: #fff;
    font: 500 0.74rem -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    opacity: 0; transform: translateY(4px); transition: opacity 0.3s ease, transform 0.3s var(--dc-ease);
}
.dc-open svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dc-card:hover .dc-open, .dc-link:focus-visible .dc-open { opacity: 1; transform: none; }

.dc-body { padding: 14px 2px 0; }
main.dc-main .dc-cat { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c); }
main.dc-main .dc-name { font-size: 1.08rem; font-weight: normal; line-height: 1.3; }
.dc-name a { color: inherit; text-decoration: none; background: linear-gradient(var(--c), var(--c)) 0 100% / 0 1px no-repeat; transition: background-size 0.35s var(--dc-ease); }
.dc-card:hover .dc-name a, .dc-name a:focus-visible { background-size: 100% 1px; }
main.dc-main .dc-desc { margin-top: 6px; font-size: 0.9rem; line-height: 1.5; color: var(--dc-muted); overflow-wrap: anywhere; }
/* "Read more": three lines, then the button opens the rest */
.dc-list[data-desc="more"] .dc-desc:not(.is-open) { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dc-more {
    margin: 4px 0 0; padding: 0; border: 0; background: none; cursor: pointer;
    font: italic 0.85rem var(--dc-serif); color: var(--dc-accent);
    text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(138, 43, 29, 0.35);
}
.dc-more:hover { text-decoration-color: currentColor; }
main.dc-main .dc-meta { display: flex; flex-wrap: wrap; align-items: center; margin-top: 7px; font-size: 0.8rem; color: var(--dc-faint); }
.dc-dl {
    margin: 6px 0 0 -8px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
    color: var(--dc-muted); text-decoration: none; border: 1px solid transparent; transition: border-color 0.2s ease, color 0.2s ease;
}
.dc-dl:hover { color: var(--dc-accent); border-color: var(--dc-rule); }
.dc-dl svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dc-fav-heart { display: inline-grid; place-items: center; }
.dc-fav-heart svg { width: 15px; height: 15px; fill: #c2384f; animation: dc-beat 3.2s ease-in-out infinite; }
.dc-card.is-flash .dc-paper { animation: dc-flash 1.6s ease 2; }
@keyframes dc-flash { 50% { box-shadow: 0 0 0 4px var(--c), 0 22px 34px -18px rgba(40, 30, 10, 0.5); } }

/* while the list loads */
.dc-loading { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--dc-card), 1fr)); gap: 26px; padding: 22px 6px; }
.dc-loading i { aspect-ratio: 0.77; border-radius: 3px; background: linear-gradient(100deg, #f1ede5 30%, #f8f6f1 50%, #f1ede5 70%) 0 0 / 300% 100%; animation: dc-shimmer 1.4s linear infinite; }
@keyframes dc-shimmer { to { background-position: -150% 0; } }

.dc-empty { padding: 60px 10px; text-align: center; color: var(--dc-muted); }
main.dc-main .dc-empty-title { font-size: 1.3rem; font-style: italic; color: var(--dc-ink); margin-bottom: 6px; }
.dc-linklike { padding: 0; border: 0; background: none; font: inherit; color: var(--dc-accent); text-decoration: underline; cursor: pointer; }

@media (max-width: 720px) {
    .dc-hero { grid-template-columns: 1fr; }
    .dc-stats { grid-column: 1; grid-row: auto; justify-content: flex-start; margin-top: 6px; }
    .dc-stats > div { text-align: left; padding: 0 14px 0 0; border-left: 0; }
    .dc-search { flex: 1 1 100%; }
    .dc-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
    .dc-chips::-webkit-scrollbar { display: none; }
    .dc-chips button { flex: none; }
    .dc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 18px; }
    .dc-open { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .dc-card, .dc-hero > p { transition: none; opacity: 1; transform: none; }
    .dc-paper, .has-stack .dc-link::before, .has-stack .dc-link::after { transition: none; }
    .dc-pin svg, .dc-loading i { animation: none; }
}
