/* =====================================================
   Eidos Research — Blog, Auth, Profile Styles
   ===================================================== */

/* ---------- Shared form inputs ---------- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
select,
textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--body);
  font-size: 0.95rem;
  padding: 0.7rem 1rem;
  outline: none;
  transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}
select option { background: var(--panel); }
.field { margin-bottom: 1.25rem; }
.field label {
  display: block;
  font-size: 0.82rem;
  font-family: var(--mono);
  color: var(--text-dim);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.field-err { color: #f87171; font-size: 0.82rem; display: block; margin-top: 0.3rem; }

/* ---------- Messages bar ---------- */
.messages-bar {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 300px;
  max-width: 600px;
}
.msg {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}
.msg.success { border-color: #4ade80; color: #4ade80; }
.msg.error   { border-color: #f87171; color: #f87171; }
.msg.warning { border-color: var(--gold); color: var(--gold); }

/* ---------- Nav additions ---------- */
.nav-user {
  color: var(--accent) !important;
  font-weight: 500;
}
.btn-nav-logout {
  background: none;
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-family: var(--body);
  font-size: 0.9rem;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-nav-logout:hover { border-color: var(--accent); color: var(--text); }

/* ---------- Buttons extra ---------- */
.btn-sm  { padding: 0.45rem 1rem; font-size: 0.85rem; }
.btn-xs  { padding: 0.3rem 0.7rem; font-size: 0.78rem; }
.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid #f87171;
  color: #f87171;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-family: var(--body);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background 0.2s;
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.22); }

/* ---------- Blog page ---------- */
.blog-page { padding-top: 80px; }

.blog-hero {
  background: linear-gradient(180deg, rgba(96,165,250,0.06) 0%, transparent 100%);
  border-bottom: 1px solid var(--line);
  padding: 5rem 0 3.5rem;
  text-align: center;
}
.blog-hero h1 { font-family: var(--display); font-size: clamp(2rem, 5vw, 3.2rem); margin: 0.5rem 0 1rem; }
.blog-hero p  { color: var(--text-dim); max-width: 560px; margin: 0 auto; }

.blog-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  padding-top: 3rem;
  padding-bottom: 5rem;
  align-items: start;
}

/* --- Sidebar --- */
.blog-sidebar { position: sticky; top: 100px; }
.sidebar-block h4 {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 0.75rem;
}
.cat-link {
  display: block;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 0.2rem;
}
.cat-link:hover, .cat-link.active {
  background: rgba(96,165,250,0.1);
  color: var(--accent);
}

/* --- Blog grid --- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.blog-grid-3 { grid-template-columns: repeat(3, 1fr); }

.blog-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.blog-card:hover { border-color: rgba(96,165,250,0.35); transform: translateY(-3px); }

.blog-card-img { width: 100%; height: 180px; object-fit: cover; display: block; }
.blog-card-body { padding: 1.25rem; }
.card-cat {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.5rem;
}
.blog-card-title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.6rem;
}
.blog-card-title a { color: var(--text); text-decoration: none; }
.blog-card-title a:hover { color: var(--accent); }
.blog-card-excerpt { font-size: 0.88rem; color: var(--text-dim); margin-bottom: 1rem; line-height: 1.55; }
.blog-card-meta { font-size: 0.78rem; color: var(--text-faint); display: flex; gap: 0.4rem; align-items: center; }
.meta-dot { opacity: 0.4; }

.filter-bar {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.filter-bar strong { color: var(--text); }
.clear-filter { color: var(--text-faint); text-decoration: none; font-size: 0.8rem; }
.clear-filter:hover { color: var(--accent); }

.blog-empty { text-align: center; padding: 5rem 0; color: var(--text-dim); }
.blog-empty svg { opacity: 0.3; margin-bottom: 1rem; }
.blog-empty p { margin-bottom: 1.5rem; }

.pagination {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  justify-content: center;
}
.page-info { color: var(--text-dim); font-size: 0.88rem; }

/* ---------- Post detail ---------- */
.post-page { padding-top: 80px; }

.post-cover { position: relative; height: 420px; overflow: hidden; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-cover-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(6,7,10,0.2) 0%, rgba(6,7,10,0.8) 100%);
}

.post-container { max-width: 780px; padding-top: 3rem; padding-bottom: 5rem; }

