/* Body font: Andale Mono — pre-installed on macOS */

@font-face {
  font-family: 'Owned';
  src: url('Owned-Regular/owned.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Agrandir Grand';
  src: url('agrandir-grand-heavy/agrandir-grand-heavy.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

:root {
  --black: #0d0d0d;
  --white: #ffffff;
  --red: #cc2222;
  --red-medium: rgba(204, 34, 34, 0.52);
  --red-light: rgba(204, 34, 34, 0.26);
  --brick: #e6e2dc;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ================================
   SHARED HEADER
   ================================ */
.page-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 28px;
  z-index: 1000;
  pointer-events: none;
}

.page-header > * {
  pointer-events: all;
}

.page-label {
  font-family: 'Agrandir Grand', sans-serif;
  font-size: 35pt;
  letter-spacing: 0.04em;
  color: var(--black);
  text-decoration: none;
  line-height: 1;
}

.page-label.white {
  color: var(--white);
}

.header-center {
  font-family: 'Owned', sans-serif;
  font-size: 18pt;
  color: inherit;
  text-decoration: none;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-align: center;
  align-self: flex-start;
}

.header-center.white {
  color: var(--white);
}

.upload-btn {
  display: flex;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}

.upload-btn img {
  height: 70px;
  width: auto;
  display: block;
}

.upload-btn.light img {
  filter: invert(1);
}

.upload-btn.dark img {
  filter: none;
}

/* ================================
   HAMBURGER + NAV DRAWER
   ================================ */
.header-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px 4px;
  align-self: flex-start;
  margin-top: 6px;
}

.menu-toggle span {
  display: block;
  width: 26px;
  height: 2.5px;
  background: currentColor;
  border-radius: 2px;
}

.menu-toggle.dark { color: var(--black); }
.menu-toggle.white { color: var(--white); }

/* Dim overlay */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.menu-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Nav drawer */
.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  background: var(--black);
  z-index: 1200;
  transform: translateX(-100%);
  transition: transform 0.32s ease;
  display: flex;
  flex-direction: column;
  padding: 70px 50px 50px;
}

.nav-drawer.active {
  transform: translateX(0);
}

.menu-close {
  position: absolute;
  top: 22px;
  right: 22px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
}

.menu-close:hover { opacity: 1; }

.nav-drawer a {
  font-family: 'Owned', sans-serif;
  font-size: 40pt;
  color: var(--white);
  text-decoration: none;
  line-height: 1.1;
  transition: opacity 0.2s;
  display: block;
}

.nav-drawer a:hover { opacity: 0.6; }

/* ================================
   LANDING PAGE
   ================================ */
.landing-body {
  min-height: 100vh;
  background-color: #1a1a1a;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.10), rgba(0, 0, 0, 0.10)),
    url('bathroom-bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
}

.landing-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 28px;
  z-index: 100;
}

.landing-logo {
  font-family: 'Owned', sans-serif;
  font-size: 18pt;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.landing-nav {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 110px 60px 60px;
  min-height: 100vh;
  gap: 0.05em;
}

.landing-nav a {
  font-family: 'Owned', sans-serif;
  font-size: 87pt;
  color: var(--white);
  text-decoration: none;
  line-height: 1.05;
  display: inline-block;
  width: fit-content;
  transition: opacity 0.2s ease;
}

.landing-nav a:hover {
  opacity: 0.65;
}

/* ================================
   HOME PAGE
   ================================ */
.home-body {
  min-height: 100vh;
  background-color: #1a1a1a;
  background-image:
    linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.1)),
    url('home-bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--black);
  padding: 100px 60px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.home-title {
  font-family: 'Owned', sans-serif;
  font-size: 18pt;
  line-height: 1.05;
  margin-bottom: 2rem;
  align-self: flex-start;
  max-width: 820px;
}

.home-text {
  font-family: 'Andale Mono', monospace;
  font-weight: 700;
  font-size: clamp(0.8rem, 1.3vw, 0.98rem);
  line-height: 1.8;
  text-align: center;
  max-width: 880px;
  margin-bottom: 3rem;
}

.home-text sup {
  font-size: 0.65em;
}

.home-reading-link {
  font-family: 'Andale Mono', monospace;
  font-weight: 700;
  font-size: clamp(0.85rem, 1.3vw, 1rem);
  text-align: center;
  color: var(--black);
}

.home-reading-link a {
  color: var(--black);
  text-decoration: none;
}

.home-reading-link a:hover {
  opacity: 0.6;
}

/* ================================
   MAP / DATA PAGES
   ================================ */
.map-body,
.data-body {
  height: 100vh;
  width: 100%;
  position: relative;
  overflow: hidden;
}

#main-map,
#data-map {
  height: 100%;
  width: 100%;
}

/* Greyscale filter for data map tiles */
.data-map-grey .leaflet-tile-pane {
  filter: grayscale(1) contrast(0.85) brightness(1.1);
}

/* Map key */
.map-key {
  position: absolute;
  bottom: 28px;
  left: 20px;
  background: rgba(255, 255, 255, 0.93);
  padding: 14px 18px;
  z-index: 500;
  font-family: 'Andale Mono', monospace;
  font-size: 0.73rem;
  font-weight: 700;
  border: 1px solid #bbb;
  line-height: 1;
}

.map-key p {
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.key-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.key-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.key-dot.high   { background: rgba(255, 33,  33,  0.50); }
.key-dot.medium { background: rgba(255, 132, 132, 0.50); }
.key-dot.low    { background: rgba(255, 201, 201, 0.50); }

/* Map pin popups */
.leaflet-popup-content-wrapper {
  border-radius: 0 !important;
  border: 2px solid var(--black) !important;
  padding: 0 !important;
  overflow: hidden !important;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.4) !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  width: 240px !important;
}

.leaflet-popup-tip-container {
  display: none;
}

.popup-photo {
  width: 100%;
  height: 160px;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 2rem;
  overflow: hidden;
}

.popup-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popup-info {
  padding: 10px 12px;
  background: var(--white);
  font-family: 'Andale Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--black);
}

/* ================================
   FEED PAGE
   ================================ */
.feed-body {
  min-height: 100vh;
  background: var(--black);
  color: var(--white);
  padding: 80px 0 0;
}

.feed-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 0 60px;
}

