/* ── Reset ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Design tokens ── */
:root {
  --background: #0b0b0d;
  --outlines: #2e2e2e;
  --background-lighter: #131313;
  --text-colour: #c0d0e8;
  --accent: #8c8eff;
  --text-colour-2: #b1a4ff;
  --accent2: #5950ff;
  --padding-sm: 8px;
  --padding-md: 24px;
}

/* ── Fonts ── */
@font-face {
  font-family: "Readex Pro";
  src: url("/assets/fonts/ReadexPro-Medium.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/SpaceGrotesk-VariableFont_wght.ttf")
    format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/AtkinsonHyperlegibleNext-VariableFont_wght.ttf")
    format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── Base ── */
body {
  font-family:
    "Readex Pro",
    sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: var(--text-colour);
  font-size: 14px;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

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

button {
  background: transparent;
  color: var(--text-colour);
  border: none;
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: normal;
  align-items: center;
}

button:hover {
  background: var(--background-lighter);
}

a {
  color: var(--accent);
}

p {
  margin: 1em 0;
}
.text-16 {
  font-size: 16px;
}

h1 {
  color: var(--accent);
  font-size: 7em;
  margin-bottom: 0.5em;
  margin-top: 0;
}

h2 {
  font-size: 20px;
  font-family: "Space Grotesk", sans-serif;
  margin: 1em 0;
  font-weight: 500;
}

/* ── Utility ── */
.mg-top-24 {
  margin-top: var(--padding-md);
}
.hflex {
  display: flex;
  flex-direction: row;
}
.vflex {
  display: flex;
  flex-direction: column;
}
.gap-8 {
  gap: 8px;
}
.align-center {
  align-items: center;
}
.space-between {
  justify-content: space-between;
}
.space-grotesk {
  font-family: "Space Grotesk", sans-serif;
}
.icon {
  height: 30px;
}
.icon-sm {
  height: 24px;
}
.accent {
  color: var(--accent);
}

/* ── Home page ── */
.flat-bg {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 100vh;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  background-color: var(--background);
}

.sidebar-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  text-decoration: none;
  color: var(--text-colour);
}

/* ── Main container (multimedia page) ── */
.container {
  display: flex;
  height: 100vh;
  padding: 16px;
  gap: 16px;
}

/* ── Sidebar ── */
.sidebar {
  border-radius: 8px;
  width: 400px;
  flex-shrink: 0;
  overflow-y: auto;
  padding-bottom: 16px;
  max-height: 96vh;
  transition: width 0.3s ease;
}

.information-sidebar {
  width: 600px;
  padding-bottom: 0px;
}

.sidebar.collapsed {
  width: 80px;
}

.sidebar-header {
  background-color: var(--background-lighter);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0px;
  z-index: 50;
}

.collapse-btn {
  background: var(--background-lighter);
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.collapse-btn svg {
  width: 24px;
  height: 24px;
}
.sidebar.collapsed .collapse-btn svg {
  transform: rotate(180deg);
}

.sidebar-section {
  padding: 16px;
  border-bottom: 2px solid var(--outlines);
  background: var(--background);
  border-radius: 8px;
}

.sidebar-navigation {
  border-radius: 0 0 8px 8px;
  position: relative;
}

.section-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
  margin-bottom: 16px;
  margin-top: 1.5em;
}

/* ── Nav grid ── */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  position: relative;
}

.sidebar.collapsed .nav-grid {
  grid-template-columns: 1fr;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
  border: 2px solid var(--outlines);
  text-decoration: none;
  color: var(--text-colour);
  transition: background 0.2s;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--accent2);
}
.nav-item.active {
  background: var(--background-lighter);
}

.nav-label {
  text-align: center;
  font-size: 14px;
  transition: opacity 0.3s;
}

.nav-text {
}

.sidebar.collapsed .nav-text {
  opacity: 0;
  display: none;
}

.label-accent {
  opacity: 0.4;
}

/* ── Categories ── */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 8px;
  border-top: 2px solid var(--outlines);
  cursor: pointer;
  transition: background 0.2s;
}

.category-item:hover {
  background: var(--accent2);
}
.category-item.active {
  background: var(--background-lighter);
}

/* ── Corner accent ── */
.corner-accent {
  background-image:
    url(/assets/images/corner.svg), url(/assets/images/corner.svg),
    url(/assets/images/corner.svg), url(/assets/images/corner.svg);
  background-repeat: no-repeat;
  background-position:
    -6px -6px,
    calc(100% + 6px) -6px,
    -6px calc(100% + 6px),
    calc(100% + 6px) calc(100% + 6px);
  bottom: -6px;
  content: "";
  left: -6px;
  pointer-events: none;
  position: absolute;
  right: -6px;
  top: -6px;
  box-sizing: border-box;
}

