
:root {
  --hx-max: 1200px;
  --hx-gap: clamp(1rem, 2vw, 2rem);
  --hx-pad: clamp(0.75rem, 1.5vw, 1.25rem);
  --hx-accent: #3a6ea5;   /* button & focus color */
  --hx-accent-contrast: #ffffff;
  --hx-text: #1e293b;     /* slate-800 */
  --hx-muted: #64748b;    /* slate-500 */
  --hx-border: #e2e8f0;   /* slate-200 */
  --hx-bg: #ffffff;
  --hx-card: #f8fafc;     /* slate-50 */
}

/* If you keep <hist-main> as a custom tag, make it block-level */
hist-main { display: block; width: 100%; }

.hx-wrap {
  margin-inline: auto;
  max-width: var(--hx-max);
  padding: var(--hx-gap);
  color: var(--hx-text);
}

/* Sticky top nav */
.hx-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--hx-border);
}
.hx-nav .hx-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hx-gap);
}
.hx-brand { font-weight: 700; letter-spacing: 0.02em; }
.hx-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.hx-btn {
  appearance: none;
  border: 1px solid var(--hx-accent);
  background: var(--hx-accent);
  color: var(--hx-accent-contrast);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-size: 0.95rem;
  line-height: 1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform .04s ease, background .2s ease;
}
.hx-btn:hover { background: #2d5a88; }
.hx-btn:active { transform: translateY(1px); }
.hx-btn--outline { background: transparent; color: var(--hx-accent); }

/* Page header */
.hx-header {
  padding-block: clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--hx-border);
  background: var(--hx-card);
}
.hx-title { margin: 0 0 0.25rem; font-size: clamp(1.4rem, 3.5vw, 2.2rem); }
.hx-sub { margin: 0; color: var(--hx-muted); font-size: clamp(0.95rem, 2.5vw, 1.1rem); }

/* Timeline layout */
.hx-timeline {
  display: grid;
  gap: clamp(1rem, 3vw, 2rem);
  padding-block: clamp(1rem, 4vw, 2.5rem);
}
.hx-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--hx-gap);
  align-items: center;
}
/* Alternate sides */
.hx-item:nth-child(even) .hx-media { order: 2; }
.hx-item:nth-child(even) .hx-text  { order: 1; }

/* Text card */
.hx-text {
  background: var(--hx-card);
  border: 1px solid var(--hx-border);
  border-radius: 12px;
  padding: clamp(0.9rem, 2vw, 1.25rem);
}
.hx-year {
  font-weight: 800;
  color: var(--hx-accent);
  letter-spacing: 0.03em;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}
.hx-h3 { margin: 0 0 0.35rem; font-size: clamp(1.1rem, 3vw, 1.4rem); line-height: 1.2; }
.hx-copy { margin: 0.5rem 0 0; color: var(--hx-text); line-height: 1.55; }
.hx-credit { margin-top: 0.75rem; color: var(--hx-muted); font-size: 0.85rem; }

/* Media frame with consistent size via aspect-ratio */
.hx-media {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--hx-border);
  aspect-ratio: 16 / 9;        /* Set desired shape here */
  background: #0001;
}
.hx-media img {
  width: 100%;
  height: 100%;                /* Fill the frame */
  object-fit: cover;           /* Crop to fit */
  object-position: center;
  display: block;
}

/* Anchor offset for sticky nav */
.hx-anchor { position: relative; scroll-margin-top: 80px; }

/* Stack on phones/tablets 900 px  but for testing I reduced it*/
@media (max-width: 900px) {
  .hx-item { grid-template-columns: 1fr; }
  .hx-item:nth-child(even) .hx-media,
  .hx-item:nth-child(even) .hx-text { order: initial; }

  /* Keep image filling its aspect-ratio frame on small screens, too */
  .hx-media img { height: 100%; }
}

/*
.hx-timeline > .hx-item {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr) !important;
}
*/




/* OPTIONAL FADE-IN:
   Uncomment only if /php/js/history.js is loaded (or add .is-in class in HTML)
.hx-reveal {
  opacity: 0;
  translate: 0 12px;
  transition: opacity .5s ease, translate .5s ease;
}
.hx-reveal.is-in {
  opacity: 1;
  translate: 0 0;
}
*/

/*Code for the buildings page */
/* Grid styles used in both views */
  .gallery, .gallery-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    align-items: start;
  }
  .gallery img, .gallery-grid img {
    width: 100%;
    height: auto;
    border: 1px solid #ccc;
    border-radius: 4px;
    display: block;
  }

  /* Lightbox tweaks */
  .lb-image { max-width: 900px !important; height: auto !important; margin: 0 auto; }
  .lb-caption { display: block !important; color: #fff; font-size: 14px; text-align: center; margin-top: 10px; }
  .lb-caption a.lb-more-link { color: #aee1ff; text-decoration: underline; }
  .lb-caption a.lb-more-link:hover { color: #fff; }

  /* Sticky notes under the faces grid */
  .building-notes {
    position: sticky;
    top: 8px;              /* adjust to clear your site header */
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px 14px;
    margin-top: 12px;
    max-width: 980px;      /* optional: match your content width */
  }
  .building-notes h3 { margin: 0 0 6px 0; font-size: 1.1rem; }
  .building-notes p  { margin: 0.25rem 0; line-height: 1.45; }
  .section-title { margin: .5rem 0 1rem; font-size: 1.35rem; }
  .back-link { margin: 0 0 1rem; display: inline-block; }
