@import url("https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;600;700&family=Space+Grotesk:wght@400;500;700&display=swap");

:root {
  --bg-1: #ebf4ff;
  --bg-2: #d1fae5;
  --card: rgba(255, 255, 255, 0.82);
  --card-strong: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --accent: #0f766e;
  --accent-2: #0284c7;
  --border: rgba(15, 23, 42, 0.12);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at 0% 0%, rgba(2, 132, 199, 0.2), transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(15, 118, 110, 0.24), transparent 40%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2));
}

body.menu-open {
  overflow: hidden;
}

body.lightbox-open {
  overflow: hidden;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

.sidebar {
  position: sticky;
  top: 20px;
  height: calc(100vh - 40px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
}

.sidebar-label {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar h1 {
  margin: 8px 0 0;
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.mobile-menu-toggle,
.sidebar-close {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-strong);
  color: var(--ink);
  font: inherit;
}

.mobile-menu-toggle {
  display: none;
}

.sidebar-close {
  display: none;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.mobile-backdrop {
  display: none;
}

.menu-tree {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-home-button {
  width: 100%;
  border: 1px solid rgba(2, 132, 199, 0.28);
  border-radius: 12px;
  min-height: 40px;
  padding: 8px 12px;
  margin: 0 0 12px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.sidebar-home-button:hover {
  transform: translateY(-1px);
  border-color: rgba(2, 132, 199, 0.5);
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.15);
}

.menu-node .children {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-3px);
  padding-left: 8px;
  margin-left: 10px;
  border-left: 1px dashed rgba(15, 118, 110, 0.28);
  transition: max-height 0.26s ease, opacity 0.2s ease, transform 0.2s ease;
}

.menu-node.is-open > .children {
  max-height: 1800px;
  opacity: 1;
  transform: translateY(0);
}

.menu-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle,
.label {
  border: 0;
  cursor: pointer;
  color: inherit;
  background: transparent;
}

.toggle {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--accent);
  font-size: 0.8rem;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.toggle:hover {
  background: rgba(2, 132, 199, 0.1);
}

.menu-node.is-open > .menu-row .toggle {
  transform: rotate(90deg);
}

.toggle-spacer {
  width: 22px;
}

.label {
  flex: 1;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.94rem;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.label:hover {
  background: rgba(2, 132, 199, 0.12);
}

.menu-node.is-open > .menu-row .label:not(.is-selected) {
  background: rgba(15, 118, 110, 0.1);
}

.label.is-selected {
  color: #ffffff;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 18px rgba(2, 132, 199, 0.24);
}

.label.no-images {
  opacity: 0.78;
}

.content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 14px;
}

.content-header {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card-strong);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.content-header h2 {
  margin: 0;
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 1.5rem;
}

.selected-path {
  margin: 8px 0 0;
  color: var(--muted);
}

.eyebrow,
#selectedTitle,
#selectedPath {
  display: none;
}

.search-panel {
  margin-top: 0;
  display: grid;
  gap: 6px;
}

.search-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.search-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 118, 110, 0.35);
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.search-input:focus {
  outline: 0;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.16);
}

.search-info {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.load-more-wrap {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.load-more-button {
  border: 1px solid rgba(2, 132, 199, 0.28);
  border-radius: 999px;
  min-height: 40px;
  padding: 8px 16px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.load-more-button:hover {
  transform: translateY(-1px);
  border-color: rgba(2, 132, 199, 0.5);
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.18);
}

.home-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 20px;
  width: min(820px, 100%);
  margin: 0 auto;
}

.home-hero {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 10px;
  padding: 24px 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    radial-gradient(circle at 12% 0%, rgba(2, 132, 199, 0.1), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(15, 118, 110, 0.1), transparent 40%),
    var(--card-strong);
  box-shadow: var(--shadow);
}

.home-hero-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: auto;
  margin: 0 auto;
}

.home-logo-small {
  width: 66px;
  height: 66px;
  border-radius: 12px;
  object-fit: cover;
  border: 0;
  background: transparent;
}

.home-hero-copy {
  display: grid;
  gap: 3px;
  justify-items: center;
  text-align: center;
}

.home-title {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.home-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.home-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 260px));
  justify-content: center;
  gap: 14px;
}

.home-post-card {
  width: min(100%, 260px);
  margin: 0;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.16);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.22);
}

.home-post-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
  display: block;
  background: #f8fafc;
}

