/* SustainableVet — Clinical Review. Restrained, academic, mobile-first. */

:root {
  --navy: #14233a;
  --navy-soft: #2a3b55;
  --green: #4f7a63;
  --green-dark: #3d614e;
  --green-tint: #eaf1ec;
  --amber: #8a6a1f;
  --amber-tint: #f6f0e1;
  --slate-tint: #eceff3;
  --bg: #fafaf8;
  --surface: #ffffff;
  --text: #1d2430;
  --muted: #5c6573;
  --line: #e2e4e8;
  --danger: #9b2c2c;
  --danger-tint: #f8eaea;
  --radius: 6px;
  --measure: 42rem;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

a { color: var(--navy); text-underline-offset: 3px; }
a:hover { color: var(--green-dark); }

h1, h2, h3 { color: var(--navy); line-height: 1.25; margin: 0 0 .75rem; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); font-weight: 650; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1rem; }

.container { width: 100%; max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: var(--measure); }

.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem 1rem; z-index: 10; }

/* Header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; gap: 1rem; }
.brand { text-decoration: none; color: var(--navy); display: flex; flex-direction: column; line-height: 1.2; }
.brand strong { font-size: 1.05rem; font-weight: 650; letter-spacing: .01em; }
.brand span { font-size: .8rem; color: var(--muted); }
.site-nav a { text-decoration: none; font-weight: 550; font-size: .95rem; }
.site-footer { border-top: 1px solid var(--line); margin-top: 4rem; padding: 2rem 0; color: var(--muted); font-size: .875rem; }

main { padding: 2.5rem 0 1rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3rem; padding: .7rem 1.4rem;
  border: 1px solid var(--navy); border-radius: var(--radius);
  background: var(--navy); color: #fff;
  font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--navy-soft); color: #fff; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--green); outline-offset: 2px;
}
.btn-green { background: var(--green); border-color: var(--green); }
.btn-green:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-secondary { background: transparent; color: var(--navy); }
.btn-secondary:hover { background: var(--slate-tint); color: var(--navy); }
.btn-small { min-height: 2.25rem; padding: .35rem .8rem; font-size: .875rem; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-tint); color: var(--danger); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Landing */
.hero { padding: 1.5rem 0 2.5rem; max-width: 44rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: .78rem; font-weight: 650; color: var(--green-dark); margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2rem, 6.5vw, 3.1rem); line-height: 1.12; margin-bottom: 1.25rem; }
.lead { font-size: 1.2rem; color: var(--muted); margin-bottom: 2rem; }
.authority { border-left: 3px solid var(--green); padding: .25rem 0 .25rem 1.1rem; margin: 2.5rem 0 0; color: var(--navy); font-size: 1.1rem; }
.authority p { margin: 0; }

