/* ============================================================
   ELEVON BLOG — design system
   Display: Fraunces (editorial headlines)
   Body copy: Inter (long-form reading)
   UI chrome: Poppins (nav, buttons, labels — shared w/ ELEVON QR)
   ============================================================ */

:root {
  /* color */
  --maroon-900: #3d0000;
  --maroon-700: #7a1010;
  --maroon-600: #8f1b1b;
  --maroon-500: #a8403f;
  --maroon-050: #fbeeed;
  --ink: #1c1815;
  --stone-700: #554d47;
  --stone-500: #857b73;
  --stone-300: #c9beb5;
  --stone-150: #e8e1da;
  --paper: #faf7f3;
  --paper-raised: #ffffff;
  --hairline: rgba(28, 21, 15, 0.11);

  /* type */
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
  --font-ui: 'Poppins', sans-serif;

  /* rhythm */
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius-lg: 1.25rem;
  --radius-full: 999px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.eyebrow {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--maroon-700);
  text-decoration: none;
  display: inline-block;
}
a.eyebrow:hover { text-decoration: underline; }

.rule {
  border: none;
  border-top: 1px solid var(--hairline);
}

/* ---------------- Public masthead ---------------- */

.masthead {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.1rem var(--gutter) 0;
}

.masthead__bar {
  max-width: 52rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.7rem 0.9rem 0.7rem 1.3rem;
  border-radius: var(--radius-full);
  background: rgba(250, 247, 243, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 2px rgba(28, 21, 15, 0.04);
}

.masthead__logo {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
.masthead__logo span { color: var(--maroon-700); }

.masthead__search {
  display: flex;
  align-items: center;
}
.masthead__search input {
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--hairline);
  background: var(--paper-raised);
  width: 15rem;
  max-width: 40vw;
}
.masthead__search input:focus {
  outline: none;
  border-color: var(--maroon-500);
}

/* ---------------- Page shell ---------------- */

.ad-rail {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.site-main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 8.5rem var(--gutter) 5rem;
}

.page-head {
  margin-bottom: 3rem;
}
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(2.1rem, 5vw, 2.8rem);
  letter-spacing: -0.01em;
  margin: 0.5rem 0 0;
  color: var(--ink);
}

/* ---------------- Editorial index (homepage list) ---------------- */

.post-feature {
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--hairline);
}
.post-feature__image {
  display: block;
  margin-bottom: 1.5rem;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--paper-raised);
}
.post-feature__image img {
  display: block;
  width: 100%;
  height: clamp(14rem, 34vw, 22rem);
  object-fit: cover;
}
.post-feature h2 {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.15;
  margin: 0.6rem 0 0.9rem;
}
.post-feature h2 a { text-decoration: none; }
.post-feature h2 a:hover { color: var(--maroon-700); }
.post-feature p.excerpt {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--stone-700);
  margin: 0 0 1rem;
}

.post-index {
  list-style: none;
  margin: 0;
  padding: 0;
}
.post-index__item {
  display: grid;
  grid-template-columns: 6.5rem 1fr 6rem;
  align-items: center;
  gap: 1.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--hairline);
}
.post-index__item:first-child { padding-top: 0; }
.post-index__image {
  display: block;
  border-radius: 0.6rem;
  overflow: hidden;
  background: var(--paper-raised);
}
.post-index__image img {
  display: block;
  width: 100%;
  height: 4.5rem;
  object-fit: cover;
}
.post-index__date {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stone-500);
  padding-top: 0.3rem;
}
.post-index__body h3 {
  font-family: var(--font-display);
  font-weight: 540;
  font-size: 1.4rem;
  line-height: 1.25;
  margin: 0.35rem 0 0.5rem;
}
.post-index__body h3 a { text-decoration: none; }
.post-index__body h3 a:hover { color: var(--maroon-700); }
.post-index__body p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--stone-700);
  margin: 0;
}

.empty-state {
  padding: 3rem 0;
  color: var(--stone-500);
  font-style: italic;
  text-align: center;
}

/* ---------------- Article page ---------------- */

.article-head { margin-bottom: 2.5rem; }
.article-head h1 {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0.75rem 0 1rem;
}
.article-meta {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone-500);
}

