/* Blog + Admin styles, brand-aligned */

/* ── PUBLIC BLOG ──────────────────────────── */
.blog-section { padding: 80px 32px; background: var(--offwhite); min-height: 60vh; }
.blog-inner { max-width: 1200px; margin: 0 auto; }
.blog-loading { text-align: center; color: var(--mid-gray); padding: 60px 0; font-size: 14px; }
.blog-empty { text-align: center; padding: 80px 24px; color: var(--mid-gray); }
.blog-empty h3 { font-family: var(--font-display); font-size: 26px; color: var(--charcoal); margin-bottom: 10px; }
.blog-empty p { font-size: 15px; line-height: 1.7; max-width: 460px; margin: 0 auto; }

.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 36px; }
.blog-card { background: white; border: 1px solid var(--light-gray); border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform 0.2s, box-shadow 0.2s; }
.blog-card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(0,0,0,0.07); }
.blog-card-img { aspect-ratio: 16/9; background: var(--green-muted); background-size: cover; background-position: center; }
.blog-card-img.placeholder { display: flex; align-items: center; justify-content: center; }
.blog-card-img.placeholder svg { width: 48px; height: 48px; stroke: rgba(95,135,84,0.4); fill: none; stroke-width: 1.4; }
.blog-card-body { padding: 22px 22px 18px; flex: 1; display: flex; flex-direction: column; }
.blog-card-tag { font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--green); margin-bottom: 10px; }
.blog-card-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1.25; color: var(--charcoal); margin-bottom: 10px; }
.blog-card-excerpt { font-size: 14px; color: var(--mid-gray); line-height: 1.65; flex: 1; }
.blog-card-foot { padding: 14px 22px; border-top: 1px solid var(--light-gray); display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--mid-gray); }
.blog-card-foot .read { font-weight: 600; color: var(--green); font-size: 13px; }

/* Single post */
.post-hero { padding: 130px 32px 56px; background: var(--charcoal); color: white; }
.post-hero-inner { max-width: 840px; margin: 0 auto; }
.post-hero-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--green-light); font-weight: 600; }
.post-hero-eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.post-hero h1 { font-family: var(--font-display); font-size: 48px; font-weight: 900; line-height: 1.1; color: var(--offwhite); margin-bottom: 14px; }
.post-hero p.lede { font-size: 18px; color: rgba(251,251,251,0.65); line-height: 1.7; font-weight: 300; max-width: 720px; margin-bottom: 22px; }
.post-meta-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; font-size: 13px; color: rgba(251,251,251,0.5); }
.post-meta-row .by { color: var(--offwhite); font-weight: 500; }

.post-cover { max-width: 1100px; margin: -30px auto 0; padding: 0 32px; position: relative; z-index: 2; }
.post-cover img { width: 100%; aspect-ratio: 21/9; object-fit: cover; border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,0.18); display: block; }