.post-header { margin-bottom: 3rem; }
.post-title {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.2;
  margin: 0.75rem 0 1rem;
}
.post-meta { font-size: 0.88rem; color: var(--text-dim); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.draft-badge {
  background: rgba(245,158,11,0.15);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 0.7rem;
  font-family: var(--mono);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.06em;
}
.post-actions { margin-top: 1rem; display: flex; gap: 0.75rem; }

/* Rich text body */
.prose { font-size: 1.05rem; line-height: 1.8; color: var(--text); }
.prose h1,.prose h2,.prose h3,.prose h4 { font-family: var(--display); color: var(--text); margin: 2rem 0 0.75rem; }
.prose h2 { font-size: 1.55rem; }
.prose h3 { font-size: 1.25rem; }
.prose p  { margin-bottom: 1.25rem; }
.prose a  { color: var(--accent); }
.prose img { max-width: 100%; border-radius: 10px; margin: 1.5rem 0; }
.prose ul,.prose ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.prose li { margin-bottom: 0.4rem; }
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  color: var(--text-dim);
  font-style: italic;
  margin: 1.5rem 0;
}
.prose pre {
  background: var(--void-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}
.prose code {
  background: var(--void-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.15em 0.4em;
  font-family: var(--mono);
  font-size: 0.88em;
}
.prose pre code { background: none; border: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.prose th,.prose td { border: 1px solid var(--line); padding: 0.6rem 1rem; text-align: left; }
.prose th { background: var(--panel); font-family: var(--display); }

.post-footer { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }

.related-posts { margin-top: 4rem; padding-top: 3rem; border-top: 1px solid var(--line); }
.related-posts h3 { font-family: var(--display); font-size: 1.25rem; margin-bottom: 1.5rem; }

/* ---------- Editor ---------- */
.editor-page { padding-top: 80px; min-height: 100vh; }
.editor-container { padding-top: 3rem; padding-bottom: 5rem; max-width: 1100px; }
.editor-header { margin-bottom: 2.5rem; }
.editor-header h1 { font-family: var(--display); font-size: 2rem; }

.editor-form {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}
.editor-main-col {}
.editor-side-col { display: flex; flex-direction: column; gap: 1.25rem; }

.side-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
}
.side-panel h4 {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 1rem;
}
.editor-btns { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }

/* TinyMCE container */
.tox-tinymce { border: 1px solid var(--line) !important; border-radius: 8px !important; overflow: hidden !important; }

/* ---------- Auth pages ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1rem 4rem;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2.5rem;
  text-align: center;
}
.auth-logo { margin-bottom: 1.25rem; display: flex; justify-content: center; }
.auth-card h2 { font-family: var(--display); font-size: 1.6rem; margin-bottom: 0.4rem; }
.auth-sub { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 2rem; }
.auth-form { text-align: left; }
.auth-submit { width: 100%; justify-content: center; margin-top: 0.5rem; font-size: 1rem; padding: 0.8rem; }
.auth-error {
  background: rgba(248,113,113,0.1);
  border: 1px solid #f87171;
  color: #f87171;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}
.auth-alt { color: var(--text-dim); font-size: 0.88rem; margin-top: 1.5rem; }
.auth-alt a { color: var(--accent); text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }

/* ---------- Profile ---------- */
.profile-page { padding-top: 100px; padding-bottom: 5rem; }
.profile-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  align-items: start;
}
.profile-aside {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 2rem;
  text-align: center;
  position: sticky;
  top: 100px;
}
.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  display: block;
}
.profile-avatar-wrap { margin-bottom: 1rem; }
.profile-avatar-placeholder {
  background: rgba(96,165,250,0.15);
  border: 2px solid rgba(96,165,250,0.3);
  color: var(--accent);
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-name { font-family: var(--display); font-size: 1.25rem; margin-bottom: 0.2rem; }
.profile-email { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 0.75rem; }
.profile-bio { color: var(--text-dim); font-size: 0.88rem; margin-top: 0.75rem; line-height: 1.55; }
.profile-website { color: var(--accent); font-size: 0.82rem; display: block; margin-top: 0.5rem; word-break: break-all; }
.role-badge {
  display: inline-block;
  background: rgba(96,165,250,0.12);
  border: 1px solid rgba(96,165,250,0.3);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-section { margin-bottom: 2.5rem; }
.profile-section h3 { font-family: var(--display); font-size: 1.15rem; margin-bottom: 1.25rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.section-head-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.section-head-row h3 { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

.posts-table { display: flex; flex-direction: column; gap: 0.5rem; }
.posts-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  gap: 1rem;
}
.posts-row-info { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.posts-row-title { color: var(--text); text-decoration: none; font-size: 0.92rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.posts-row-title:hover { color: var(--accent); }
.posts-row-date { font-size: 0.75rem; color: var(--text-faint); }
.posts-row-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.status-pill {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid currentColor;
}
.status-published { color: #4ade80; border-color: rgba(74,222,128,0.4); background: rgba(74,222,128,0.08); }
.status-draft     { color: var(--text-faint); border-color: var(--line); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-sidebar { position: static; }
  .editor-form { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-aside { position: static; }
  .blog-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .blog-grid, .blog-grid-3 { grid-template-columns: 1fr; }
}

/* ---------- Light theme overrides (blog/auth/profile) ---------- */
[data-theme="light"] .blog-hero {
  background: linear-gradient(180deg, rgba(37,99,235,0.06) 0%, transparent 100%);
}
[data-theme="light"] .blog-card { box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
[data-theme="light"] .blog-card:hover { border-color: rgba(37,99,235,0.4); }
[data-theme="light"] .auth-card { box-shadow: 0 2px 16px rgba(0,0,0,0.07); }
[data-theme="light"] .profile-aside { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
[data-theme="light"] .side-panel { box-shadow: 0 1px 6px rgba(0,0,0,0.05); }
[data-theme="light"] .posts-row { box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
[data-theme="light"] .prose code,
[data-theme="light"] .prose pre { background: #f0f2f8; border-color: #d4d8ea; }
[data-theme="light"] .theme-toggle:hover { background: rgba(37,99,235,0.08); }
[data-theme="light"] .msg { background: var(--panel); }

/* smooth transitions on theme change */
.blog-card, .auth-card, .profile-aside, .side-panel,
.posts-row, .blog-hero, .post-cover-overlay, .prose pre {
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
