@import url("/brand-tokens.css");

:root {
  color-scheme: light;
  font-family: var(--sdc-font);
  color: var(--sdc-primary);
  background: var(--sdc-light-gray);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #0b2a52;
  --graphite: #0b2a52;
  --blue: #3e7cb1;
  --blue-dark: #3e7cb1;
  --mist: #e9eef5;
  --stone: #a7b3c6;
  --paper: #e9eef5;
  --white: #fff;
  --line: rgba(11, 42, 82, 0.14);
  --shadow: 0 22px 60px rgba(11, 42, 82, 0.13);
  --success: #28785f;
  --amber: #a96b12;
  --danger: #a64040;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); }
body, button, input, textarea, select { font: inherit; }
button, input, textarea, select { letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.resource-shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.resource-header { position: sticky; z-index: 20; top: 0; padding: 14px 0; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.resource-header__inner { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(240px, 340px) auto; align-items: center; gap: clamp(14px, 2vw, 28px); width: min(1460px, calc(100% - 32px)); margin: auto; }
.resource-brand img { display: block; width: clamp(210px, 18vw, 286px); height: auto; }
.resource-header nav { display: flex; justify-content: flex-end; align-items: center; gap: clamp(18px, 2vw, 34px); color: rgba(11,42,82,.7); font-size: .88rem; font-weight: 600; }
.resource-header nav a { min-height: 36px; display: inline-flex; align-items: center; border-bottom: 2px solid transparent; }
.resource-header nav a:hover, .resource-header nav a.is-active { color: var(--ink); border-bottom-color: var(--blue); }
.icon-link { display: inline-grid; width: 42px; height: 42px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--mist); }
.icon-link:hover { background: var(--sdc-light-gray); }
.resource-search { width: 100%; margin: 0; }
.search-box { display: flex; width: 100%; min-height: 44px; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--blue-dark); background: var(--sdc-light-gray); }
.search-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(62,124,177,.14); }
.search-box input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-box input::placeholder { color: rgba(11,42,82,.56); }

.resource-hero { padding: clamp(72px, 9vw, 120px) 0 clamp(54px, 7vw, 88px); color: #fff; background: #0b2a52; }
.resource-hero__layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, .34fr); gap: clamp(34px, 7vw, 96px); align-items: end; }
.eyebrow { margin: 0 0 12px; color: var(--blue); font-size: .76rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.resource-hero .eyebrow { color: var(--sdc-gray); }
.resource-hero h1, .resource-title-band h1, .document-page h1 { margin: 0; max-width: 900px; font-size: clamp(2.5rem, 6vw, 5.8rem); line-height: .98; letter-spacing: 0; }
.resource-hero__lead { max-width: 780px; margin: 24px 0 0; color: rgba(255,255,255,.78); font-size: clamp(1.03rem, 1.55vw, 1.32rem); line-height: 1.65; }
.resource-stats { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: baseline; padding-left: 24px; border-left: 1px solid rgba(255,255,255,.24); }
.resource-stats strong { font-size: 2.2rem; font-weight: 600; color: #fff; }
.resource-stats span { color: rgba(255,255,255,.68); font-size: .9rem; }

.resource-library { padding: clamp(52px, 7vw, 92px) 0; }
.folder-list { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 52px; }
.folder-chip { display: inline-flex; min-height: 42px; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--graphite); background: rgba(255,255,255,.8); font-size: .9rem; font-weight: 600; }
.folder-chip:hover { border-color: rgba(62,124,177,.48); background: #fff; }
.folder-chip small { display: inline-grid; min-width: 24px; height: 24px; place-items: center; border-radius: 50%; color: var(--blue-dark); background: var(--mist); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.section-heading h2 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.6rem); letter-spacing: 0; }
.section-heading > p { margin: 0; color: rgba(11,42,82,.68); font-size: .9rem; }
.document-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.document-card { display: grid; grid-template-rows: auto auto 1fr auto auto; min-width: 0; min-height: 310px; padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.92); box-shadow: 0 14px 38px rgba(11,42,82,.07); }
.document-card:hover { border-color: rgba(62,124,177,.4); box-shadow: 0 18px 48px rgba(11,42,82,.11); }
.document-card__type { display: flex; align-items: center; gap: 8px; color: var(--blue-dark); font-size: .75rem; font-weight: 600; }
.document-card h3 { margin: 22px 0 10px; font-size: 1.18rem; line-height: 1.32; letter-spacing: 0; overflow-wrap: anywhere; }
.document-card h3 a::after { position: absolute; content: ''; }
.document-card p { margin: 0; color: rgba(11,42,82,.72); font-size: .91rem; line-height: 1.6; }
.document-card__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: rgba(11,42,82,.6); font-size: .76rem; }
.text-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; color: var(--blue-dark); font-size: .88rem; font-weight: 600; }
.empty-state { grid-column: 1 / -1; padding: 52px; border: 1px dashed rgba(11,42,82,.24); border-radius: 8px; text-align: center; background: rgba(255,255,255,.52); }
.empty-state h2 { margin: 0; font-size: 1.35rem; }
.empty-state p { margin: 10px 0 0; color: rgba(11,42,82,.68); }

