/* ============================================================
   Blog CSS — DIY Wedding Journey
   Matches the landing site design system
   ============================================================ */

/* --- Variables (mirror landing/static/css/style.css) --- */
:root {
    --primary: #d4a574;
    --primary-dark: #b8885a;
    --secondary: #f7f3ef;
    --accent: #8b6f47;
    --text-dark: #2c2c2c;
    --text-mid: #555;
    --text-light: #888;
    --white: #ffffff;
    --border: #e8e0d8;
    --danger: #e74c3c;
    --success: #27ae60;

    --gradient-1: linear-gradient(135deg, #d4a574 0%, #8b6f47 100%);
    --gradient-dark: linear-gradient(135deg, #2c2016 0%, #4a3520 100%);

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.10);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.14);

    --radius: 12px;
    --radius-sm: 6px;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Montserrat', sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Navbar --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-brand {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.nav-menu a {
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-mid);
    transition: background 0.2s, color 0.2s;
}

.nav-menu a:hover { background: var(--secondary); color: var(--accent); }
.nav-menu .nav-external { color: var(--primary-dark); }
.nav-menu .nav-admin { background: var(--primary); color: var(--white); border-radius: var(--radius-sm); }
.nav-menu .nav-admin:hover { background: var(--primary-dark); color: var(--white); }

/* --- Flash Messages --- */
.flash-container { padding: 0.5rem 0; }
.flash {
    max-width: 900px;
    margin: 0.5rem auto;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
}
.flash-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn svg { width: 1rem; height: 1rem; }

.btn-primary {
    background: var(--gradient-1);
    color: var(--white);
    border-color: transparent;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: var(--shadow-md); }

.btn-outline {
    background: transparent;
    color: var(--accent);
    border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--white); }

.btn-read {
    background: transparent;
    color: var(--primary-dark);
    border-color: var(--primary);
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
}
.btn-read:hover { background: var(--primary); color: var(--white); }

.btn-full { width: 100%; justify-content: center; margin-bottom: 0.5rem; }

.btn-ghost-dark {
    background: transparent;
    color: var(--text-mid);
    border-color: var(--border);
}
.btn-ghost-dark:hover { background: #f0f0f0; color: var(--text-dark); }

.btn-danger { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn-danger:hover { opacity: 0.85; }

/* --- Blog Hero --- */
.blog-hero {
    position: relative;
    background: var(--gradient-dark);
    color: var(--white);
    padding: 5rem 2rem;
    text-align: center;
    overflow: hidden;
}

.blog-hero .hero-overlay {
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4a574' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.blog-hero .hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.hero-label {
    display: inline-block;
    background: rgba(212, 165, 116, 0.2);
    color: var(--primary);
    border: 1px solid rgba(212, 165, 116, 0.4);
    padding: 0.3rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.blog-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.blog-hero p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    max-width: 500px;
    margin: 0 auto;
}

/* --- Category Bar --- */
.category-bar {
    background: var(--secondary);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.pill {
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--text-mid);
    background: var(--white);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.pill:hover, .pill.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* --- Post Grid --- */
.posts-section { padding: 4rem 0; }

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

.post-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.post-card-image {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--secondary);
    overflow: hidden;
}

.post-card-image img,
.post-card-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: var(--secondary); /* hides black before video loads */
}

.post-card-image .image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0e8df, #e8ddd3);
}

.post-card-image .image-placeholder svg {
    width: 3rem;
    height: 3rem;
    color: var(--primary);
    opacity: 0.5;
}

.post-category-badge {
    position: absolute;
    top: 0.75rem;
    left: 28px;
    background: var(--primary);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.post-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.post-card-title a:hover { color: var(--primary-dark); }

.post-card-excerpt {
    color: var(--text-mid);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.post-author { font-weight: 600; color: var(--accent); }

/* --- Single Post Layout --- */
.post-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 2rem;
    align-items: start;
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.post-category-link {
    display: inline-block;
    background: var(--secondary);
    color: var(--accent);
    border: 1px solid var(--border);
    padding: 0.3rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    transition: background 0.2s;
}

.post-category-link:hover { background: var(--primary); color: var(--white); }

.post-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
}

.post-author { color: var(--accent); font-weight: 600; }
.meta-divider { color: var(--border); }

.post-lead {
    font-size: 1.15rem;
    color: var(--text-mid);
    line-height: 1.7;
    font-style: italic;
}

.post-featured-image {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-md);
}

