/* Shared styles for gallery landing pages */
:root {
  --bg: #0b0b0b;
  --panel: #141414;
  --border: #2a2a2a;
  --text: #f5f5f5;
  --muted: #c9c9c9;
  --link: #e6c46a;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 64px; /* space for fixed footer */
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: 12px;
  top: 12px;
  width: auto;
  height: auto;
  padding: .5rem .75rem;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  z-index: 9999;
}
.container { max-width: 960px; margin: 0 auto; padding: 0 1rem; }

/* Hard overrides to ensure centering even if other legacy styles load */
/* These help when an external stylesheet floats or aligns elements */
/* Do not include generic figure here to allow .float-photo to work */
header, main, footer, .container, .content, .hero, .hero img {
  float: none !important;
}
.container { margin-left: auto !important; margin-right: auto !important; }
.content figure { margin: 0 auto !important; }
.content img { display: block !important; margin-left: auto !important; margin-right: auto !important; }

header {
  padding: 1.25rem 0 0.5rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0));
}

/* VSU Archives brand link */
header .container { position: relative; }
/* formerly brand-link styles removed (no longer used) */

.hero {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 0 0 1rem;
  background: #000;
}

.hero img { display: block; width: 100%; height: auto; }
.hero a { display: block; text-decoration: none; }
.hero a:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; }

nav.breadcrumb { margin: .5rem 0 1.25rem; }
nav.breadcrumb a {
  color: var(--link);
  text-decoration: none;
}
nav.breadcrumb a:hover { text-decoration: underline; }
.muted { color: var(--muted); }

/* Keyboard focus */
a:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }

/* Grid of thumbnails */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  align-items: start; /* avoid equal-height stretch causing empty space */
}

.thumb {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.thumb a { display: block; color: inherit; text-decoration: none; }
/* Constrain thumbnail proportions to reduce uneven card heights */
.thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}
.thumb .caption {
  padding: .6rem .75rem .7rem;
  color: var(--muted);
  font-size: .95rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Photo index: subtler, centered captions so images stand out */
.photo-grid .thumb .caption {
  font-size: .72rem;
  text-align: center;
  color: var(--muted);
}

footer { color: var(--muted); }
footer.container {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: .75rem 1rem; /* add horizontal padding */
  background: var(--bg);
  border-top: 1px solid var(--border);
}
footer a { color: var(--link); text-decoration: none; }
footer a:hover { text-decoration: underline; }

footer .footer-logo {
  height: 18px;
  width: auto;
  vertical-align: middle;
  margin-right: .5rem;
  opacity: .95;
}

/* Detail pages */
.detail-nav { display: flex; gap: 1rem; margin: .5rem 0 1.25rem; justify-content: center; align-items: center; }
.detail-nav a { color: var(--link); text-decoration: none; }
.detail-nav a:hover { text-decoration: underline; }

.content { margin: 0 0 2rem; }
/* Ensure media centers reliably across browsers */
/* Center the figure itself regardless of text alignment */
.content figure { margin: 0 auto; display: block; }
.content img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.content figcaption { color: var(--muted); text-align: center; padding-top: .5rem; }

.media-strip { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.media-strip img { height: auto; max-width: 100%; }

/* OCR text block for article transcriptions */
.ocr {
  text-align: left; /* reset from .content center */
  margin: 1.25rem auto 2.5rem;
  padding: 1rem 1.25rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-width: 70ch;
  font-family: Georgia, "Times New Roman", Times, serif;
  line-height: 1.75;
}

.ocr h2 {
  margin: 0 0 .25rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.ocr p { margin: .75rem 0; }
.ocr p.note { color: var(--muted); font-style: italic; margin-top: .25rem; }
.ocr p.source { color: var(--muted); }

/* Inventory rendering */
.inventory {
  margin: 1.25rem 0 3rem;
  font-family: Georgia, "Times New Roman", Times, serif;
  line-height: 1.7;
  padding-bottom: 4.5rem; /* clear fixed footer */
}
.inventory h1, .inventory h2, .inventory h3 { margin: 0 0 .5rem; }
.inventory blockquote { margin: .25rem 0 1rem; padding-left: 1rem; border-left: 3px solid var(--border); color: var(--muted); }
.inventory ul { list-style: none; margin: .25rem 0; padding-left: 0; }
.inventory li { margin: .15rem 0; }
.inventory a { color: var(--link); text-decoration: none; }
.inventory a:hover { text-decoration: underline; }

/* Legacy finding aid tweaks */
.inventory.legacy {
  font-size: 0.98rem;
}
.inventory table { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; }
.inventory td, .inventory th { border: 1px solid var(--border); padding: .4rem .5rem; vertical-align: top; }
.inventory img { max-width: 100%; height: auto; }

/* Callout button/link at top of inventory */
.cta { margin: .5rem 0 1.25rem; }
.btn {
  display: inline-block;
  padding: .55rem .9rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.btn:hover { filter: brightness(1.1); }

/* ArchivesSpace button with logo */
.btn.aspace { display: inline-flex; align-items: center; gap: .5rem; }
.btn.aspace .logo { height: 20px; width: auto; display: inline-block; vertical-align: middle; }

/* ArchivesSpace hero section */
/* Float photo left; content wraps */
.float-photo { float: left; max-width: 360px; width: 42%; min-width: 220px; margin: .25rem 2rem 1.5rem 0; border-radius: 8px; overflow: visible; border: none; background: transparent; padding: 0; }
.float-photo img { display: block; width: 100%; height: auto; border-radius: 8px; }
.float-photo figcaption { text-align: center; color: var(--muted); font-size: .9rem; padding-top: .35rem; }

/* Override generic figure styles so margins apply and text has breathing room */
.content figure.float-photo {
  display: block;             /* override display: table */
  float: left !important;     /* ensure text wraps to the right */
  margin: .25rem 2rem 1.5rem 0 !important; /* ensure right/bottom space wins */
  background: transparent; border: 0; padding: 0;
}

/* ArchivesSpace logo and message on the right */
.aspace-right { text-align: center; margin: .25rem auto .5rem; float: none; width: auto; clear: none; }
.aspace-right .logo { height: 96px; width: auto; display: block; margin: 0 auto; }
.aspace-right .aspace-msg { margin-top: .5rem; text-align: center; }
.aspace-right .aspace-msg a { color: var(--link); text-decoration: none; }
.aspace-right .aspace-msg a:hover { text-decoration: underline; }

/* Reduce gap under legacy section heading/content */
.inventory.legacy { margin-bottom: .5rem; }

@media (max-width: 720px){
  .float-photo { float: none !important; width: 100%; max-width: 100%; margin: .5rem 0 .75rem; }
  .aspace-right { float: none; width: 100%; text-align: center; }
  .aspace-right .logo { height: 80px; }
}
/* Ensure last paragraph clears fixed footer */
.ocr p:last-of-type { padding-bottom: 4.5rem; }
