:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --ink: #1e2328;
  --muted: #66707a;
  --line: #d9d3c9;
  --paper: #fffdf8;
  --accent: #23635a;
  --accent-strong: #123f3a;
  --gold: #b98524;
  --rose: #b25656;
  --shadow: 0 18px 45px rgba(33, 33, 33, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

button,
a {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  padding: 48px clamp(20px, 6vw, 72px) 28px;
  border-bottom: 1px solid var(--line);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.hero-tabs {
  max-width: 780px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 6vw, 5.6rem);
  font-weight: 500;
  line-height: 0.94;
}

.hero-tab {
  display: inline;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.08em;
  white-space: normal;
  cursor: pointer;
}

.hero-tab:hover,
.hero-tab[aria-selected="true"] {
  background: transparent;
  color: var(--accent);
  text-decoration-color: currentColor;
}

.hero-tab:focus-visible {
  outline: 3px solid rgba(35, 99, 90, 0.28);
  outline-offset: 4px;
}

h2 {
  margin: 0;
  font-size: 1rem;
}

.sections {
  display: grid;
  gap: 22px;
  padding: 40px clamp(20px, 6vw, 72px) 64px;
}

.list-section {
  display: grid;
  gap: 16px;
}

.item-flow {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(14px, 3vw, 34px);
  align-items: flex-start;
}

.item-tile {
  width: clamp(180px, 27vw, 360px);
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.item-tile[data-size="small"] {
  width: clamp(140px, 18vw, 240px);
}

.item-tile[data-size="large"] {
  width: clamp(240px, 36vw, 520px);
}

.item-tile[data-size="wide"] {
  width: clamp(280px, 48vw, 680px);
}

.item-media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 2rem;
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.item-media.has-image {
  border: 0;
}

.item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-tile:hover .item-media,
.item-tile:focus-visible .item-media {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 24px;
  background: rgba(255, 253, 248, 0.55);
}

.item-dialog {
  width: min(92vw, 620px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 0;
  box-shadow: 0 24px 70px rgba(30, 35, 40, 0.24);
}

.item-dialog::backdrop {
  background: rgba(30, 35, 40, 0.24);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 36px;
  border: 1px solid rgba(30, 35, 40, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
  color: var(--ink);
  padding: 0 12px;
  cursor: pointer;
}

.dialog-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e6e0d6;
}

.dialog-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.dialog-title {
  font-size: 1.3rem;
}

.dialog-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.dialog-link {
  width: max-content;
  border-bottom: 2px solid currentColor;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.admin-page {
  background: #f7f7f4;
}

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

.admin-login {
  width: min(420px, 100%);
  margin: 10vh auto 0;
}

.admin-login h1,
.admin-header h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1;
}

.admin-workspace {
  display: grid;
  gap: 22px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.admin-panel {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 16px;
}

.add-panel {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
}

.admin-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.admin-panel input,
.admin-panel textarea,
.admin-panel select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px;
}

.admin-button {
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
}

.admin-button.secondary {
  background: transparent;
  color: var(--accent);
}

.admin-lists {
  display: grid;
  gap: 16px;
}

.item-editor-section h2 {
  font-size: 1.1rem;
}

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

.item-editor {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr minmax(110px, 0.5fr) auto;
  gap: 10px;
  align-items: end;
}

.admin-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.admin-message {
  min-height: 1.4em;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 760px) {
  .hero-tabs {
    font-size: clamp(2.1rem, 14vw, 4.5rem);
  }

  .item-tile {
    width: min(100%, 320px);
  }

  .admin-header,
  .admin-actions {
    display: grid;
    width: 100%;
  }

  .add-panel,
  .item-editor {
    grid-template-columns: 1fr;
  }
}
