/* Small overrides on top of Bootstrap's dark theme. Keep this file short. */

:root {
  --nav-height: 56px;
}

/* Each section starts exactly below the navbar. Snapping is "proximity" so long
   sections (Professional) scroll freely instead of jumping to the next one. */
html {
  scroll-padding-top: var(--nav-height);
  scroll-snap-type: y proximity;
  scroll-behavior: smooth;
}

body {
  padding-top: var(--nav-height);
}

/* Each section fills at least one screen, so neighbors stay off-screen. */
.section {
  display: flex;
  flex-direction: column;
  padding-block: 3rem;
  min-height: calc(100vh - var(--nav-height));
  min-height: calc(100dvh - var(--nav-height));
  scroll-snap-align: start;
  border-bottom: 1px solid var(--bs-border-color);
}

.section:last-of-type {
  border-bottom: 0;
}

.site-footer {
  margin-top: auto;
}

.section-title {
  margin-bottom: 1.5rem;
}

.subsection-title {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--bs-secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
}

/* Icon from images/icons/, colored by the surrounding text (see icon() in app.js). */
.icon {
  display: inline-block;
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask: no-repeat center / contain;
  mask: no-repeat center / contain;
}

.profile-link .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.interest-icon .icon {
  width: 1.75rem;
  height: 1.75rem;
}

/* Experience */
.company + .company {
  margin-top: 2rem;
}

/* Timeline: the left border is the line, each role gets a dot on it. */
.role {
  position: relative;
  border-left: 2px solid var(--bs-border-color);
  padding-left: 1rem;
  margin-top: 1rem;
}

.role::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.45rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bs-body-bg);
  border: 2px solid var(--bs-secondary-color);
}

.role-current::before {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
}

.role-toggle[aria-expanded="true"] .when-closed,
.role-toggle[aria-expanded="false"] .when-open {
  display: none;
}

/* Sidebar (education, skills, interests) stays in view beside the timeline. */
@media (min-width: 992px) {
  .professional-aside {
    position: sticky;
    top: calc(var(--nav-height) + 1rem);
  }
}

.role-dates {
  color: var(--bs-secondary-color);
  font-size: 0.9rem;
}

.project-name {
  font-weight: 600;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}

.award .icon {
  width: 0.9em;
  height: 0.9em;
  margin-right: 0.35em;
  vertical-align: -0.1em;
}

.company-logo {
  width: 1.75rem;
  height: 1.75rem;
  object-fit: contain;
}

/* Gallery: one preview card per topic */
.gallery-card {
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.gallery-card:hover,
.gallery-card:focus-visible {
  border-color: var(--bs-secondary-color);
}

.gallery-cover {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Fixed-size stage so the dialog (and its Prev/Next buttons) stays put
   regardless of each photo's dimensions; photos letterbox inside it. */
#lightbox-img {
  width: 100%;
  height: 75vh;
  object-fit: contain;
}

/* Keep long captions on one line so they can't change the header height */
#lightbox-caption {
  min-width: 0;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; scroll-snap-type: none; }
  .gallery-card { transition: none; }
}
