/* ═══════════════════════════════════════════════════════════════════
   ICA Document Portal — Light Blue Theme
   Accordion layout · Sky-blue header · Clean white cards
   ═══════════════════════════════════════════════════════════════════ */

html { scroll-behavior: smooth; }

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=JetBrains+Mono:wght@400;500&family=Epilogue:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* ─── Custom Properties ──────────────────────────────────────────── */
:root {
  --page-bg:       #f0f9ff;
  --header-bg:     #0ea5e9;
  --header-border: #0284c7;
  --acc-header-bg: #dbeafe;
  --acc-header-h:  #eff6ff;
  --acc-text:      #1e3a8a;
  --acc-text-h:    #1e40af;
  --acc-border:    #bae6fd;
  --acc-active:    #0ea5e9;
  --panel-bg:      #ffffff;
  --card-bg:       #ffffff;
  --card-border:   #bae6fd;
  --card-shadow:   0 1px 3px rgba(12,74,110,.06), 0 4px 16px rgba(12,74,110,.05);
  --card-shadow-h: 0 6px 24px rgba(12,74,110,.13), 0 2px 8px rgba(12,74,110,.08);
  --ff-display:    'Syne', sans-serif;
  --ff-mono:       'JetBrains Mono', monospace;
  --ff-body:       'Epilogue', sans-serif;
  --accent:        #0ea5e9;
  --tx-primary:    #0c4a6e;
  --tx-secondary:  #1e40af;
  --tx-muted:      #60a5fa;
  --col-teal:      #14b8a6;
  --col-purple:    #8b5cf6;
  --col-amber:     #f59e0b;
  --col-blue:      #3b82f6;
  --col-green:     #22c55e;
  --col-orange:    #f97316;
  --col-red:       #ef4444;
  --col-indigo:    #6366f1;
  --col-gray:      #6b7280;
  --col-pink:      #ec4899;
}

/* ─── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--ff-body);
  background: var(--page-bg);
  color: var(--tx-primary);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; }

/* ─── Site Header ────────────────────────────────────────────────── */
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,.18);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.logo-mark svg { width: 18px; height: 18px; }

.logo-img {
  height: 30px;
  object-fit: contain;
  display: none;
}

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

.logo-name {
  font-family: var(--ff-display);
  font-size: 13px;
  font-weight: 700;
  color: #f9fafb;
  line-height: 1.2;
}

.logo-sub {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: #bae6fd;
  letter-spacing: .04em;
}

.header-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  font-family: var(--ff-mono);
  font-size: 12px;
  color: #bae6fd;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  letter-spacing: .02em;
  transition: color .15s, background .15s;
}
.nav-link:hover       { color: #f0f9ff; background: rgba(255,255,255,.1); }
.nav-link.active      { color: #ffffff; background: rgba(255,255,255,.18); }

.header-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ff-mono);
  font-size: 11px;
  color: #bae6fd;
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(34,197,94,.25);
}

/* ─── Page wrapper ───────────────────────────────────────────────── */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px 64px;
}

/* ─── Page hero (compact) ────────────────────────────────────────── */
.page-hero {
  padding: 40px 0 32px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid #bae6fd;
  margin-bottom: 0;
}

.hero-label {
  font-family: var(--ff-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--tx-muted);
  margin-bottom: 8px;
}

.hero-title {
  font-family: Calibri, 'Gill Sans MT', 'Trebuchet MS', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--tx-primary);
  line-height: 1.1;
}

.hero-title-accent { color: var(--accent); }

.hero-desc {
  font-size: 14px;
  color: var(--tx-secondary);
  margin-top: 10px;
  max-width: 520px;
  line-height: 1.6;
}

/* Search */
.search-wrap {
  position: relative;
  flex-shrink: 0;
  width: 260px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--tx-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 9px 36px 9px 34px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--tx-primary);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.search-input::placeholder { color: var(--tx-muted); }
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--tx-muted);
  cursor: pointer;
  display: none;
  padding: 2px;
  line-height: 0;
}
.search-clear.visible { display: block; }
.search-clear svg { width: 14px; height: 14px; }

/* ─── Stats row ──────────────────────────────────────────────────── */
.stats-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid #bae6fd;
  margin-bottom: 0;
}

.stat-chip {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: #0369a1;
}

.stat-chip strong {
  color: #0c4a6e;
  font-weight: 500;
}

.stat-sep {
  width: 1px;
  height: 14px;
  background: #bae6fd;
}

/* ─── Accordion ──────────────────────────────────────────────────── */
.accordion { margin-top: 0; }

