/* lock.css — Combination-lock menu for Student Hub
   Load AFTER theme.css, layout.css, animations.css.
   Colours are the variables at the top of .lock-menu: point them at your theme tokens to match the site. */
.lock-menu {
  --item: 48px;
  --drum: 170px;
  --brass: var(--color-gold);
  --brass-lo: var(--color-gold-dim);
  --brass-ink: var(--color-bg);   /* accent + its shadow + text on accent */
  --steel: var(--color-surface);
  --steel-hi: var(--color-surface-hover);
  --ring: var(--color-text-primary);        /* lock body + focus ring */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 3vw, 20px);
  width: 100%;
  margin-inline: auto;
}

.lock {
  position: relative;
  width: min(476px, 100%);
  padding: 14px clamp(16px, 4vw, 22px);
  border-radius: 20px;
  background: linear-gradient(145deg, var(--steel-hi), var(--steel) 40%, #1e2833);
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 -2px 6px rgba(0, 0, 0, 0.4);
}

.lock::before,
.lock::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f3d58f, var(--brass-lo));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.lock::before { left: 6px; }
.lock::after  { right: 6px; }

.drum-wrap {
  position: relative;
  height: var(--drum);
  border-radius: 12px;
  overflow: hidden;
  background: #0b1015;
  box-shadow: inset 0 8px 18px rgba(0, 0, 0, 0.8), inset 0 -8px 18px rgba(0, 0, 0, 0.8);
}

.drum-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(#000 0, transparent 32%, transparent 68%, #000 100%);
  opacity: 0.75;
}

.band {
  position: absolute;
  left: 0;
  right: 0;
  top: calc((var(--drum) - var(--item)) / 2);
  height: var(--item);
  z-index: 2;
  pointer-events: none;
  border-block: 2px solid var(--brass);
  box-shadow: 0 0 22px rgba(201, 162, 39, 0.28), inset 0 0 18px rgba(201, 162, 39, 0.12);
}

.drum {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  overscroll-behavior: contain;
  padding-block: calc((var(--drum) - var(--item)) / 2);
  -webkit-overflow-scrolling: touch;
  outline: none;
  scroll-behavior: smooth;
}
.drum::-webkit-scrollbar { display: none; }
.drum:focus-visible { box-shadow: 0 0 0 3px var(--brass); }

.drum button {
  --o: 0;
  --a: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2.5vw, 12px);
  width: 100%;
  height: var(--item);
  padding: 0 clamp(10px, 3vw, 18px);
  scroll-snap-align: center;
  border: 0;
  background: none;
  cursor: pointer;
  color: #f6e9c8;
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(15px, 3.8vw, 18px);
  line-height: 1.1;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transform: perspective(420px) rotateX(calc(var(--o) * -34deg)) scale(calc(1 - var(--a) * 0.09));
  opacity: calc(1 - var(--a) * 0.3);
  transition: color 0.25s;
}

.drum button span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.drum button i {
  font-style: normal;
  font-size: clamp(17px, 4.2vw, 22px);
  flex: none;
}

.drum button[aria-current="true"] {
  color: var(--brass);
  text-shadow: 0 0 14px rgba(201, 162, 39, 0.55);
}

.select {
  display: block;
  text-align: center;
  text-decoration: none;
  width: min(476px, 100%);
  padding: clamp(12px, 2.5vw, 14px) 24px;
  border-radius: 999px;
  background: linear-gradient(var(--color-gold-bright), var(--brass));
  color: var(--brass-ink);
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(15px, 3.5vw, 17px);
  line-height: 1;
  letter-spacing: 0.14em;
  box-shadow: 0 5px 0 var(--brass-lo), 0 12px 20px -6px rgba(0, 0, 0, 0.6);
  transition: transform 0.12s, box-shadow 0.12s;
}
.select:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--brass-lo), 0 6px 12px -6px rgba(0, 0, 0, 0.6);
}
.select:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 4px;
}

/* Without JS: show the plain link list. With JS: show the lock instead. */
.lock-menu { display: none; }
.has-lock .lock-menu { display: flex; }
.has-lock .link-fallback { display: none; }

/* Fallback visibility when JS is disabled */
html:not(.has-lock) .animate-item {
  opacity: 1;
  transform: none;
}

/* Ensure .lock-menu remains visible after entrance sequence */
body.is-ready .lock-menu {
  opacity: 1;
}

/* ── Responsive adjustments for mobile resolutions & orientations ── */
@media (max-width: 480px) {
  .lock-menu {
    --drum: 160px;
    --item: 46px;
    gap: 14px;
  }
  .lock {
    padding: 12px 14px;
    border-radius: 18px;
  }
}

@media (max-width: 360px) {
  .lock-menu {
    --drum: 154px;
    --item: 44px;
    gap: 12px;
  }
  .lock {
    padding: 10px 12px;
  }
}

/* Landscape orientation on compact screens (smartphones held horizontally) */
@media (orientation: landscape) and (max-height: 560px) {
  body {
    padding: var(--space-4) var(--space-4);
  }
  .hub-wrapper {
    gap: var(--space-4);
  }
  .logo-section {
    gap: var(--space-2);
  }
  .logo-img {
    width: clamp(55px, 14vh, 75px);
  }
  .lock-menu {
    --drum: 138px;
    --item: 40px;
    gap: 10px;
  }
  .lock {
    padding: 8px 16px;
    border-radius: 16px;
  }
  .select {
    padding: 9px 20px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drum { scroll-behavior: auto; }
  .drum button, .select { transition: none; }
}

/* Button font: Manrope Bold */
.link-btn,
.link-btn .btn-label,
.select,
.channel-action,
.channel-btn-text {
  font-family: var(--font-button);
  font-weight: 700;
}
