/* CounselDocket v3 — the complete stylesheet for briefs.html.

   Self-contained: briefs.html links this file alone. It is the three former
   stylesheets flattened in cascade order, so later sections override earlier
   ones exactly as the separate <link> tags did.

     1. Base      — the v1 design system
     2. v2 layer  — larger type scale, per-entry action buttons
     3. v3 layer  — Docket Overview as a card

   Sections 2 and 3 deliberately restate declarations from section 1; those
   restatements are the overrides, and order is what makes them win. */

/* ==========================================================================
   1. BASE
   ========================================================================== */

/* CounselDocket — attorney docket dashboard
   Palette: ink navy, slate, parchment, vellum, walnut, ochre.
   Type: Libre Caslon Display (captions) / Source Serif 4 (body) / Courier Prime (docket data). */

:root {
    --ink: #0A1729;
    --slate: #1B2E4A;
    --steel: #3E5C76;
    --parchment: #EFE7D8;
    --vellum: #FBF7EF;
    --walnut: #6B4A2F;
    --ochre: #A6641C;
    --ochre-deep: #8C5316;
    --brass: #C9A227;
    --moss: #607466;
    --plate: #FFFDF8;

    --text: #24303C;
    --muted: #6E6153;
    --rule: #CFC1A8;
    --rule-soft: #E2D8C6;

    --display: "Libre Caslon Display", "Iowan Old Style", Georgia, serif;
    --body: "Source Serif 4", "Source Serif Pro", Georgia, serif;
    --data: "Courier Prime", "Courier New", monospace;

    --gutter: 4rem;
    --leaf-pad: 1.75rem;
}

/* ---------- base ---------- */

body {
    margin: 0;
    background-color: var(--parchment);
    background-image:
        repeating-linear-gradient(0deg, rgba(107, 74, 47, 0.028) 0 1px, transparent 1px 3px);
    color: var(--text);
    font-family: var(--body);
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: 0.01em;
    margin: 0;
}

a {
    color: inherit;
}

p {
    margin: 0;
}

/* nothing on this page is rounded — it is printed matter */
button,
input,
select {
    border-radius: 0;
    appearance: none;
    -webkit-appearance: none;
}

:focus-visible {
    outline: 2px solid var(--ochre);
    outline-offset: 3px;
}

.shell {
    max-width: 68rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.eyebrow {
    font-family: var(--data);
    font-size: 0.6875rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- masthead ---------- */

.masthead {
    background: var(--ink);
    color: var(--parchment);
    border-bottom: 3px double rgba(239, 231, 216, 0.35);
}

.masthead__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 1.5rem 0 1.25rem;
}

.wordmark {
    font-family: var(--display);
    font-size: 1.75rem;
    line-height: 1;
    color: var(--parchment);
}

.wordmark span {
    color: var(--brass);
}

.wordmark__sub {
    display: block;
    margin-top: 0.45rem;
    font-family: var(--data);
    font-size: 0.625rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(239, 231, 216, 0.6);
}

.counsel {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.counsel__id {
    text-align: right;
    line-height: 1.35;
}

.counsel__name {
    font-family: var(--display);
    font-size: 1.0625rem;
    color: var(--parchment);
}

.counsel__bar {
    font-family: var(--data);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    color: rgba(239, 231, 216, 0.62);
}

/* Sits on parchment, in the Docket Overview header. Outlined, so it stays
   quieter than the ochre actions on the entries below. */
.btn-draft {
    display: inline-flex;
    align-items: center;
    gap: 0.55em;
    font-family: var(--data);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--walnut);
    background: var(--plate);
    border: 1px solid var(--rule);
    padding: 0.6rem 1.1rem;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.btn-draft:hover {
    color: #FFFFFF;
    background: var(--brass);
    border-color: var(--brass);
}

/* Sized in em so it tracks the button's type scale in both versions. */
.btn-draft__mark {
    width: 0.95em;
    height: 0.95em;
    flex: 0 0 auto;
}

.masthead__nav {
    display: flex;
    gap: 2rem;
    padding-bottom: 0.75rem;
    font-family: var(--data);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.masthead__nav a {
    color: rgba(239, 231, 216, 0.66);
    text-decoration: none;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid transparent;
}

.masthead__nav a:hover {
    color: var(--parchment);
}

.masthead__nav a[aria-current="page"] {
    color: var(--parchment);
    border-bottom-color: var(--brass);
}

/* ---------- ledger ---------- */

.ledger {
    margin: 2.5rem 0 2rem;
    border-bottom: 1px solid var(--rule);
}

/* The heavy ink rule sits under the title row, where the ledger's top edge was. */
.ledger__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    flex-wrap: wrap;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--ink);
}

.section-head {
    font-size: 1.75rem;
}

.ledger__row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.ledger__cell {
    padding: 1.1rem 1.25rem 1.2rem;
    border-left: 1px solid var(--rule-soft);
}

.ledger__cell:first-child {
    border-left: 0;
    padding-left: 0;
}

.ledger__count {
    font-family: var(--display);
    font-size: 2.25rem;
    line-height: 1;
    display: block;
    margin-bottom: 0.4rem;
}

.ledger__cell--flag .ledger__count {
    color: var(--ochre);
}

/* ---------- docket tally ---------- */

.result-line {
    margin: 1.1rem 0 1.75rem;
    font-family: var(--data);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--muted);
}

