:root {
  --bg: #101214;
  --surface: #171a1f;
  --surface-2: #1e232a;
  --text: #e8edf2;
  --muted: #9aa7b5;
  --accent: #d62828;
  --accent-text: #ffffff;
  --accent-alt: #2563eb;
  --accent-soft: #2a2f36;
  --line: #2c3440;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
}

html[data-theme="light"] {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #141a22;
  --muted: #4d5a6a;
  --accent: #d62828;
  --accent-text: #ffffff;
  --accent-alt: #2563eb;
  --accent-soft: #eceff3;
  --line: #d6dde5;
  --shadow: 0 15px 30px rgba(12, 20, 30, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03), transparent 180px),
    radial-gradient(circle at 20% -10%, rgba(255, 255, 255, 0.06), transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: "Manrope", sans-serif;
  line-height: 1.6;
}

.container { width: min(1240px, 92vw); margin: 0 auto; }
a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
}
.topbar-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}
.brand { display: flex; align-items: baseline; gap: .4rem; font-family: "Newsreader", serif; font-size: 1.35rem; }
.brand-text { letter-spacing: .2px; font-weight: 600; }
.search-form { display: flex; gap: .5rem; }
.search-form input {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: .75rem .85rem;
}
.search-form button,
button,
.button-link {
  border: 0;
  border-radius: 10px;
  padding: .7rem 1rem;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
  font-weight: 700;
  transition: transform .2s ease, box-shadow .2s ease;
}

.theme-toggle,
.admin-link {
  background: var(--accent-alt);
  color: #ffffff;
}
button:hover,
.button-link:hover,
.theme-toggle:hover,
.admin-link:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.topbar-meta { display: flex; align-items: center; gap: .5rem; }
.viewer-pill {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .4rem .8rem;
  color: var(--muted);
}
.nav-links { display: flex; gap: 1.2rem; padding: .65rem 0 .9rem; font-weight: 600; color: var(--muted); }
.nav-links a:hover { color: var(--text); }

.home-layout {
  display: grid;
  grid-template-columns: 250px 1fr 250px;
  gap: 1.25rem;
  margin-top: 1.3rem;
  margin-bottom: 3rem;
}

.left-rail,
.right-rail,
.post-layout aside { display: flex; flex-direction: column; gap: 1rem; }

.featured-card,
.post-card,
.trending-panel,
.viewer-panel,
.page-shell,
.post-article,
.comment-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.editorial-intro {
  margin: .1rem 0 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: .9rem;
}

.editorial-intro h1 {
  margin: .25rem 0 0;
  font-family: "Newsreader", serif;
  font-size: clamp(1.35rem, 2.1vw, 1.95rem);
  line-height: 1.25;
  max-width: 28ch;
}

.intro-actions {
  margin-top: .85rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
}

.intro-actions span {
  color: var(--muted);
  font-size: .95rem;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: .72rem;
  font-weight: 700;
}

.featured-card a { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.2rem; padding: 1rem; }
.featured-media img,
.featured-media video,
.post-card img,
.post-card video,
.hero-media {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 12px;
}
.featured-content h1,
.post-article h1,
.page-shell h1 {
  font-family: "Newsreader", serif;
  letter-spacing: .2px;
  line-height: 1.2;
}
.pill {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: .35rem .65rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: .7rem;
}
.meta-row { display: flex; flex-wrap: wrap; gap: .8rem; color: var(--muted); font-size: .9rem; }

.latest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.latest-grid .post-card:nth-child(2n) {
  transform: translateY(6px);
}
.post-card { overflow: hidden; transition: transform .2s ease, border-color .2s ease; }
.post-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.post-card-content { padding: .95rem 1rem 1.1rem; }
.post-card-content h2 { margin: .1rem 0 .45rem; font-size: 1.1rem; }
.post-card-content p { color: var(--muted); margin: 0 0 .7rem; }