.post-featured-image img,
.post-featured-image video { width: 100%; background-color: var(--secondary); }

/* Post Body Typography */
.post-body {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-dark);
}

.post-body h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    color: var(--text-dark);
}

.post-body h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
}

.post-body p { margin-bottom: 1.5rem; }

.post-body ul, .post-body ol {
    padding-left: 1.75rem;
    margin-bottom: 1.5rem;
}

.post-body li { margin-bottom: 0.5rem; }

.post-body strong { color: var(--accent); }

.post-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: var(--secondary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text-mid);
}

/* Post Footer */
.post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.post-tags { display: flex; gap: 0.5rem; }

.tag {
    padding: 0.3rem 0.9rem;
    background: var(--secondary);
    color: var(--accent);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border);
}

.post-nav-links { display: flex; gap: 0.75rem; }

/* --- Sidebar --- */
.post-sidebar { position: sticky; top: 5rem; }

.sidebar-widget {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.widget-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--accent);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary);
}

.category-list { list-style: none; }
.category-list li { margin-bottom: 0.5rem; }
.category-list a {
    color: var(--text-mid);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    display: block;
    transition: background 0.2s, color 0.2s;
}
.category-list a:hover, .category-list a.active {
    background: var(--secondary);
    color: var(--accent);
}

.recent-post-list { list-style: none; }
.recent-post-list li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}
.recent-post-list li:last-child { border-bottom: none; }
.recent-post-list a { color: var(--text-dark); font-weight: 500; line-height: 1.4; }
.recent-post-list a:hover { color: var(--primary-dark); }
.recent-date { display: block; color: var(--text-light); font-size: 0.75rem; margin-top: 0.2rem; }

.sidebar-cta {
    background: var(--gradient-dark);
    color: var(--white);
    border: none;
}
.sidebar-cta h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}
.sidebar-cta p { font-size: 0.85rem; opacity: 0.8; margin-bottom: 1rem; }

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-mid);
}
.empty-state svg { width: 4rem; height: 4rem; color: var(--border); margin: 0 auto 1rem; }
.empty-state h3 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 0.5rem; }
.empty-state p { margin-bottom: 1.5rem; }

/* --- Footer --- */
.footer {
    background: #1a1208;
    color: rgba(255,255,255,0.7);
    padding: 3rem 0 1.5rem;
    margin-top: 6rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.footer-brand h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.footer-brand p { font-size: 0.85rem; }

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links a {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--primary); }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
    font-size: 0.8rem;
}

.admin-link { color: rgba(255,255,255,0.3); font-size: 0.75rem; }
.admin-link:hover { color: var(--primary); }

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

.admin-body {
    background: #f5f5f5;
    min-height: 100vh;
}

/* --- Login Split --- */
.login-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.login-brand {
    background: var(--gradient-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.login-brand-content { max-width: 380px; color: var(--white); }

.brand-logo svg { width: 3rem; height: 3rem; color: var(--primary); margin-bottom: 1.5rem; }

.login-brand-content h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.brand-tagline { color: var(--primary); font-weight: 600; margin-bottom: 2rem; }

.brand-features { list-style: none; margin-bottom: 2.5rem; }
.brand-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}
.brand-features svg { width: 1rem; height: 1rem; color: var(--primary); flex-shrink: 0; }

.back-link { color: rgba(255,255,255,0.5); font-size: 0.85rem; }
.back-link:hover { color: var(--primary); }

.login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--white);
}

.login-form-content { width: 100%; max-width: 380px; }

.login-form-content h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.login-subtitle { color: var(--text-light); margin-bottom: 2rem; }

/* --- Forms --- */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-dark);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-dark);
    background: var(--white);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
}

.form-group textarea { resize: vertical; line-height: 1.6; }

.form-group small { display: block; color: var(--text-light); font-size: 0.78rem; margin-top: 0.35rem; }

.html-hint { color: var(--text-light); font-size: 0.78rem; font-weight: 400; }

.input-icon-wrapper { position: relative; }
.input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--text-light);
    pointer-events: none;
}
.form-group .input-icon-wrapper input { padding-left: 2.75rem; }

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slug-wrapper { display: flex; align-items: center; }
.slug-prefix {
    padding: 0.7rem 0.75rem;
    background: var(--secondary);
    border: 1.5px solid var(--border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
}
.slug-wrapper input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* --- Alert --- */
.alert {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* --- Admin Layout --- */
.admin-layout { min-height: calc(100vh - 60px); background: #f5f5f5; }

.admin-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

.admin-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-header h1 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
}

.admin-header p { color: var(--text-light); font-size: 0.88rem; }

.admin-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-filter {
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    user-select: none;
}

.stat-filter:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212,165,116,0.15);
}

