/* S&A Lawyers Knowledge Hub: public site. Colours follow sandalawyers.com. */
:root {
  --brand: #d3072a;          /* S&A crimson */
  --brand-dark: #a80522;
  --brand-tint: #fdecee;
  --black: #000000;
  --ink: #303030;            /* body text */
  --muted: #737373;          /* secondary text */
  --line: #e3e3e3;
  --line-strong: #cbcbcb;
  --bg: #ffffff;
  --tint: #f2f2f2;           /* light panels */
  --footer: #757575;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 6px 20px rgba(0, 0, 0, .06);
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 var(--sans); color: var(--ink); background: var(--bg); }
img { max-width: 100%; }
a { color: var(--brand); }
h1, h2, h3 { font-family: var(--sans); color: var(--black); line-height: 1.2; font-weight: 500; letter-spacing: -.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid rgba(211, 7, 42, .35); outline-offset: 2px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 820px; }

/* ---------- header ---------- */
.site-header { background: #fff; color: var(--black); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 80px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--black); text-decoration: none; }
.brand-logo { display: block; height: 22px; width: auto; }
.brand-hub { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding: 4px 0 4px 14px; border-left: 1px solid var(--line-strong); white-space: nowrap; }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav > a, .nav-dropdown-btn { color: var(--black); text-decoration: none; font: 400 15px var(--sans); padding: 10px 12px; background: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.site-nav > a:hover, .nav-dropdown-btn:hover { color: var(--brand); }
.site-nav > a.active, .nav-dropdown-btn.active { color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.nav-admin { border: 1px solid var(--line-strong) !important; border-radius: var(--radius); margin-left: 4px; }

.nav-dropdown { position: relative; }
.nav-dropdown-menu { display: none; position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid var(--line); border-top: 2px solid var(--brand); box-shadow: 0 12px 40px rgba(0,0,0,.12); padding: 8px; min-width: 320px; }
.nav-dropdown.open .nav-dropdown-menu { display: block; }
@media (hover: hover) and (min-width: 961px) { .nav-dropdown:hover .nav-dropdown-menu { display: block; } .nav-dropdown::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 10px; } }
.nav-dropdown-menu a { display: flex; justify-content: space-between; gap: 16px; padding: 9px 12px; color: var(--ink); text-decoration: none; font-size: 14.5px; }
.nav-dropdown-menu a:hover { background: var(--tint); color: var(--brand); }
.nav-dropdown-menu .count { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.nav-dropdown-menu a.all { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; color: var(--brand); font-weight: 500; }

.nav-search { display: flex; align-items: center; margin-left: 8px; background: var(--tint); border: 1px solid transparent; border-radius: 999px; padding: 2px 4px 2px 14px; }
.nav-search:focus-within { border-color: var(--line-strong); background: #fff; }
.nav-search input[type=search] { background: transparent; border: 0; color: var(--black); font: 14px var(--sans); width: 150px; padding: 7px 0; outline: none; }
.nav-search input::placeholder { color: var(--muted); }
.nav-search button { background: none; border: 0; color: var(--ink); padding: 6px 8px; cursor: pointer; display: grid; place-items: center; }

.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 26px; height: 1.5px; background: var(--black); margin: 7px 0; transition: .2s; }
.nav-toggle span:nth-child(2) { width: 18px; margin-left: 8px; }

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 80px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 8px 16px 20px; gap: 2px; border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0,0,0,.08); max-height: calc(100vh - 80px); overflow-y: auto; }
  .site-nav.open { display: flex; }
  .site-nav > a, .nav-dropdown-btn { width: 100%; justify-content: space-between; padding: 12px; }
  .site-nav > a.active, .nav-dropdown-btn.active { box-shadow: inset 3px 0 0 var(--brand); }
  .nav-dropdown-menu { position: static; transform: none; box-shadow: none; min-width: 0; border: 0; background: var(--tint); }
  .nav-search { margin: 10px 0 0; }
  .nav-search input[type=search] { width: 100%; }
  .nav-admin { margin: 8px 0 0 !important; justify-content: center !important; }
}
@media (max-width: 480px) { .container { padding: 0 16px; } }
@media (max-width: 420px) { .brand-logo { height: 18px; } .brand { gap: 10px; } .brand-hub { padding-left: 10px; font-size: 10px; letter-spacing: .12em; } }
@media (max-width: 360px) { .brand-hub { display: none; } }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 500 14.5px var(--sans); padding: 11px 22px; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { border-color: var(--line-strong); color: var(--black); background: #fff; }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-link { background: none; color: var(--brand); padding: 8px 10px; }
.btn-link:hover { text-decoration: underline; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
input[type=search], input[type=text], select { font: 15px var(--sans); color: var(--black); padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; width: 100%; min-width: 0; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23737373' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
input:focus, select:focus { border-color: var(--brand); outline: 3px solid rgba(211,7,42,.12); outline-offset: 0; }

/* ---------- hero (red band with diagonal lines, as on the firm site) ---------- */
.hero { background: var(--brand); color: #fff; padding: 80px 0 88px; position: relative; overflow: hidden; }
.hero::before, .hero::after { content: ''; position: absolute; pointer-events: none; top: 0; width: 4px; height: 1600px; background: rgba(255, 70, 88, .8); transform: rotate(-52deg); transform-origin: top center; }
.hero::before { right: 45%; }
.hero::after { right: 18%; }
.hero .container { position: relative; z-index: 1; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: 12px; font-weight: 500; color: rgba(255,255,255,.8); margin: 0 0 16px; }
.hero h1 { color: #fff; font-weight: 400; font-size: clamp(34px, 4.8vw, 56px); line-height: 1.12; max-width: 820px; margin: 0 0 18px; }
.hero-lead { color: rgba(255,255,255,.88); font-size: 18px; font-weight: 300; max-width: 680px; margin: 0 0 40px; }
.hero-search { display: grid; grid-template-columns: 2fr 1.3fr .8fr auto; gap: 12px; align-items: end; background: #fff; padding: 20px; border-radius: var(--radius); box-shadow: 0 20px 50px rgba(0,0,0,.18); max-width: 1040px; }
.hero-search .field { margin: 0; }
.hero-search .btn { height: 44px; padding: 0 30px; }
@media (max-width: 860px) { .hero-search { grid-template-columns: 1fr 1fr; } .hero-search .field-q { grid-column: 1 / -1; } .hero-search .btn { grid-column: 1 / -1; } }
@media (max-width: 480px) { .hero { padding: 52px 0 60px; } .hero-search { grid-template-columns: 1fr; } .hero-lead { font-size: 16px; } }

/* ---------- sections ---------- */
.section { padding: 72px 0; }
.section-tight { padding: 40px 0 72px; }
.section-tint { background: var(--tint); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 32px; font-weight: 400; color: var(--brand); }
.link-arrow { color: var(--black); text-decoration: none; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.link-arrow::after { content: ' ›'; color: var(--brand); font-size: 16px; }
.link-arrow:hover { color: var(--brand); }
.empty { padding: 32px; text-align: center; color: var(--muted); background: var(--tint); }

.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.area-tile { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 128px; padding: 22px; text-decoration: none; color: var(--black); background: #fff; border: 1px solid var(--line); position: relative; overflow: hidden; transition: background .15s, color .15s; }
.area-tile::before { content: ''; position: absolute; left: 0; top: 0; height: 3px; width: 0; background: var(--brand); transition: width .2s; }
.area-tile:hover { background: #fcfcfc; }
.area-tile:hover::before { width: 100%; }
.area-tile:hover .area-name { color: var(--brand); }
.area-name { font-size: 18px; font-weight: 500; line-height: 1.3; transition: color .15s; }
.area-count { font-size: 13px; color: var(--muted); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
@media (max-width: 400px) { .card-grid { grid-template-columns: 1fr; } }
.card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); padding: 24px; transition: box-shadow .15s, border-color .15s; }
.card:hover { box-shadow: var(--shadow); }
.card-media { display: block; margin: -24px -24px 20px; aspect-ratio: 16 / 9; overflow: hidden; background: var(--tint); }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.03); }
.card-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 12px; flex-wrap: wrap; }
.card-title { font-size: 20px; font-weight: 600; margin: 0 0 10px; line-height: 1.3; }
.card-title a { color: var(--black); text-decoration: none; }
.card-title a:hover { color: var(--brand); }
.card-summary { color: var(--muted); margin: 0 0 18px; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-summary mark, .snippet mark { background: var(--brand-tint); color: var(--brand-dark); padding: 0 2px; }
.card-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.card-areas { display: flex; flex-wrap: wrap; gap: 6px; }
.area-chip { display: inline-block; font-size: 12.5px; color: var(--ink); background: var(--tint); padding: 3px 10px; border-radius: 999px; text-decoration: none; border: 1px solid transparent; }
.area-chip:hover { border-color: var(--brand); color: var(--brand); }
.pdf-flag { font-size: 11px; font-weight: 600; color: var(--brand); border: 1px solid var(--brand); padding: 1px 6px; border-radius: 3px; letter-spacing: .04em; }

.badge { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 3px; }
.badge-article { background: var(--brand); color: #fff; }
.badge-blog { background: var(--brand-tint); color: var(--brand-dark); }
.badge-memo { background: var(--ink); color: #fff; }
.badge-document { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }

.about-strip { background: var(--tint); }
.about-strip h2 { color: var(--brand); font-weight: 400; font-size: 30px; margin: 0 0 8px; }
.about-strip p { margin: 0; max-width: 640px; color: var(--ink); }
.about-strip-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }

/* ---------- page hero / library ---------- */
.page-hero { background: var(--tint); padding: 40px 0 36px; }
.page-hero h1 { font-size: clamp(32px, 4vw, 44px); font-weight: 400; color: var(--brand); margin: 10px 0 8px; }
.page-lead { color: var(--muted); font-size: 17px; margin: 0; max-width: 720px; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }

.library-layout { display: grid; grid-template-columns: 270px 1fr; gap: 40px; align-items: start; }
.filters { position: sticky; top: 104px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--brand); padding: 20px; }
.filters-heading { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.other-areas { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.other-areas ul { list-style: none; margin: 0; padding: 0; font-size: 14.5px; }
.other-areas li a { display: block; padding: 5px 0; text-decoration: none; color: var(--ink); }
.other-areas li a:hover { color: var(--brand); }
.results-bar { margin-bottom: 16px; }
.results-count { margin: 0; color: var(--muted); }
.results-count strong { color: var(--black); }
.result-list { display: grid; gap: 16px; }
.result-list .card-summary { -webkit-line-clamp: 4; }
/* in the library list, images sit beside the text */
.result-list .card.has-image { display: grid; grid-template-columns: 1fr 240px; column-gap: 28px; align-content: start; }
.result-list .card.has-image > * { grid-column: 1; }
.result-list .card.has-image .card-media { grid-column: 2; grid-row: 1 / span 4; margin: 0; aspect-ratio: 4 / 3; align-self: start; }
@media (max-width: 640px) {
  .result-list .card.has-image { display: flex; }
  .result-list .card.has-image .card-media { margin: -24px -24px 20px; aspect-ratio: 16 / 9; }
}
.pager { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 32px; color: var(--muted); }
.pager a { text-decoration: none; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--black); }
.pager a:hover { border-color: var(--brand); color: var(--brand); }
@media (max-width: 860px) {
  .library-layout { grid-template-columns: 1fr; gap: 24px; }
  .filters { position: static; }
  #filter-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
  #filter-form .field:first-child, #filter-form .btn { grid-column: 1 / -1; }
}
@media (max-width: 480px) { #filter-form { grid-template-columns: 1fr; } }

.area-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.area-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px 8px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; transition: background .15s; }
.area-row:hover { background: #fafafa; }
.area-row:hover h2 { color: var(--brand); }
.area-row h2 { margin: 0; font-size: 22px; font-weight: 500; transition: color .15s; }
.area-row p { margin: 6px 0 0; color: var(--muted); }
.area-row .area-count { white-space: nowrap; color: var(--brand); }
@media (max-width: 560px) { .area-row { flex-direction: column; align-items: flex-start; gap: 8px; } }

/* ---------- publication ---------- */
.preview-banner { background: #fff4d6; color: #6b5413; text-align: center; padding: 10px 16px; font-size: 14px; border-bottom: 1px solid #f0dfa8; }
.pub-header { background: var(--tint); padding: 32px 0 40px; }
.pub-type { margin: 22px 0 14px; }
.pub-header h1 { font-size: clamp(30px, 4.2vw, 44px); font-weight: 500; margin: 0 0 16px; }
.pub-summary { font-size: 19px; font-weight: 300; color: var(--ink); margin: 0 0 18px; line-height: 1.55; }
.pub-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 14.5px; margin-bottom: 14px; }
.pub-areas { display: flex; flex-wrap: wrap; gap: 6px; }
.pub-areas .area-chip { background: #fff; }
.pub-body-wrap { padding-top: 40px; padding-bottom: 56px; }
.pub-figure { margin: 0 0 36px; }
.pub-figure img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: cover; }
.pub-figure figcaption { font-size: 13.5px; color: var(--muted); margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--brand); }

.prose { font-size: 17px; line-height: 1.75; color: var(--ink); }
.prose h2 { font-size: 25px; font-weight: 500; color: var(--brand); margin: 1.8em 0 .5em; }
.prose h3 { font-size: 20px; font-weight: 600; margin: 1.6em 0 .4em; }
.prose p { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .4em; }
.prose li::marker { color: var(--brand); }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--brand); color: var(--ink); font-size: 18px; font-weight: 300; }
.prose a { text-underline-offset: 3px; }
.prose table { border-collapse: collapse; width: 100%; margin: 1.2em 0; font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose th { background: var(--tint); font-weight: 600; }
.prose .ql-align-center { text-align: center; } .prose .ql-align-right { text-align: right; } .prose .ql-align-justify { text-align: justify; }
.prose > :first-child { margin-top: 0; }
.prose img { display: block; max-width: 100%; height: auto; margin: 1.6em auto; }
.prose p:has(> img:only-child) { margin: 0; }

.pdf-box { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border: 1px solid var(--line); border-left: 3px solid var(--brand); margin-bottom: 32px; flex-wrap: wrap; background: #fff; }
.pdf-box-info { display: flex; align-items: center; gap: 14px; color: var(--brand); min-width: 0; }
.pdf-name { color: var(--black); font-weight: 500; word-break: break-word; }
.pdf-hint { color: var(--muted); font-size: 14px; }
.pdf-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pdf-embed { margin: 8px 0 32px; border: 1px solid var(--line); overflow: hidden; height: 80vh; min-height: 520px; }
.pdf-embed iframe { width: 100%; height: 100%; border: 0; }
@media (max-width: 640px) { .pdf-embed { display: none; } }

.pub-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 32px 0 0; font-size: 14px; }
.pub-tags span { color: var(--muted); font-weight: 500; }
.pub-tags a { text-decoration: none; background: var(--brand-tint); color: var(--brand-dark); padding: 3px 10px; border-radius: 999px; }
.pub-disclaimer { margin-top: 36px; padding: 16px 18px; background: var(--tint); font-size: 13.5px; color: var(--muted); }
.pub-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; margin-left: -10px; }

.page-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.error-page { text-align: center; padding: 40px 0; }
.error-page h1 { color: var(--brand); font-weight: 400; }
.error-page .btn { margin: 4px; }

/* ---------- footer (grey, as on the firm site) ---------- */
.site-footer { background: var(--footer); color: #fff; font-size: 14.5px; padding: 56px 0 0; }
.site-footer p { color: rgba(255,255,255,.9); }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1.4fr 1fr; gap: 40px; }
.footer-brand { margin-bottom: 16px; }
.footer-brand img { display: block; height: 24px; width: auto; }
.footer-heading { color: #fff; text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 600; margin-bottom: 14px; }
.footer-areas, .footer-links { list-style: none; padding: 0; margin: 0; }
.footer-areas { columns: 2; column-gap: 24px; }
.footer-areas li, .footer-links li { margin-bottom: 8px; break-inside: avoid; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.25); margin-top: 40px; padding: 20px 24px 28px; font-size: 13px; }
.footer-legal p { margin: 0 0 6px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
@media (max-width: 420px) { .footer-areas { columns: 1; } }

/* ---------- print ---------- */
@media print {
  .site-header, .site-footer, .pub-tools, .pdf-actions, .pdf-embed, .preview-banner, .section-tint, .crumbs { display: none !important; }
  .pub-header { background: none; padding: 0; }
  .prose { font-size: 12pt; }
  a { color: inherit; }
}
