:root {
  --bg: #f6f1e6;
  --ink: #1d1b19;
  --accent: #c9512f;
  --accent-dark: #8b3b22;
  --muted: #6d655b;
  --card: #fffaf2;
  --shadow: rgba(29, 27, 25, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f2e8d5 0%, #f6f1e6 60%, #fdfaf4 100%);
}

img {
  max-width: 100%;
  display: block;
  border-radius: 12px;
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
  padding: 32px 0 48px;
}

.narrow {
  width: min(640px, 92vw);
}

.site-header {
  background: #201d1a;
  color: #fef6ea;
  padding: 32px 0 24px;
}

.site-header .container {
  padding: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 700;
}

.site-header h1 {
  margin: 0 0 4px;
  font-size: clamp(1.8rem, 2.5vw, 2.6rem);
}

.site-header p {
  margin: 0;
  color: #e6d7c5;
}

.alert {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #3d342c;
  border-radius: 12px;
  background: #2b2621;
}

main section {
  margin-top: 48px;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.panic {
  background: #fff1e5;
  border: 1px solid #f1c8aa;
  padding: 24px;
  border-radius: 18px;
  box-shadow: 0 12px 24px var(--shadow);
}

.panic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.value {
  font-size: 1.1rem;
  font-weight: 600;
}

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

figure {
  margin: 0;
  background: var(--card);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 10px 24px var(--shadow);
}

.image-button {
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  width: 100%;
}

.image-button img {
  width: 100%;
  height: auto;
}

figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.contact-form,
.card {
  display: grid;
  gap: 14px;
  background: var(--card);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 10px 24px var(--shadow);
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

input,
textarea {
  border: 1px solid #d8cbb8;
  padding: 10px 12px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
}

button,
.button-link {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  width: fit-content;
}

button:hover,
.button-link:hover {
  background: var(--accent-dark);
}

.text-link {
  color: var(--accent-dark);
  text-decoration: none;
}

.inline-form {
  margin: 0;
}

.danger {
  background: #b73a2a;
}

.danger:hover {
  background: #8f2c21;
}

.message {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.message.error {
  background: #ffe4e0;
  color: #8b2e24;
}

.message.success {
  background: #e4f6e8;
  color: #1d6d33;
}

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

.admin-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table {
  display: grid;
  gap: 12px;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: 180px 160px 200px 1fr 120px;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border-radius: 12px;
}

.table-head {
  font-weight: 700;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.site-footer {
  background: #201d1a;
  color: #e6d7c5;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(18, 16, 14, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.lightbox.open {
  display: flex;
}

.lightbox-frame {
  background: #fffaf2;
  border-radius: 18px;
  padding: 18px;
  max-width: min(900px, 92vw);
  max-height: 88vh;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.25);
  display: grid;
  gap: 12px;
}

.lightbox-frame img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
}

.lightbox-close {
  background: transparent;
  border: none;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--accent-dark);
  justify-self: end;
}

@media (max-width: 720px) {
  .table-head,
  .table-row {
    grid-template-columns: 1fr;
  }
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
