/* ============================================
   BLOG CSS – Café Santiago
   Shared styles for admin dashboard + public blog
   ============================================ */

/* ---- ADMIN LAYOUT ---- */
.admin-body {
    background: #f0f4f1;
    margin: 0;
    font-family: 'Rubik', sans-serif;
    color: #2d2d2d;
}
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 240px;
    background: #1c3829;
    min-height: 100vh;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-brand img {
    height: 36px;
    filter: brightness(0) invert(1);
}
.sidebar-brand span {
    color: white;
    font-size: 16px;
    font-weight: 600;
}
.sidebar-nav {
    padding: 16px 0;
    flex: 1;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    cursor: pointer;
    background: none;
    border-radius: 0;
    width: 100%;
    text-align: left;
    font-family: 'Rubik', sans-serif;
}
.nav-item:hover, .nav-item.active {
    color: white;
    background: rgba(255,255,255,0.08);
    border-left-color: #4caf80;
}
.nav-item i {
    width: 18px;
    text-align: center;
}
.nav-logout {
    margin-top: auto;
    color: rgba(255,100,100,0.8) !important;
}
.nav-logout:hover {
    background: rgba(255,0,0,0.1) !important;
    border-left-color: #ff6b6b !important;
    color: #ff6b6b !important;
}

/* Main */
.admin-main {
    margin-left: 240px;
    flex: 1;
    padding: 0;
    min-width: 0;
}
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    background: white;
    border-bottom: 1px solid #e5ece8;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.admin-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #1c3829;
    cursor: default;
}
.admin-content {
    padding: 28px 32px;
}