.steps { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.steps li { background: var(--surface); padding: 1.5rem; }
.step-number { display: block; font-size: .8rem; font-weight: 650; color: var(--green-dark); margin-bottom: .35rem; letter-spacing: .05em; }
.steps h2 { font-size: 1.1rem; margin-bottom: .35rem; }
.steps p { margin: 0; color: var(--muted); font-size: .975rem; }
@media (min-width: 40rem) { .steps { grid-template-columns: 1fr 1fr; } }
@media (min-width: 64rem) { .steps { grid-template-columns: repeat(4, 1fr); } }

.pilot-note { margin-top: 2rem; font-size: .875rem; color: var(--muted); }

/* Status labels */
.status { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 650; letter-spacing: .02em; white-space: nowrap; border: 1px solid transparent; }
.status-available { background: var(--green-tint); color: var(--green-dark); border-color: #cddcd2; }
.status-review { background: var(--amber-tint); color: var(--amber); border-color: #e8dcbc; }
.status-reviewed { background: var(--slate-tint); color: var(--navy); border-color: #d3d9e1; }

/* Library */
.page-intro { margin-bottom: 1.5rem; }
.page-intro p { color: var(--muted); margin: 0; }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1.5rem; display: grid; gap: .75rem; }
.filters .search { grid-column: 1 / -1; }
.filters-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
@media (min-width: 48rem) {
  .filters { grid-template-columns: repeat(3, 1fr); }
}
.result-count { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; }

.article-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
@media (min-width: 48rem) { .article-list { grid-template-columns: 1fr 1fr; } }
.article-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.25rem 1.1rem; height: 100%; display: flex; flex-direction: column; position: relative; }
.article-card:hover { border-color: #c7ccd4; }
.article-card h2 { font-size: 1.15rem; margin: .6rem 0 .5rem; }
.article-card h2 a { text-decoration: none; }
.article-card h2 a::after { content: ""; position: absolute; inset: 0; }
.article-card p { color: var(--muted); font-size: .95rem; margin-bottom: .9rem; }
.card-meta { margin-top: auto; font-size: .85rem; color: var(--muted); }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0; }
.tags li { font-size: .8rem; color: var(--navy-soft); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: .1rem .5rem; }
.tags .tag-label { color: var(--muted); }

.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 2rem; text-align: center; color: var(--muted); }

/* Article detail */
/* Mobile: header, review panel, then body. Desktop: panel in a sticky side column. */
.detail { display: grid; column-gap: 2.5rem; grid-template-areas: "header" "aside" "body"; }
.detail > .article-header { grid-area: header; }
.detail > aside { grid-area: aside; margin-bottom: 2rem; }
.detail > .article-body { grid-area: body; }
@media (min-width: 64rem) {
  .detail { grid-template-columns: minmax(0, 1fr) 20rem; grid-template-areas: "header aside" "body aside"; align-items: start; }
  .detail > aside { align-self: stretch; margin-bottom: 0; }
}
.breadcrumb { font-size: .9rem; margin-bottom: 1.25rem; }
.breadcrumb a { text-decoration: none; color: var(--muted); }
.article-header .summary { font-size: 1.15rem; color: var(--muted); }
.article-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.article-header .status { margin-bottom: 1rem; }
.article-body { max-width: var(--measure); font-size: 1.075rem; line-height: 1.75; }
.article-body h2 { margin-top: 2rem; }
.article-body h3 { margin-top: 1.5rem; }
.lang-note { font-size: .85rem; color: var(--muted); margin-bottom: 1.5rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.panel h2 { font-size: 1.15rem; }
.panel dl { margin: 1.25rem 0; }
.panel dt { font-weight: 650; color: var(--navy); font-size: .95rem; }
.panel dd { margin: 0 0 1rem; color: var(--muted); font-size: .95rem; }
.panel-cta { border-top: 3px solid var(--green); }
@media (min-width: 64rem) { .sticky { position: sticky; top: 1.5rem; } }
.reviewer-credit { border-top: 3px solid var(--navy); }
.reviewer-credit .name { font-weight: 650; color: var(--navy); margin-bottom: .1rem; }
.reviewer-credit ul { list-style: none; padding: 0; margin: .75rem 0 0; font-size: .95rem; }

/* Forms */
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem 1.25rem; }
@media (min-width: 40rem) { .form-card { padding: 2rem; } }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .35rem; color: var(--navy); }
.field .optional { font-weight: 400; color: var(--muted); font-size: .85rem; }
.field .help { font-size: .85rem; color: var(--muted); margin-top: .25rem; }
input[type=text], input[type=email], input[type=url], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 3rem; padding: .6rem .8rem;
  font: inherit; font-size: 1rem; color: var(--text);
  background: #fff; border: 1px solid #c9ced6; border-radius: var(--radius);
}
textarea { min-height: 6rem; line-height: 1.5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 1.1rem) 1.3rem, calc(100% - .8rem) 1.3rem; background-size: .3rem .3rem; background-repeat: no-repeat; padding-right: 2rem; }
.errorlist { list-style: none; padding: 0; margin: .35rem 0 0; color: var(--danger); font-size: .875rem; }
.field-error input, .field-error select { border-color: var(--danger); }
fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; }
legend { font-weight: 650; color: var(--navy); font-size: 1.05rem; margin-bottom: .75rem; padding: 0; }
.fieldset-note { color: var(--muted); font-size: .9rem; margin-top: -.5rem; }
.two-col { display: grid; gap: 0 1rem; }
@media (min-width: 40rem) { .two-col { grid-template-columns: 1fr 1fr; } }
details.optional-links { border-top: 1px solid var(--line); padding-top: 1rem; margin-bottom: 1.25rem; }
details.optional-links summary { cursor: pointer; font-weight: 600; color: var(--navy); padding: .25rem 0 .75rem; min-height: 2.5rem; }
.checkbox { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: 1rem; font-size: .95rem; }
.checkbox input { width: 1.25rem; height: 1.25rem; margin-top: .2rem; flex: none; accent-color: var(--green); }
.checkbox label { font-weight: 400; color: var(--text); }
.form-context { margin-bottom: 1.5rem; }
.form-context p { color: var(--muted); }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.messages li { padding: .85rem 1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); margin-bottom: .5rem; }
.messages .success { background: var(--green-tint); border-color: #cddcd2; color: var(--green-dark); }
.messages .error { background: var(--danger-tint); border-color: #eccaca; color: var(--danger); }
.messages .info { background: var(--amber-tint); border-color: #e8dcbc; color: var(--amber); }

/* Review page */
.review-meta { display: grid; gap: 1rem; margin: 1.5rem 0 2rem; }
@media (min-width: 40rem) { .review-meta { grid-template-columns: repeat(2, 1fr); } }
.review-meta div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; }
.review-meta span { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.review-meta strong { color: var(--navy); font-size: 1.05rem; }
.review-step { margin-bottom: 1.5rem; }
.instructions { padding-left: 1.25rem; margin: 0 0 1.5rem; }
.instructions li { margin-bottom: .4rem; }
.upload-box { border: 2px dashed #c9ced6; border-radius: var(--radius); padding: 1.25rem; background: var(--bg); }
.uploaded-file { display: flex; gap: .75rem; align-items: center; background: var(--green-tint); border: 1px solid #cddcd2; padding: .85rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; overflow-wrap: anywhere; }
.uploaded-file svg { flex: none; }
.submit-area { border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: 1.5rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.notice { border-left: 3px solid var(--green); padding-left: 1rem; }
.center-card { max-width: 36rem; margin: 1rem auto; text-align: left; }

/* Admin */
.admin-bar { background: var(--navy); color: #fff; }
.admin-bar .container { display: flex; align-items: center; justify-content: space-between; min-height: 3.25rem; gap: 1rem; flex-wrap: wrap; }
.admin-bar a, .admin-bar button { color: #fff; text-decoration: none; font-size: .9rem; background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
.admin-bar nav { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.admin-bar form { margin: 0; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: .7rem 1rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 550; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--navy); }
.tabs .count { font-size: .8rem; background: var(--slate-tint); border-radius: 999px; padding: 0 .45rem; margin-left: .3rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--bg); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.flag { color: var(--amber); font-weight: 600; font-size: .8rem; }
.overdue { color: var(--danger); font-weight: 600; }
.admin-grid { display: grid; gap: 1.5rem; }
@media (min-width: 64rem) { .admin-grid { grid-template-columns: minmax(0, 1fr) 24rem; align-items: start; } }
.claim-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.claim-card dl { display: grid; grid-template-columns: 8.5rem 1fr; gap: .3rem .75rem; font-size: .9rem; margin: .75rem 0; }
.claim-card dt { color: var(--muted); }
.claim-card dd { margin: 0; word-break: break-word; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .75rem; }
.actions form { margin: 0; display: flex; gap: .4rem; align-items: center; }
.actions input[type=number] { width: 5rem; min-height: 2.25rem; padding: .3rem .5rem; }
.term-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.term-row input { min-height: 2.5rem; }
.term-row form { display: flex; gap: .5rem; flex: 1; margin: 0; }
td:first-child { min-width: 14rem; }