.trending-panel,
.viewer-panel { padding: .95rem; }
.panel-note {
  color: var(--muted);
  margin: .5rem 0 0;
  font-size: .95rem;
}
.trending-item { display: grid; grid-template-columns: 30px 1fr; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.trending-item:last-child { border-bottom: none; }
.trending-item small { color: var(--muted); }
.empty-board {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, #ffffff 8%), var(--surface));
  padding: 1.2rem;
}

.empty-board h2 {
  margin: 0 0 .4rem;
  font-family: "Newsreader", serif;
}

.empty-board p {
  margin: 0;
  color: var(--muted);
  max-width: 65ch;
}

.empty-links {
  margin-top: .9rem;
  display: flex;
  gap: .7rem;
}

.empty-links a {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .4rem .65rem;
  font-weight: 600;
  color: var(--text);
}
.sticky { position: sticky; top: 125px; }
.inline-grid { grid-column: 1 / -1; }

.post-layout {
  display: block;
  margin: 1.6rem auto 3rem;
}
.post-article { padding: 1.2rem; }
.rich-content img,
.rich-content video { max-width: 100%; border-radius: 12px; margin: 1rem 0; }
.rich-content p { margin: .8rem 0; }
.taxonomy-list { display: flex; flex-wrap: wrap; gap: .45rem; margin: .6rem 0 0; }
.taxonomy-list a {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .25rem .6rem;
  font-size: .8rem;
}

.comments-section,
.report-section { margin-top: 1.2rem; }
.comment-form,
.contact-form,
.report-section form {
  display: grid;
  gap: .7rem;
  margin: .8rem 0 1rem;
}
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .75rem .85rem;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
.comment-item { padding: .8rem; margin-bottom: .7rem; }
.comment-item header { display: flex; justify-content: space-between; color: var(--muted); }

.page-shell {
  padding: 1.2rem;
  margin-top: 1.4rem;
  margin-bottom: 2.6rem;
}
.legal p { max-width: 75ch; }
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.4rem; background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; }
.footer-grid h4 { margin: 0 0 .5rem; }
.footer-grid a { display: block; color: var(--muted); margin: .2rem 0; }
.alert {
  padding: .7rem .9rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-weight: 600;
}
.alert.success { background: #20262d; color: #f2f4f7; border: 1px solid #3a434d; }
.alert.error { background: #2a2a2a; color: #f2f2f2; border: 1px solid #474747; }

.chat-launcher {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  border: 1px solid #1e40af;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: #f8fbff;
  border-radius: 999px;
  width: 60px;
  height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-weight: 700;
  font-size: .95rem;
  line-height: 1;
  box-shadow: var(--shadow);
}

.chat-launcher:hover {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
}

.chat-launcher.active {
  font-size: 1.25rem;
}

.chat-widget {
  position: fixed;
  right: 1rem;
  bottom: 5.4rem;
  width: min(390px, calc(100vw - 2rem));
  height: min(560px, calc(100vh - 7rem));
  background: #1e2024;
  border: 1px solid #3a3f47;
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: none;
  grid-template-rows: auto auto 1fr auto;
  z-index: 50;
  overflow: hidden;
}

.chat-widget.open {
  display: grid;
  animation: chatWidgetOpen .2s ease-out;
}

.chat-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.05rem 1rem;
  background: #2b3038;
  color: #fff;
}

.chat-widget-header h3 {
  margin: 0;
  font-size: 1.08rem;
}

.chat-widget-note {
  padding: .72rem 1rem;
  font-size: .9rem;
  color: #b6beca;
  border-bottom: 1px solid #363b43;
  background: #252a31;
}

.chat-close {
  background: transparent;
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: .1rem .4rem;
  font-size: 1.4rem;
  line-height: 1;
}

.chat-messages {
  padding: 1rem;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: .7rem;
  background: #1e2024;
}

.chat-message {
  border: 1px solid #3a4048;
  border-radius: 14px;
  padding: .65rem .75rem;
  background: #2a2f37;
}

.chat-message-header {
  display: flex;
  justify-content: space-between;
  color: #a5b0bf;
  font-size: .78rem;
}

.chat-message p {
  margin: .3rem 0 0;
  word-break: break-word;
  color: #e5e9ef;
}

.chat-widget-form {
  border-top: 1px solid #363b43;
  padding: .7rem .8rem .8rem;
  display: grid;
  gap: .5rem;
  background: #252a31;
}

.chat-widget-form input {
  border-radius: 999px;
  border: 1px solid #454c57;
  background: #1c1f25;
  color: #e4e9f0;
}

.chat-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: .55rem;
}

