:root {
  --bg: #f1f1f1;
  --text: #2a2a2a;
  --text-dim: #555;
  --accent: #c84a3c;
  --sidebar-w: 180px;
  --content-max: 1100px;
  --page-max: 1280px;       /* sidebar + content */
  --page-gutter: 32px;      /* equal left/right margin at narrow widths */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

/* ------- Page wrapper: centered with equal L/R margins ------- */
.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
  display: flex;
  align-items: flex-start;
}

/* ------- Sidebar ------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  flex-shrink: 0;
  width: var(--sidebar-w);
  max-height: 100vh;
  padding: 32px 24px 32px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}
.sidebar a {
  font-size: 12px;
  color: var(--text);
  padding: 1px 0;
  letter-spacing: 0.01em;
}
.sidebar a.current { color: var(--accent); }

/* ------- Content ------- */
.content {
  flex: 1;
  min-width: 0;
  padding: 32px 0 64px 1cm;
  max-width: var(--content-max);
}

h1 { font-size: 22px; font-weight: 700; margin: 0 0 28px; }
h2 { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
p { margin: 0 0 12px; }

/* ------- Home heroes (75% of content width, left-aligned) ------- */
.hero {
  max-width: 75%;
  margin: 0 0 56px 0;
}
.hero img {
  display: block;
  width: 100%;
  height: auto;
}

/* ------- Gallery grid ------- */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px 28px;
}
.card { margin: 0; }
.card .thumb { display: block; }
.card img {
  display: block;
  width: 100%;
  height: auto;
}
.card figcaption {
  margin-top: 10px;
}
.card .title {
  font-weight: 700;
  font-size: 13px;
}
.card .caption-sub {
  font-size: 12px;
  color: var(--text-dim);
}
.card figcaption p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  white-space: pre-line;
}

/* ------- Stub pages ------- */
.stub {
  max-width: 640px;
}

/* ------- Long-form content (About, Blog, Contact) ------- */
.prose {
  max-width: 720px;
  font-size: 14px;
  line-height: 1.65;
}
.prose h2 {
  font-size: 18px;
  margin: 32px 0 12px;
}
.prose h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 24px 0 8px;
}
.prose p { margin: 0 0 12px; }
.prose ul {
  margin: 0 0 16px;
  padding-left: 22px;
}
.prose ul li { margin-bottom: 4px; }
.prose .meta {
  color: var(--text-dim);
  font-size: 12px;
}
.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* About page portrait — float on the right */
.portrait {
  float: right;
  width: 220px;
  margin: 0 0 16px 24px;
}
.portrait img {
  display: block;
  width: 100%;
  height: auto;
}

/* Blog post body */
.post-body .back {
  font-size: 12px;
  margin-bottom: 8px;
}
.post-body h1 { margin-bottom: 4px; }
.post-body > .meta { margin-bottom: 28px; }
.post-body img {
  max-width: 100%;
  height: auto;
  margin: 16px 0;
}
.post-body blockquote {
  margin: 16px 0;
  padding: 6px 16px;
  border-left: 3px solid var(--accent);
  background: #fafafa;
  color: var(--text);
}
.post-body blockquote p { margin: 8px 0; }
.post-body code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: #ececec;
  padding: 1px 4px;
  border-radius: 3px;
}
.post-body hr {
  border: none;
  border-top: 1px solid #d8d8d8;
  margin: 28px 0;
}
.post-body ul ul,
.post-body ol ul,
.post-body ul ol {
  margin-top: 4px;
  margin-bottom: 4px;
}

/* Blog index — hero banner */
.blog-hero {
  margin: 0 0 28px;
  max-width: 540px;
}
.blog-hero-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.blog-hero-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}
.blog-hero-text {
  margin-top: 18px;
  color: var(--text);
}
.blog-hero h1 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--text);
}
.blog-hero .tagline {
  margin: 0;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}
.blog-hero .accent-bar {
  display: block;
  width: 32px;
  height: 2px;
  background: var(--accent);
  margin: 0 0 12px;
}

/* Blog post list */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.post {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 28px;
  padding: 26px 0;
  border-bottom: 1px solid #d8d8d8;
  align-items: start;
}
.post:first-child { padding-top: 8px; }
.post:last-child { border-bottom: none; }
.post-date {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  padding-top: 6px;
  line-height: 1.4;
}
.post-date-day {
  display: inline-block;
  color: var(--text);
}
.post-date-year { color: var(--text-dim); }
.post-content { min-width: 0; }
.post h2 {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.3;
}
.post h2 a { color: var(--text); text-decoration: none; }
.post h2 a:hover { color: var(--accent); }
.post .excerpt {
  margin: 0 0 12px;
  color: var(--text);
}
.post .read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}
.post .read-more::after {
  content: "→";
  display: inline-block;
  transition: transform 0.18s ease;
}
.post .read-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.post .read-more:hover::after { transform: translateX(3px); }

.blog-index { max-width: 800px; }

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 480px;
  margin: 16px 0 24px;
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.contact-form span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
}
.contact-form input,
.contact-form textarea {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
}
.contact-form textarea { resize: vertical; }
.contact-form button {
  align-self: flex-start;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.contact-form button:hover { background: #a83a2c; }

/* ------- Admin mode (only active with ?admin on a gallery page) ------- */
body.admin-mode [data-admin-editable] {
  outline: 1px dashed rgba(200, 74, 60, 0.45);
  outline-offset: 2px;
  cursor: text;
  border-radius: 2px;
  transition: outline-color 0.15s, background 0.15s;
}
body.admin-mode [data-admin-editable]:hover {
  outline-color: var(--accent);
}
body.admin-mode [data-admin-editable]:focus {
  outline: 2px solid var(--accent);
  background: #fff;
}
body.admin-mode [data-admin-placeholder]:empty::before {
  content: "Add a description…";
  color: #999;
  font-style: italic;
}

.admin-status {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: #2a2a2a;
  border-radius: 4px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s, transform 0.18s;
  pointer-events: none;
  z-index: 1000;
}
.admin-status.show {
  opacity: 1;
  transform: translateY(0);
}
.admin-status[data-kind="ok"]    { background: #2e7d32; }
.admin-status[data-kind="error"] { background: var(--accent); }

/* ------- Mobile ------- */
@media (max-width: 720px) {
  .page {
    flex-direction: column;
    padding: 0 16px;
  }
  .sidebar {
    position: static;
    width: 100%;
    max-height: none;
    padding: 16px 0;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 16px;
  }
  .content {
    width: 100%;
    max-width: 100%;
    padding: 16px 0;
  }
  .hero {
    max-width: 100%;
  }
  .grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .blog-hero {
    margin-bottom: 20px;
  }
  .blog-hero-text { margin-top: 14px; }
  .blog-hero h1 { font-size: 18px; }
  .blog-hero .tagline { font-size: 10px; }
  .post {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 22px 0;
  }
  .post-date { padding-top: 0; }
}