.post-body { background: var(--offwhite); padding: 64px 32px 96px; }
.post-content { max-width: 720px; margin: 0 auto; font-size: 17px; line-height: 1.75; color: var(--charcoal); }
.post-content h2 { font-family: var(--font-display); font-size: 30px; font-weight: 800; line-height: 1.2; margin: 36px 0 14px; color: var(--charcoal); }
.post-content h3 { font-family: var(--font-display); font-size: 22px; font-weight: 700; line-height: 1.3; margin: 28px 0 10px; color: var(--charcoal); }
.post-content p { margin-bottom: 18px; }
.post-content a { color: var(--green-dark); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { color: var(--green); }
.post-content ul, .post-content ol { margin: 0 0 18px 22px; padding-left: 6px; }
.post-content li { margin-bottom: 8px; }
.post-content blockquote { border-left: 4px solid var(--green); padding: 4px 0 4px 22px; margin: 22px 0; color: var(--mid-gray); font-style: italic; }
.post-content code { background: var(--green-muted); color: var(--green-dark); padding: 2px 6px; border-radius: 4px; font-family: var(--font-mono); font-size: 14px; }
.post-content pre { background: var(--charcoal); color: var(--offwhite); padding: 20px; border-radius: 10px; overflow-x: auto; margin: 22px 0; }
.post-content pre code { background: transparent; color: inherit; padding: 0; }
.post-content img { max-width: 100%; height: auto; border-radius: 10px; margin: 24px 0; }
.post-content hr { border: 0; border-top: 1px solid var(--light-gray); margin: 36px 0; }

.post-end-cta { max-width: 720px; margin: 56px auto 0; padding: 32px; background: white; border: 1px solid var(--light-gray); border-radius: 16px; }
.post-end-cta h4 { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.post-end-cta p { font-size: 14px; color: var(--mid-gray); margin-bottom: 18px; line-height: 1.6; }

@media (max-width: 880px) {
  .blog-grid { grid-template-columns: 1fr; }
  .post-hero { padding: 110px 22px 48px; }
  .post-hero h1 { font-size: 34px; }
  .post-cover { padding: 0 22px; }
  .post-body { padding: 48px 22px 72px; }
  .post-content { font-size: 16px; }
  .post-content h2 { font-size: 24px; }
}

/* ── ADMIN ─────────────────────────────────── */
.admin-shell { min-height: 100vh; background: var(--offwhite); padding-top: 64px; }
.admin-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 64px; z-index: 100;
  background: var(--charcoal); color: white;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.admin-bar-brand { display: flex; align-items: center; gap: 12px; }
.admin-bar-brand img { height: 36px; }
.admin-bar-brand .label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.5); border-left: 1px solid rgba(255,255,255,0.15); padding-left: 12px; }
.admin-bar-right { display: flex; gap: 14px; align-items: center; font-size: 13px; color: rgba(255,255,255,0.7); }
.admin-bar-right a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 13px; padding: 6px 10px; border-radius: 6px; transition: background 0.15s; }
.admin-bar-right a:hover { background: rgba(255,255,255,0.06); color: white; }
.admin-bar-right .user { font-family: var(--font-mono); font-size: 12px; }
.admin-bar-right .sign-out { color: var(--green-light); cursor: pointer; }

.admin-page { max-width: 1100px; margin: 0 auto; padding: 36px 24px 80px; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 28px; }
.admin-head h1 { font-family: var(--font-display); font-size: 32px; font-weight: 800; line-height: 1.1; }
.admin-head .sub { font-size: 14px; color: var(--mid-gray); margin-top: 4px; }

