/* Showcase site styles. Bootstrap handles layout; this file only adds the
   small amount of custom behavior the page needs on top. */

:root {
  --theme-bg-page: #f7f6f3;
  --theme-bg-surface: #ffffff;
  --theme-bg-soft: #f1efe9;
  --theme-border: #d9d5cb;
  --theme-text: #2f2b27;
  --theme-text-muted: #5e5851;
  --theme-accent-primary: #00563f;
  --theme-accent-primary-strong: #004733;
  --theme-accent-secondary: #5c2a86;
  --theme-accent-secondary-strong: #4a1f6f;
  --theme-search-hit: rgba(201, 151, 0, 0.38);
  --theme-on-dark: #f8f9fa;
}

/* Subtle Bootstrap 5 alignment for pages that load this stylesheet. */
body {
  background-color: var(--theme-bg-page) !important;
  color: var(--theme-text);
}

.bg-light {
  background-color: var(--theme-bg-page) !important;
}

.bg-white,
.card,
.modal-content,
.list-group,
.list-group-item {
  background-color: var(--theme-bg-surface) !important;
}

.border,
.border-top,
.border-bottom,
.card,
.list-group-item,
.modal-content,
#photoModalMeta,
#showcase-search-results,
.identity-panel {
  border-color: var(--theme-border) !important;
}

.text-secondary,
.text-muted,
.navbar-text {
  color: var(--theme-text-muted) !important;
}

a {
  color: var(--theme-accent-primary);
}

a:hover {
  color: var(--theme-accent-primary-strong);
}

.navbar .nav-link {
  color: var(--theme-text-muted);
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: var(--theme-accent-primary);
}

.btn-primary {
  --bs-btn-bg: var(--theme-accent-primary);
  --bs-btn-border-color: var(--theme-accent-primary);
  --bs-btn-hover-bg: var(--theme-accent-primary-strong);
  --bs-btn-hover-border-color: var(--theme-accent-primary-strong);
  --bs-btn-active-bg: var(--theme-accent-primary-strong);
  --bs-btn-active-border-color: var(--theme-accent-primary-strong);
}

.btn-dark {
  --bs-btn-bg: var(--theme-accent-primary-strong);
  --bs-btn-border-color: var(--theme-accent-primary-strong);
  --bs-btn-hover-bg: #003a2a;
  --bs-btn-hover-border-color: #003a2a;
  --bs-btn-active-bg: #003a2a;
  --bs-btn-active-border-color: #003a2a;
}

.btn-outline-secondary {
  --bs-btn-color: var(--theme-text-muted);
  --bs-btn-border-color: var(--theme-border);
  --bs-btn-hover-color: var(--theme-text);
  --bs-btn-hover-bg: var(--theme-bg-soft);
  --bs-btn-hover-border-color: var(--theme-border);
  --bs-btn-active-color: var(--theme-text);
  --bs-btn-active-bg: var(--theme-bg-soft);
  --bs-btn-active-border-color: var(--theme-border);
}

.form-control,
.form-select {
  border-color: var(--theme-border);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--theme-accent-primary);
  box-shadow: 0 0 0 0.2rem rgba(0, 86, 63, 0.14);
}

/* --- Carousel arrows: hidden until you hover the card --- */
.card .carousel-control-prev,
.card .carousel-control-next {
  opacity: 0;
  transition: opacity .2s;
}
.card:hover .carousel-control-prev,
.card:hover .carousel-control-next {
  opacity: .85;
}

/* --- Locked aspect ratio prevents masonry from jumping when slides change --- */
.carousel-fixed              { aspect-ratio: 3 / 2; overflow: hidden; }
.carousel-fixed img,
.carousel-fixed picture,
.carousel-fixed picture img  { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }

/* Single-image tiles use natural aspect — portraits stay portrait, landscapes stay
   landscape, masonry handles the varied heights. Carousels still need a locked
   ratio above to keep height stable as slides change. */
.thumb-wrap                  { background: var(--theme-bg-soft); overflow: hidden; }
.thumb-wrap img              { width: 100%; height: auto; display: block; }

/* Wide cards are 2x as wide on xl screens — flatten the ratio so they aren't
   also 2x as tall, which leaves masonry gaps that nothing can fill. */
@media (min-width: 1200px) {
  .showcase-grid-item--wide .carousel-fixed { aspect-ratio: 2 / 1; }
  .showcase-grid-item--wide .thumb-wrap     { aspect-ratio: 2 / 1; }
  .showcase-grid-item--wide .thumb-wrap img { height: 100%; object-fit: cover; object-position: 50% 30%; }
}

