@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=IBM+Plex+Mono:wght@400;600&display=swap");

:root {
  --oil-black: #101010;
  --metal: #252628;
  --plate: #17191b;
  --weld: #34363a;
  --text: #ece7de;
  --muted: #a49c8e;
  --rust: #b35f25;
  --grease: #5a6f3f;
  --warning: #cb3e23;
  --line: #444038;
  --card: #1c1d20;
  --shadow: 0 18px 36px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: "IBM Plex Mono", "Consolas", monospace;
  min-height: 100vh;
  overflow-anchor: none;
  background:
    radial-gradient(circle at 8% 12%, rgba(179, 95, 37, 0.28), transparent 34%),
    radial-gradient(circle at 90% 75%, rgba(90, 111, 63, 0.2), transparent 32%),
    linear-gradient(180deg, #0f1112 0%, #141619 42%, #0c0d0e 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02) 1px, transparent 1px, transparent 84px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.18) 2px, transparent 2px, transparent 7px);
  opacity: 0.3;
  z-index: -1;
}

a {
  color: #90ad60;
  text-decoration: none;
}

a:hover {
  color: #be6e36;
}

.container {
  width: min(1180px, 94vw);
  margin: 0 auto;
}

main.container {
  padding-bottom: 6rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(20, 21, 24, 0.95), rgba(31, 28, 25, 0.9));
  backdrop-filter: blur(6px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.82rem 0 0.62rem;
}

.header-right {
  display: flex;
  align-items: center;
  flex-direction: row;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-left: auto;
  position: relative;
  padding-top: 0.95rem;
}

.brand h1,
h2,
h3,
h4 {
  font-family: "Bebas Neue", "Impact", sans-serif;
  letter-spacing: 0.05em;
}

.brand h1 {
  margin: 0;
  font-size: 1.65rem;
  color: #d8a166;
}

.brand-logo {
  display: block;
  width: clamp(120px, 16vw, 168px);
  height: auto;
  transform-origin: left center;
  transition: width 180ms ease, opacity 180ms ease;
}

.brand small {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.72rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem;
}

.nav a {
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 0.28rem 0.58rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #2f3337, #1b1d20);
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.nav a.active,
.nav a:hover {
  background: linear-gradient(180deg, #667f46, #4f6336);
  color: #f9f4ea;
  border-color: #7f995d;
}

body.header-shrink .site-header {
  border-bottom-color: rgba(68, 64, 56, 0.82);
  height: 64px;
  overflow: hidden;
}

body.header-shrink .header-inner {
  gap: 0.24rem;
  height: 64px;
  padding: 0.02rem 0 0.01rem;
  align-items: center;
}

body.header-shrink .brand-logo {
  width: clamp(44px, 5vw, 54px);
  opacity: 0.96;
}

body.header-shrink .site-header {
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.active-trip-line {
  position: absolute;
  top: 0.08rem;
  right: 0;
  padding: 0;
  color: var(--muted);
  border: 0;
  border-radius: 0;
  background: transparent;
  white-space: nowrap;
  font-size: 0.74rem;
  line-height: 1.1;
  transition: color 180ms ease;
  margin-left: 0;
}

body.header-shrink .header-right {
  height: 100%;
  padding-top: 0;
  justify-content: center;
  gap: 0.25rem;
}

body.header-shrink .nav {
  align-self: center;
}

.active-trip-line:hover {
  color: #c6d2b2;
}

.hero {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1rem;
  padding: 1.3rem;
  margin: 1.2rem 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(140deg, rgba(30, 27, 24, 0.96), rgba(22, 24, 26, 0.96));
  box-shadow: var(--shadow);
  animation: rise 420ms ease-out;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero h2 {
  margin: 0 0 0.3rem;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  color: #d8a166;
}

.hero p {
  color: #dbd6cd;
  line-height: 1.5;
}

.trips-intro {
  white-space: pre-line;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.9rem 0 1rem;
}

.badge {
  background: #2a2d30;
  border: 1px solid #4a443b;
  border-left: 3px solid var(--warning);
  border-radius: 4px;
  padding: 0.34rem 0.6rem;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.btn {
  display: inline-block;
  border-radius: 4px;
  padding: 0.5rem 0.88rem;
  font-weight: 600;
  font-size: 0.8rem;
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.4rem;
  margin-bottom: 0.4rem;
}

.btn-primary {
  background: linear-gradient(180deg, #667f46, #4f6336);
  color: #fff;
  border-color: #8aa66a;
}

.btn-primary:hover {
  color: #fff;
  background: linear-gradient(180deg, #6f8d4b, #5b7340);
}

.btn-secondary {
  background: linear-gradient(180deg, #3f352f, #2d2722);
  color: #efe6d7;
  border-color: #604f42;
}

.btn-secondary:hover {
  color: #fff;
  border-color: #be6e36;
}

.section-card,
.sidebar-card,
.post-card {
  background: linear-gradient(160deg, #212327, #17191b);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  position: relative;
  isolation: isolate;
}

.section-card {
  padding: 1rem;
}

.trip-stat-card {
  justify-self: end;
  align-self: start;
  width: min(240px, 100%);
  padding: 0.75rem 0.9rem;
}

.trip-stat-card h3 {
  margin: 0.1rem 0 0;
  font-size: clamp(3rem, 6vw, 4.6rem);
  line-height: 0.9;
}

.trip-stat-card .meta {
  font-size: 0.72rem;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr);
  gap: 1rem;
  margin: 1rem 0 1.3rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
  gap: 1rem;
  margin: 1rem 0 1.3rem;
}

.admin-sidebar {
  position: sticky;
  top: 5.5rem;
  align-self: start;
  height: fit-content;
}

.admin-nav {
  display: grid;
  gap: 0.45rem;
  margin: 0.8rem 0 0.9rem;
}

.admin-nav a {
  display: block;
  padding: 0.62rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #292c30, #1c1f22);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.76rem;
}

.admin-nav a:hover {
  border-color: #8aa66a;
  color: #f6efe4;
}

.admin-nav a.active {
  border-color: #8aa66a;
  background: linear-gradient(180deg, #6a8447, #516737);
  color: #f6efe4;
}

.admin-content {
  min-width: 0;
}

.admin-content > .admin-panel-section {
  margin-top: 0;
}

.admin-panel-section {
  display: none;
}

.admin-panel-section.is-open {
  display: block;
}

.section-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.admin-head-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-card-list {
  display: grid;
  gap: 0.7rem;
}

.admin-item-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem;
  background: linear-gradient(160deg, #24272b, #17191b);
}

.admin-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.admin-item-head h4 {
  margin: 0.1rem 0 0.3rem;
}

.admin-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.7rem;
}

.admin-post-thumb {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.btn-danger {
  background: linear-gradient(180deg, #7b2f26, #5d221b);
  color: #fff1ed;
  border-color: #b14d3f;
}

.btn-danger:hover {
  color: #fff;
  border-color: #df7868;
}

.admin-subsection h4 {
  margin-bottom: 0.65rem;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.admin-modal[hidden] {
  display: none;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(4px);
}

.admin-modal-panel {
  position: relative;
  z-index: 1;
  width: min(860px, 96vw);
  max-height: 88vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, #1f2124, #151719);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.admin-modal-panel.preview-only .post-modal-layout {
  grid-template-columns: 1fr;
}

.admin-modal-panel.preview-only .post-modal-preview {
  display: none;
}

.post-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.85fr);
  gap: 1rem;
}

.post-modal-editor,
.post-modal-preview {
  min-width: 0;
}

.editor-block {
  margin: 1rem 0;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.section-head-row.compact {
  margin-bottom: 0.7rem;
}

.post-crop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 0.8rem;
  align-items: start;
}

.post-crop-frame,
.post-preview-frame {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #101214;
}

.post-crop-frame {
  min-height: 240px;
}

.post-preview-frame {
  min-height: 260px;
}

.post-crop-image,
.post-preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-crop-controls {
  display: grid;
  gap: 0.6rem;
}

.post-modal-preview {
  position: sticky;
  top: 0;
  align-self: start;
}

.preview-card-shell {
  display: grid;
  gap: 0.7rem;
}

.post-preview-card {
  margin-bottom: 0;
}

.post-preview-card .post-content {
  padding: 0.85rem 0.95rem 1rem;
}

.post-preview-card h4 {
  margin-top: 0.15rem;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.icon-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  background: #23262a;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
}

.icon-button:hover {
  border-color: #8aa66a;
}

.post-card {
  overflow: hidden;
  margin-bottom: 0.9rem;
}

.post-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  filter: saturate(0.88) contrast(1.08);
}

.post-content {
  padding: 0.9rem 1rem;
}

.post-content h3,
.post-content h4,
.sidebar-card h4 {
  margin: 0.15rem 0 0.4rem;
  color: #d8a166;
}

.meta,
.small,
label {
  color: var(--muted);
}

.meta {
  font-size: 0.78rem;
}

.stack > * + * {
  margin-top: 0.8rem;
}

.sidebar-card {
  padding: 0.85rem;
}

.list-clean {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list-clean li + li {
  margin-top: 0.45rem;
}

.map-box {
  position: relative;
  z-index: 0;
  width: 100%;
  min-height: 300px;
  border-radius: 8px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.timeline {
  position: relative;
  padding-left: 1.25rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(var(--rust), var(--grease));
}

.timeline-item {
  position: relative;
  margin-bottom: 1rem;
  padding-left: 0.85rem;
}

.restoration-extra-gallery {
  margin-top: 0.7rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  background: var(--warning);
}

.photo-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.photo-pair img,
.gallery-grid img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  object-fit: cover;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.7rem;
}

.gallery-empty {
  margin: 0;
}

.gallery-tile {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem;
  background: #191b1e;
}

.gallery-tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-bottom: 0.5rem;
}

.gallery-tile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.gallery-tile-actions .btn {
  width: 100%;
  margin: 0;
  padding-inline: 0.55rem;
}

.gallery-tile-actions .btn-danger {
  grid-column: span 1;
}

.media-carousel {
  position: relative;
}

.media-carousel-viewport {
  overflow: hidden;
  border-radius: inherit;
}

.media-carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.media-carousel-track::-webkit-scrollbar {
  display: none;
}

.media-carousel-slide {
  flex: 0 0 100%;
  margin: 0;
  scroll-snap-align: start;
}

.media-carousel-slide .post-image {
  height: 100%;
}

.media-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem 0;
}

.carousel-button {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #23262a;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
}

.carousel-button:hover {
  border-color: #8aa66a;
}

.carousel-status {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.trip-hero-media {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.trip-hero-media .post-image {
  height: 100%;
  min-height: 300px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

label {
  font-size: 0.78rem;
  display: block;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #4a443b;
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  font: inherit;
  color: #ede6d7;
  background: #222428;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.form-actions {
  margin-top: 0.65rem;
}

.notice {
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  margin-top: 0.6rem;
  background: #2a3124;
  border: 1px solid #5f7440;
  color: #c8dfaa;
  font-size: 0.8rem;
}

.site-footer {
  margin-top: 1.3rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #111214, #1a1613);
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1rem;
  padding: 1rem 0 1.3rem;
}

.footer-inner h4 {
  margin: 0 0 0.45rem;
  color: #d8a166;
}

.small {
  font-size: 0.8rem;
}

@media (max-width: 900px) {
  .hero,
  .main-grid,
  .footer-inner,
  .admin-layout,
  .header-right {
    justify-content: flex-start;
    margin-left: 0;
    padding-top: 0.75rem;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    top: auto;
  }

  .section-head-row,
  .admin-item-head,
  .modal-head {
    flex-direction: column;
  }

  .post-modal-layout,
  .post-crop-layout {
    grid-template-columns: 1fr;
  }

  .admin-badges {
    justify-content: flex-start;
  }

  .form-grid,
  .photo-pair {
    grid-template-columns: 1fr;
  }

  .post-image {
    height: 200px;
  }

  .trip-hero-media .post-image {
    min-height: 220px;
  }

  .brand-logo {
    width: clamp(96px, 26vw, 124px);
  }

  body.header-shrink .brand-logo {
    transform: scale(0.36);
  }

  .header-right {
    gap: 0.35rem;
    padding-top: 0.85rem;
  }
}