.home-post-label {
  margin: 0;
  padding: 12px 14px 14px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: #0f172a;
}

.folder-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  display: grid;
  grid-template-rows: 154px auto;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.folder-card:hover {
  transform: translateY(-3px);
  border-color: rgba(2, 132, 199, 0.35);
  box-shadow: 0 20px 32px rgba(15, 23, 42, 0.18);
}

.folder-card:focus-visible {
  outline: 0;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.folder-card.is-league .folder-visual {
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.5), transparent 46%),
    linear-gradient(135deg, #0f766e, #0284c7);
}

.folder-card.is-folder .folder-visual {
  background: linear-gradient(135deg, #e2e8f0, #f8fafc);
}

.folder-card.is-team .folder-visual {
  background: linear-gradient(145deg, #edf2ff, #f8fafc);
}

.folder-visual {
  position: relative;
  display: grid;
  place-items: center;
  background: #f3f8ff;
}

.folder-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 10px;
  background: #ffffff;
}

.folder-thumb.is-badge {
  object-fit: contain;
  object-position: center;
  padding: 10px;
  background: #ffffff;
}

.folder-thumb.is-flag {
  width: auto;
  height: auto;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  object-fit: contain;
  object-position: center;
  padding: 0;
  margin: auto;
  background: transparent;
}

.folder-flag {
  font-size: 2.4rem;
  text-shadow: 0 8px 20px rgba(2, 6, 23, 0.28);
}

.folder-monogram {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1px solid rgba(2, 132, 199, 0.34);
  background: rgba(255, 255, 255, 0.75);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Chakra Petch", "Trebuchet MS", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0f172a;
}

.folder-info {
  display: grid;
  gap: 4px;
  padding: 11px 12px 12px;
}

.folder-title {
  font-size: 0.92rem;
  line-height: 1.2;
}

.folder-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.photo-card {
  margin: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card-strong);
  box-shadow: var(--shadow);
  animation: card-in 0.25s ease both;
  cursor: pointer;
}

.photo-card img {
  width: 100%;
  height: 260px;
  display: block;
  object-fit: contain;
  object-position: center;
  background: #ffffff;
}

.photo-card figcaption {
  padding: 10px;
  display: grid;
  gap: 4px;
  color: var(--ink);
  text-wrap: pretty;
}