.acc-section {
  border-bottom: 1px solid #e0f2fe;
}

/* Section header button */
.acc-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  background: none;
  border: none;
  cursor: pointer;
  border-left: 3px solid transparent;
  padding-left: 3px;
  transition: border-color .2s;
  text-align: left;
}

.acc-section[data-open="true"] > .acc-header {
  border-left-color: var(--acc-active);
}

.acc-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
}

.acc-icon-wrap svg { width: 18px; height: 18px; }

.acc-title-group { flex: 1; min-width: 0; }

.acc-title {
  font-family: var(--ff-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--tx-primary);
  line-height: 1.2;
  transition: color .15s;
}

.acc-section[data-open="true"] .acc-title { color: var(--tx-primary); }

.acc-subtitle {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  color: var(--tx-muted);
  margin-top: 2px;
  letter-spacing: .02em;
}

.acc-count-chip {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: #0369a1;
  background: #dbeafe;
  padding: 3px 9px;
  border-radius: 12px;
  flex-shrink: 0;
  letter-spacing: .02em;
  transition: background .2s, color .2s;
}

.acc-section[data-open="true"] .acc-count-chip {
  background: rgba(14,165,233,.18);
  color: #0c4a6e;
}

.acc-chevron {
  width: 18px;
  height: 18px;
  color: var(--tx-muted);
  flex-shrink: 0;
  transition: transform .25s ease, color .2s;
}

.acc-section[data-open="true"] .acc-chevron {
  transform: rotate(90deg);
  color: var(--accent);
}

/* Accordion panel (the card grid area) */
.acc-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height .35s cubic-bezier(.4,0,.2,1), padding .25s ease;
  padding-bottom: 0;
}

.acc-section[data-open="true"] .acc-panel {
  max-height: 3000px;
  padding-bottom: 32px;
}

/* ─── Card Grid ──────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 18px;
  padding-top: 20px;
}

/* ─── Portal Card ────────────────────────────────────────────────── */
.portal-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 2px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative;
}

.portal-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-h);
}

/* Colour accent strip at top of card */
.card-accent { height: 3px; width: 100%; flex-shrink: 0; }

[data-color="teal"]   .card-accent { background: var(--col-teal); }
[data-color="purple"] .card-accent { background: var(--col-purple); }
[data-color="amber"]  .card-accent { background: var(--col-amber); }
[data-color="blue"]   .card-accent { background: var(--col-blue); }
[data-color="green"]  .card-accent { background: var(--col-green); }
[data-color="orange"] .card-accent { background: var(--col-orange); }
[data-color="red"]    .card-accent { background: var(--col-red); }
[data-color="indigo"] .card-accent { background: var(--col-indigo); }
[data-color="gray"]   .card-accent { background: var(--col-gray); }
[data-color="pink"]   .card-accent { background: var(--col-pink); }

.card-media {
  width: 100%;
  height: 148px;
  overflow: hidden;
  position: relative;
  background: #eff6ff;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform .3s ease;
  display: block;
}

.portal-card:hover .card-media img { transform: scale(1.05); }

.card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: rgba(13,17,23,.72);
  color: #e6edf3;
  padding: 3px 7px;
  border-radius: 2px;
  backdrop-filter: blur(4px);
}

