/* Layer progress ribbon (layer1-4.php, shared via
   app/Views/partials/layer_ribbon.php + assets/js/layer-ribbon.js): a
   chevron strip sitting on a soft rounded tray. Segments have a small
   visible gap so every arrowhead reads clearly even between two
   same-coloured (grey) steps -- the shared tray plus matching chevron
   rhythm is what keeps it reading as one object, not four detached
   buttons. Deliberately NOT the level-journey timeline
   (public/assets/css/level-journey.css) — no numbered circles, no
   connecting line. Palette matched to dashboard-igcse.css (green #4CAF50
   done) and the layer pages' own navy #003366 accent for the current step. */

.layer-ribbon-wrap {
  max-width: 900px;
  margin: 0 auto 20px;
  padding: 9px 14px;
  background: #eef2f7;
  border-radius: 18px;
  box-shadow: inset 0 1px 3px rgba(0, 51, 102, 0.08);
}

.layer-ribbon {
  --arrow: 18px;
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 3px 0;
}

.layer-ribbon-item {
  flex: 1 1 0;
  min-width: 0;
}

.layer-ribbon-item.is-current {
  position: relative;
  z-index: 2;
}

.layer-ribbon-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  padding: 0 calc(var(--arrow) + 10px) 0 calc(var(--arrow) + 4px);
  background: #dde3ea;
  color: #6b7889;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85em;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  filter: drop-shadow(0 2px 4px rgba(0, 51, 102, 0.12));
  clip-path: polygon(
    0 0,
    calc(100% - var(--arrow)) 0,
    100% 50%,
    calc(100% - var(--arrow)) 100%,
    0 100%,
    var(--arrow) 50%
  );
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, filter 0.15s ease;
}

.layer-ribbon-item:first-child .layer-ribbon-link {
  padding-left: 18px;
  clip-path: polygon(
    0 0,
    calc(100% - var(--arrow)) 0,
    100% 50%,
    calc(100% - var(--arrow)) 100%,
    0 100%
  );
}

.layer-ribbon-item:last-child .layer-ribbon-link {
  padding-right: 18px;
  clip-path: polygon(
    0 0,
    100% 0,
    100% 100%,
    0 100%,
    var(--arrow) 50%
  );
}

.layer-ribbon-check {
  font-weight: 700;
}

.layer-ribbon-link:hover {
  background: #cbd5e0;
  color: #33465c;
  transform: translateY(-2px);
  filter: drop-shadow(0 5px 10px rgba(0, 51, 102, 0.2));
}

.layer-ribbon-link:focus-visible {
  outline: 3px solid #00bfff;
  outline-offset: -3px;
}

.layer-ribbon-item.is-completed .layer-ribbon-link {
  background: #4CAF50;
  color: #ffffff;
}
.layer-ribbon-item.is-completed .layer-ribbon-link:hover {
  background: #429a47;
  filter: drop-shadow(0 5px 10px rgba(76, 175, 80, 0.35));
}

.layer-ribbon-item.is-current .layer-ribbon-link {
  background: #003366;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9em;
  transform: scale(1.05);
  filter: drop-shadow(0 6px 14px rgba(0, 51, 102, 0.4));
}
.layer-ribbon-item.is-current .layer-ribbon-link:hover {
  background: #01477f;
  transform: scale(1.05) translateY(-2px);
}

.layer-ribbon-item.is-upcoming .layer-ribbon-link {
  background: #dde3ea;
  color: #6b7889;
}

/* Locked (> reached_layer + 1, non-staff student only): a plain <span>, not
   an <a> — muted, default cursor, no hover lift/colour shift. Background
   must stay visibly distinct from .layer-ribbon-wrap's own tray fill
   (#eef2f7) or the segment's chevron shape disappears into it — same grey
   as .is-upcoming, but a lighter/washed-out text colour (plus the lock
   icon) is what tells the two apart. Overrides the base
   .layer-ribbon-link:hover above, which would otherwise still apply (hover
   isn't link-only) since these still share the same base class for
   sizing/shape. */
.layer-ribbon-item.is-locked .layer-ribbon-link {
  background: #dde3ea;
  color: #9aa5b3;
  cursor: default;
}
.layer-ribbon-item.is-locked .layer-ribbon-link:hover {
  background: #dde3ea;
  color: #9aa5b3;
  transform: none;
  filter: drop-shadow(0 2px 4px rgba(0, 51, 102, 0.12));
}
.layer-ribbon-lock {
  font-size: 0.8em;
  line-height: 1;
}

@media (max-width: 640px) {
  .layer-ribbon-wrap {
    padding: 8px 10px;
  }
  .layer-ribbon {
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .layer-ribbon-item {
    flex: none;
    width: 150px;
  }
}
