/* FlipAll5 Blog Styles - Mobile First */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Base: mobile defaults ───────────────────────────────── */
html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #3498db;
    min-height: 100vh;
    padding: 10px;
    line-height: 1.7;
    color: #333;
    font-size: 1rem;
}

.blog-container {
    background: rgba(168, 216, 234, 0.9);
    border-radius: 12px;
    padding: 15px;
    max-width: 1200px;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ── Header ─────────────────────────────────────────────── */
.blog-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(44, 95, 124, 0.2);
}

.title-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.blog-logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: white;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

h1 {
    font-size: 1.4rem;
    font-weight: bold;
    color: #2c5f7c;
}

.tagline {
    font-size: 0.85rem;
    color: #2c5f7c;
    font-style: italic;
    opacity: 0.85;
}

.header-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    background: #2c5f7c;
    color: white;
    border: none;
    padding: 9px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn:hover {
    background: #1a3a4d;
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.7);
    color: #2c5f7c;
    border: 2px solid #2c5f7c;
}

.btn-secondary:hover {
    background: white;
}

.btn-danger {
    background: #d32f2f;
}

.btn-danger:hover {
    background: #b71c1c;
}

/* ── Post Grid ───────────────────────────────────────────── */
.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.post-featured-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, #3498db 0%, #2c5f7c 100%);
}

.post-content {
    padding: 16px;
}

