/* ── WIC GALLERY – SITE STYLES v2.0.0 ── */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Source+Sans+3:wght@400;600&display=swap');

:root {
  /* Brand (WIC Web App Template §8) */
  --red: #C0392B;
  --red-dark: #922B21;
  --red-light: #E74C3C;
  --black: #111111;
  --charcoal: #2C2C2C;
  --steel: #4A4A4A;
  --mid: #666666;
  --muted: #999999;
  --border: #E2E2E2;
  --bg: #F7F6F4;
  --white: #FFFFFF;
  --text: #1A1A1A;

  /* Semantic */
  --success: #2E7D32;
  --warning: #ED6C02;
  --danger:  #C62828;
  --info:    #0277BD;

  /* Type */
  --font-display: 'Oswald', Arial, sans-serif;
  --font-sub:     'Montserrat', Arial, sans-serif; /* reserved; not yet loaded */
  --font-body:    'Source Sans 3', Arial, sans-serif;

  --shadow: 0 1px 4px rgba(0,0,0,0.06);
  --radius: 0px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.6;
}

/* ── TOP BAR ── */
.wic-top {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}

.wic-top-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wic-brand { display: flex; align-items: center; }

.wic-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.wic-logo-img {
  height: 56px;
  width: auto;
  display: block;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.wic-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── HERO ── */
.wic-hero {
  background: var(--charcoal);
  padding: 2.6rem 0;
  position: relative;
  overflow: hidden;
}

.wic-hero-bg { display: none; }

.wic-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.wic-hero-eyebrow {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.5rem;
}

.wic-hero-eyebrow::before {
  content: '';
  display: block;
  width: 18px;
  height: 2px;
  background: var(--red);
  flex-shrink: 0;
}

.wic-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--white);
  line-height: 1.05;
  margin-bottom: 0.5rem;
}

.wic-hero h1 span { color: var(--red); }

.wic-hero-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.45);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.wic-hero-sub-div {
  width: 1px;
  height: 11px;
  background: rgba(255,255,255,0.2);
}

/* ── BUTTONS ── */
.btn {
  border: 1.5px solid var(--border);
  background: var(--white);
  padding: 7px 14px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--steel);
  text-decoration: none;
  display: inline-block;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  border-radius: 0;
}

.btn:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--white);
}

.btn:disabled { opacity: 0.4; cursor: default; }

/* Red primary CTA (template §8 .btn-primary) */
.btn-primary,
.wic-meta a.btn.btn-primary {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

.btn-primary:hover,
.wic-meta a.btn.btn-primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: var(--white);
}

.wic-meta a.btn {
  background: var(--bg);
  border-color: var(--border);
  color: var(--charcoal);
  font-weight: 600;
}

.wic-meta a.btn:visited { color: var(--charcoal); }

.wic-meta a.btn:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

/* ── PAGE LAYOUT ── */
.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 40px;
}

/* ── CARDS ── */
.card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 16px;
  box-shadow: var(--shadow);
  border-radius: 0;
}

/* Signature WIC red top-accent, animates in on hover (template §8) */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.card:hover::before { transform: scaleX(1); }

.card-mt { margin-top: 16px; }

.card-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

/* ── TYPOGRAPHY ── */
h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--black);
  margin: 0;
}

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--black);
  margin: 0 0 4px;
}

h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--black);
  margin: 0 0 6px;
}

.status {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-display);
  letter-spacing: 0.08em;
}

.status.error { color: var(--danger); font-weight: 700; }

.meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.muted { font-size: 12px; color: var(--muted); }

/* ── LATEST PHOTO ── */
.latest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 10px;
  gap: 12px;
}

.latest-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Featured hero cross-fade as it cycles through uploads */
#latestImg { transition: opacity 0.45s ease; }

/* Global image reset */
img, video {
  width: 100%;
  height: auto;
  border-radius: 0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--white);
}

/* Logo overrides */
.wic-logo,
.wic-logo img,
.wic-logo-img {
  border-radius: 0 !important;
  box-shadow: none !important;
  border: none !important;
  background: transparent !important;
}

/* ── SPLIT GRID ── */
.split-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: start;
}

.split-grid > section,
.split-grid > .card {
  min-width: 0;
  width: 100%;
}

/* ── CARD CONTROLS ── */
.card-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.card-controls > * { min-width: 0; }

