/* ============================================================
   Campus Gallery — shared stylesheet
   Used by gallery.html and add-images.html
   ============================================================ */

:root {
  /* --- Color tokens --- */
  --ink: #1F3A3D;          /* deep chalkboard teal — header, nav, headings */
  --ink-light: #2E4F52;
  --paper: #F1F2EA;         /* warm-cool paper background */
  --card: #FFFFFF;
  --accent: #E0A63A;        /* marigold — active states, CTAs */
  --accent-dark: #C48A22;
  --sage: #6F8F76;          /* secondary accent — tags, links */
  --sage-dark: #56714D;
  --text: #22302F;
  --text-muted: #5B6B67;
  --border: #DAD9C9;
  --danger: #B0483E;
  --danger-dark: #8E3931;

  /* --- Type --- */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --shadow-card: 0 1px 2px rgba(31, 58, 61, 0.06), 0 4px 14px rgba(31, 58, 61, 0.07);
  --shadow-lift: 0 10px 30px rgba(31, 58, 61, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 2px;
}

/* ============================================================
   Header / Nav
   ============================================================ */

.site-header {
  background: var(--ink);
  color: #F1F2EA;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: #fff;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #C7D6D3;
}

.main-nav {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.main-nav a {
  text-decoration: none;
  font-size: 14.5px;
  color: #D7E0DD;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.main-nav a:hover { color: #fff; }

.main-nav a.active {
  color: #fff;
  border-color: var(--accent);
}

/* ============================================================
   Hero / breadcrumb banner
   ============================================================ */

.hero-banner {
  background: linear-gradient(180deg, var(--ink-light) 0%, var(--ink) 100%);
  color: #fff;
  padding: 46px 0 40px;
}

.hero-banner .eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.hero-banner h1 {
  color: #fff;
  font-size: clamp(32px, 4.5vw, 46px);
  margin-bottom: 8px;
}

.hero-banner p {
  color: #C7D6D3;
  max-width: 46em;
  margin: 0;
}

/* ============================================================
   Category tabs — styled like folder index tabs
   ============================================================ */

.tab-rail {
  background: var(--ink);
  padding-bottom: 0;
  position: sticky;
  top: 0;
  z-index: 30;
}

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 14px 0 0;
  border-bottom: 3px solid var(--accent-dark);
}

.tab {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--ink-light);
  color: #C7D6D3;
  border: none;
  padding: 11px 18px 9px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  position: relative;
  top: 2px;
  transition: background 0.15s ease, color 0.15s ease, top 0.15s ease;
}

.tab:hover { background: #385C5F; color: #fff; }

.tab.is-active {
  background: var(--accent);
  color: var(--ink);
  font-weight: 600;
  top: 0;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
}

.tab .count {
  opacity: 0.75;
  margin-left: 5px;
}

/* ============================================================
   Gallery grid
   ============================================================ */

.gallery-section {
  padding: 40px 0 70px;
}

.gallery-grid {
  columns: 4 260px;
  column-gap: 18px;
}

@media (max-width: 900px) {
  .gallery-grid { columns: 2 220px; }
}
@media (max-width: 520px) {
  .gallery-grid { columns: 1; }
}

.photo-card {
  break-inside: avoid;
  margin-bottom: 18px;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  border: 1px solid var(--border);
}

.photo-card img {
  width: 100%;
  height: auto;
  transition: transform 0.35s ease;
}

.photo-card:hover img { transform: scale(1.04); }

.photo-card .card-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 14px 12px;
  background: linear-gradient(180deg, rgba(31,58,61,0) 0%, rgba(20,35,37,0.88) 100%);
  color: #fff;
  transform: translateY(6px);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.photo-card:hover .card-caption,
.photo-card:focus-visible .card-caption {
  opacity: 1;
  transform: translateY(0);
}

.card-caption .cat {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 3px;
}

.card-caption .cap {
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.3;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 14px;
}

/* ============================================================
   Lightbox
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 26, 27, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 30px;
}

.lightbox.is-open { display: flex; }

.lightbox-inner {
  max-width: 1000px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox img {
  max-height: 74vh;
  width: auto;
  margin: 0 auto;
  border-radius: 4px;
  box-shadow: var(--shadow-lift);
}

.lightbox-meta {
  color: #EDEFE8;
  text-align: center;
  margin-top: 16px;
  max-width: 700px;
}

.lightbox-meta .cat {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.lightbox-meta .cap {
  font-family: var(--font-display);
  font-size: 18px;
  margin-top: 4px;
}

.lightbox-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #9FB2AE;
  margin-top: 8px;
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  background: rgba(241, 242, 234, 0.1);
  border: 1px solid rgba(241, 242, 234, 0.3);
  color: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover { background: rgba(241, 242, 234, 0.22); }

.lightbox-close { top: 24px; right: 24px; }
.lightbox-nav.prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-nav.next { right: 24px; top: 50%; transform: translateY(-50%); }

@media (max-width: 640px) {
  .lightbox-nav.prev { left: 8px; }
  .lightbox-nav.next { right: 8px; }
  .lightbox-close { top: 12px; right: 12px; }
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  background: var(--ink);
  color: #B9C7C4;
  padding: 30px 0;
  font-size: 13.5px;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  border-radius: 999px;
  padding: 11px 22px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  text-decoration: none;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: var(--ink);
}
.btn-primary:hover { background: var(--accent-dark); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-secondary:hover { background: var(--ink); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--sage-dark);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--sage-dark); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
  padding: 7px 14px;
  font-size: 13px;
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   Admin / form page
   ============================================================ */

.admin-header-note {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: uppercase;
}

.admin-layout {
  padding: 36px 0 70px;
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 34px;
  align-items: start;
}

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  box-shadow: var(--shadow-card);
}

.panel h2 {
  font-size: 21px;
  margin-bottom: 4px;
}

.panel .panel-sub {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 22px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sage-dark);
  margin-bottom: 7px;
}

.field input[type="text"],
.field select,
.field input[type="url"] {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14.5px;
  background: #FDFCF8;
  color: var(--text);
}

.field input:focus,
.field select:focus {
  border-color: var(--sage-dark);
}

.field-hint {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 6px;
}

.new-category-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.new-category-row input { flex: 1; }

.source-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
}

.source-toggle button {
  flex: 1;
  padding: 9px 10px;
  background: #FDFCF8;
  border: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
}

.source-toggle button.is-active {
  background: var(--ink);
  color: #fff;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover, .dropzone.is-drag {
  border-color: var(--sage-dark);
  background: #F4F6EF;
}

.dropzone input { display: none; }

.preview-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.preview-thumb {
  width: 74px;
  height: 74px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}

.preview-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}

.preview-thumb .remove {
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(20,35,37,0.75);
  color: #fff;
  border: none;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--ink);
  color: #fff;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* --- Manage panel --- */

.manage-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.manage-toolbar h2 { margin-bottom: 0; }

.io-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.manage-group {
  margin-bottom: 26px;
}

.manage-group-title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sage-dark);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.manage-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #FDFCF8;
}

.manage-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.manage-item-body {
  padding: 8px 10px 10px;
}

.manage-item-cap {
  font-size: 12.5px;
  line-height: 1.3;
  margin-bottom: 8px;
  min-height: 32px;
  color: var(--text);
}

.manage-item-cap.empty {
  color: var(--text-muted);
  font-style: italic;
}

.import-input { display: none; }

.file-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -4px;
}

.storage-bar-wrap {
  margin-top: 6px;
}

.storage-bar {
  height: 6px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}

.storage-bar-fill {
  height: 100%;
  background: var(--sage);
}
