/* ============================
   Blog Styles (scoped)
   ============================ */

.blog-container {
    width: 80%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 25px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    font-family: 'Roboto', Arial, sans-serif;
    color: #333;
}

/* Responsive tweak */
@media (max-width: 768px) {
    .blog-container { width: 95%; }
}

.blog-container h1,
.blog-container h2,
.blog-container h3 {
    font-family: 'Montserrat', sans-serif;
    color: #001f5f;
    margin-top: 1.4em;
    margin-bottom: 0.6em;
    font-weight: 600;
}

.blog-container p {
    margin-bottom: 1.1em;
    line-height: 1.8;
    font-size: 17px;
}

.blog-container ul,
.blog-container ol {
    margin: 1em 0 1em 1.5em;
    padding: 0;
}

.blog-container li { margin-bottom: 0.5em; }

/* Links inside blog */
.blog-container a { color: #2563eb; text-decoration: none; }
.blog-container a:hover { color: #1d4ed8; }

/* Code blocks */
.blog-container pre {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.95rem;
    line-height: 1.5;
}
.blog-container code {
    font-family: monospace;
    background: #f1f1f1;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.95rem;
}


/* Blockquotes */
.blog-container blockquote {
    border-left: 4px solid #003366;
    margin: 1em 0;
    padding: 0.5em 1em;
    background: #f9f9f9;
    font-style: italic;
    color: #555;
}

/* Post Form */
.blog-container form {
    max-width: 700px;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.blog-container .form-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
.blog-container label {
    font-weight: 600;
    color: #001f5f;
    font-family: 'Montserrat';
    font-size: 15px;
}
.blog-container input[type="text"],
.blog-container textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1rem;
    font-family: 'Roboto', Arial, sans-serif;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.blog-container input[type="text"]:focus,
.blog-container textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.25);
    outline: none;
}
.blog-container button {
    align-self: flex-start;
    padding: 10px 20px;
    background: #003087;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.blog-container button:hover { background: #001f5f; }

/* Markdown Preview */
.preview-box {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
    min-height: 120px;
    font-size: 16px;
    line-height: 1.6;
}
.preview-box h1, .preview-box h2, .preview-box h3 { margin-top: 1em; margin-bottom: 0.5em; color: #001f5f; }
.preview-box pre {
    background: #272822;
    color: #f8f8f2;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.9rem;
}

/* Post Meta & Actions */
.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    font-size: 0.9rem;
    color: #555;
}
.post-actions { display: flex; gap: 12px; margin-top: 20px; align-items: center; }
.inline-form { display: inline; }

.action-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 6px; font-size: 14px;
    font-weight: 500; text-decoration: none;
    cursor: pointer; transition: background 0.2s, transform 0.15s;
}
.action-btn:hover { transform: translateY(-1px); }
.action-btn.edit-btn { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; }
.action-btn.edit-btn:hover { background: #e0f2fe; }
.action-btn.delete-btn { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.action-btn.delete-btn:hover { background: #fee2e2; }
.action-btn.back-btn { background: #f9fafb; color: #374151; border: 1px solid #d1d5db; }
.action-btn.back-btn:hover { background: #f3f4f6; }

/* Blog / Author Links */
.blog-link, .author-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}
.blog-link:hover, .author-link:hover {
    text-decoration: underline;
    color: #1a73e8;
}

/* Counters */
.counter { display: block; font-size: 0.85em; color: #555; margin-top: 4px; }
.counter.limit-reached { color: red; font-weight: bold; }

/* Markdown Preview Box */
.markdown-preview {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f9f9f9;
    font-size: 0.95em; line-height: 1.6; color: #222;
    white-space: pre-wrap; word-wrap: break-word;
}
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3 {
    margin-top: 1em; margin-bottom: 0.5em; color: #0b357a;
}
.markdown-preview pre {
    background: #272822; color: #f8f8f2;
    padding: 10px; border-radius: 4px; overflow-x: auto;
}
.markdown-preview code { font-family: Consolas, Monaco, "Courier New", monospace; }

/* Preview Wrapper */
.preview-wrapper { margin-top: 30px; }
.preview-label { font-size: 1.1em; font-weight: 600; margin-bottom: 8px; color: #0b357a; }

/* Social Section */
.social-entry {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.social-entry select, .social-entry input[type="text"] {
    flex: 1; padding: 8px 12px; border: 1px solid #ccc; border-radius: 6px;
    font-size: 0.95rem; font-family: 'Roboto', Arial, sans-serif;
    background: #fff; box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.social-entry select:focus, .social-entry input[type="text"]:focus {
    border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.25);
    outline: none;
}
.btn-add-social {
    display: inline-block; margin-top: 12px; padding: 8px 14px;
    background: #0b357a; color: #fff; border: none; border-radius: 6px;
    font-size: 14px; font-weight: 500; cursor: pointer;
    transition: background 0.2s;
}
.btn-add-social:hover { background: #092a5c; }
.remove-social {
    flex-shrink: 0; padding: 6px 10px; border: none; border-radius: 6px;
    background: #f87171; color: #fff; font-size: 14px;
    cursor: pointer; transition: background 0.2s;
}
.remove-social:hover { background: #dc2626; }

/* Dropdown styles */
.dropdown { position: relative; }
.dropdown > a { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%; right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    list-style: none;
    padding: 8px 0;
    margin: 6px 0 0 0;
    min-width: 180px;
    z-index: 1000;
}
.dropdown-menu li { padding: 0; }
.dropdown-menu li a {
    display: block; padding: 10px 16px; color: #333;
    text-decoration: none; font-size: 14px;
    transition: background 0.2s ease;
}
.dropdown-menu li a:hover { background: #f5f5f5; }
/* Show dropdown on hover */
.dropdown:hover .dropdown-menu { display: block; }

/* Image Upload Preview */
.preview-container { margin-top: 10px; }
.preview-canvas {
    border: 1px solid #ddd;
    border-radius: 6px;
    display: block;
    margin-top: 8px;
    max-width: 100%;
}

/* ============================
   Thumbnails & Featured Images
   ============================ */

.post-thumb {
    width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 12px;
    display: block;
}

.post-image-wrapper {
    margin: 20px 0;
    text-align: center;
}

.post-main-image {
    max-width: 100%;
    height: auto;
    margin: 1.5em auto;
    border-radius: 8px;
    display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.blog-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}
.blog-card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}
.blog-card-body { padding: 1rem; flex-grow: 1; }
.blog-card-title { font-size: 1.25rem; margin: 0 0 0.5rem 0; }
.blog-card-title a { color: #111; text-decoration: none; }
.blog-card-title a:hover { text-decoration: underline; }
.blog-card-excerpt { color: #555; font-size: 0.95rem; line-height: 1.4; }

/* Footer layout */
.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f7f7f7;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: #444;
}

/* Author section */
.author-meta {
    display: flex;
    align-items: center;
    gap: 2px; /* space between avatar and name/socials */
}
.author-avatar {
    width: 40px;   /* bigger avatar */
    height: 40px;
    border-radius: 50%;
    margin-right: 0.6rem;
    object-fit: cover;
    border: 1px solid #fff;       /* subtle white border */
    box-shadow: 0 1px 4px rgba(0,0,0,0.15); /* soft shadow */
}
.author-details {
    display: flex;
    align-items: center;
    gap: 6px; /* space between name and socials */
}
.author-name {
    font-weight: 600;
    color: #555;
    text-decoration: none;
}
.author-name:hover { color: #000; }
.blog-card-footer .author-name,
.blog-card-footer .author-link {
    color: #6c757d;
    text-decoration: none;
    font-weight: 500;
}
.blog-card-footer .author-name:hover,
.blog-card-footer .author-link:hover {
    color: #343a40;
    text-decoration: underline;
}

/* Socials */
.author-socials a {
    color: inherit;
    font-size: 0.9em;
    transition: color 0.2s ease-in-out;
}
/* Brand colors on hover */
.author-socials a:hover .fa-linkedin { color: #0a66c2; }
.author-socials a:hover .fa-instagram { color: #e4405f; }
.author-socials a:hover .fa-x-twitter { color: #000; }