.resource-title-band { padding: 54px 0 72px; background: #fff; border-bottom: 1px solid var(--line); }
.resource-title-band h1 { max-width: 980px; font-size: clamp(2.25rem, 5vw, 4.6rem); }
.resource-title-band > .resource-shell > p:not(.eyebrow) { max-width: 760px; margin: 22px 0 0; color: rgba(11,42,82,.7); font-size: 1.08rem; line-height: 1.65; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 44px; color: rgba(11,42,82,.6); font-size: .8rem; }
.breadcrumbs a:hover { color: var(--blue-dark); }
.breadcrumbs a:last-child { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.document-page { padding: 44px 0 90px; background: #fff; }
.document-page__layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(42px, 7vw, 96px); align-items: start; }
.document-kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; color: var(--blue-dark); font-size: .8rem; font-weight: 600; }
.document-page h1 { max-width: 850px; font-size: clamp(2.25rem, 5vw, 4.8rem); line-height: 1.03; overflow-wrap: anywhere; }
.document-page__lead { max-width: 800px; margin: 24px 0 0; color: rgba(11,42,82,.72); font-size: clamp(1rem, 1.5vw, 1.22rem); line-height: 1.7; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tag-list span { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; color: rgba(11,42,82,.72); background: var(--paper); font-size: .78rem; font-weight: 600; }
.document-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 9px; padding: 0 16px; border: 1px solid transparent; border-radius: 8px; font-weight: 600; font-size: .88rem; }
.button--primary { color: #fff; background: var(--ink); }
.button--primary:hover { background: var(--blue-dark); }
.button--secondary { color: var(--ink); border-color: var(--line); background: #fff; }
.button--secondary:hover { border-color: var(--blue); }
.button--quiet { color: var(--ink); border-color: var(--line); background: var(--paper); }
.button--danger { margin-right: auto; color: var(--danger); border-color: rgba(166,64,64,.24); background: #fff; }
.document-facts { position: sticky; top: 100px; padding: 24px; border-left: 3px solid var(--blue); background: var(--paper); }
.document-facts h2 { margin: 0 0 18px; font-size: 1rem; }
.document-facts dl, .document-facts div { margin: 0; }
.document-facts div { padding: 13px 0; border-top: 1px solid var(--line); }
.document-facts dt { color: rgba(11,42,82,.58); font-size: .72rem; font-weight: 600; text-transform: uppercase; }
.document-facts dd { margin: 5px 0 0; color: var(--graphite); font-size: .9rem; line-height: 1.4; }
.document-facts a { color: var(--blue-dark); font-weight: 600; }
.document-preview { margin-top: clamp(48px, 7vw, 84px); padding-top: 36px; border-top: 1px solid var(--line); }
.document-preview__heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.document-preview__heading h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: 0; }
.document-preview__heading .text-link { margin: 0; }
.document-preview__canvas { display: grid; min-height: 320px; place-items: center; padding: clamp(16px, 3vw, 36px); overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--mist); }
.document-preview__canvas img { display: block; width: auto; max-width: 100%; max-height: 980px; object-fit: contain; background: #fff; box-shadow: 0 18px 44px rgba(11,42,82,.18); }
.resource-footer { padding: 42px 0; color: rgba(255,255,255,.72); background: var(--sdc-primary); }
.resource-footer__inner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 36px; }
.resource-footer img { width: 230px; }
.resource-footer div div { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; font-size: .8rem; }
.resource-footer p { margin: 0; max-width: 240px; text-align: right; font-size: .8rem; }

/* Admin */
.admin-page { min-height: 100vh; background: var(--sdc-light-gray); }
.admin-shell { min-height: 100vh; }
.admin-header { display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 20px; padding: 12px clamp(20px, 4vw, 56px); border-bottom: 1px solid var(--line); background: #fff; }
.admin-header img { display: block; width: clamp(220px, 20vw, 286px); }
.admin-header > div { display: flex; align-items: center; gap: 18px; color: rgba(11,42,82,.66); font-size: .82rem; }
.admin-workspace { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.admin-sidebar { padding: 28px 18px; border-right: 1px solid var(--line); background: #fff; }
.admin-sidebar__heading, .admin-content__heading, .dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-sidebar h1, .admin-content h2, dialog h2 { margin: 0; font-size: 1.35rem; letter-spacing: 0; }
.admin-sidebar nav { display: grid; gap: 4px; margin-top: 24px; }
.folder-nav-item { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 0 11px; border: 0; border-radius: 6px; color: rgba(11,42,82,.7); background: transparent; text-align: left; font-size: .86rem; font-weight: 600; }
.folder-nav-item:hover, .folder-nav-item.is-active { color: var(--ink); background: var(--mist); }
.folder-nav-item small { color: var(--sdc-gray); }
.folder-nav-row { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 3px; }
.folder-edit-button { width: 34px; border: 0; border-radius: 6px; color: var(--sdc-gray); background: transparent; }
.folder-edit-button:hover { color: var(--ink); background: var(--mist); }
.admin-content { min-width: 0; padding: clamp(26px, 4vw, 52px); }
.admin-content__heading { margin-bottom: 24px; }
.drop-zone { display: grid; min-height: 130px; place-items: center; align-content: center; gap: 7px; padding: 24px; border: 2px dashed rgba(62,124,177,.35); border-radius: 8px; color: rgba(11,42,82,.68); background: rgba(255,255,255,.65); text-align: center; outline: 0; }
.drop-zone strong { color: var(--ink); }
.drop-zone span { font-size: .82rem; }
.drop-zone:hover, .drop-zone:focus, .drop-zone.is-dragging { border-color: var(--blue); background: #fff; }
.drop-zone.is-uploading { opacity: .55; pointer-events: none; }
.admin-message { margin-top: 16px; padding: 12px 14px; border-left: 3px solid var(--success); color: #205c4a; background: #e7f4ef; font-size: .86rem; }
.admin-message[data-tone="error"] { border-left-color: var(--danger); color: #863535; background: #faecec; }
.admin-table-wrap { margin-top: 22px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; }
.admin-table th { padding: 13px 16px; color: rgba(11,42,82,.58); background: var(--sdc-light-gray); font-size: .7rem; font-weight: 600; text-transform: uppercase; white-space: nowrap; }
.admin-table td { padding: 14px 16px; border-top: 1px solid var(--line); color: rgba(11,42,82,.72); font-size: .84rem; }
.document-name { display: grid; gap: 4px; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.document-name strong { color: var(--ink); font-size: .9rem; }
.document-name span { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sdc-gray); font-size: .74rem; }
.status { display: inline-flex; min-height: 28px; align-items: center; padding: 0 9px; border-radius: 6px; font-size: .72rem; font-weight: 600; }
.status--published { color: var(--success); background: #e3f2ed; }
.status--draft { color: var(--amber); background: #fff3dd; }
.table-action { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: #fff; }
.table-empty { padding: 28px; text-align: center; color: rgba(11,42,82,.6); }
.login-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: clamp(44px, 9vw, 120px); align-items: center; width: min(1040px, calc(100% - 40px)); min-height: calc(100vh - 76px); margin: auto; padding: 60px 0; }
.login-panel h1 { margin: 0; font-size: clamp(2.4rem, 5vw, 4.8rem); line-height: 1; }
.login-panel > div > p:not(.eyebrow) { max-width: 560px; color: rgba(11,42,82,.7); font-size: 1.05rem; line-height: 1.65; }
.login-panel form { display: grid; gap: 18px; padding: 30px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
label { display: grid; gap: 8px; color: rgba(11,42,82,.72); font-size: .8rem; font-weight: 600; }
input, textarea, select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid rgba(11,42,82,.2); border-radius: 6px; color: var(--ink); background: #fff; outline: 0; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(62,124,177,.14); }
.form-error { margin: 0; color: var(--danger); font-size: .82rem; }
dialog { width: min(620px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 8px; color: var(--ink); background: #fff; box-shadow: 0 28px 90px rgba(3,22,47,.3); }
dialog::backdrop { background: rgba(7,29,58,.55); backdrop-filter: blur(4px); }
dialog form { display: grid; gap: 18px; padding: 26px; }
.dialog-heading { margin-bottom: 4px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input { width: 18px; min-height: 18px; }
.file-replacement { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.file-replacement > div { display: grid; min-width: 0; gap: 4px; }
.file-replacement span { color: rgba(11,42,82,.58); font-size: .7rem; font-weight: 600; text-transform: uppercase; }
.file-replacement strong { overflow: hidden; color: var(--ink); font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .resource-header nav { display: none; }
  .resource-hero__layout, .document-page__layout, .login-panel { grid-template-columns: 1fr; }
  .resource-stats { grid-template-columns: auto 1fr; max-width: 360px; }
  .document-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-facts { position: static; }
  .resource-footer__inner { grid-template-columns: 1fr; text-align: center; }
  .resource-footer img { margin: auto; }
  .resource-footer p { margin: auto; text-align: center; }
  .admin-workspace { grid-template-columns: 1fr; }
  .admin-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .resource-shell { width: min(100% - 28px, 1180px); }
  .resource-header__inner { width: calc(100% - 24px); grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .resource-brand img { width: 190px; }
  .resource-search { grid-column: 1 / -1; grid-row: 2; }
  .resource-header .icon-link { grid-column: 2; grid-row: 1; }
  .resource-hero { padding-top: 58px; }
  .resource-hero h1 { font-size: 3.2rem; }
  .document-grid { grid-template-columns: 1fr; }
  .document-card { min-height: 0; }
  .section-heading { align-items: start; flex-direction: column; }
  .document-page h1, .resource-title-band h1 { font-size: 2.45rem; }
  .document-actions .button { width: 100%; }
  .document-preview__heading { align-items: start; flex-direction: column; }
  .document-preview__canvas { min-height: 220px; padding: 10px; }
  .admin-header > div > span { display: none; }
  .admin-content { padding: 24px 14px; }
  .admin-content__heading { align-items: start; flex-direction: column; }
  .admin-sidebar nav { grid-template-columns: 1fr; }
  .admin-table th:nth-child(2), .admin-table td:nth-child(2), .admin-table th:nth-child(4), .admin-table td:nth-child(4) { display: none; }
  .login-panel { width: calc(100% - 28px); }
  .dialog-actions { flex-wrap: wrap; }
  .button--danger { width: 100%; margin-right: 0; }
}