/* Buttons */
.btn-primary {
    background: #06543C;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    font-family: 'Rubik', sans-serif;
}
.btn-primary:hover { background: #044d37; color: white; }
.btn-secondary {
    background: white;
    color: #06543C;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: 2px solid #06543C;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: 'Rubik', sans-serif;
}
.btn-secondary:hover { background: #06543C; color: white; }
.btn-danger {
    background: #dc3545;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    font-family: 'Rubik', sans-serif;
}
.btn-danger:hover { background: #c82333; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e8ede9;
}
.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.bg-green { background: #e8f5ef; color: #06543C; }
.bg-blue  { background: #e8f0fc; color: #1a73e8; }
.bg-orange{ background: #fff3e0; color: #f57c00; }
.bg-purple{ background: #f3e8fd; color: #7c3aed; }
.stat-info {}
.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1c3829;
    line-height: 1;
}
.stat-label {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

/* Cards */
.admin-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e8ede9;
    overflow: hidden;
    margin-bottom: 24px;
}
.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #f0f4f1;
}
.admin-card-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1c3829;
    cursor: default;
}
.badge {
    background: #e8f5ef;
    color: #06543C;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Table */
.table-wrap { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-table th {
    background: #f7faf8;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #444;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e8ede9;
}
.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f4f1;
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafcfb; }
.post-title-cell span {
    font-weight: 500;
    color: #1c3829;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.status-published { background: #e8f5ef; color: #06543C; }
.status-draft     { background: #fff3e0; color: #e65100; }

/* Action Buttons */
.actions-cell { display: flex; gap: 6px; }
.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s;
    text-decoration: none;
}
.edit-btn    { background: #e8f0fc; color: #1a73e8; }
.edit-btn:hover { background: #1a73e8; color: white; }
.publish-btn { background: #e8f5ef; color: #06543C; }
.publish-btn:hover { background: #06543C; color: white; }
.unpublish-btn { background: #fff3e0; color: #e65100; }
.unpublish-btn:hover { background: #e65100; color: white; }
.delete-btn  { background: #fde8e8; color: #dc3545; }
.delete-btn:hover { background: #dc3545; color: white; }

/* ---- EDITOR LAYOUT ---- */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
}
.editor-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.editor-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 80px;
}
.form-group {
    margin-bottom: 0;
}
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5ece8;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Rubik', sans-serif;
    transition: border-color 0.2s;
    outline: none;
    color: #2d2d2d;
    background: white;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: #06543C;
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-input-title {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5ece8;
    border-radius: 8px;
    font-size: 22px;
    font-family: 'Rubik', sans-serif;
    font-weight: 600;
    transition: border-color 0.2s;
    outline: none;
    color: #1c3829;
}
.form-input-title:focus { border-color: #06543C; }
.form-input-title::placeholder { color: #aaa; font-weight: 400; }

/* Quill Editor */
.quill-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e8ede9;
    overflow: hidden;
}
#quill-editor {
    min-height: 450px;
    font-family: 'Rubik', sans-serif;
    font-size: 16px;
    line-height: 1.8;
}
.ql-toolbar.ql-snow {
    border: none !important;
    border-bottom: 1px solid #e8ede9 !important;
    padding: 12px 16px !important;
    background: #f7faf8;
}
.ql-container.ql-snow {
    border: none !important;
    font-family: 'Rubik', sans-serif !important;
}
.ql-editor { padding: 20px 24px !important; min-height: 420px; }
.ql-editor p { margin-bottom: 12px; }
.ql-snow .ql-stroke { stroke: #555; }
.ql-snow .ql-fill  { fill: #555; }
.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: #06543C; }
.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill  { fill: #06543C; }

/* Cover Image Preview */
.cover-preview {
    width: 100%;
    height: 160px;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 10px;
    display: none;
    background: #f0f4f1;
}
.cover-preview.show { display: block; }
.cover-placeholder {
    width: 100%;
    height: 120px;
    border-radius: 8px;
    background: #f0f4f1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 13px;
    margin-bottom: 10px;
    border: 2px dashed #d0dbd4;
    flex-direction: column;
    gap: 8px;
}
.cover-placeholder i { font-size: 28px; }

/* Status Toggle */
.status-toggle {
    display: flex;
    gap: 8px;
}
.toggle-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #e5ece8;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
    background: white;
    font-family: 'Rubik', sans-serif;
    color: #666;
}
.toggle-btn.active-draft   { border-color: #f57c00; background: #fff3e0; color: #e65100; }
.toggle-btn.active-publish { border-color: #06543C; background: #e8f5ef; color: #06543C; }

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1c3829;
    color: white;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 999;
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #c82333; }
.toast.success { background: #06543C; }

/* ---- PUBLIC BLOG ---- */
.blog-hero {
    background-image: url(/cdn/para_01.jpg);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    padding: 100px 20px 80px;
    text-align: center;
}
.blog-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(6, 84, 60, 0.72);
}
.blog-hero-content {
    position: relative;
    z-index: 2;
}
.blog-hero h1 {
    color: white;
    font-size: 52px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -1px;
    cursor: default;
}
.blog-hero p {
    color: rgba(255,255,255,0.85);
    font-size: 18px;
    max-width: 500px;
    margin: 0 auto;
}

/* Blog listing */
.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-top: 40px;
}
.blog-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}
.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
}
.blog-card-img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    background: #e8f5ef;
    display: block;
}
.blog-card-img-placeholder {
    width: 100%;
    height: 210px;
    background: linear-gradient(135deg, #e8f5ef 0%, #c8e6d9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #06543C;
}
.blog-card-body { padding: 22px; }
.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.blog-cat-badge {
    background: #e8f5ef;
    color: #06543C;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.blog-date {
    font-size: 12px;
    color: #999;
}
.blog-card-title {
    font-size: 17px;
    font-weight: 600;
    color: #1c3829;
    margin-bottom: 10px;
    line-height: 1.4;
    cursor: default;
}
.blog-card-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-clamp: 3;
    overflow: hidden;
}
.blog-card-footer {
    padding: 14px 22px;
    border-top: 1px solid #f0f4f1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.blog-read-more {
    font-size: 13px;
    font-weight: 600;
    color: #06543C;
    display: flex;
    align-items: center;
    gap: 6px;
}
.blog-views {
    font-size: 12px;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 4px;
}
.blog-section-title {
    text-align: center;
    margin-bottom: 12px;
}
.blog-section-title h2 {
    font-size: 42px;
    font-weight: 700;
    color: #1c3829;
    letter-spacing: -1px;
    cursor: default;
}
.blog-section-subtitle {
    text-align: center;
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
}
.blog-section-line {
    width: 60px;
    height: 3px;
    background: #06543C;
    border-radius: 2px;
    margin: 14px auto 0;
}
.blog-no-posts {
    text-align: center;
    padding: 80px 20px;
    color: #888;
}
.blog-no-posts i { font-size: 3rem; margin-bottom: 16px; display: block; color: #c8e6d9; }

/* Single Article */
.article-hero {
    position: relative;
    height: 480px;
    overflow: hidden;
}
.article-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.article-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(6,84,60,0.7) 100%);
}
.article-hero-noimg {
    height: 300px;
    background: linear-gradient(135deg, #1c3829 0%, #06543C 100%);
    display: flex;
    align-items: flex-end;
    padding: 0 40px 40px;
}
.article-hero-content {
    position: absolute;
    bottom: 40px;
    left: 0;
    right: 0;
    padding: 0 40px;
}
.article-hero-content .blog-cat-badge {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}
.article-hero-content h1 {
    color: white;
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    max-width: 800px;
    margin: 12px 0 16px;
    cursor: default;
}
.article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}
.article-meta i { margin-right: 4px; }
.article-body-wrap {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 20px 80px;
}
.article-body {
    font-size: 17px;
    line-height: 1.85;
    color: #333;
}
.article-body h2, .article-body h3 {
    color: #1c3829;
    margin: 36px 0 14px;
    cursor: default;
}
.article-body h2 { font-size: 26px; }
.article-body h3 { font-size: 21px; }
.article-body p  { margin-bottom: 20px; }
.article-body img { max-width: 100%; border-radius: 10px; margin: 20px 0; }
.article-body ul, .article-body ol { padding-left: 24px; margin-bottom: 20px; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
    border-left: 4px solid #06543C;
    padding: 16px 20px;
    background: #f0f9f5;
    border-radius: 0 8px 8px 0;
    margin: 24px 0;
    font-style: italic;
    color: #444;
}
.article-body a { color: #06543C; text-decoration: underline; }
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e8ede9;
}
.article-tag {
    background: #f0f9f5;
    color: #06543C;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid #c8e6d9;
}
.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #06543C;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 32px;
    font-size: 15px;
}
.back-to-blog:hover { text-decoration: underline; }

/* Homepage blog section */
.homepage-blog-section {
    padding: 80px 20px;
    background: #f7faf8;
}
.homepage-blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 40px auto 0;
}
.homepage-blog-section .view-all-btn {
    display: block;
    text-align: center;
    margin-top: 40px;
}
.homepage-blog-section .view-all-btn a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 2px solid #06543C;
    color: #06543C;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.2s;
}
.homepage-blog-section .view-all-btn a:hover {
    background: #06543C;
    color: white;
}

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 52px;
}
.page-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #e5ece8;
    background: white;
    color: #444;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
}
.page-btn:hover, .page-btn.active {
    background: #06543C;
    border-color: #06543C;
    color: white;
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .blog-grid, .homepage-blog-grid { grid-template-columns: repeat(2, 1fr); }
    .editor-layout { grid-template-columns: 1fr; }
    .editor-sidebar { position: static; }
}
@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-240px); transition: transform 0.3s; }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .blog-grid, .homepage-blog-grid { grid-template-columns: 1fr; }
    .blog-hero h1 { font-size: 34px; }
    .article-hero-content { padding: 0 20px; }
    .article-hero-content h1 { font-size: 26px; }
    .article-body-wrap { padding: 28px 16px 60px; }
    .admin-content { padding: 20px 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
