/* =========================================
   WMRN APP — FINAL STYLES (APP-SCOPED)
========================================= */

/* ===== BASE ===== */
.app-active {
  margin: 0;
  padding: 0;
  background: #000033;
  color: #ffffff;
  font-family: system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

/* kill theme containers */
.app-active #page,
.app-active .site,
.app-active .container,
.app-active .content-area {
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* ===== APP WRAPPER ===== */
.wmrn-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
}

/* ===== HEADER ===== */
.app-header {
  padding: 20px 16px;
  border-bottom: 2px solid #7295B7;
}

.app-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.app-header span {
  font-size: 12px;
  opacity: 0.7;
}

/* ===== CONTENT ===== */
.app-content {
  flex: 1;
  padding: 16px;
  padding-bottom: 110px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== CARDS ===== */
.app-card {
  background: #111144;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.app-card:active {
  transform: scale(0.98);
}

.app-card h2 {
  margin: 0 0 8px 0;
  font-size: 18px;
}

.app-card h3 {
  margin: 6px 0;
  font-size: 16px;
  font-weight: 600;
}

.app-card p {
  margin: 0;
  font-size: 14px;
  opacity: 0.85;
}

/* ===== BUTTON ===== */
.app-button {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 14px;
  background: #7295B7;
  color: #000033;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s ease;
}

.app-button:hover {
  opacity: 0.9;
}

.app-button:active {
  opacity: 0.7;
}

/* ===== NAV ===== */
.app-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #000033;
  border-top: 2px solid #7295B7;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0;
  z-index: 9999;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

/* NAV ITEMS */
.app-nav a {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  gap: 2px;
  padding: 6px 0;
  white-space: nowrap;
  transition: all 0.15s ease;
}

/* ICON */
.app-nav a span {
  font-size: 20px;
  line-height: 1;
}

/* ACTIVE */
.app-nav a.active {
  color: #7295B7;
  transform: translateY(-2px);
}

/* TAP */
.app-nav a:active {
  opacity: 0.6;
  transform: scale(0.92);
}

/* ===== SCROLL FIX ===== */
html, body {
  height: 100%;
}

/* ===== REMOVE WORDPRESS JUNK ===== */
.app-active header,
.app-active footer,
.app-active .site-header,
.app-active .site-footer {
  display: none !important;
}

/* ===== COLLECTION GRID ===== */
.collections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

/* ===== COLLECTION TILE ===== */
.collection-tile {
  display: block;
  background: #1c2d4a;
  border-radius: 12px;
  padding: 14px;
  text-decoration: none;
  color: #fff;
  transition: all 0.15s ease;
}

.collection-tile span {
  font-size: 22px;
  display: block;
  margin-bottom: 6px;
}

.collection-tile strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.collection-tile p {
  font-size: 12px;
  opacity: 0.8;
}

/* TAP FEEL */
.collection-tile:active {
  transform: scale(0.96);
}

/* =========================================
   FORCE FULL APP MODE (OVERRIDE THEME)
========================================= */

body.app-active,
body.app-active html {
  background: #000033 !important;
}

/* kill EVERYTHING from theme */
body.app-active #page,
body.app-active .site,
body.app-active .site-content,
body.app-active .content-area,
body.app-active .wrap,
body.app-active .container,
body.app-active main {
  all: unset !important;
}

/* remove header/footer completely */
body.app-active header,
body.app-active footer,
body.app-active .site-header,
body.app-active .site-footer {
  display: none !important;
}

/* force app to take over screen */
body.app-active .wmrn-app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background: #000033;
  z-index: 999999;
}

.wmrn-app {
  transition: opacity 0.15s ease;
}

.wmrn-app.loading {
  opacity: 0.45;
  pointer-events: none;
}

/* =========================================
   APP FORCE OVERRIDES (CRITICAL)
========================================= */

body.app-active {
  background: #000033 !important;
  color: #fff !important;
  font-family: system-ui, -apple-system, sans-serif !important;
}

/* kill theme bleed */
body.app-active * {
  font-family: inherit !important;
}

/* ===== GRID FIX ===== */
.archive-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 16px !important;
  padding: 12px !important;
}

/* ===== CARD ===== */
.archive-item {
  display: block !important;
  background: linear-gradient(145deg, #111144, #0b0b33) !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  text-decoration: none !important;
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4) !important;
}

/* ===== IMAGE ===== */
.archive-thumb {
  width: 100% !important;
  height: 140px !important;
  object-fit: cover !important;
  background: #000 !important;
}

/* ===== CONTENT ===== */
.archive-info {
  padding: 10px !important;
}

.archive-title {
  font-size: 13px !important;
  line-height: 1.4 !important;
}

.archive-meta {
  font-size: 11px !important;
  opacity: 0.6 !important;
}

/* ===== FILTERS ===== */
.archive-controls {
  padding: 12px !important;
}

#archive-search {
  width: 100% !important;
  padding: 10px !important;
  border-radius: 8px !important;
  border: none !important;
  margin-bottom: 10px !important;
  font-size: 14px !important;
}

/* FILTER BUTTONS */
.archive-filters {
  display: flex !important;
  gap: 8px !important;
}

.filter-btn {
  flex: 1 !important;
  padding: 10px !important;
  background: #111144 !important;
  border: none !important;
  color: #fff !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

.filter-btn.active {
  background: #7295B7 !important;
  color: #000033 !important;
}

/* ===== ACCESSION TAG ===== */
.accession-tag {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  background: rgba(0,0,0,0.7) !important;
  padding: 4px 6px !important;
  font-size: 10px !important;
  border-radius: 4px !important;
  color: #7295B7 !important;
}