.stat-filter.active {
    border-color: var(--primary);
    background: #fdf8f3;
    box-shadow: 0 0 0 3px rgba(212,165,116,0.2);
}

.stat-filter.active .stat-label {
    color: var(--primary);
    font-weight: 600;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label { color: var(--text-light); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* Admin Card */
.admin-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-card h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-dark);
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.admin-card-header h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
}

/* Posts Table */
.table-wrapper { overflow-x: auto; }

.posts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.posts-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--secondary);
    color: var(--text-mid);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.posts-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.posts-table tr:last-child td { border-bottom: none; }
.posts-table tr:hover td { background: rgba(212, 165, 116, 0.04); }

.post-title-cell a { font-weight: 600; color: var(--text-dark); }
.post-title-cell a:hover { color: var(--primary-dark); }
.post-slug { display: block; font-size: 0.75rem; color: var(--text-light); margin-top: 0.15rem; }

.category-tag {
    background: var(--secondary);
    color: var(--accent);
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge {
    padding: 0.2rem 0.65rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}
.status-badge.published { background: #d4edda; color: #155724; }
.status-badge.draft { background: #fff3cd; color: #856404; }

.date-cell { color: var(--text-light); white-space: nowrap; }

.actions-cell { white-space: nowrap; display: flex; gap: 0.5rem; align-items: center; }

.action-btn {
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: var(--font-body);
    transition: opacity 0.2s;
    text-decoration: none;
    display: inline-block;
}

.action-btn.edit { background: var(--secondary); color: var(--accent); }
.action-btn.edit:hover { background: var(--border); }
.action-btn.delete { background: #fde8e8; color: var(--danger); }
.action-btn.delete:hover { background: var(--danger); color: var(--white); }

.empty-table { padding: 2rem; text-align: center; color: var(--text-light); }
.text-muted { color: var(--text-light); }

/* Post Form Layout */
.post-form { padding: 0 0 3rem; }

.form-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    align-items: start;
}

.form-sidebar .admin-card { margin-bottom: 1rem; }

.form-actions { display: flex; flex-direction: column; gap: 0.5rem; }

.danger-zone { border-color: #fcc; }
.danger-zone h3 { color: var(--danger); border-color: #fcc; }

/* ── Quill Rich Text Editor (admin) ──────────────────────────────────────────*/
.quill-editor-container {
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    min-height: 420px;
    font-family: var(--font-body);
    font-size: 1rem;
    background: var(--white);
}

/* Override Quill toolbar to match admin card border colour */
.ql-toolbar.ql-snow {
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--secondary);
    font-family: var(--font-body);
}

.ql-container.ql-snow {
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.ql-editor { min-height: 380px; padding: 1rem 1.25rem; line-height: 1.75; }
.ql-editor.ql-blank::before { font-style: italic; color: var(--text-light); }

/* Toolbar button hover/active colours */
.ql-snow .ql-stroke { stroke: var(--accent); }
.ql-snow .ql-fill  { fill:   var(--accent); }
.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--primary-dark); }
.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill   { fill:   var(--primary-dark); }

.content-hint { color: var(--text-light); margin-top: 0.4rem; display: block; }

/* ── File input (styled) ─────────────────────────────────────────────────────*/
.file-input-hidden { display: none; }

.file-input-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    margin-bottom: 0.4rem;
}

.file-input-btn {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
    transition: background 0.2s;
}
.file-input-label:hover .file-input-btn { background: var(--border); }

.file-input-name {
    font-size: 0.82rem;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Featured image preview ──────────────────────────────────────────────────*/
.featured-image-preview {
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
}
.featured-image-preview img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}
.featured-image-current small {
    display: block;
    padding: 0.3rem 0.6rem;
    font-size: 0.78rem;
    color: var(--text-light);
    background: var(--secondary);
}

.guide-img-preview { margin-top: 0.5rem; }

/* ── Public post body — Quill output rendering ───────────────────────────────
   Ensures content saved by Quill renders correctly on the public blog.       */
.post-body { line-height: 1.8; color: var(--text-dark); }
.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
    font-family: var(--font-display);
    color: var(--accent);
    margin: 1.6rem 0 0.6rem;
}
.post-body p  { margin: 0 0 1rem; }
.post-body ul, .post-body ol { margin: 0 0 1rem 1.5rem; }
.post-body li { margin-bottom: 0.3rem; }
.post-body blockquote {
    border-left: 4px solid var(--primary);
    margin: 1.2rem 0;
    padding: 0.6rem 1.2rem;
    background: var(--secondary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-mid);
    font-style: italic;
}
.post-body pre, .post-body code {
    font-family: 'Courier New', monospace;
    background: #f4f0ec;
    border-radius: var(--radius-sm);
}
.post-body pre  { padding: 1rem; overflow-x: auto; margin-bottom: 1rem; }
.post-body code { padding: 0.15rem 0.4rem; font-size: 0.88em; }
.post-body img  { max-width: 100%; border-radius: var(--radius-sm); margin: 0.5rem 0; }
.post-body iframe { max-width: 100%; border-radius: var(--radius-sm); }
.post-body a    { color: var(--primary-dark); text-decoration: underline; }

/* Quill alignment classes used in rendered post content */
.post-body .ql-align-center  { text-align: center; }
.post-body .ql-align-right   { text-align: right; }
.post-body .ql-align-justify { text-align: justify; }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .post-layout { grid-template-columns: 1fr; }
    .post-sidebar { position: static; }
    .login-split { grid-template-columns: 1fr; }
    .login-brand { display: none; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .form-layout { grid-template-columns: 1fr; }
}

/* --- Role badges --- */
.role-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    vertical-align: middle;
    margin-left: 0.5rem;
}
.role-admin { background: var(--primary); color: var(--white); }
.role-author { background: var(--border); color: var(--text-dark); }