.post-category {
    display: inline-block;
    background: rgba(44, 95, 124, 0.1);
    color: #2c5f7c;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.post-title {
    color: #2c5f7c;
    font-size: 1.2rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.post-title a {
    color: inherit;
    text-decoration: none;
}

.post-title a:hover {
    color: #ff6b35;
}

.post-excerpt {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #666;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 6px;
}

.post-date { font-style: italic; }

.read-more {
    color: #2c5f7c;
    font-weight: 600;
    text-decoration: none;
}

.read-more:hover { color: #ff6b35; }

/* ── Single Post ─────────────────────────────────────────── */
.post-single {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
}

.post-single h1 {
    color: #2c5f7c;
    margin-bottom: 12px;
    font-size: 1.7rem;
    line-height: 1.3;
}

.post-single h2 {
    color: #2c5f7c;
    margin-top: 25px;
    margin-bottom: 12px;
    font-size: 1.4rem;
    line-height: 1.3;
}

.post-single h3 {
    color: #2c5f7c;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.post-single p {
    margin-bottom: 15px;
    color: #333;
    line-height: 1.8;
    font-size: 1rem;
}

.post-single ul,
.post-single ol {
    margin-bottom: 15px;
    margin-left: 24px;
}

.post-single li {
    margin-bottom: 8px;
    font-size: 1rem;
    line-height: 1.7;
}

.post-single img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

.post-single code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.post-single pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 15px;
}

.post-single blockquote {
    border-left: 4px solid #2c5f7c;
    padding-left: 16px;
    margin: 16px 0;
    font-style: italic;
    color: #555;
}

/* ── Related Posts ───────────────────────────────────────── */
.related-posts { margin-top: 40px; }

.related-posts h3 {
    color: #2c5f7c;
    margin-bottom: 16px;
    font-size: 1.2rem;
}

.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* ── Categories ──────────────────────────────────────────── */
.categories-list {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.categories-list h3 {
    color: #2c5f7c;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.categories-list ul { list-style: none; }

.categories-list li { margin-bottom: 8px; }

.categories-list a {
    color: #2c5f7c;
    text-decoration: none;
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.categories-list a:hover {
    background: rgba(44, 95, 124, 0.1);
}

/* ── Admin ───────────────────────────────────────────────── */
.admin-container { max-width: 1400px; }

.admin-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #2c5f7c;
}

.stat-label {
    color: #666;
    font-size: 0.85rem;
    margin-top: 4px;
}

.posts-table {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

table { width: 100%; border-collapse: collapse; }

th {
    background: rgba(44, 95, 124, 0.1);
    color: #2c5f7c;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9rem;
}

tr:hover { background: rgba(44, 95, 124, 0.05); }

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-published { background: rgba(76, 175, 80, 0.2); color: #2e7d32; }
.status-draft { background: rgba(158, 158, 158, 0.2); color: #424242; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    color: #2c5f7c;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2c5f7c;
}

.form-group textarea {
    min-height: 280px;
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 25px;
}

.form-actions .btn { width: 100%; text-align: center; }

/* ── Flash Messages ──────────────────────────────────────── */
.flash-messages { margin-bottom: 16px; }

.flash {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.flash-success { background: rgba(76, 175, 80, 0.2); color: #2e7d32; border-left: 4px solid #4caf50; }
.flash-error   { background: rgba(211, 47, 47, 0.2); color: #b71c1c; border-left: 4px solid #d32f2f; }
.flash-info    { background: rgba(33, 150, 243, 0.2); color: #1565c0; border-left: 4px solid #2196f3; }

/* ── Login Form ──────────────────────────────────────────── */
.login-container {
    max-width: 400px;
    margin: 40px auto;
    background: white;
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

/* ── Footer ──────────────────────────────────────────────── */
.blog-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 16px;
    border-top: 2px solid rgba(44, 95, 124, 0.2);
    color: #2c5f7c;
    font-size: 0.9rem;
}

/* ── Modal ───────────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 92%;
    max-width: 800px;
    max-height: 90vh;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.modal-content h2 {
    color: #2c5f7c;
    margin: 0;
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
    font-size: 1.4rem;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    font-size: 1rem;
    line-height: 1.7;
}

.modal-body h3 { color: #2c5f7c; margin-top: 20px; margin-bottom: 10px; font-size: 1.2rem; }
.modal-body h4 { color: #2c5f7c; margin-top: 16px; margin-bottom: 8px; font-size: 1.05rem; }
.modal-body p  { margin-bottom: 12px; color: #333; }
.modal-body ul { margin-bottom: 12px; margin-left: 22px; }
.modal-body li { margin-bottom: 6px; }
.modal-body a  { color: #2c5f7c; text-decoration: underline; }
.modal-body a:hover { color: #ff6b35; }

.modal-close {
    color: #999;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    padding: 16px 20px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover { color: #d32f2f; }

/* ── Cookie Banner ───────────────────────────────────────── */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 3px solid #2c5f7c;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    z-index: 999;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cookie-content p { margin: 0; color: #333; line-height: 1.5; font-size: 0.95rem; }

.cookie-content strong {
    color: #2c5f7c;
    font-size: 1rem;
    display: block;
    margin-bottom: 6px;
}

.cookie-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cookie-actions .btn { width: 100%; text-align: center; }

/* ── Tablet: 600px+ ──────────────────────────────────────── */
@media (min-width: 600px) {
    body { padding: 15px; }

    .blog-container { padding: 20px; }

    h1 { font-size: 1.7rem; }

    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .related-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .post-single { padding: 28px; }
    .post-single h1 { font-size: 2rem; }
    .post-single h2 { font-size: 1.6rem; }

    .admin-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .admin-stats {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .form-actions {
        flex-direction: row;
    }

    .form-actions .btn { width: auto; }

    .cookie-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 20px 28px;
    }

    .cookie-actions {
        flex-direction: row;
        flex-shrink: 0;
    }

    .cookie-actions .btn { width: auto; }

    .login-container { margin: 60px auto; padding: 35px; }
}

/* ── Desktop: 900px+ ─────────────────────────────────────── */
@media (min-width: 900px) {
    body { padding: 20px; }

    .blog-container { padding: 30px; }

    h1 { font-size: 2rem; }

    .blog-logo { width: 60px; height: 60px; }

    .post-single { padding: 40px; }
    .post-single h1 { font-size: 2.5rem; }
    .post-single h2 { font-size: 1.8rem; }
    .post-single h3 { font-size: 1.4rem; }

    .modal-content { margin: 5% auto; width: auto; }
    .modal-content h2 { padding: 25px 30px; font-size: 1.8rem; }
    .modal-body { padding: 30px; }
}