/* ---------- case leaf (pleading paper) ---------- */

.case-leaf {
    position: relative;
    background: var(--vellum);
    border: 1px solid var(--rule);
    margin-bottom: 4rem;
    box-shadow: 0 1px 2px rgba(10, 23, 41, 0.06);
}

/* the double margin rule of pleading paper */
.case-leaf::before,
.case-leaf::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(27, 46, 74, 0.32);
}

.case-leaf::before {
    left: calc(var(--gutter) - 0.75rem);
}

.case-leaf::after {
    left: calc(var(--gutter) - 0.5rem);
}

.tab {
    position: absolute;
    top: -1.7rem;
    left: -1px;
    font-family: var(--data);
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--parchment);
    padding: 0.3rem 1rem 0.25rem;
    clip-path: polygon(0 0, calc(100% - 0.7rem) 0, 100% 100%, 0 100%);
}

.tab--criminal   { background: var(--ink); }
.tab--commercial { background: var(--walnut); }
.tab--realestate { background: var(--steel); }

.caption {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: var(--leaf-pad) var(--leaf-pad) 1.1rem var(--gutter);
    border-bottom: 1px solid var(--rule-soft);
}

.caption__title {
    font-size: 1.5rem;
    line-height: 1.25;
}

.caption__venue {
    margin-top: 0.35rem;
    font-size: 0.9375rem;
    color: var(--muted);
}

.caption__venue em {
    font-style: normal;
    color: var(--walnut);
}

.caption__meta {
    text-align: right;
    font-family: var(--data);
    font-size: 0.75rem;
    line-height: 1.7;
    color: var(--muted);
    white-space: nowrap;
}

.caption__docket {
    display: block;
    color: var(--ink);
    letter-spacing: 0.06em;
}

/* Edit Matter sits under the docket data it edits, right-aligned with it. */
.caption__meta .case-act {
    display: inline-block;
    margin-top: 0.7rem;
}

.briefs {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0 0;
}

/* Case-level actions, at the foot of the leaf where the next entry would land.
   The gutter carries that next entry number, greyed. */
.leaf-foot {
    display: grid;
    grid-template-columns: var(--gutter) minmax(0, 1fr);
    align-items: center;
    padding: 0.85rem 0 1rem;
    border-top: 1px solid var(--rule-soft);
}

.leaf-foot__acts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
}

.case-act {
    font-family: var(--data);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    background: transparent;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.case-act--add {
    color: var(--walnut);
    background: var(--plate);
    border: 1px solid var(--rule);
    padding: 0.45rem 0.85rem;
}

.case-act--add:hover {
    color: #FFFFFF;
    background: var(--brass);
    border-color: var(--brass);
}

/* Fully bordered, but a size down from Add brief — it edits the case record
   rather than adding to the docket. */
.case-act--edit {
    color: var(--walnut);
    background: var(--plate);
    border: 1px solid var(--rule);
    padding: 0.3rem 0.6rem;
}

.case-act--edit:hover {
    color: #FFFFFF;
    background: var(--brass);
    border-color: var(--brass);
}

.brief {
    display: grid;
    grid-template-columns: var(--gutter) minmax(0, 1fr) 12.5rem 9rem;
    align-items: baseline;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--rule-soft);
    transition: background 120ms ease;
}

.briefs .brief:last-child {
    border-bottom: 0;
}

.brief:hover {
    background: rgba(107, 74, 47, 0.045);
}

.brief__entry {
    font-family: var(--data);
    font-size: 0.75rem;
    color: rgba(27, 46, 74, 0.45);
    text-align: right;
    padding-right: 1.6rem;
}