/* --- Lightbox: keep image area stable while the full-res arrives --- */
#photoModalImg               { min-height: 200px; background: var(--theme-bg-soft); }
#photoModalImg.is-loading    { opacity: .35; transition: opacity .15s; }

/* Prev/next chevrons over the lightbox. Bootstrap utilities handle the
   positioning, shape, and shadow on the element itself — this just fixes
   the size and forces hide when the [hidden] attribute is set (Bootstrap's
   .btn display would otherwise win against the user-agent [hidden] rule). */
.photo-modal-nav             { z-index: 2; width: 44px; height: 44px; padding: 0; font-size: 1.5rem; line-height: 1; }
.photo-modal-nav[hidden]     { display: none !important; }

/* Footer of the lightbox: meta on the left, download original on the right. */
#photoModalMeta              { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
#photoModalMeta .meta-text   { flex: 1 1 auto; min-width: 0; }
#photoModalMeta .meta-actions{ flex: 0 0 auto; }

/* --- Right-side semester timeline scrubber (Google Photos style) --- */
#semester-timeline {
  position: fixed;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}
@media (max-width: 991.98px) {
  #semester-timeline { display: none; }
}
.sem-tick {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity .2s;
  text-decoration: none;
}
.sem-tick:hover { opacity: 1; }
.sem-tick.active { opacity: 1; }
.sem-tick__line {
  flex-shrink: 0;
  width: 16px;
  height: 2px;
  background: var(--theme-text-muted);
  border-radius: 1px;
  transition: width .2s, background .2s;
}
.sem-tick.active .sem-tick__line {
  width: 28px;
  background: var(--theme-accent-secondary);
}
.sem-tick__label {
  font-size: 0.68rem;
  white-space: nowrap;
  color: var(--theme-text-muted);
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sem-tick.active .sem-tick__label {
  color: var(--theme-accent-secondary-strong);
  font-weight: 700;
}

/* Event/album sub-headings inside a semester section */
.event-heading {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--theme-text-muted);
  border-bottom: 1px solid var(--theme-border);
  padding-bottom: 0.3rem;
  margin-bottom: 1rem;
}

/* Edit mode affordances (only visible on showcase.html?edit=1) */
body.edit-mode .showcase-card {
  outline: 2px dashed rgba(13, 110, 253, 0.25);
  outline-offset: 2px;
}

body.edit-mode .showcase-card--hidden {
  opacity: 0.6;
  filter: grayscale(0.2);
}

.js-edit-photo {
  line-height: 1;
}

.card-notes {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#showcase-search-results {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--theme-border);
  border-radius: 0.5rem;
}

#showcase-search-results .list-group-item {
  border-left: 0;
  border-right: 0;
}

.showcase-card.search-hit {
  box-shadow: 0 0 0 3px var(--theme-search-hit) !important;
}

/* Masonry uses this as the base column width for mixed-size cards. */
.showcase-grid-sizer {
  height: 0;
  min-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

/* --- Left profile card action row --- */
.action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.action-row .btn {
  text-transform: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

  /* --- Identity block in left sidebar (profile + rifle background) --- */
  .identity-panel {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    height: 200px;
    border: 1px solid var(--theme-border);
    background: var(--theme-bg-soft);
  }

  .identity-panel__bg {
    position: absolute;
    inset: 0;
    background-image: url('assets/img/profile/prone-rifle.png');
    background-size: cover;
    background-position: center;
    filter: saturate(0.85) contrast(0.9);
  }

  .identity-panel__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.15));
  }

  .identity-panel__avatar {
    position: absolute;
    left: 0.9rem;
    bottom: 0.7rem;
    width: 84px;
    height: 84px;
    border-radius: 0.5rem;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32);
    z-index: 2;
  }

  .identity-panel__caption {
    position: absolute;
    left: 0.9rem;
    right: 0.9rem;
    top: 0.8rem;
    color: var(--theme-on-dark);
    z-index: 1;
  }

  .identity-panel__kicker {
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.85;
    font-weight: 700;
  }

  .identity-panel__text {
    font-size: 0.78rem;
    line-height: 1.35;
    font-weight: 500;
    max-width: 255px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  }

@media (max-width: 576px) {
  .action-row {
    grid-template-columns: 1fr;
  }

    .identity-panel {
      height: 184px;
    }

    .identity-panel__avatar {
      width: 70px;
      height: 70px;
    }

  .identity-panel__text {
    font-size: 0.72rem;
      max-width: 220px;
  }
}