.card-ext {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  background: rgba(13,17,23,.55);
  color: #e6edf3;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.card-ext svg { width: 11px; height: 11px; }

.card-body {
  padding: 15px 16px 17px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-category {
  font-family: var(--ff-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--tx-muted);
  margin-bottom: 5px;
}

.card-title {
  font-family: var(--ff-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--tx-primary);
  line-height: 1.3;
  margin-bottom: 7px;
}

.card-desc {
  font-size: 12.5px;
  color: var(--tx-secondary);
  line-height: 1.55;
  flex: 1;
  margin-bottom: 13px;
}

.local-path-card { cursor: default; }
.local-path-card:hover { transform: none; box-shadow: var(--shadow-card); }
.card-local-path {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e0f2fe;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.local-path-text {
  font-family: var(--ff-mono);
  font-size: 10px;
  color: var(--tx-secondary);
  word-break: break-all;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 4px;
  padding: 4px 6px;
  display: block;
}
.copy-path-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #0ea5e9;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 5px 10px;
  font-family: var(--ff-mono);
  font-size: 11px;
  cursor: pointer;
  transition: background .15s;
  align-self: flex-start;
}
.copy-path-btn svg { width: 12px; height: 12px; }
.copy-path-btn:hover { background: #0284c7; }
.copy-path-btn.copied { background: #16a34a; }

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 11px;
  border-top: 1px solid #e0f2fe;
}

.card-cta {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--tx-secondary);
  letter-spacing: .02em;
}

.card-arrow {
  width: 15px;
  height: 15px;
  color: var(--tx-muted);
  transition: transform .15s, color .15s;
  flex-shrink: 0;
}
.portal-card:hover .card-arrow { transform: translateX(3px); color: var(--accent); }

/* ─── No-results message ─────────────────────────────────────────── */
.no-results {
  display: none;
  text-align: center;
  padding: 60px 0;
}
.no-results.visible { display: block; }
.no-results svg { width: 44px; height: 44px; color: var(--tx-muted); margin: 0 auto 16px; display: block; }
.no-results h3 { font-family: var(--ff-display); font-size: 18px; margin-bottom: 8px; }
.no-results p  { font-size: 13px; color: var(--tx-secondary); }
.no-results button { background: none; border: none; color: var(--accent); cursor: pointer; font-size: inherit; padding: 0; text-decoration: underline; }

.card-hidden { display: none !important; }

/* ─── Back link (share.php) ──────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--ff-mono);
  font-size: 12px;
  color: var(--tx-muted);
  text-decoration: none;
  margin: 28px 0 0;
  transition: color .15s;
}
.back-link:hover { color: var(--tx-secondary); }
.back-link svg { width: 14px; height: 14px; }

/* ─── Footer ─────────────────────────────────────────────────────── */
.site-footer {
  margin-top: 48px;
  padding: 24px 0;
  border-top: 1px solid #e0f2fe;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-copy {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--tx-muted);
}

.footer-links { display: flex; gap: 20px; }

.footer-link {
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--tx-muted);
  text-decoration: none;
  transition: color .12s;
}
.footer-link:hover { color: var(--tx-secondary); }

/* ─── Content layout (sidebar + main) ───────────────────────────── */
.content-layout {
  display: flex;
  align-items: flex-start;
  padding-top: 20px;
}

/* ─── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  width: 230px;
  flex-shrink: 0;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  border-right: 1px solid var(--acc-border);
  margin-right: 28px;
  padding-bottom: 48px;
  scrollbar-width: thin;
  scrollbar-color: #bae6fd transparent;
}
.sidebar::-webkit-scrollbar        { width: 4px; }
.sidebar::-webkit-scrollbar-track  { background: transparent; }
.sidebar::-webkit-scrollbar-thumb  { background: #bae6fd; border-radius: 2px; }

.sidebar-inner { padding: 18px 14px 0 0; }

.sidebar-heading {
  font-family: var(--ff-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--tx-muted);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0f2fe;
}

/* ─── Sidebar tree ───────────────────────────────────────────────── */
.sidebar-tree { display: flex; flex-direction: column; gap: 18px; }

.tree-group { display: flex; flex-direction: column; }

.tree-group-label {
  font-family: var(--ff-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--tx-muted);
  margin-bottom: 5px;
  padding: 0 4px;
}

.tree-item { border-radius: 5px; margin-bottom: 1px; }

.tree-section-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 6px;
  border-radius: 5px;
  font-family: var(--ff-body);
  font-size: 12.5px;
  color: var(--tx-primary);
  text-align: left;
  line-height: 1.3;
  transition: background .12s, color .12s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-section-btn:hover             { background: #e0f2fe; color: var(--tx-secondary); }
.tree-item--active .tree-section-btn {
  background: rgba(14,165,233,.12);
  color: var(--accent);
  font-weight: 600;
}

.tree-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── Main area ──────────────────────────────────────────────────── */
.main-area { flex: 1; min-width: 0; }

/* ─── Accordion group divider ────────────────────────────────────── */
.acc-group-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 8px;
}
.acc-group-divider::before,
.acc-group-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #bae6fd;
}
.acc-group-divider span {
  font-family: var(--ff-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--tx-muted);
  white-space: nowrap;
}

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .sidebar         { display: none; }
  .content-layout  { padding-top: 0; }
}

@media (max-width: 768px) {
  .header-inner { padding: 0 20px; }
  .page-wrap    { padding: 0 20px 48px; }
  .page-hero    { flex-direction: column; align-items: flex-start; padding: 28px 0 24px; }
  .search-wrap  { width: 100%; }
  .hero-title   { font-size: 28px; }
  .acc-header   { padding: 15px 0; }
  .card-grid    { grid-template-columns: 1fr; }
  .site-footer  { flex-direction: column; text-align: center; gap: 12px; }
  .header-pill  { display: none; }
}

@media (max-width: 480px) {
  .header-nav   { display: none; }
}