.admin-table { background: white; border: 1px solid var(--light-gray); border-radius: 14px; overflow: hidden; }
.admin-row { display: grid; grid-template-columns: 1fr 120px 140px 120px; gap: 16px; padding: 14px 22px; align-items: center; border-bottom: 1px solid var(--light-gray); font-size: 14px; }
.admin-row:last-child { border-bottom: 0; }
.admin-row.head { background: var(--offwhite); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 700; color: var(--mid-gray); }
.admin-row .title-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.admin-row .title-cell .t { font-weight: 600; color: var(--charcoal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-row .title-cell .s { font-size: 12px; color: var(--mid-gray); font-family: var(--font-mono); }
.admin-row .pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.admin-row .pill.published { background: var(--green-muted); color: var(--green-dark); }
.admin-row .pill.draft { background: rgba(0,0,0,0.06); color: var(--mid-gray); }
.admin-row .actions { display: flex; gap: 8px; justify-content: flex-end; }
.admin-row .actions a, .admin-row .actions button { font-size: 12px; padding: 6px 10px; border-radius: 6px; text-decoration: none; cursor: pointer; border: 0; background: transparent; color: var(--green-dark); font-weight: 600; }
.admin-row .actions .danger { color: #b54040; }
.admin-row .actions a:hover, .admin-row .actions button:hover { background: rgba(0,0,0,0.04); }

.empty-state { background: white; border: 2px dashed var(--light-gray); border-radius: 14px; padding: 60px 24px; text-align: center; }
.empty-state h3 { font-family: var(--font-display); font-size: 22px; margin-bottom: 8px; color: var(--charcoal); }
.empty-state p { font-size: 14px; color: var(--mid-gray); margin-bottom: 18px; }

/* Login */
.login-shell { min-height: 100vh; background: var(--charcoal); display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: white; border-radius: 18px; padding: 48px 40px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 32px 80px rgba(0,0,0,0.18); }
.login-card img { height: 64px; width: auto; margin: 0 auto 20px; display: block; }
.login-card h1 { font-family: var(--font-display); font-size: 26px; font-weight: 800; margin-bottom: 8px; color: var(--charcoal); }
.login-card p { font-size: 14px; color: var(--mid-gray); margin-bottom: 28px; line-height: 1.65; }
.login-card .signin-btn {
  display: inline-flex; align-items: center; gap: 10px;
  width: 100%; justify-content: center;
  padding: 13px 18px; border-radius: 10px;
  background: var(--charcoal); color: white;
  text-decoration: none; font-weight: 600; font-size: 14px;
  border: 0; cursor: pointer; transition: background 0.2s;
}
.login-card .signin-btn:hover { background: #1f1f1f; }
.login-card .signin-btn svg { width: 18px; height: 18px; }
.login-error { background: #fef2f2; color: #b54040; border: 1px solid #fecaca; border-radius: 10px; padding: 12px 14px; margin-top: 16px; font-size: 13px; text-align: left; display: none; }
.login-error.show { display: block; }
.login-foot { margin-top: 22px; font-size: 11px; color: var(--soft-gray); }
.login-foot a { color: var(--green); text-decoration: none; }

/* Editor */
.editor-wrap { background: white; border: 1px solid var(--light-gray); border-radius: 16px; overflow: hidden; }
.editor-head { display: grid; grid-template-columns: 1fr 140px; gap: 16px; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--light-gray); background: var(--offwhite); }
.editor-head .title-input { width: 100%; border: 0; background: transparent; font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--charcoal); padding: 6px 0; }
.editor-head .title-input:focus { outline: 0; }
.editor-head select { padding: 8px 12px; border: 1px solid var(--light-gray); border-radius: 8px; background: white; font-size: 13px; font-family: var(--font-body); }
.editor-meta { padding: 18px 24px; border-bottom: 1px solid var(--light-gray); display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor-meta .form-input, .editor-meta .form-select, .editor-meta textarea { font-family: var(--font-body); }
.editor-meta textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--light-gray); border-radius: 8px; min-height: 64px; font-size: 14px; color: var(--charcoal); line-height: 1.5; resize: vertical; }
.editor-meta .full { grid-column: 1 / -1; }
.editor-cover { padding: 18px 24px; border-bottom: 1px solid var(--light-gray); display: flex; gap: 16px; align-items: center; }
.editor-cover .thumb { width: 120px; height: 68px; border-radius: 8px; background: var(--green-muted); background-size: cover; background-position: center; flex-shrink: 0; }
.editor-cover label.upload { font-size: 13px; padding: 8px 14px; background: var(--charcoal); color: white; border-radius: 8px; cursor: pointer; font-weight: 600; }
.editor-cover input[type=file] { display: none; }
.editor-cover .clear-cover { font-size: 12px; color: var(--mid-gray); background: transparent; border: 0; cursor: pointer; padding: 6px 8px; }

.editor-body { padding: 24px; }
.editor-body textarea { width: 100%; min-height: 540px; padding: 16px; border: 1px solid var(--light-gray); border-radius: 10px; font-family: var(--font-mono); font-size: 14px; line-height: 1.7; color: var(--charcoal); resize: vertical; }

.editor-actions { padding: 18px 24px; border-top: 1px solid var(--light-gray); display: flex; justify-content: space-between; align-items: center; background: var(--offwhite); }
.editor-actions .status-text { font-size: 12px; color: var(--mid-gray); font-family: var(--font-mono); }
.editor-actions .btn-group { display: flex; gap: 10px; }

@media (max-width: 880px) {
  .admin-row { grid-template-columns: 1fr; gap: 4px; padding: 14px 18px; }
  .admin-row.head { display: none; }
  .editor-head { grid-template-columns: 1fr; }
  .editor-meta { grid-template-columns: 1fr; }
}