.brief__name {
    font-size: 1.0625rem;
    padding-right: 1rem;
}

.brief__note {
    display: block;
    font-size: 0.875rem;
    color: var(--muted);
    margin-top: 0.1rem;
}

.brief__meta {
    font-family: var(--data);
    font-size: 0.75rem;
    color: var(--muted);
    text-align: right;
    padding-right: var(--leaf-pad);
    white-space: nowrap;
}

.brief__meta--due {
    color: var(--ochre);
}

/* ---------- status marks ---------- */

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--data);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.35rem 0.65rem;
    white-space: nowrap;
}

.status::before {
    content: "";
    width: 0.6rem;
    height: 0.6rem;
    flex: 0 0 auto;
    border: 1px solid currentColor;
}

/* Every status is a filled badge. The marker glyph still separates them
   without relying on color alone: hollow, half, hatched, solid. */
.status--awaiting {
    color: var(--vellum);
    background: var(--walnut);
}

.status--progress {
    color: var(--vellum);
    background: var(--steel);
}

.status--progress::before {
    background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

.status--clarify {
    color: var(--vellum);
    background: var(--ochre-deep);
}

.status--clarify::before {
    background: repeating-linear-gradient(-45deg, currentColor 0 2px, transparent 2px 4px);
}

.status--complete {
    color: var(--parchment);
    background: var(--ink);
}

.status--complete::before {
    background: currentColor;
}

/* ---------- colophon ---------- */

.colophon {
    margin: 3rem 0 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-family: var(--data);
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- motion ---------- */

.case-leaf {
    animation: leaf-in 420ms ease both;
}

@keyframes leaf-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.001ms !important;
    }
}

/* ---------- narrow screens ---------- */

@media (max-width: 60rem) {
    .ledger__row {
        grid-template-columns: repeat(2, 1fr);
    }

    .ledger__cell:nth-child(odd) {
        border-left: 0;
        padding-left: 0;
    }

    .brief {
        grid-template-columns: var(--gutter) minmax(0, 1fr) 12.5rem;
    }

    .brief__meta {
        grid-column: 2 / -1;
        text-align: left;
        padding: 0.35rem 0 0;
    }
}

@media (max-width: 40rem) {
    :root {
        --gutter: 2.75rem;
        --leaf-pad: 1.1rem;
    }

    .shell {
        padding: 0 1rem;
    }

    .caption__title {
        font-size: 1.25rem;
    }

    .caption__meta {
        text-align: left;
    }

    .brief {
        grid-template-columns: var(--gutter) minmax(0, 1fr);
        row-gap: 0.4rem;
    }

    .brief__status {
        grid-column: 2;
    }
}
/* ==========================================================================
   2. V2 LAYER — larger type scale, per-entry actions
   ========================================================================== */

/* CounselDocket v2 — layered on top of dashboard.css.
   Two changes from v1: a larger type scale throughout, and every brief entry
   carries the one action its status calls for instead of a date. */

/* ---------- type scale ---------- */

body {
    font-size: 1.125rem;
    line-height: 1.6;
}

.eyebrow {
    font-size: 0.75rem;
}

.wordmark {
    font-size: 2rem;
}

.wordmark__sub {
    font-size: 0.6875rem;
}

.counsel__name {
    font-size: 1.4375rem;
}

.counsel__bar,
.masthead__nav {
    font-size: 0.8125rem;
}

.btn-draft {
    font-size: 0.8125rem;
    padding: 0.65rem 1.2rem;
}

.section-head {
    font-size: 2rem;
}

.ledger__count {
    font-size: 2.75rem;
}

.result-line {
    font-size: 0.8125rem;
}

.caption__title {
    font-size: 1.875rem;
}

.caption__venue {
    font-size: 1.0625rem;
}

.caption__meta {
    font-size: 0.8125rem;
}

.brief__entry {
    font-size: 0.875rem;
}

.brief__name {
    font-size: 1.25rem;
}

.brief__note {
    font-size: 1rem;
}

.status {
    font-size: 0.8125rem;
    gap: 0.55rem;
    padding: 0.35rem 0.7rem;
}

.status::before {
    width: 0.7rem;
    height: 0.7rem;
}

.case-act {
    font-size: 0.8125rem;
}

.case-act--add {
    padding: 0.5rem 0.95rem;
}

.colophon {
    font-size: 0.75rem;
}

/* ---------- entry row: date column replaced by an action ---------- */

:root {
    --gutter: 4.75rem;
    --leaf-pad: 2rem;
}

