/* Unified header/footer chrome — hub, landing, admin pages */

.oe-app[data-variant="hub"],
.oe-app[data-variant="landing"],
.oe-app[data-variant="admin"] {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.oe-page {
  flex: 1;
  min-height: 0;
  width: 100%;
  margin-top: calc(var(--oe-header-h) + var(--oe-subheader-h) + var(--oe-safe-top));
  margin-bottom: calc(var(--oe-footer-h) + var(--oe-safe-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.oe-page::-webkit-scrollbar {
  display: none;
}

.oe-page .container {
  height: auto !important;
  overflow: visible !important;
}

/* Hub index — vertically center content when it fits the viewport */
.oe-app[data-variant="hub"] .oe-page {
  display: flex;
  flex-direction: column;
}

.oe-app[data-variant="hub"] .oe-page .container {
  flex: 1 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  max-width: min(100%, 1200px);
  margin: 0 auto;
  width: 100%;
  padding: var(--oe-content-pad);
  padding-bottom: 2rem;
  box-sizing: border-box;
}

/* Safe vertical centering: centers content when it fits, snaps to top with scrollability when it overflows */
.oe-app[data-variant="hub"] .oe-page .container > :first-child {
  margin-top: auto;
}

.oe-app[data-variant="hub"] .oe-page .container > :last-child {
  margin-bottom: auto;
}

.oe-header__brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 auto;
  text-decoration: none;
  color: inherit;
  margin-left: -0.15rem;
}

.oe-header__login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  min-height: 44px;
  border-radius: 22px;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-decoration: none;
  background-color: var(--btn-primary-bg);
  color: #fff;
  border: 1px solid var(--btn-primary-border);
  transition: background-color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.oe-header__login-btn:hover {
  background-color: var(--btn-primary-hover);
  transform: translateY(-1px);
}

.oe-header__user-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
}

/* Landing sub-nav */
.oe-subheader--nav .oe-nav-links {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.oe-subheader--nav .oe-nav-links a {
  color: var(--muted-text);
  text-decoration: none;
  font-size: clamp(0.75rem, 2vw, 0.9rem);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
  position: relative;
  padding: 0.25rem 0;
}

.oe-subheader--nav .oe-nav-links a:hover,
.oe-subheader--nav .oe-nav-links a.active {
  color: var(--accent-color);
}

.oe-app[data-variant="landing"] .oe-header__hamburger {
  display: none;
}

@media (max-width: 768px) {
  .oe-app[data-variant="landing"] .oe-subheader--nav {
    display: none;
  }

  .oe-app[data-variant="landing"] .oe-header__hamburger {
    display: flex;
  }
}

/* Landing mobile drawer (homepage) */
.oe-landing-sidebar {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: min(280px, 88vw);
  height: 100%;
  background-color: var(--card-bg);
  border-left: 1px solid var(--card-border);
  z-index: calc(var(--oe-z-sidebar) + 1);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-direction: column;
  padding: 1.5rem;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
}

#admin-btn,
#user-profile-btn {
  display: none;
}

.oe-landing-sidebar.is-open {
  transform: translateX(0);
}

.oe-landing-sidebar__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: var(--oe-z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.oe-landing-sidebar__overlay.is-active {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 768px) {
  .oe-landing-sidebar {
    display: flex;
  }
}

.oe-landing-sidebar__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 1rem;
}

.oe-landing-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.oe-landing-sidebar__nav a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.oe-landing-sidebar__nav a i {
  width: 1.25rem;
  text-align: center;
  color: var(--accent-color);
}

.oe-landing-sidebar__nav a:hover {
  background-color: var(--option-bg);
  color: var(--accent-color);
}
