/* =============================================================================
   LAYOUT.CSS — Major Page Structure
   Sidebar, mobile header, main content area, fixed borders.
   Font sizes in rem. Spacing in px via semantic tokens.
   ============================================================================= */

/* ── Sidebar — Desktop ───────────────────────────────────────────────────── */

.Sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background-color: var(--color-bg);
  padding: var(--spacing-3xl) var(--spacing-2xl);   /* 48px 40px */
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.Sidebar-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);     /* 24px */
  height: 100%;
}


/* ── Mobile Header ───────────────────────────────────────────────────────── */

.MobileHeader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--color-bg);
  z-index: 20;
  padding: var(--spacing-md) var(--spacing-base);   /* 12px 16px */
  display: none;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}


/* ── Menu Overlay ────────────────────────────────────────────────────────── */

.MenuOverlay {
  position: fixed;
  inset: 0;
  background-color: var(--color-overlay);
  z-index: 30;
  display: none;
}


/* ── Mobile Menu ─────────────────────────────────────────────────────────── */

.MobileMenu {
  position: fixed;
  top: 68px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-bg);
  z-index: 40;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}


/* ── Fixed Borders — Desktop frame effect ────────────────────────────────── */

.FrameBorder--top {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--border-size);
  background-color: var(--color-bg);
  z-index: 10;
}

.FrameBorder--bottom {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--border-size);
  background-color: var(--color-bg);
  z-index: 10;
}

.FrameBorder--right {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: var(--border-size);
  background-color: var(--color-bg);
  z-index: 10;
}

/* ═══════════════════════════════════════════════════════
       GALLERY.CSS
  ════════════════════════════════════════════════════════ */
/* ─── Controls row ───────────────────────────────────────────────────────── */

.gallery__controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-base);
  flex-wrap: wrap;
}


/* ─── View toggle ────────────────────────────────────────────────────────── */

.view-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 4px;
  flex-shrink: 0;
  align-self: flex-start;
}

.view-toggle__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  padding: var(--spacing-sm) var(--spacing-base);
  cursor: pointer;
  transition:
    background var(--f-duration-fast) var(--f-ease-out-expo),
    color      var(--f-duration-fast) var(--f-ease-out-expo);
}

.view-toggle__btn:hover { color: var(--color-text); }

.view-toggle__btn[aria-pressed="true"] {
  background: var(--color-surface);
  color: var(--color-text);
}

.view-toggle__btn svg { width: 14px; height: 14px; flex-shrink: 0; }


/* ─── Tier-1 tab wrapper ─────────────────────────────────────────────────── */

.gallery-tabs {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.gallery-tabs__tier1 {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  align-items: center;
  position: relative;   /* selbox positions inside this */
  overflow: visible;
  padding-bottom: var(--spacing-base);
}


/* ─── Category tab button ────────────────────────────────────────────────── */

.gtab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 9px 18px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition:
    color            var(--f-duration-fast) var(--f-ease-out-expo),
    background-color var(--f-duration-fast) var(--f-ease-out-expo);
  outline: none;
  white-space: nowrap;
}

.gtab__chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--color-white-10);
  flex-shrink: 0;
  transition: background var(--f-duration-fast) var(--f-ease-out-expo);
}

.gtab__chip svg {
  width: 14px;
  height: 14px;
  fill: var(--color-text-muted);
  transition: fill var(--f-duration-fast) var(--f-ease-out-expo);
}

.gtab:hover { color: var(--color-text); background: var(--color-white-5); }
.gtab:hover .gtab__chip { background: var(--color-white-10); }

.gtab[aria-selected="true"] {
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
  background: var(--color-primary-dim);
  border-color: transparent;
  border-radius: 0;
}

.gtab[aria-selected="true"] .gtab__chip { background: var(--color-primary-dim); }
.gtab[aria-selected="true"] .gtab__chip svg { fill: var(--color-primary); }
.gtab:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }


/* ─── Selbox overlay ─────────────────────────────────────────────────────── */

.gallery-selbox {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 2;
  width: 0; height: 0;
  box-sizing: border-box;
  border: .5px solid var(--color-primary);
  transition:
    transform 380ms cubic-bezier(0.4, 0, 0.2, 1),
    width     380ms cubic-bezier(0.4, 0, 0.2, 1),
    height    380ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity   220ms ease;
  opacity: 0;
}

.gallery-selbox.is-ready { opacity: 1; }