.card-controls label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

select, input {
  border: 1px solid var(--border);
  background: var(--white);
  padding: 5px 8px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
  border-radius: 0;
}

input { min-width: 180px; }

/* ── THUMBNAIL GRIDS ── */
.grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  align-items: start;
}

.grid-compact {
  grid-template-columns: repeat(2, 1fr);
}

.grid > * { min-width: 0; }

/* Thumb tiles */
.thumb {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  background: var(--border);
  cursor: zoom-in;
  /* Skip rendering/layout of off-screen tiles in long camera grids. */
  content-visibility: auto;
  contain-intrinsic-size: auto 130px;
}

.thumb img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
  border: none;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
  transition: transform 0.25s;
}

.thumb:hover img { transform: scale(1.04); }

/* Camera grid — overlay caption */
#cameraGrid .thumb .thumb-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  margin: 0;
  padding: 5px 8px;
  background: rgba(0,0,0,0.55);
  color: var(--white);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  border-radius: 0;
}

/* Approved grid — caption below image */
#approvedGrid .thumb img { height: 110px; }

#approvedGrid .thumb .thumb-caption {
  position: static;
  background: transparent;
  color: var(--steel);
  padding: 4px 2px 0;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 0;
}

/* ── MODAL ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
}

.modal.open { display: flex; }

.modal-inner { max-width: 1200px; width: 100%; }

.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.modal-name {
  color: var(--white);
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.8;
}

.modal img {
  max-height: 85vh;
  object-fit: contain;
  width: 100%;
  display: block;
  cursor: zoom-out;
  border: none;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
}

.modal .btn {
  color: var(--white);
  border-color: rgba(255,255,255,0.3);
  background: transparent;
}

.modal .btn:hover {
  border-color: var(--white);
  background: transparent;
  color: var(--white);
}

/* Modal nav arrows */
.modal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  opacity: 0.92;
  pointer-events: auto;
  color: var(--white);
  border-color: rgba(255,255,255,0.3);
  background: transparent;
  width: auto !important;
}

.modal-arrow-prev { left: 12px; }
.modal-arrow-next { right: 12px; }

/* ── KPI PILLS (admin pages) ── */
.kpi { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.pill { background: var(--bg); border: 1px solid var(--border); padding: 6px 12px; font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.08em; color: var(--steel); }

/* ── LATEST RIGHT ── */
.latest-right { display: flex; align-items: center; gap: 10px; }

/* ── UPLOAD PAGE ── */
.dropzone {
  border: 2px dashed var(--border);
  background: var(--white);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  border-radius: var(--radius);
  transition: border-color 0.2s, background 0.2s;
}
.dropzone > * { pointer-events: none; } /* drag events fire on the zone, not its children */
.dropzone:hover { border-color: var(--red); }
.dropzone:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.dropzone.dragover {
  border-color: var(--red);
  background: rgba(192, 57, 43, 0.06);
}
.dropzone.disabled { pointer-events: none; opacity: 0.5; }
.dropzone-icon { font-size: 1.7rem; line-height: 1; color: var(--red); margin-bottom: 8px; }
.dropzone-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.9rem;
  color: var(--charcoal);
}
.dropzone-sub { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.dropzone-link { color: var(--red); text-decoration: underline; }

.thumb-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.65);
  color: var(--white);
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
  text-align: center;
}

.thumb-remove:hover { background: var(--red); }

/* ── FOOTER ── */
.wic-footer { background: var(--black); }

.wic-footer-bar {
  background: var(--red);
  padding: 0.9rem 20px;
}

.wic-footer-tagline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--white);
  max-width: 1200px;
  margin: 0 auto;
  display: block;
}

.wic-footer-bottom {
  padding: 1.2rem 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.wic-footer-copy { font-size: 11px; color: var(--mid); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .split-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .wic-top-inner { flex-wrap: wrap; gap: 8px; }
  .wic-meta { width: 100%; justify-content: flex-start; }
  .wic-hero { padding: 2rem 0; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .grid-compact { grid-template-columns: repeat(2, 1fr); }
  select, input { min-width: 0; width: 100%; }
  .card-head { flex-wrap: wrap; align-items: flex-start; }
  .status { width: 100%; }
}

@media (max-width: 480px) {
  .modal .btn { width: auto; }
}