/* ——— Adventure in the Ordinary — design system ———
   Warm editorial: cream paper, Cormorant serif, sage + terracotta.
*/

:root {
  --paper: #f6f1e7;
  --paper-deep: #ede5d3;
  --card: #fbf8f1;
  --ink: #2f2a24;
  --ink-soft: #6f655a;
  --ink-faint: #998d7f;
  --sage: #7d8c74;
  --sage-deep: #57654f;
  --sage-wash: #e3e7dc;
  --terracotta: #b65c38;
  --terracotta-deep: #9c4b2b;
  --rule: #d8cdb8;
  --max: 1080px;
  --serif: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --sans: "Figtree", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ——— type ——— */

h1, h2, h3, .serif {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 0.5em;
}

.kicker {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin: 0 0 1.2rem;
}

.kicker--terra { color: var(--terracotta); }

a { color: var(--terracotta); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--terracotta-deep); }

/* ——— structure ——— */

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }
.wrap--narrow { max-width: 720px; }

.site-header {
  border-bottom: 1px solid var(--rule);
  background: rgba(246, 241, 231, 0.92);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.brand em { color: var(--sage-deep); }

.site-nav { display: flex; align-items: center; gap: 30px; }

.site-nav a {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.site-nav a:hover { color: var(--terracotta); }

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #fdfbf6;
  background: var(--terracotta);
  border: 1px solid var(--terracotta);
  border-radius: 2px;
  padding: 13px 28px 12px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s ease;
}

.btn:hover { background: var(--terracotta-deep); color: #fdfbf6; transform: translateY(-1px); }

.btn--ghost {
  background: transparent;
  color: var(--sage-deep);
  border: 1px solid var(--sage);
}
.btn--ghost:hover { background: var(--sage-wash); color: var(--sage-deep); }

.btn--small { padding: 9px 18px 8px; letter-spacing: 0.18em; }

/* ——— hero ——— */

.hero { padding: 110px 0 90px; position: relative; overflow: hidden; }

.hero::after {
  content: "❋";
  position: absolute;
  right: 6%;
  top: 18%;
  font-size: 220px;
  color: var(--sage);
  opacity: 0.1;
  pointer-events: none;
  line-height: 1;
}

.hero h1 {
  font-size: clamp(3rem, 7.5vw, 5.6rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  max-width: 14ch;
}

.hero h1 em {
  font-style: italic;
  color: var(--terracotta);
}

.hero p.lede {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-style: italic;
  color: var(--ink-soft);
  max-width: 44ch;
  margin: 1.6rem 0 2.4rem;
  line-height: 1.5;
}

.fade-up { animation: fadeUp 0.9s ease both; }
.fade-up.d1 { animation-delay: 0.12s; }
.fade-up.d2 { animation-delay: 0.24s; }
.fade-up.d3 { animation-delay: 0.36s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ——— sections ——— */

.section { padding: 80px 0; }
.section--sage { background: var(--sage-wash); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }

.section-head { text-align: center; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(2rem, 4vw, 2.9rem); letter-spacing: 0.06em; }

.hr-orn {
  border: 0;
  text-align: center;
  margin: 0 auto 1rem;
}
.hr-orn::after {
  content: "· ❋ ·";
  color: var(--sage);
  font-size: 1rem;
  letter-spacing: 0.5em;
}

/* ——— blog cards ——— */

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 44px 36px;
}

.post-card { background: transparent; }

.post-card .thumb {
  display: block;
  aspect-ratio: 3 / 2;
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  overflow: hidden;
  margin-bottom: 20px;
}

.post-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.post-card:hover .thumb img { transform: scale(1.04); }

.post-card .thumb .ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 2.6rem;
  color: var(--sage);
}

.post-card time {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.post-card h3 { font-size: 1.7rem; margin: 0.4rem 0 0.4rem; }
.post-card h3 a { color: var(--ink); }
.post-card h3 a:hover { color: var(--terracotta); }
.post-card p { color: var(--ink-soft); font-size: 15.5px; margin: 0; }

/* ——— article ——— */

.article-head { text-align: center; padding: 90px 0 50px; }
.article-head h1 { font-size: clamp(2.4rem, 5vw, 4rem); max-width: 20ch; margin-left: auto; margin-right: auto; }
.article-head time {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.article-cover {
  max-width: 880px;
  margin: 0 auto 60px;
  padding: 0 28px;
}
.article-cover img {
  width: 100%;
  border: 1px solid var(--rule);
  display: block;
}

.prose {
  font-size: 18px;
  color: #46403a;
}
.prose p { margin: 0 0 1.5em; }
.prose h2, .prose h3 { margin-top: 2.2em; letter-spacing: 0.04em; }
.prose img { max-width: 100%; border: 1px solid var(--rule); }
.prose blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.5;
  color: var(--sage-deep);
  border-left: 2px solid var(--sage);
  margin: 2.2em 0;
  padding: 0.2em 0 0.2em 1.4em;
}
.prose a { text-decoration: underline; text-underline-offset: 3px; }

/* ——— subscribe band ——— */

.subscribe-band {
  background: var(--sage-deep);
  color: #f1efe6;
  padding: 90px 0;
  text-align: center;
}

.subscribe-band h2 {
  color: #f7f4ea;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-style: italic;
  font-weight: 500;
}

.subscribe-band p { color: #d4d6c6; max-width: 50ch; margin: 0.8rem auto 2.2rem; }

.subscribe-form {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 560px;
  margin: 0 auto;
}

.subscribe-form input[type="email"],
.subscribe-form input[type="text"] {
  flex: 1 1 240px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: #f7f4ea;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 13px 16px;
  outline: none;
}

.subscribe-form input:focus { border-color: var(--terracotta); }

.form-note { font-size: 12.5px; color: #b9bda9; margin-top: 1.1rem; letter-spacing: 0.04em; }

.flash {
  max-width: 560px;
  margin: 0 auto 1.4rem;
  padding: 12px 18px;
  border-radius: 2px;
  font-size: 14.5px;
  background: rgba(247, 244, 234, 0.14);
  border: 1px solid rgba(247, 244, 234, 0.3);
  color: #f7f4ea;
}

.flash--page {
  background: var(--sage-wash);
  border: 1px solid var(--sage);
  color: var(--sage-deep);
  margin: 24px auto;
}

.flash--error { border-color: var(--terracotta); color: var(--terracotta-deep); background: #f3e3da; }

/* ——— footer ——— */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 44px 0 52px;
  text-align: center;
}

.site-footer .brand { font-size: 1.15rem; }
.site-footer p {
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 10px 0 0;
}

/* ——— admin ——— */

.admin-body { background: #f1ece1; }

.admin-shell { display: flex; min-height: 100vh; }

.admin-side {
  width: 230px;
  flex-shrink: 0;
  background: var(--ink);
  color: #cfc6b8;
  padding: 28px 0;
}

.admin-side .brand { color: #f1ecdf; display: block; padding: 0 26px 22px; font-size: 1.05rem; }

.admin-side nav a {
  display: block;
  padding: 11px 26px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b3a897;
}

.admin-side nav a:hover, .admin-side nav a.active { background: rgba(255,255,255,0.07); color: #f1ecdf; }

.admin-main { flex: 1; padding: 44px 48px; max-width: 1100px; }

.admin-main h1 { font-size: 2.1rem; letter-spacing: 0.04em; }

.admin-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--rule); }
.admin-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
}
.admin-table td { padding: 13px 16px; border-bottom: 1px solid #eae2d2; font-size: 15px; }
.admin-table tr:last-child td { border-bottom: 0; }

.pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
}
.pill--green { background: var(--sage-wash); color: var(--sage-deep); }
.pill--gray { background: #e7e0d2; color: var(--ink-soft); }
.pill--terra { background: #f3e3da; color: var(--terracotta-deep); }

.field { margin-bottom: 22px; }
.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.field input[type="text"], .field input[type="password"], .field input[type="email"], .field textarea, .field select {
  width: 100%;
  font-family: var(--sans);
  font-size: 15.5px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 11px 14px;
  outline: none;
}
.field textarea { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; line-height: 1.7; min-height: 380px; }
.field input:focus, .field textarea:focus { border-color: var(--sage); }
.field .hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 6px; }

.admin-actions { display: flex; gap: 14px; align-items: center; margin-top: 30px; }

/* image upload controls */
.upload-row { display: flex; gap: 10px; align-items: stretch; }
.upload-row input { flex: 1; }
.upload-row .btn { white-space: nowrap; }
.upload-status {
  font-size: 13.5px; padding: 10px 15px; margin: 0 0 20px;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink-soft);
}
.upload-status--ok { border-color: var(--sage); color: var(--sage-deep); background: var(--sage-wash); }
.upload-status--error { border-color: var(--terracotta); color: var(--terracotta-deep); }

/* Toast UI rich-text editor — blend into the studio theme */
#editor { margin-bottom: 8px; }
.toastui-editor-defaultUI { border: 1px solid var(--rule) !important; border-radius: 4px; }
.toastui-editor-defaultUI-toolbar { background: var(--card) !important; border-bottom: 1px solid var(--rule) !important; }
.toastui-editor-defaultUI .ProseMirror,
.toastui-editor-contents { font-family: var(--sans); font-size: 16px; line-height: 1.7; color: var(--ink); }
.toastui-editor-contents h1, .toastui-editor-contents h2, .toastui-editor-contents h3 { font-family: var(--serif); letter-spacing: 0.02em; }
.toastui-editor-contents blockquote { border-left-color: var(--sage); color: var(--sage-deep); }
.toastui-editor-contents a { color: var(--terracotta-deep); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin: 30px 0 40px; }
.stat {
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 22px 24px;
}
.stat .n { font-family: var(--serif); font-size: 2.4rem; font-weight: 600; color: var(--sage-deep); line-height: 1; }
.stat .l { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-faint); margin-top: 8px; }

.login-card {
  max-width: 400px;
  margin: 12vh auto 0;
  background: var(--card);
  border: 1px solid var(--rule);
  padding: 44px 40px;
}

.toolbar { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 24px; }

@media (max-width: 860px) {
  .admin-shell { flex-direction: column; }
  .admin-side { width: 100%; padding: 12px 0; }
  .admin-main { padding: 28px 22px; }
  .hero { padding: 70px 0 60px; }
  .brand { font-size: 1.05rem; max-width: 9rem; line-height: 1.3; }
  .site-nav { gap: 18px; }
  .site-nav a.nav-hide-m { display: none; }
}