.article-cover {
  margin: 0 0 2.5rem;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--paper-raised);
}
.article-cover img {
  display: block;
  width: 100%;
  height: clamp(14rem, 42vw, 26rem);
  object-fit: cover;
}

.article-body {
  font-size: 1.08rem;
  line-height: 1.8;
  color: #2c2521;
}
.article-body p { margin: 0 0 1.4em; }
.article-body p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 3.6rem;
  font-weight: 560;
  color: var(--maroon-700);
  float: left;
  line-height: 0.85;
  padding: 0.05em 0.08em 0 0;
}
.article-body h2, .article-body h3 {
  font-family: var(--font-display);
  font-weight: 560;
  color: var(--ink);
  margin: 1.6em 0 0.6em;
}
.article-body a { color: var(--maroon-700); text-decoration-color: var(--stone-300); }
.article-body img { max-width: 100%; border-radius: 0.75rem; }
.article-body blockquote {
  margin: 1.75rem 0;
  padding: 0 0 0 1.25rem;
  border-left: 3px solid var(--maroon-500);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--stone-700);
}

/* ---------------- Comments ---------------- */

.comments-panel {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--hairline);
}
.comments-panel h2 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone-700);
  margin: 0 0 1.75rem;
}
.comment { padding: 1.25rem 0; border-bottom: 1px solid var(--hairline); }
.comment:first-child { padding-top: 0; }
.comment__author {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.85rem;
}
.comment__body {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--stone-700);
  margin-top: 0.4rem;
}

.notice {
  background: var(--maroon-050);
  color: var(--maroon-900);
  font-size: 0.88rem;
  border-radius: 0.9rem;
  padding: 0.9rem 1.2rem;
  margin-bottom: 2rem;
}

.form { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 1.75rem; }
.form input, .form textarea {
  font-family: var(--font-body);
  font-size: 0.92rem;
  padding: 0.8rem 1.1rem;
  border-radius: 0.9rem;
  border: 1px solid var(--hairline);
  background: var(--paper-raised);
  width: 100%;
}
.form input:focus, .form textarea:focus {
  outline: none;
  border-color: var(--maroon-500);
}
.form textarea { resize: vertical; min-height: 6.5rem; }

/* ---------------- Buttons ---------------- */

.btn {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  padding: 0.8rem 1.9rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: filter 0.2s ease, transform 0.2s ease;
}
.btn--primary {
  background: linear-gradient(135deg, var(--maroon-700) 0%, var(--maroon-900) 100%);
  color: #fff;
  box-shadow: 0 12px 24px -10px rgba(122, 16, 16, 0.45);
}
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost {
  background: transparent;
  color: var(--maroon-700);
  border: 1px solid var(--hairline);
}
.btn--ghost:hover { border-color: var(--maroon-500); }
.btn--sm { padding: 0.55rem 1.2rem; font-size: 0.66rem; }
.btn--danger { background: none; border: none; color: var(--maroon-700); padding: 0; text-transform: none;
  letter-spacing: normal; font-weight: 500; font-size: 0.82rem; font-family: var(--font-body); cursor: pointer; }
.btn--danger:hover { text-decoration: underline; }

/* ---------------- Ad slot ---------------- */

.ad-slot {
  margin: 2.25rem 0;
  padding: 0.85rem;
  text-align: center;
  background: transparent;
  border: 1px dashed var(--stone-300);
  border-radius: 0.85rem;
  font-family: var(--font-ui);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone-500);
}

/* ---------------- Public footer ---------------- */

.site-footer {
  border-top: 1px solid var(--hairline);
  background: var(--paper-raised);
  padding: 3.5rem var(--gutter) 2.5rem;
}
.site-footer__inner {
  max-width: 42rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}
.site-footer__brand {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.95rem;
}
.site-footer__brand span { color: var(--maroon-700); }
.site-footer__tag {
  font-size: 0.85rem;
  color: var(--stone-500);
  margin-top: 0.5rem;
  max-width: 20rem;
  line-height: 1.5;
}
.site-footer__links {
  display: flex;
  gap: 2.5rem;
}
.site-footer__links div { display: flex; flex-direction: column; gap: 0.55rem; }
.site-footer__links strong {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone-500);
  margin-bottom: 0.2rem;
}
.site-footer__links a { font-size: 0.85rem; text-decoration: none; color: var(--stone-700); }
.site-footer__links a:hover { color: var(--maroon-700); }
.site-footer__base {
  max-width: 42rem;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.72rem;
  color: var(--stone-500);
}