.brief {
    grid-template-columns: var(--gutter) minmax(0, 1fr) 14rem 11rem;
    align-items: center;
    padding: 0.95rem 0;
}

.brief__action {
    text-align: right;
    padding-right: var(--leaf-pad);
}

/* One form for every brief action: white plate, solid navy rule. The status
   badge beside it already carries the state, so the button need not. */
.act {
    font-family: var(--data);
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    min-width: 8.5rem;
    padding: 0.5rem 0.9rem;
    color: #FFFFFF;
    background: var(--moss);
    border: 1px solid var(--ink);
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease;
}

.act:hover {
    color: #FFFFFF;
    background: var(--ink);
}

/* ---------- narrow screens ---------- */

@media (max-width: 64rem) {
    .brief {
        grid-template-columns: var(--gutter) minmax(0, 1fr) 14rem;
        row-gap: 0.6rem;
    }

    .brief__action {
        grid-column: 3;
        grid-row: 1;
    }
}

@media (max-width: 48rem) {
    .brief {
        grid-template-columns: var(--gutter) minmax(0, 1fr);
    }

    .brief__status,
    .brief__action {
        grid-column: 2;
        grid-row: auto;
        text-align: left;
        padding-right: 0;
    }
}

@media (max-width: 40rem) {
    :root {
        --gutter: 3rem;
        --leaf-pad: 1.25rem;
    }

    .caption__title {
        font-size: 1.5rem;
    }

    .act {
        width: 100%;
        min-width: 0;
    }
}
/* ==========================================================================
   3. V3 LAYER — Docket Overview card
   ========================================================================== */

.ledger {
    background: var(--vellum);
    border: 1px solid var(--rule);
    box-shadow: 0 1px 2px rgba(10, 23, 41, 0.06);
    padding: 1.5rem 1.75rem 1.4rem;
    /* Clears the folder tab on the first case leaf, which sits ~1.4rem above it. */
    margin-bottom: 4rem;
}

/* The cells sit inside the card's padding now, so they carry less of their own. */
.ledger__cell {
    padding: 1.1rem 1.25rem 0;
}

@media (max-width: 40rem) {
    .ledger {
        padding: 1.1rem 1.1rem 1rem;
    }
}

/* Rounded corners. This is a deliberate departure from the base's flat
   printed-matter rule, so it lives here rather than in section 1. */
:root {
    --radius-card: 0.5rem;
    --radius-control: 0.25rem;
}

.ledger,
.case-leaf {
    border-radius: var(--radius-card);
}

.btn-draft,
.act,
.case-act--add,
.case-act--edit,
.status {
    border-radius: var(--radius-control);
}

/* Button icons. Sized in em so each tracks its button's type scale, and drawn
   in currentColor so they follow the label through the brass hover. */
.btn-ico {
    width: 0.95em;
    height: 0.95em;
    flex: 0 0 auto;
}

.act,
.case-act,
.caption__meta .case-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55em;
}

/* Masthead nav, given more presence: brighter links, heavier type, and its own
   band under the identity row. Brass stays reserved for the current page. */
.masthead__nav {
    gap: 2.25rem;
    font-size: 0.875rem;
    font-weight: 700;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
    border-top: 1px solid rgba(239, 231, 216, 0.18);
}

.masthead__nav a {
    color: rgba(239, 231, 216, 0.88);
    padding-bottom: 0.55rem;
}

.masthead__nav a:hover {
    color: var(--parchment);
    border-bottom-color: rgba(239, 231, 216, 0.4);
}

.masthead__nav a[aria-current="page"] {
    color: var(--parchment);
    border-bottom-color: var(--brass);
}

/* Account and Support sit at the right end of the nav bar. The auto margin on
   the first of them takes up all the slack, so both ride right. */
.masthead__nav {
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

.masthead__nav .nav-right {
    margin-left: auto;
}

/* Sticky masthead. js/dashboard-v3.js replaces `top` with the negative height
   of the identity row, so that row scrolls away and the nav pins. Without JS
   this degrades to the whole masthead sticking, which is still usable. */
.masthead {
    position: sticky;
    top: 0;
    z-index: 20;
}

.masthead.is-pinned {
    box-shadow: 0 2px 8px rgba(10, 23, 41, 0.3);
}

/* Anchor targets clear the pinned bar. */
html {
    scroll-padding-top: 4.5rem;
}


/* A page action that navigates rather than acts is a link wearing the button's
   clothes; without this it would carry the browser's underline. */
a.btn-draft,
a.case-act--edit {
    text-decoration: none;
}