.photo-card:focus-visible {
  outline: 0;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.photo-title {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
}

.photo-meta {
  font-size: 0.76rem;
  color: var(--muted);
}

.photo-context {
  font-size: 0.72rem;
  color: #0f766e;
  opacity: 0.9;
}

.photo-card.is-error img {
  filter: grayscale(1);
  opacity: 0.45;
}

.photo-skeleton {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.photo-skeleton-image {
  height: 260px;
  background: linear-gradient(110deg, #e2e8f0 8%, #f8fafc 18%, #e2e8f0 33%);
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.15s linear infinite;
}

.photo-skeleton-caption {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.photo-skeleton-line {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: #dbe3ee;
}

.photo-skeleton-line.is-wide {
  width: 82%;
}

.photo-skeleton-line:not(.is-wide) {
  width: 58%;
}

.empty-gallery {
  grid-column: 1 / -1;
  padding: 28px;
  border-radius: 18px;
  border: 1px dashed rgba(15, 118, 110, 0.35);
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  text-align: center;
}

.lightbox {
  display: none;
}

.lightbox.is-open {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 18px;
  background: rgba(15, 23, 42, 0.86);
  backdrop-filter: blur(4px);
}

.lightbox-close {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}

.lightbox-nav {
  width: 44px;
  height: 68px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-figure {
  margin: 0;
  min-width: 0;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.lightbox-figure img {
  max-width: min(92vw, 1120px);
  max-height: 76vh;
  width: auto;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 30px 60px rgba(2, 6, 23, 0.45);
  background: #0b1220;
}

.lightbox-caption {
  color: #ffffff;
  text-align: center;
  display: grid;
  gap: 4px;
  text-wrap: pretty;
}

.lightbox-caption strong {
  font-size: 0.95rem;
}

.lightbox-caption span {
  font-size: 0.8rem;
  opacity: 0.9;
}

@keyframes skeleton-shimmer {
  from {
    background-position: 220% 0;
  }

  to {
    background-position: -20% 0;
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 300px minmax(0, 1fr);
    padding: 16px;
    gap: 16px;
  }

  .content-header {
    padding: 18px;
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(88vw, 360px);
    height: 100vh;
    max-height: none;
    border-radius: 0 18px 18px 0;
    z-index: 80;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  .content {
    padding-top: 54px;
  }

  .content-header {
    padding: 16px;
    border-radius: 16px;
  }

  .content-header h2 {
    font-size: 1.3rem;
    line-height: 1.15;
  }

  .selected-path {
    font-size: 0.86rem;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 90;
    padding: 9px 12px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow);
  }

  .sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.menu-open .mobile-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .photo-card img {
    height: 220px;
  }

  .photo-skeleton-image {
    height: 220px;
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
  }

  .folder-card {
    grid-template-rows: 138px auto;
  }

  .lightbox.is-open {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px 10px;
  }

  .lightbox-nav {
    position: fixed;
    bottom: 16px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    font-size: 1.6rem;
  }

  .lightbox-nav.prev {
    left: calc(50% - 56px);
  }

  .lightbox-nav.next {
    right: calc(50% - 56px);
  }

  .lightbox-figure img {
    max-width: 94vw;
    max-height: 74vh;
  }

  .lightbox-caption {
    padding: 0 8px 60px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 10px;
    gap: 10px;
  }

  .content {
    gap: 10px;
  }

  .search-input {
    padding: 9px 10px;
  }

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

  .home-panel {
    gap: 14px;
  }

  .home-hero {
    padding: 18px 14px;
    border-radius: 18px;
  }

  .home-logo-small {
    width: 60px;
    height: 60px;
    border-radius: 10px;
  }

  .home-post-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
    justify-content: center;
    gap: 10px;
  }

  .home-post-card {
    width: min(100%, 220px);
    border-radius: 16px;
  }

  .folder-card {
    border-radius: 14px;
    grid-template-rows: 122px auto;
  }

  .folder-thumb.is-badge {
    padding: 8px;
  }

  .folder-thumb.is-flag {
    max-width: calc(100% - 20px);
    max-height: calc(100% - 20px);
  }

  .folder-title {
    font-size: 0.84rem;
  }

  .folder-meta {
    font-size: 0.72rem;
  }

  .photo-card {
    border-radius: 14px;
  }

  .photo-card img {
    height: 196px;
  }

  .photo-skeleton-image {
    height: 196px;
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding: 8px;
  }

  .sidebar {
    width: min(92vw, 350px);
    border-radius: 0 14px 14px 0;
    padding: 16px;
  }

  .mobile-menu-toggle {
    top: 8px;
    left: 8px;
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .content {
    padding-top: 48px;
  }

  .content-header {
    padding: 14px;
    border-radius: 14px;
  }

  .eyebrow {
    font-size: 0.68rem;
  }

  .content-header h2 {
    font-size: 1.12rem;
  }

  .search-label {
    font-size: 0.78rem;
  }

  .search-info {
    font-size: 0.72rem;
  }

  .gallery {
    gap: 8px;
  }

  .home-post-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 178px));
    justify-content: center;
    gap: 8px;
  }

  .home-post-card {
    width: min(100%, 178px);
  }

  .home-title {
    font-size: 1.52rem;
  }

  .home-subtitle {
    font-size: 0.84rem;
  }

  .home-post-label {
    padding: 10px 10px 11px;
    font-size: 0.86rem;
  }

  .home-hero-main {
    gap: 10px;
  }

  .home-logo-small {
    width: 54px;
    height: 54px;
    border-radius: 10px;
  }

  .folder-card {
    grid-template-rows: 108px auto;
  }

  .folder-thumb.is-flag {
    max-width: calc(100% - 16px);
    max-height: calc(100% - 16px);
  }

  .folder-flag {
    font-size: 1.9rem;
  }

  .folder-monogram {
    width: 52px;
    height: 52px;
    font-size: 1rem;
  }

  .folder-info {
    padding: 9px 9px 10px;
    gap: 2px;
  }

  .photo-card img {
    height: 180px;
  }

  .photo-skeleton-image {
    height: 180px;
  }
}

@media (max-width: 390px) {
  .gallery {
    grid-template-columns: 1fr;
  }

  .folder-card {
    grid-template-rows: 132px auto;
  }

  .folder-thumb.is-flag {
    max-width: calc(100% - 18px);
    max-height: calc(100% - 18px);
  }

  .photo-card img {
    height: 230px;
  }

  .photo-skeleton-image {
    height: 230px;
  }
}