.chat-widget-form textarea {
  min-height: 48px;
  max-height: 110px;
  border-radius: 999px;
  border: 1px solid #454c57;
  background: #1c1f25;
  color: #e4e9f0;
  padding-right: 1rem;
}

.chat-widget-form input::placeholder,
.chat-widget-form textarea::placeholder {
  color: #98a1ad;
}

.chat-send {
  border-radius: 999px;
  width: 46px;
  height: 46px;
  padding: 0;
  font-size: .8rem;
}

@keyframes chatWidgetOpen {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-page-shell {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: .8rem;
}

.images-page p {
  color: var(--muted);
}

.exposures-hero {
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(120deg, rgba(214, 40, 40, .12), transparent 40%),
    linear-gradient(0deg, color-mix(in srgb, var(--surface) 96%, #000 4%), var(--surface));
  padding: 1rem;
}

.exposures-hero h1 {
  margin: .2rem 0 .4rem;
}

.exposures-lead {
  margin: 0;
  max-width: 70ch;
}

.images-toolbar {
  margin-top: .9rem;
  margin-bottom: .8rem;
  display: grid;
  gap: .8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: .8rem;
}

.images-search-wrap {
  display: grid;
  gap: .3rem;
  color: var(--muted);
  font-size: .9rem;
}

.images-search-wrap input {
  max-width: 360px;
}

.images-filter-group {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
}

.images-filter {
  border-radius: 999px;
  padding: .38rem .75rem;
}

.images-filter.active {
  border-color: var(--text);
}

.images-count {
  margin: 0;
}

.images-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .9rem;
}

.image-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: transform .15s ease, border-color .15s ease;
}

.image-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}

.image-card-media {
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
}

.image-card-media img,
.image-card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-card-meta {
  padding: .7rem .8rem .85rem;
}

.image-name {
  margin: 0;
  color: var(--text);
  font-weight: 700;
  word-break: break-word;
}

.image-path {
  margin: .2rem 0 0;
  font-size: .86rem;
  color: var(--muted);
  word-break: break-word;
}

.image-preview-btn {
  margin-top: .55rem;
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: .84rem;
  background: var(--accent-alt);
}

.image-card.is-hidden {
  display: none;
}

.images-viewer {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, .8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 70;
  padding: 1rem;
}

.images-viewer.open {
  display: flex;
}

.images-viewer-dialog {
  width: min(980px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  background: #161a20;
  border: 1px solid #323844;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.images-viewer-header {
  padding: .7rem .9rem;
  border-bottom: 1px solid #2f3540;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1f2530;
}

.images-viewer-header h2 {
  margin: 0;
  font-size: 1rem;
  color: #ebeff5;
}

.images-viewer-close {
  border-radius: 6px;
  border: 1px solid #3d4656;
  background: #252d3b;
  color: #edf2f9;
  padding: .2rem .45rem;
  line-height: 1;
}

.images-viewer-body {
  padding: .9rem;
  overflow: auto;
}

.images-viewer-body img,
.images-viewer-body video {
  width: 100%;
  max-height: calc(100vh - 10rem);
  object-fit: contain;
  background: #0f1319;
  border-radius: 10px;
}

.images-empty {
  margin-top: 1rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 1rem;
  background: var(--surface);
}

.reveal {
  opacity: 0;
  transform: translateY(8px);
  animation: rise .5s ease forwards;
  animation-delay: var(--delay, 60ms);
}
@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .home-layout { grid-template-columns: 1fr; }
  .left-rail, .right-rail { order: 2; }
  .post-layout { grid-template-columns: 1fr; }
  .sticky { position: static; }
}

@media (max-width: 760px) {
  .topbar-inner { grid-template-columns: 1fr; }
  .topbar-meta { justify-content: space-between; }
  .featured-card a { grid-template-columns: 1fr; }
  .nav-links { overflow-x: auto; white-space: nowrap; padding-bottom: .8rem; }
  .intro-actions {
    align-items: flex-start;
  }
  .chat-widget {
    right: .5rem;
    left: .5rem;
    width: auto;
    bottom: 5.2rem;
    height: min(560px, calc(100vh - 6rem));
  }
  .chat-launcher {
    bottom: 1rem;
  }
}