/* --- User management table --- */
.user-role-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}
.user-role-tag.admin { background: rgba(212,165,116,0.15); color: var(--accent); }
.user-role-tag.author { background: var(--secondary); color: var(--text-light); }

/* ── Two-column layout — editor ──────────────────────────────────────────────*/
.ql-editor .ql-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 0.5rem 0;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
}
.ql-col-pane {
    position: relative;
    min-height: 80px;
}
.ql-col-content {
    min-height: 64px;
    border: 1px dashed rgba(0,0,0,0.12);
    border-radius: 4px;
    padding: 0.5rem 0.65rem;
    outline: none;
    font-size: 0.9rem;
    line-height: 1.65;
}
.ql-col-content:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(212,165,116,0.15);
}
.ql-col-content img { max-width: 100%; height: auto; display: block; margin: 0.3rem 0; }
.ql-col-img-btn {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--secondary);
    color: var(--text-light);
    cursor: pointer;
    font-family: var(--font-body);
    line-height: 1.4;
}
.ql-col-img-btn:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* Toolbar two-column button */
.ql-snow.ql-toolbar .ql-twoColumn,
.ql-snow .ql-toolbar .ql-twoColumn { padding: 2px 4px; }
.ql-snow .ql-twoColumn svg { pointer-events: none; }

/* ── Image resize overlay (fixed — appended to body, not quill.root) ────────*/
.ql-img-overlay {
    position: fixed;
    box-sizing: border-box;
    border: 2px solid var(--primary);
    pointer-events: none;
    z-index: 9999;
}
.ql-img-size-label {
    position: absolute;
    top: -22px;
    left: 0;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-family: monospace;
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
}
.ql-img-resize-handle {
    position: absolute;
    right: -6px;
    bottom: -6px;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border: 2px solid #fff;
    border-radius: 2px;
    cursor: se-resize;
    pointer-events: auto;
}

/* ── Two-column layout — public post view ────────────────────────────────────*/
.post-body .ql-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}
.post-body .ql-col-pane    { min-height: 0; }
.post-body .ql-col-content {
    border: none;
    min-height: 0;
    padding: 0;
    font-size: inherit;
    line-height: inherit;
    outline: none;
}
.post-body .ql-col-content:focus { border: none; box-shadow: none; }
.post-body .ql-col-img-btn { display: none; }
.post-body .ql-col-pane img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

@media (max-width: 768px) {
    .posts-grid { grid-template-columns: 1fr; }
    .admin-header-content { flex-direction: column; align-items: flex-start; }
    .nav-menu { display: none; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .footer-content { flex-direction: column; }
    /* Columns stack on mobile */
    .ql-editor .ql-two-col,
    .post-body .ql-two-col { grid-template-columns: 1fr; }
}