/* ---------------- 404 ---------------- */

.state-404 {
  text-align: center;
  padding: 5rem 0 3rem;
}
.state-404 .eyebrow { display: block; margin-bottom: 0.75rem; }
.state-404 h1 {
  font-family: var(--font-display);
  font-size: 3.5rem;
  margin: 0 0 0.75rem;
}
.state-404 p { color: var(--stone-500); margin-bottom: 2rem; }

/* ============================================================
   ADMIN
   ============================================================ */

.admin-body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  margin: 0;
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 15rem;
  flex-shrink: 0;
  background: var(--ink);
  color: #d9d2cb;
  padding: 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.admin-sidebar__brand {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: #fff;
  text-decoration: none;
  margin-bottom: 2.25rem;
  display: block;
}
.admin-sidebar__brand span { color: #c9605f; }
.admin-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.admin-sidebar a {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.6rem;
  text-decoration: none;
  color: #bdb3aa;
}
.admin-sidebar a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.admin-sidebar a.active { background: rgba(255,255,255,0.1); color: #fff; }
.admin-sidebar__logout {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.admin-sidebar__logout button {
  font-family: var(--font-ui);
  background: none; border: none; cursor: pointer;
  color: #bdb3aa; font-size: 0.78rem; padding: 0.5rem 0.75rem;
}
.admin-sidebar__logout button:hover { color: #fff; }

.admin-main {
  flex: 1;
  min-width: 0;
  padding: 2.75rem clamp(1.5rem, 4vw, 3.5rem);
  max-width: 62rem;
}
.admin-main h1 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0 0 0.35rem;
}
.admin-main > h1:first-child { margin-bottom: 1.75rem; }
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}
.admin-toolbar h1 { margin: 0; }

.admin-card {
  background: var(--paper-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

.admin-table { width: 100%; border-collapse: collapse; background: var(--paper-raised);
  border: 1px solid var(--hairline); border-radius: var(--radius-lg); overflow: hidden; }
.admin-table th, .admin-table td { text-align: left; padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--hairline); font-size: 0.88rem; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table th {
  font-family: var(--font-ui);
  text-transform: uppercase; font-size: 0.66rem; letter-spacing: 0.07em; color: var(--stone-500);
  background: var(--paper);
}
.admin-table td.actions { display: flex; gap: 1rem; align-items: center; }

.badge {
  font-family: var(--font-ui);
  font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.25rem 0.65rem; border-radius: var(--radius-full);
  background: var(--stone-150); color: var(--stone-700);
}
.badge--live { background: #e4f3e8; color: #2c6e3f; }

.post-form, .inline-form { display: flex; flex-direction: column; gap: 1.3rem; max-width: 38rem; }
.post-form label, .inline-form label {
  font-family: var(--font-ui);
  font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--stone-500);
  display: flex; flex-direction: column; gap: 0.45rem;
}
.post-form input, .post-form select, .post-form textarea,
.inline-form input, .inline-form select {
  font-family: var(--font-body); font-size: 0.92rem; text-transform: none; letter-spacing: normal;
  padding: 0.75rem 1rem; border: 1px solid var(--hairline); border-radius: 0.75rem;
  background: var(--paper-raised); color: var(--ink);
}
.post-form input:focus, .post-form select:focus, .post-form textarea:focus,
.inline-form input:focus { outline: none; border-color: var(--maroon-500); }
.post-form textarea { resize: vertical; }
.inline-form { flex-direction: row; align-items: flex-end; gap: 0.9rem; max-width: none; }
.inline-form label { flex: 1; }

.post-form input[type="file"] {
  padding: 0.6rem 0.75rem; background: var(--paper); cursor: pointer;
}
.field-hint {
  font-family: var(--font-body); font-size: 0.78rem; text-transform: none;
  letter-spacing: normal; color: var(--stone-500);
}
.current-image {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 0.25rem;
}
.current-image img {
  width: 6rem; height: 4rem; object-fit: cover; border-radius: 0.6rem;
  border: 1px solid var(--hairline);
}
.current-image__remove {
  display: flex !important; flex-direction: row !important; align-items: center;
  gap: 0.4rem; text-transform: none !important; letter-spacing: normal !important;
  font-size: 0.82rem !important; color: var(--stone-600) !important;
}

.admin-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.admin-list li {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--paper-raised); border: 1px solid var(--hairline);
  padding: 0.9rem 1.25rem; border-radius: 0.9rem; font-size: 0.9rem;
}

.stats { display: flex; gap: 1.25rem; margin-top: 0; flex-wrap: wrap; }
.stat-card {
  background: var(--paper-raised); border: 1px solid var(--hairline);
  border-radius: var(--radius-lg); padding: 1.6rem 1.9rem; min-width: 10rem;
}
.stat-card strong {
  display: block; font-family: var(--font-display); font-size: 2.4rem; font-weight: 560; color: var(--maroon-700);
  line-height: 1;
}
.stat-card span {
  font-family: var(--font-ui); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--stone-500); margin-top: 0.5rem; display: block;
}

.comment-mod-card {
  background: var(--paper-raised); border: 1px solid var(--hairline);
  border-radius: var(--radius-lg); padding: 1.5rem 1.75rem; margin-bottom: 1rem;
}
.comment-mod-card p:first-child { font-size: 0.85rem; color: var(--stone-500); margin: 0 0 0.6rem; }
.comment-mod-card p:first-child strong { color: var(--ink); font-family: var(--font-ui); }
.comment-mod-card p.body-text { font-size: 0.95rem; line-height: 1.6; margin: 0 0 1rem; }
.comment-mod-card .row { display: flex; gap: 1rem; align-items: center; }

.login-box {
  max-width: 22rem; margin: auto; padding: 2.75rem;
  background: var(--paper-raised); border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px -20px rgba(28, 21, 15, 0.15);
  text-align: center; border: 1px solid var(--hairline);
}
.login-box h1 {
  font-family: var(--font-ui); font-weight: 600; font-size: 1rem;
  text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 1.75rem; color: var(--ink);
}
.login-box form { display: flex; flex-direction: column; gap: 1.1rem; }
.login-box label { display: block; text-align: left; font-family: var(--font-ui); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--stone-500); }
.login-box input {
  width: 100%; padding: 0.75rem 1rem; margin-top: 0.4rem;
  border: 1px solid var(--hairline); border-radius: 0.75rem; font-family: var(--font-body);
}
.login-box input:focus { outline: none; border-color: var(--maroon-500); }
.login-box button {
  width: 100%; margin-top: 0.4rem; font-family: var(--font-ui);
  background: linear-gradient(135deg, var(--maroon-700) 0%, var(--maroon-900) 100%);
  color: #fff; border: none; padding: 0.85rem; border-radius: var(--radius-full);
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em; cursor: pointer;
}
.login-box .error {
  background: var(--maroon-050); color: var(--maroon-900);
  font-size: 0.82rem; padding: 0.7rem 1rem; border-radius: 0.75rem; margin-bottom: 0.5rem;
}

.inline { display: inline; }

@media (max-width: 720px) {
  .admin-body { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; flex-direction: row;
    align-items: center; overflow-x: auto; padding: 1rem; }
  .admin-sidebar__brand { margin: 0 1rem 0 0; }
  .admin-sidebar nav { flex-direction: row; }
  .admin-sidebar__logout { margin: 0 0 0 auto; padding: 0; border: none; }
  .post-index__item { grid-template-columns: 1fr; gap: 0.35rem; }
  .post-index__date { padding-top: 0; }
  .post-index__image { margin-top: 0.5rem; order: 3; }
  .post-index__image img { height: 10rem; }
  .masthead__bar { flex-wrap: wrap; gap: 0.75rem; padding: 0.7rem 0.9rem; border-radius: 1.5rem; }
  .masthead__search input { width: 100%; max-width: none; }
  .site-footer__links { flex-wrap: wrap; row-gap: 1.75rem; }
  .admin-toolbar { flex-wrap: wrap; gap: 1rem; }
}