.gallery-selbox__corner {
  position: absolute;
  width: 5px; height: 5px;
  background: var(--color-primary);
}

.gallery-selbox__corner--tl { top: -2.5px;    left: -2.5px;  }
.gallery-selbox__corner--tr { top: -2.5px;    right: -2.5px; }
.gallery-selbox__corner--bl { bottom: -2.5px; left: -2.5px;  }
.gallery-selbox__corner--br { bottom: -2.5px; right: -2.5px; }

.gallery-selbox__cursor { position: absolute; bottom: -14px; right: -10px; pointer-events: none; }
.gallery-selbox__cursor img { display: block; width: 28px; height: 28px; }


/* ─── Tier-2 subtab row ──────────────────────────────────────────────────── */

.gallery-tabs__tier2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  border-top: 1px solid var(--color-border);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition:
    max-height 300ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity    220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-tabs__tier2.is-visible {
  max-height: 60px;
  opacity: 1;
  pointer-events: auto;
}

.gsubtab {
  display: inline-flex;
  align-items: center;
  padding: 10px var(--spacing-base);
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  cursor: pointer;
  transition:
    color        var(--f-duration-fast) var(--f-ease-out-expo),
    border-color var(--f-duration-fast) var(--f-ease-out-expo);
  outline: none;
  white-space: nowrap;
  margin-top: 2px;
}

.gsubtab:hover { color: var(--color-text); }

.gsubtab[aria-selected="true"] {
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
  border-bottom-color: var(--color-primary);
}

.gsubtab:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 2px; }





/* ── Project Details Main Content Area ───────────────────────────────────────────────────── */

main {
  flex-grow: 1;
}

.MainContent {
  position: fixed;
  top: var(--border-size);
  bottom: var(--border-size);
  left: 267px;
  right: var(--border-size);
}

.ContentWrapper {
  background-color: #1a1b1e;
  background-image: linear-gradient(to right bottom, #262631, #252530, #24242f, #24242e, #23232d);
  border-radius: var(--radius-md);
  height: 100%;
  overflow-y: auto;
}

.PageContent {
  max-width: var(--content-max-width);
  margin: 40px auto 0;
  padding: 0 var(--spacing-base);
}

.ProjectPageContent{
  padding: var(--space-8) var(--space-24);   /* 64px 60px */
  max-width: var(--page-max-width);
  margin: 0 auto;
}

#Project-grid {
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 20% 1fr 20%;
  justify-content: space-between;
  gap: 40px;
  width: calc(100% - 32px);
  max-width: var(--content-max-width);
  height: 100%;
  margin: 0 auto;
}

.JournalEntryContent {
  padding: var(--space-8) var(--space-24);   /* 64px 60px */
  max-width: var(--page-max-width);
  margin: 0 auto;
}

.JournalEntry-container {
  display: flex;
  flex-direction: column;
  margin: 24px;
}

#Oneminutesummary {
  justify-content: center;
  grid-area: 1 / 1 / 2 / 4;
  align-items: start;
}

#ProjectDetails-container {
  width: auto;
  max-width: 1140px;
  grid-area: 2 / 1 / 3 / 3;
}


/* ── Tablet (max 1023px) ─────────────────────────────────────────────────── */

@media (max-width: 1023px) {

  .Sidebar {
    display: none;
  }

  .FrameBorder--top,
  .FrameBorder--right {
    display: none;
  }

  .MobileHeader {
    display: flex;
  }

  .FrameBorder--bottom {
    left: 0;
    height: var(--border-size-mobile);
  }

  .MainContent {
    top: 80px;
    bottom: var(--border-size-mobile);
    left: var(--spacing-base);    /* 16px */
    right: var(--spacing-base);
  }

  .PageContent {
    padding: var(--spacing-xl);   /* 32px */
    margin: 0px auto 0;
  }
}


/* ── Mobile (max 575px) ──────────────────────────────────────────────────── */

@media (max-width: 1020px) {

  #Project-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  #Oneminutesummary {
    grid-area: 1 / 1 / 2 / 3;
  }

  #main {
    grid-area: 2 / 1 / 3 / 2;
    max-width: 100%;
    width: 100%;
  }

  .AnchorList-section {
    display: none;
  }

  .FooterContent {
    width: auto;
    bottom: 0;
  }

  .FooterCopy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 50px;
    padding-top: var(--spacing-base);   /* 16px */
    font-size: var(--font-size-xs);     /* 0.75rem → 12px */
    color: var(--color-text);
    text-transform: uppercase;
  }
}
