:root {
  --ink: #182322;
  --muted: #596663;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --line: #d8ded8;
  --teal: #0f6d67;
  --teal-dark: #0a4e4a;
  --marigold: #e5a72f;
  --clay: #a85f4b;
  --sage: #dfe8dc;
  --shadow: 0 18px 42px rgba(24, 35, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.alzn-page-shell {
  min-height: 100vh;
  padding: clamp(20px, 4vw, 52px);
}

.alzn-resource-hub {
  max-width: 1180px;
  margin: 0 auto;
}

.hub-hero {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  background: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hub-hero__media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(18, 35, 34, 0.92) 0%, rgba(18, 35, 34, 0.76) 42%, rgba(18, 35, 34, 0.12) 100%),
    url("./alzn-resource-hub-banner.png") center / cover;
}

.hub-hero__content {
  position: relative;
  z-index: 1;
  width: min(650px, 100%);
  padding: clamp(28px, 7vw, 76px);
  color: #fffdf7;
}

.hub-kicker {
  margin: 0 0 18px;
  color: #f1c869;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 660px;
  margin-bottom: 20px;
  font-size: clamp(2.8rem, 5.4vw, 4.55rem);
  line-height: 1;
  letter-spacing: 0;
}

.hub-intro {
  max-width: 560px;
  margin-bottom: 30px;
  color: rgba(255, 253, 247, 0.86);
  font-size: 1.12rem;
  line-height: 1.6;
}

.hub-actions,
.dialog-actions,
.resource-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 15px;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover,
.filter-pill:hover,
.collection-button:hover,
.save-toggle:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.button--primary {
  background: var(--marigold);
  color: #231b0b;
  font-weight: 750;
}

.button--secondary {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fffdf7;
}

.button--compact {
  min-height: 36px;
  padding: 8px 10px;
  border-color: var(--line);
  background: #fff;
  font-size: 0.9rem;
}

#importFile {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.hub-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, auto) minmax(170px, auto);
  gap: 16px;
  align-items: end;
  margin: 26px 0 18px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

label,
.search-field,
.select-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd4ce;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill,
.collection-button,
.save-toggle,
.icon-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.filter-pill {
  min-height: 38px;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.88rem;
}

.filter-pill.is-active,
.collection-button.is-active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.hub-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.hub-stats div {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.hub-stats strong {
  display: block;
  margin-bottom: 2px;
  color: var(--teal-dark);
  font-size: 1.9rem;
  line-height: 1;
}

.hub-stats span {
  color: var(--muted);
  font-size: 0.9rem;
}

.hub-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.hub-sidebar,
.resource-region {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.hub-sidebar {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 8px;
  padding: 16px;
}

.hub-sidebar h2 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.collection-button {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 6px;
  padding: 10px 12px;
  text-align: left;
}

.collection-button span {
  overflow-wrap: anywhere;
}

.resource-region {
  min-height: 500px;
  padding: 18px;
}

.resource-region__header {
  display: flex;
  gap: 18px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.resource-region__header h2 {
  margin-bottom: 4px;
  font-size: 1.35rem;
}

.resource-region__header p,
.resource-summary,
.empty-state p {
  color: var(--muted);
  line-height: 1.55;
}

#visibleCount {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--sage);
  padding: 6px 10px;
  color: var(--teal-dark);
  font-size: 0.85rem;
  font-weight: 800;
}

.resource-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.resource-card {
  display: grid;
  gap: 12px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.resource-card__meta,
.resource-details,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.topic-badge,
.priority-badge,
.resource-details span,
.tag-list span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.78rem;
}

.topic-badge {
  background: #e1f0ef;
  color: var(--teal-dark);
  font-weight: 800;
}

.priority-badge {
  background: #fff2cf;
  color: #72500f;
  font-weight: 800;
}

.resource-card h3 {
  margin-bottom: 0;
  font-size: 1.1rem;
  line-height: 1.3;
}

.resource-summary {
  margin-bottom: 0;
}

.resource-details span {
  background: #f4f1ec;
  color: #4f5b58;
}

.tag-list span {
  background: #f2e7e2;
  color: #7b3e30;
}

.save-toggle {
  min-height: 36px;
  margin-left: auto;
  border-radius: 6px;
  padding: 8px 10px;
  font-weight: 800;
}

.save-toggle[aria-pressed="true"] {
  border-color: var(--clay);
  background: var(--clay);
  color: #fff;
}

.empty-state {
  padding: 50px 18px;
  text-align: center;
}

.resource-dialog {
  width: min(760px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.resource-dialog::backdrop {
  background: rgba(10, 22, 21, 0.62);
}

#resourceForm {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dialog-header h2 {
  margin-bottom: 0;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dialog-actions {
  justify-content: flex-end;
}

.dialog-actions .button--secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

#deleteButton {
  margin-right: auto;
  border-color: #e2b7ad;
  color: #833522;
}

@media (max-width: 920px) {
  .hub-toolbar,
  .hub-layout {
    grid-template-columns: 1fr;
  }

  .hub-sidebar {
    position: static;
  }
}

@media (max-width: 700px) {
  .alzn-page-shell {
    padding: 12px;
  }

  .hub-hero {
    min-height: 560px;
  }

  .hub-hero__media {
    background:
      linear-gradient(180deg, rgba(18, 35, 34, 0.94) 0%, rgba(18, 35, 34, 0.78) 58%, rgba(18, 35, 34, 0.26) 100%),
      url("./alzn-resource-hub-banner.png") center / cover;
  }

  .hub-hero__content {
    padding: 26px;
  }

  h1 {
    max-width: 11ch;
    font-size: 2.85rem;
  }

  .hub-stats,
  .resource-list,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .resource-region__header {
    display: grid;
  }

  .resource-actions {
    align-items: stretch;
  }

  .resource-actions .button,
  .save-toggle {
    flex: 1 1 140px;
  }

  .save-toggle {
    margin-left: 0;
  }
}
