:root {
  --paper: #fbfaf7;
  --surface: #ffffff;
  --ink: #1c2421;
  --muted: #65716b;
  --line: #d8dfd8;
  --pine: #2d5b4f;
  --pine-dark: #1f4038;
  --copper: #b55239;
  --blue: #355c7d;
  --danger: #a33a33;
  --success-bg: #e9f4ec;
  --error-bg: #f9e9e7;
  --shadow: 0 18px 50px rgba(28, 36, 33, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body {
  min-height: 100vh;
  margin: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

textarea {
  resize: vertical;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(216, 223, 216, 0.7);
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: blur(16px);
}

.brand,
.admin-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--pine);
  color: white;
  font-size: 0.9rem;
}

.nav-links,
.admin-menu {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a,
.link-button,
.admin-menu a {
  min-height: 40px;
  padding: 9px 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.nav-links a.active,
.nav-links a:hover,
.link-button:hover,
.admin-menu a.active,
.admin-menu a:hover {
  background: #eef3ee;
  color: var(--ink);
}

.inline-form {
  display: inline;
  margin: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--pine);
  border-radius: 8px;
  background: var(--pine);
  color: white;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.button:hover {
  background: var(--pine-dark);
}

.button-secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button-secondary:hover {
  background: #f2f5f2;
}

.button.danger,
.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: white;
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.flash-stack {
  width: min(1120px, calc(100% - 32px));
  margin: 18px auto 0;
}

.flash,
.form-errors {
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 700;
}

.flash + .flash {
  margin-top: 8px;
}

.flash-success {
  border: 1px solid #b8d7bf;
  background: var(--success-bg);
  color: #214c2c;
}

.flash-error,
.form-errors {
  border: 1px solid #e3b6b1;
  background: var(--error-bg);
  color: #74302c;
}

.form-errors {
  margin: 0 0 18px;
}

.form-errors p {
  margin: 0;
}

.form-errors p + p {
  margin-top: 6px;
}

.hero {
  min-height: min(640px, calc(100vh - 68px));
  display: flex;
  align-items: end;
  padding: 88px 32px 56px;
  background:
    linear-gradient(90deg, rgba(18, 24, 21, 0.78), rgba(18, 24, 21, 0.36) 52%, rgba(18, 24, 21, 0.08)),
    url("/assets/workshop-hero.png") center / cover no-repeat;
  color: white;
}

.hero-content {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--copper);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f0bc72;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(3rem, 7vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 560px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.section-heading,
.admin-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-heading h2,
.admin-heading h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.08;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.work-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(28, 36, 33, 0.06);
}

.work-card-image {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #e6ece6;
}

.work-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.work-card:hover .work-card-image img {
  transform: scale(1.025);
}

.work-card-body {
  padding: 18px;
}

.work-card h3 {
  margin: 7px 0 8px;
  font-size: 1.2rem;
  line-height: 1.2;
}

.work-card p,
.empty-state p,
.admin-row p,
.lead {
  color: var(--muted);
}

.work-meta,
.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--blue);
  font-size: 0.83rem;
  font-weight: 800;
}

.empty-state {
  display: grid;
  grid-template-columns: 220px 1fr;
  align-items: center;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px;
}

.empty-state img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  object-fit: cover;
}

.empty-state h2,
.empty-state h3 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0 0 16px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.detail-page {
  padding-bottom: 48px;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 40px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 24px;
}

.detail-media {
  overflow: hidden;
  border-radius: 8px;
  background: #e6ece6;
}

.detail-media img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.detail-copy {
  align-self: center;
}

.detail-copy h1 {
  margin: 0 0 14px;
  font-size: clamp(2.3rem, 6vw, 5rem);
  line-height: 1;
}

.detail-facts {
  display: grid;
  gap: 12px;
  margin: 26px 0 0;
}

.detail-facts div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.detail-facts dt {
  color: var(--muted);
  font-weight: 800;
}

.detail-facts dd {
  margin: 0;
}

.detail-text {
  padding-top: 28px;
}

.detail-text h2 {
  margin-top: 0;
}

.detail-text p {
  max-width: 760px;
  white-space: pre-line;
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.image-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  object-fit: cover;
}

.auth-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(45, 91, 79, 0.1), rgba(181, 82, 57, 0.08)),
    var(--paper);
}

.auth-panel {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-brand {
  margin-bottom: 28px;
}

.auth-panel h1 {
  margin: 0 0 22px;
  font-size: 2rem;
}

.form-stack,
.admin-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

label span {
  font-size: 0.92rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5cf;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 11px 12px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(45, 91, 79, 0.18);
  border-color: var(--pine);
}

.subtle-link {
  display: inline-flex;
  margin-top: 18px;
  color: var(--pine);
  font-weight: 800;
}

.dev-link {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-body {
  background: #f5f7f4;
}

.admin-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 24px 18px;
}

.admin-menu {
  align-items: stretch;
  flex-direction: column;
}

.admin-menu a {
  display: flex;
}

.admin-main {
  width: min(1160px, 100%);
  padding: 34px;
}

.admin-main.narrow {
  max-width: 840px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-grid div,
.form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.stat-grid span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.stat-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 2rem;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.admin-row > img {
  width: 112px;
  height: 84px;
  border-radius: 8px;
  object-fit: cover;
  background: #e6ece6;
}

.admin-row-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.admin-row h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1.16rem;
}

.admin-row p {
  margin: 5px 0;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.status-pill.published {
  background: var(--success-bg);
  color: #214c2c;
}

.status-pill.draft {
  background: #eef1f3;
  color: var(--blue);
}

.form-section h2 {
  margin: 0 0 16px;
  font-size: 1.2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid.compact {
  align-items: end;
}

.span-2 {
  grid-column: 1 / -1;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.file-box {
  min-height: 120px;
  align-content: center;
  justify-items: center;
  border: 1px dashed #b7c2bb;
  border-radius: 8px;
  background: #f7faf7;
  padding: 18px;
  text-align: center;
}

.file-box input {
  max-width: 420px;
}

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

.existing-images {
  margin-top: 22px;
}

.image-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.image-admin-grid article {
  display: grid;
  gap: 10px;
}

.image-admin-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  object-fit: cover;
}

.status-page {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 96px 0;
}

.status-page h1 {
  margin-top: 0;
  font-size: clamp(2.2rem, 6vw, 4rem);
}

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

  .admin-sidebar {
    position: static;
    height: auto;
  }

  .admin-menu {
    flex-flow: row wrap;
  }

  .admin-row {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .row-actions {
    grid-column: 1 / -1;
    justify-content: start;
  }

  .detail-media img {
    min-height: 320px;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
  }

  .nav-links {
    flex-wrap: wrap;
  }

  .hero {
    min-height: 540px;
    padding: 72px 16px 42px;
  }

  .section,
  .detail-hero,
  .site-footer {
    width: calc(100% - 28px);
  }

  .section-heading,
  .admin-heading,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .empty-state,
  .form-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .admin-main {
    padding: 20px 14px 32px;
  }

  .admin-row {
    grid-template-columns: 1fr;
  }

  .admin-row > img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .admin-row-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .button {
    width: 100%;
    white-space: normal;
  }

  .row-actions,
  .form-actions {
    width: 100%;
  }

  .row-actions form,
  .row-actions a,
  .form-actions a,
  .form-actions button {
    flex: 1 1 180px;
  }
}