.feed-item {
  border-top: 1px solid #2a2a2a;
  border-bottom: 1px solid #2a2a2a;
  margin-bottom: -1px;
}

.feed-photo {
  width: 100%;
  min-height: 340px;
  max-height: 580px;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3a3a3a;
  font-size: 3rem;
  overflow: hidden;
  position: relative;
}

.feed-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feed-photo-placeholder {
  width: 100%;
  height: 380px;
  background: #1c1c1c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: #2e2e2e;
}

.feed-caption {
  background: var(--white);
  color: var(--black);
  padding: 14px 22px;
  font-family: 'Andale Mono', monospace;
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.6;
}

.feed-caption .location {
  font-size: 0.95rem;
}

.feed-caption .timestamp {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* ================================
   UPLOAD PAGE
   ================================ */
.upload-body {
  min-height: 100vh;
  background: var(--white);
  color: var(--black);
  padding: 80px 40px 60px;
}

.upload-form-container {
  max-width: 980px;
  margin: 30px auto 0;
  border: 2px solid var(--black);
  padding: 36px 40px 40px;
}

.upload-page-title {
  font-family: 'Agrandir Grand', sans-serif;
  font-size: 35pt;
  letter-spacing: 0.04em;
  margin-bottom: 36px;
}

.upload-grid-main {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 36px;
}

.upload-grid-secondary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.upload-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.field-icon-box {
  width: 100%;
  aspect-ratio: 1;
  max-width: 200px;
  border: 2px solid #bbb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: #bbb;
  position: relative;
  transition: border-color 0.2s, color 0.2s;
}

.upload-field.required .field-icon-box {
  border-color: var(--black);
  color: var(--black);
}

.box-label {
  font-family: 'Andale Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
  padding: 0 10px;
  color: inherit;
}

.field-icon-box .plus-badge {
  position: absolute;
  bottom: -14px;
  right: -14px;
  width: 32px;
  height: 32px;
  background: var(--black);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: bold;
  line-height: 1;
}

.upload-field:hover .field-icon-box {
  border-color: var(--black);
  color: var(--black);
}

.field-label {
  font-family: 'Andale Mono', monospace;
  font-weight: 700;
  font-size: 0.82rem;
  text-align: center;
  color: #aaa;
  transition: color 0.2s;
}

.upload-field.required .field-label {
  color: var(--black);
  font-size: 0.95rem;
}

.upload-field:hover .field-label {
  color: var(--black);
}

/* Expanded input areas */
.field-input-area {
  width: 100%;
  display: none;
  padding: 8px 0 0;
}

.field-input-area.active {
  display: block;
}

.field-input-area input,
.field-input-area textarea {
  width: 100%;
  font-family: 'Andale Mono', monospace;
  font-size: 0.82rem;
  border: 1px solid #ccc;
  padding: 8px 10px;
  outline: none;
  resize: vertical;
}

.field-input-area input:focus,
.field-input-area textarea:focus {
  border-color: var(--black);
}

.upload-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 20px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.submit-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
}

.submit-btn:hover {
  opacity: 0.50;
}

.required-note {
  font-family: 'Andale Mono', monospace;
  font-size: 0.72rem;
  color: #888;
}

/* ================================
   READING LIST PAGE
   ================================ */
.reading-list-body {
  min-height: 100vh;
  background: var(--black);
  color: var(--white);
  padding: 100px 60px 80px;
}

.reading-list-title {
  font-family: 'Agrandir Grand', sans-serif;
  font-size: 35pt;
  letter-spacing: 0.04em;
  margin-bottom: 50px;
  color: var(--white);
}

.reading-list-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 960px;
}

.reading-item a {
  font-family: 'Permanent Marker', cursive;
  font-size: clamp(0.50rem, 1.4vw, 1rem);
  color: var(--white);
  word-break: break-all;
  line-height: 1.5;
}

.reading-item a:hover {
  text-decoration: none;
}

.reading-item .reading-desc {
  font-family: 'Andale Mono', monospace;
  font-size: 0.50rem;
  color: #888;
  margin-top: 6px;
  line-height: 1.5;
}

/* ================================
   LEAFLET OVERRIDES
   ================================ */
.leaflet-control-zoom {
  border-radius: 0 !important;
  border: 2px solid var(--black) !important;
}

.leaflet-control-zoom a {
  border-radius: 0 !important;
  font-size: 1rem;
}

/* ================================
   SUCCESS TOAST
   ================================ */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--black);
  color: var(--white);
  font-family: 'Andale Mono', monospace;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 14px 28px;
  z-index: 9999;
  transition: transform 0.4s ease;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}
