/* ==========================================================================
   shared.css — styles every template relies on: base resets, social icons,
   the modal system (photo essays, audio, video), and small utilities.
   Template-specific looks live in each template's own style.css.
   ========================================================================== */

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body, system-ui, sans-serif);
  color: var(--color-text, #1a1a1a);
  background: var(--color-bg, #ffffff);
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

/* Bootstrap rows with large gutters (g-5) have negative side margins wider
   than the default container padding — widen the padding so nothing bleeds
   off-screen, and clip any stray horizontal overflow. */
.container, .container-fluid { padding-left: 1.5rem; padding-right: 1.5rem; }
body { overflow-x: clip; }

h1, h2, h3, h4 { font-family: var(--font-heading, inherit); line-height: 1.15; }

a { color: inherit; }

/* Sections get breathing room under sticky navs when jumped to */
section[id] { scroll-margin-top: 90px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Social icons
   -------------------------------------------------------------------------- */

.icon { width: 1em; height: 1em; display: block; }

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.4em;
  height: 2.4em;
  font-size: 0.95rem;
  border-radius: 50%;
  color: var(--social-icon-color, var(--color-bg, #fff));
  background: var(--social-icon-bg, var(--color-text, #1a1a1a));
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.social-links a:hover { transform: translateY(-2px); opacity: 0.85; }

/* --------------------------------------------------------------------------
   Work cards — shared mechanics (each template restyles the surface)
   -------------------------------------------------------------------------- */

.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.work-card-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  text-align: inherit;
  width: 100%;
}

.work-card-media {
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

.work-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.work-card-link:hover .work-card-media img,
.work-row-link:hover .work-row-media img { transform: scale(1.04); }

.work-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.65;
}

.media-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.media-badge .icon { width: 1.1em; height: 1.1em; }

/* Full-width row layout (used by some templates) */
.work-row-link { color: inherit; text-decoration: none; display: block; cursor: pointer; }
.work-row-media { overflow: hidden; }
.work-row-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }

/* --------------------------------------------------------------------------
   Modals (photo essay slideshow / audio / video)
   -------------------------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(10, 10, 12, 0.88);
}

.modal-overlay.is-open { display: flex; }

body.modal-open { overflow: hidden; }

.modal-box {
  position: relative;
  width: min(1000px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--modal-bg, #101014);
  color: #f4f4f4;
  border-radius: 10px;
  padding: 1.25rem 1.25rem 1.5rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 5;
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover { background: rgba(255, 255, 255, 0.25); }

.modal-title {
  margin: 0.2rem 2.6rem 0.25rem 0.2rem;
  font-size: 1.35rem;
}

.modal-meta {
  margin: 0 0 1rem 0.2rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.6;
}

.modal-description { margin: 1rem 0.2rem 0; font-size: 0.95rem; opacity: 0.85; }

/* Video */
.modal-video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
}

.modal-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Audio */
.modal-audio-photo img {
  width: 100%;
  max-height: 55vh;
  object-fit: contain;
  border-radius: 6px;
  background: #000;
}

.modal-audio audio { width: 100%; margin-top: 1rem; }

/* Photo essay slideshow */
.slideshow { position: relative; }

.slide { display: none; }
.slide.is-active { display: block; }

.slide img {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  background: #000;
  border-radius: 6px;
}

.slide-caption {
  margin: 0.75rem 0.2rem 0;
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.9;
}

.slideshow-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.slideshow-controls button {
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.slideshow-controls button:hover { background: rgba(255, 255, 255, 0.3); }

.slide-counter { font-size: 0.85rem; letter-spacing: 0.1em; opacity: 0.7; min-width: 4.5rem; text-align: center; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  padding: 2.5rem 0 3rem;
  font-size: 0.85rem;
  text-align: center;
  opacity: 0.75;
}

.site-footer p { margin: 0.25rem 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .work-card-media img, .work-row-media img, .social-links a { transition: none; }
}