/* ── Main content ── */
.main-content {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scrollbar-width: none;
}

.main-content.fit-content {
  border-radius: 8px;
  max-height: 100vh;
  object-fit: contain;
}

.fade-bottom {
  -webkit-mask-image: linear-gradient(to bottom, black 95%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 95%, transparent 100%);
}

.detail-content {
  padding: 2rem;
  max-width: 800px;
  font-family: "Atkinson Hyperlegible", sans-serif;
  line-height: 1.2;
  font-size: 1.125rem;
  overflow-wrap: break-word;
}

.detail-content h2 {
  font-size: 30px;
  margin-bottom: 1rem;
  display: block;
  margin-block-start: 0.83em;
  margin-block-end: 0.83em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  font-weight: bold;
}

.detail-content p {
  margin-bottom: 1rem;
}

.detail-content ul,
.detail-content ol {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

.detail-content img {
  max-width: 100%;
}

.image-container {
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}

/* ── Controls bar ── */
.controls {
  position: sticky;
  top: 0;
  display: flex;
  gap: 8px;
  z-index: 1000;
  flex-wrap: wrap;
  align-items: center;
}

.controls a {
  text-decoration: none;
}

.control-btn {
  background: var(--background);
  color: var(--text-colour-1);
  border: 1px solid var(--outlines);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  height: auto;
  box-sizing: border-box;
  flex: 0 0 auto;
  min-height: 32px;
  align-self: flex-start;
}

.control-btn:hover {
  border: 1px solid var(--accent);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000c;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal {
  background: var(--background-lighter);
  max-width: 80%;
  min-width: 70%;
  padding: var(--padding-md);
  border-radius: 8px;
  position: relative;
  z-index: 9000;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  cursor: pointer;
  font-size: 20px;
}

.divider {
  height: 2px;
  background-color: var(--outlines);
  width: 100%;
}

/* ── Accordion ── */
.accordion {
  margin: 20px;
  width: 100%;
}

.accordion-header {
  width: 100%;
  background: var(--background);
  color: var(--text-colour);
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 16px;
  padding: 12px;
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-content.open {
  max-height: 300px;
}

.button {
  background: transparent;
  color: var(--text-colour);
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  transition:
    background 0.2s,
    transform 0.2s;
  display: inline-block;
}

.button:hover {
  background: var(--background-lighter);
  transform: translateX(5px);
}

button[data-bg].active {
  background-color: var(--accent);
  color: white;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--background-lighter);
}
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

/* ═══════════════════════════════════════════
   SCATTERED GALLERY
═══════════════════════════════════════════ */
.gallery-canvas {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 52px);
}

.gallery-item-title {
  font-family: "Atkinson Hyperlegible", sans-serif;
  font-size: 20px;
  padding: 8px 0px;
}

.photo-card {
  position: absolute;
  background: var(--background);
  border: 1px solid rgba(255, 255, 255, 0.07);
  cursor: grab;
  user-select: none;
  transition:
    scale 0.4s ease,
    opacity 0.4s ease;
  text-decoration: none;
  color: var(--text-colour);
  display: block;
  border-radius: 8px;
  overflow: hidden;
  padding: 8px;
}

.photo-card:hover {
  /* box-shadow:
    0 16px 52px rgba(0, 0, 0, 0.35),
    0 4px 16px rgba(0, 0, 0, 0.2); */
  z-index: 50 !important;
}

.photo-card.dragging {
  cursor: grabbing;
  transition: scale 0.3s ease;
  scale: 1.1;
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  pointer-events: none;
}

.photo-card .card-label {
  display: block;
  padding: 0.45rem 0.65rem 0.55rem;
  font-size: 0.72rem;
  font-family: "Space Grotesk", sans-serif;
  color: rgba(192, 208, 232, 0.85);
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

/* Hidden state (hide windows button) */
.gallery-canvas.hidden .photo-card {
  opacity: 0;
  pointer-events: none;
}

/* ── Responsive ── */
@media (max-width: 991px) {
  .container {
    padding: 8px;
    gap: 8px;
    display: flex;
    flex-direction: columns;
  }
  .sidebar {
    width: 80px;
  }
  .controls {
    flex-wrap: wrap;
  }
}
