/* Andelsboligforening – Scandinavian-inspired design */

:root {
  --color-bg: #f7f4ef;
  --color-bg-alt: #ede8e0;
  --color-surface: #ffffff;
  --color-text: #1c2421;
  --color-text-muted: #5c6662;
  --color-primary: #2d5a4a;
  --color-primary-dark: #1e3d32;
  --color-primary-light: #e8f0ec;
  --color-accent: #c4783a;
  --color-border: #d9d2c7;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-serif: "Fraunces", Georgia, serif;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(28, 36, 33, 0.08);
  --shadow-lg: 0 12px 40px rgba(28, 36, 33, 0.12);
  --container: 1120px;
  --header-height: 72px;
}

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

html {
  scroll-behavior: smooth;
}

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

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-primary-dark);
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  margin-top: 0;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 1rem; }
h3 { font-size: 1.15rem; }

p { margin-top: 0; }

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  z-index: 200;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 244, 239, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--color-primary);
  color: white;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 10px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1rem;
}

.logo-sub {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.main-nav ul {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: block;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.2s, color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.hero {
  padding: 4rem 0 5rem;
  background:
    radial-gradient(ellipse at 80% 20%, rgba(45, 90, 74, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 10% 80%, rgba(196, 120, 58, 0.06) 0%, transparent 40%),
    var(--color-bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.hero-lead {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 36ch;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.hero-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  max-width: 320px;
  width: 100%;
}

.hero-card-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.hero-card-value {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.hero-card-note {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: white;
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-secondary:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

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

.text-link {
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card time {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.card h3 {
  margin: 0.5rem 0;
}

.card p {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.card-link {
  font-weight: 600;
  text-decoration: none;
}

.card-link:hover {
  text-decoration: underline;
}

.person-card .role {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}

/* Quick links */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.quick-link:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow);
}

.quick-link-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.quick-link strong {
  display: block;
  margin-bottom: 0.15rem;
}

.quick-link small {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* Page hero */
.page-hero {
  padding: 3rem 0 2rem;
  background:
    radial-gradient(ellipse at 70% 0%, rgba(45, 90, 74, 0.06) 0%, transparent 50%),
    var(--color-bg);
}

.page-lead {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 55ch;
  margin-bottom: 0;
}

.content-narrow {
  max-width: 720px;
}

.content-narrow h2 {
  margin-top: 2.5rem;
}

.content-narrow h2:first-child {
  margin-top: 0;
}

.info-list {
  padding-left: 1.25rem;
}

.info-list li {
  margin-bottom: 0.5rem;
}

/* News */
.news-article {
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--color-border);
}

.news-article:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.news-article time {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.news-article h2 {
  margin: 0.35rem 0 1rem;
}

.news-article__attachment {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

/* Documents */
.doc-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}

.doc-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.doc-info strong {
  display: block;
}

.doc-info span {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.doc-note {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
  padding: 1rem;
  border-radius: var(--radius);
  margin-top: 2rem;
}

.doc-note code {
  font-size: 0.85em;
  background: var(--color-surface);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.contact-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.contact-card h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.contact-form .form-group {
  margin-bottom: 1rem;
}

.contact-form label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  background: var(--color-bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-note {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
  margin-bottom: 0;
}

/* Footer */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.85);
  padding-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  padding-bottom: 2rem;
}

.footer-brand {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.1rem;
  color: white;
  margin-bottom: 0.75rem;
}

.footer-heading {
  font-weight: 600;
  color: white;
  margin-bottom: 0.75rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.footer-links a:hover {
  color: white;
  text-decoration: underline;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.9);
}

.site-footer a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 1.25rem 0;
  font-size: 0.9rem;
}

.footer-bottom p {
  margin: 0;
}

/* Utilities */
.text-center { text-align: center; }
.mt-lg { margin-top: 2rem; }

/* Responsive */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem;
    display: none;
    box-shadow: var(--shadow);
  }

  .main-nav.is-open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0.25rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero {
    padding: 2.5rem 0 3rem;
  }

  .section {
    padding: 2.5rem 0;
  }
}

/* App extensions */
.muted { color: var(--color-text-muted); }
.mt-lg { margin-top: 2rem; }
.prose p { margin-bottom: 0.75rem; }

.prose h3 {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.15rem;
  color: var(--color-primary);
}

.prose h3:first-child {
  margin-top: 0;
}

.prose a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.flash {
  margin: 1rem auto;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
}
.preview-banner,
.preview-banner.local-mode,
.preview-banner.preview-banner--full {
  background: #1e3d32;
  color: #fff;
  text-align: center;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
}
.preview-banner a,
.preview-banner.local-mode a {
  color: #b8e0cc;
  font-weight: 600;
}
.preview-banner--full {
  line-height: 1.5;
  padding: 0.75rem 1rem;
}
.preview-banner.local-mode code {
  background: rgba(255,255,255,0.12);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.flash-success { background: var(--color-primary-light); color: var(--color-primary-dark); border: 1px solid #b8d4c8; }
.flash-error { background: #fdecea; color: #8a2e2e; border: 1px solid #f0c4c4; }

.btn-danger {
  background: #8a2e2e;
  color: #fff;
  border: 1px solid #8a2e2e;
}
.btn-danger:hover {
  background: #6f2424;
  border-color: #6f2424;
  color: #fff;
}

.invitation-copy-box { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }
.invitation-copy-item { margin-top: 1.25rem; }
.invitation-copy-item h4 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.invitation-textarea {
  width: 100%;
  min-height: 14rem;
  margin: 0.75rem 0;
  padding: 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
}
.inline-details { display: inline-block; vertical-align: middle; }
.inline-details summary { list-style: none; cursor: pointer; }
.inline-details summary::-webkit-details-marker { display: none; }
.inline-details[open] { display: block; margin-top: 0.5rem; }

.nav-highlight { font-weight: 600 !important; }

.hero-with-image { position: relative; padding-top: 0; overflow: hidden; }
.hero-image { max-height: 280px; overflow: hidden; }
.hero-image img { width: 100%; height: 280px; object-fit: cover; display: block; filter: saturate(0.9); }
.hero-with-image .hero-grid { padding: 3rem 0 4rem; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.gallery-img {
  border-radius: var(--radius);
  aspect-ratio: 4/3;
  object-fit: cover;
  width: 100%;
  border: 1px solid var(--color-border);
}

.dashboard-grid, .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.dashboard-panel, .stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.stat-value { display: block; font-family: var(--font-serif); font-size: 2.5rem; font-weight: 600; color: var(--color-primary); }
.stat-label { display: block; color: var(--color-text-muted); margin-bottom: 0.5rem; }

.list-item { padding: 0.65rem 0; border-bottom: 1px solid var(--color-border); }
.list-item strong { display: block; }
.list-item span { font-size: 0.9rem; color: var(--color-text-muted); }

.two-col {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: start;
}
.content-wide { max-width: 1100px; margin-inline: auto; }

.table-wrap {
  overflow-x: auto;
  margin-bottom: 2rem;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
.data-table th { font-weight: 600; color: var(--color-primary-dark); }
.data-table .actions { white-space: nowrap; }
.data-table--users .col-bolig {
  min-width: 280px;
  width: 32%;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
}
.data-table--users .col-email {
  min-width: 160px;
  max-width: 220px;
  word-break: break-word;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.filter-bar a {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 0.9rem;
}
.filter-bar a.active, .filter-bar a:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: var(--color-bg-alt);
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
}
.badge-green { background: var(--color-primary-light); }

.referat-card { margin-bottom: 1.25rem; }
.referat-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.referat-card__head h3 { margin: 0; }
.referat-card__head .badge { margin-bottom: 0; }
.referat-file { margin-top: 0.75rem; }

.guide-download-card { margin-bottom: 2rem; }
.guide-download-card h2 { margin-top: 0; }

.post-create-card {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--color-bg-alt);
  border: 2px solid var(--color-primary-light);
}
.post-create-card h2 { margin-top: 0; }

.post-card.pinned { border-color: var(--color-primary); }
.post-meta { font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.comments { margin: 1rem 0; padding-left: 1rem; border-left: 3px solid var(--color-primary-light); }
.comment { margin-bottom: 0.75rem; }
.comment-form { margin-top: 1rem; }
.comment-form textarea { width: 100%; margin-bottom: 0.5rem; padding: 0.5rem; border: 1px solid var(--color-border); border-radius: 8px; font-family: inherit; }

.inline-form { display: inline; }
.inline-form button { margin-right: 0.35rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.checkbox-group label { font-weight: 400; display: flex; gap: 0.5rem; align-items: center; }

select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: inherit;
  background: var(--color-bg);
}

.event-card.board-only { border-left: 4px solid var(--color-primary); }
.doc-admin-card .actions { margin-top: 0.75rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

.doc-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  align-items: start;
}
.doc-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 1rem);
}
.folder-tree {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 1.5rem;
}
.folder-tree__item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.92rem;
  transition: background 0.15s;
  cursor: pointer;
}
.folder-tree__label { flex: 1; min-width: 0; }
.folder-tree__item:hover { background: var(--color-primary-light); }
.folder-tree__item.is-active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}
.folder-tree__item.is-active .folder-tree__meta { color: rgba(255,255,255,0.75); }
.folder-tree__icon { flex-shrink: 0; }
.folder-tree__meta {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--color-text-muted);
}
.folder-create { padding: 1rem; margin-top: 0.5rem; }
.folder-create h3 { font-size: 1rem; margin-bottom: 0.75rem; }
.folder-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}
.folder-breadcrumb a { text-decoration: none; }
.folder-breadcrumb span { color: var(--color-text-muted); }
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.folder-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.folder-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.folder-card--open { min-height: 150px; }
.folder-card__icon { font-size: 1.75rem; }
.folder-card__count { font-size: 0.85rem; color: var(--color-text-muted); }
.folder-card__action {
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
}
.folder-browser { margin-bottom: 1.5rem; }
.folder-browser h2 { font-size: 1.1rem; }

.upload-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}
.upload-toolbar .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.upload-selection { margin-top: 0.5rem; font-size: 0.9rem; }
.text-upload-panel {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

.doc-list-admin li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.doc-list-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.doc-upload-card { padding: 1.5rem; margin-bottom: 1.5rem; }
.doc-folder { margin-bottom: 2rem; }
.doc-folder__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-primary-light);
}
.doc-folder__icon { font-size: 1.25rem; }
.doc-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.doc-admin-card__head { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.doc-admin-meta { font-size: 0.9rem; margin-bottom: 0; }
.badge-public { background: #e8f0ec; color: var(--color-primary-dark); }
.badge-member { background: #e8eef8; color: #2a4a6b; }
.badge-board { background: #f5ead8; color: #7a5520; }

/* Gold-fracture upload panel */
.gold-fracture-panel {
  position: relative;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 0;
  margin-bottom: 2.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: linear-gradient(145deg, var(--color-primary-dark) 0%, #254a3d 100%);
  color: #fff;
}
.gold-fracture-panel__shards {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.gold-shard {
  position: absolute;
  background: linear-gradient(135deg, rgba(245, 230, 200, 0.15), rgba(196, 120, 58, 0.65), rgba(232, 200, 114, 0.4));
  transform: skewX(-12deg);
}
.gold-shard--1 {
  top: -10%;
  right: 38%;
  width: 3px;
  height: 130%;
  opacity: 0.9;
}
.gold-shard--2 {
  top: -5%;
  right: 42%;
  width: 8px;
  height: 120%;
  background: linear-gradient(180deg, transparent, rgba(232, 200, 114, 0.5) 30%, rgba(196, 120, 58, 0.8) 55%, transparent);
  opacity: 0.7;
}
.gold-shard--3 {
  top: 20%;
  right: 0;
  width: 55%;
  height: 2px;
  transform: skewX(-28deg);
  background: linear-gradient(90deg, transparent, rgba(232, 200, 114, 0.6), transparent);
}
.gold-fracture-panel__intro {
  position: relative;
  z-index: 1;
  padding: 2rem 2rem 2rem 2.25rem;
  border-right: 1px solid rgba(232, 200, 114, 0.2);
}
.gold-fracture-panel__form {
  position: relative;
  z-index: 1;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.97);
  color: var(--color-text);
}
.eyebrow-gold {
  color: #e8c872;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}
.gold-fracture-panel__intro h2 {
  color: #fff;
  margin-bottom: 0.75rem;
}
.gold-fracture-panel__intro p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
}
.gold-fracture-list {
  margin: 1.25rem 0 0;
  padding-left: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}
.gold-fracture-list li { margin-bottom: 0.35rem; }

.doc-type-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.doc-type-tab {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.doc-type-tab:hover { border-color: var(--color-accent); color: var(--color-text); }
.doc-type-tab.is-active {
  border-color: var(--color-accent);
  background: linear-gradient(135deg, #fdf6ea, #f5e6c8);
  color: var(--color-primary-dark);
}
.doc-type-panel[hidden] { display: none; }

.file-drop-zone {
  position: relative;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--color-bg);
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}
.file-drop-zone:hover,
.file-drop-zone.is-dragover,
.file-drop-zone.has-file {
  border-color: var(--color-accent);
  background: #fdf8f0;
}
.file-drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.file-drop-zone__icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.file-drop-zone__content p { margin: 0.25rem 0; }
.file-drop-zone__name {
  margin-top: 0.75rem !important;
  font-weight: 600;
  color: var(--color-primary-dark);
}

.btn-gold {
  background: linear-gradient(135deg, #c4783a, #e8a84a);
  color: #fff;
  border: none;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(196, 120, 58, 0.35);
}
.btn-gold:hover {
  background: linear-gradient(135deg, #a8642f, #c4783a);
  color: #fff;
}

.quick-link-gold {
  border-color: var(--color-accent);
  background: linear-gradient(135deg, #fffaf3, #fdf0dc);
}
.quick-link-gold strong { color: var(--color-primary-dark); }
.quick-link-gold small { color: #7a5520; }

.area-member .site-header,
.area-board .site-header {
  border-bottom-color: var(--color-primary-light);
}

.legal-text ul { padding-left: 1.25rem; }

/* In-browser page text editing (board only) */
.admin-edit-banner {
  background: linear-gradient(135deg, #fff8e8, #f5e6c8);
  border-bottom: 1px solid #e0c98a;
  color: #5c4520;
  font-size: 0.95rem;
}
.admin-edit-banner__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding-block: 0.75rem;
}
.admin-edit-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.editable-block {
  position: relative;
  border: 1px dashed transparent;
  border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.editable-block:not(.is-editing):hover {
  border-color: #e0c98a;
  background: rgba(255, 248, 232, 0.55);
}
.editable-block.is-editing {
  border-color: var(--color-accent);
  background: #fffdf8;
  box-shadow: 0 0 0 3px rgba(196, 120, 58, 0.12);
  padding: 0.75rem;
  margin-block: 0.25rem;
}
.editable-content {
  margin: 0;
}
.editable-block .editable-content p,
.editable-block.hero-lead .editable-content,
.editable-block.page-lead .editable-content {
  margin: 0;
}
.editable-input {
  display: block;
  width: 100%;
  min-height: 6rem;
  margin: 0 0 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font: inherit;
  line-height: 1.55;
  color: inherit;
  background: #fff;
  resize: vertical;
}
.editable-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.editable-block:not(.is-editing) .editable-toolbar {
  opacity: 0.85;
}
.editable-block:not(.is-editing):hover .editable-toolbar,
.editable-block.is-editing .editable-toolbar {
  opacity: 1;
}
.editable-status {
  font-size: 0.875rem;
}
.editable-status--ok { color: var(--color-primary-dark); }
.editable-status--error { color: #8a2e2e; }

/* Keep hero/page lead styling when wrapped for editing */
.editable-block.hero-lead,
.editable-block.page-lead {
  margin-top: 0;
  margin-bottom: 1rem;
}
.hero-content .editable-block.hero-lead {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 36rem;
}
.page-hero .editable-block.page-lead {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 40rem;
}

@media (max-width: 768px) {
  .two-col, .form-row { grid-template-columns: 1fr; }
  .data-table { font-size: 0.85rem; }
  .doc-layout { grid-template-columns: 1fr; }
  .doc-sidebar { position: static; }
  .gold-fracture-panel { grid-template-columns: 1fr; }
  .gold-fracture-panel__intro {
    border-right: none;
    border-bottom: 1px solid rgba(232, 200, 114, 0.2);
    padding-bottom: 1.5rem;
  }
  .gold-fracture-panel__form { padding: 1.5rem; }
}