@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Playfair+Display:wght@600;700&family=Fira+Code:wght@400&display=swap');

:root {
    /* Light Mode (Default) - Clean, Stark, Minimal */
    --bg-color: #ffffff;
    --bg-secondary: #f4f4f5; /* Zinc-100 */
    --text-primary: #09090b; /* Zinc-950 */
    --text-secondary: #71717a; /* Zinc-500 */
    --border-color: #e4e4e7; /* Zinc-200 */
    
    --primary-color: #000000;
    --primary-text: #ffffff;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-full: 9999px; /* Pill shapes */
    
    --font-ui: 'Inter', sans-serif;
    --font-heading: 'Playfair Display', serif;
    --font-mono: 'Fira Code', monospace;
    
    --shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --bg-color: #000000;
    --bg-secondary: #18181b;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --border-color: #27272a;
    
    --primary-color: #ffffff;
    --primary-text: #000000;
}

/* --- RESET & BASE --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-ui); background: var(--bg-color); color: var(--text-primary); transition: background 0.3s ease, color 0.3s ease; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.7; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* --- NAVBAR --- */
.navbar { position: sticky; top: 0; z-index: 100; background: var(--bg-color); border-bottom: 1px solid var(--border-color); height: 55px; display: flex; align-items: center; }
.nav-container { max-width: 1000px; width: 100%; margin: 0 auto; padding: 0 24px; display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: var(--font-heading); font-weight: 700; font-size: 1.5rem; display: flex; align-items: center; gap: 8px; letter-spacing: -0.5px; }

/* --- BUTTONS (Rounded & Pill) --- */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; font-size: 0.9rem; font-weight: 500; border-radius: var(--radius-full); border: 1px solid transparent; transition: all 0.2s; gap: 6px; }
.btn-primary { background: var(--primary-color); color: var(--primary-text); }
.btn-primary:hover { opacity: 0.8; }
.btn-secondary { background: transparent; border-color: var(--border-color); color: var(--text-primary); }
.btn-secondary:hover { background: var(--bg-secondary); }
.btn-danger { background: #ef4444; color: white; border: none; }
.btn-icon { padding: 8px; border-radius: 50%; border: 1px solid var(--border-color); background: transparent; color: var(--text-primary); }
.btn-icon:hover { background: var(--bg-secondary); }

input{
    border-radius: 50px !important;
}
textarea{
    resize: vertical;
}
input, textarea { width: 100%; padding: 12px 16px; background: var(--bg-color); border: 1px solid var(--border-color); border-radius: var(--radius-md); color: var(--text-primary); font-family: var(--font-ui); outline: none; transition: border-color 0.2s; }
input:focus, textarea:focus { border-color: var(--text-primary); }
label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }

/* --- CARDS & LAYOUT --- */
.container { max-width: 800px; margin: 0 auto; padding: 48px 24px; min-height: 80vh; }
.card { border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 24px; background: var(--bg-color); transition: border-color 0.2s; }
.card:hover { border-color: var(--text-secondary); }

/* --- BLOG GRID --- */
.blog-grid { display: flex; flex-direction: column; gap: 24px; }
/* --- UNIFIED CARD STYLE (Feed & Search) --- */
.blog-item {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 32px 0;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none; /* Remove default link underline */
    color: inherit;
}
/* --- DESKTOP (Default) --- */
.blog-item { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    gap: 30px; 
    padding: 32px 0;
    border-bottom: 1px solid var(--border-color);
}

.blog-item-content { 
    flex: 1; 
}

.blog-item-image-wrapper { 
    width: 150px; 
    height: auto; 
    flex-shrink: 0; 
}

.blog-item-image-wrapper img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    border-radius: 20px; 
}
.blog-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
@media (max-width: 650px) {
    .blog-item {
        flex-direction: column-reverse;
        gap: 20px;
    }

    .blog-item-image-wrapper {
        width: 100%;
        height: auto; 
        aspect-ratio: 16 / 9;
        margin-bottom: 10px;
    }

    .blog-item-image-wrapper img {
        border-radius: 20px;
    }

    .blog-item-title {
        font-size: 1.4rem;
    }
}
.blog-item-content { flex: 1; }

.blog-item-thumbnail {
    width: 160px;
    height: auto;
    object-fit: cover;
    background: var(--bg-secondary);
}

@media(max-width: 600px) {
    .blog-item { flex-direction: column-reverse; }
    .blog-item-thumbnail { width: 100%; height: auto; aspect-ratio: 16/9; margin-bottom: 20px; }
}
/* --- NEW FIXES: PERFECT SQUARE THUMBNAILS --- */

/* Force all thumbnails into perfect squares */
.blog-item-thumbnail, 
.blog-item-image-wrapper img, 
.search-card-thumbnail {
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
}

/* Base Desktop Square Size */
.blog-item-thumbnail-link {
    width: 130px !important;
    height: 130px !important;
    flex-shrink: 0 !important;
    display: block !important;
}

/* Mobile Square Size Adjustment */
@media (max-width: 650px) {
    .blog-item-thumbnail-link,
    .blog-item-image-wrapper, 
    .blog-item-thumbnail, 
    .search-card-thumbnail {
        width: 100px !important;
        height: 100px !important;
        aspect-ratio: 1 / 1 !important;
    }
}
/* --- TAG PILLS --- */
.tag-pill {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 99px;
    transition: all 0.2s;
    text-decoration: none;
    border: 1px solid transparent;
}

.tag-pill:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.blog-item:last-child { border-bottom: none; }
.blog-title { font-family: var(--font-heading); font-size: 1.75rem; font-weight: 700; margin-bottom: 8px; line-height: 1.2; letter-spacing: -0.02em; }
.blog-meta { font-size: 0.85rem; color: var(--text-secondary); display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.author-pill { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--text-primary); }
.author-pill img { width: 20px; height: 20px; border-radius: 50%; }

:root {
    --radius-pill: 99px;
}

.auth-full-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-ui);
    padding: 50px 24px;
}

.auth-pill-card {
    width: 100%;
    max-width: 420px;
}

/* Floating Label Logic */
.floating-group {
    position: relative;
    margin-bottom: 20px;
}

.floating-input {
    width: 100%;
    padding: 18px 24px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s ease;
}

.floating-input::placeholder { color: transparent; }

.floating-label {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-color); /* Matches background to hide border line */
    padding: 0 6px;
    color: var(--text-secondary);
    pointer-events: none;
    transition: all 0.2s ease;
}

.floating-input:focus + .floating-label,
.floating-input:not(:placeholder-shown) + .floating-label {
    top: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.floating-input:focus {
    border-color: var(--text-primary);
}

/* Google & Buttons */
.btn-google {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-google:hover { background: var(--bg-secondary); }

.btn-primary {
    background: var(--primary-color);
    color: var(--primary-text);
    border: none;
    border-radius: var(--radius-pill);
    font-weight: 600;
    cursor: pointer;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 32px 0;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}
.divider::before { margin-right: 1rem; }
.divider::after { margin-left: 1rem; }
/* --- SINGLE POST --- */
.post-header { margin-bottom: 40px; text-align: center; }
.post-header h1 { font-family: var(--font-heading); font-size: 3rem; line-height: 1.1; margin-bottom: 24px; letter-spacing: -0.03em; }
.prose { font-family: var(--font-body); font-size: 1.125rem; line-height: 1.8; color: var(--text-primary); }
.prose p { margin-bottom: 1.5rem; }
.prose h1, .prose h2 { font-family: var(--font-heading); font-weight: 700; margin-top: 2.5rem; margin-bottom: 1rem; line-height: 1.2; }
.prose img { max-width: 100%; border-radius: var(--radius-md); margin: 2rem 0; box-shadow: var(--shadow); cursor: zoom-in; }

/* --- COMMENTS & LIKES --- */
.interaction-bar { border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); padding: 16px 0; margin: 40px 0; display: flex; justify-content: space-between; align-items: center; }
.like-btn { display: flex; align-items: center; gap: 8px; background: none; border: none; font-size: 1rem; color: var(--text-secondary); transition: 0.2s; }
.like-btn:hover, .like-btn.active { color: #ef4444; }
.comment-list { margin-top: 32px; display: flex; flex-direction: column; gap: 20px; }
.comment { display: flex; gap: 12px; }
.comment-avatar { width: 32px; height: 32px; border-radius: 50%; }
.comment-content { background: var(--bg-secondary); padding: 12px 16px; border-radius: var(--radius-md); width: 100%; }
.comment-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.comment-text { font-size: 0.95rem; }
.comment-name a:hover {
    opacity: 0.8;
}
#author-embed-trigger,#save-btn{
    padding: 10px;
}
.comment-avatar:hover {
    opacity: 0.9;
    transform: scale(1.02);
    transition: 0.2s;
}
.interaction-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 20px 0; 
    border-top: 1px solid var(--border-color); 
    border-bottom: 1px solid var(--border-color);
    margin: 50px 0;
}
.action-btn { background: none; border: none; display: flex; align-items: center; gap: 6px; color: var(--text-secondary); cursor: pointer; font-size: 0.95rem; font-weight: 500; }
.action-btn:hover { color: var(--text-primary); }

/* Comment UI Fix */
.comments-section h3 { font-family: var(--font-heading); margin-bottom: 24px; font-size: 1.5rem; }
.comment-input-wrapper { 
    background: var(--bg-secondary); 
    border-radius: 24px; 
    padding: 10px; 
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
}
.comment-input-wrapper textarea { 
    border: none; background: transparent; width: 100%; resize: none; font-size: 1rem; padding: 0; border-radius: 0px;
}
.comment-controls { display: flex; justify-content: flex-end; border-top: 1px solid var(--border-color); padding-top: 12px; }
.comment-date { font-size: 0.75rem; color: var(--text-secondary); font-weight: 400; }
/* --- AUTHOR PROFILE --- */
.profile-header { text-align: center; margin-bottom: 20px; padding-bottom: 20px; }
.profile-avatar-lg { width: 128px; height: 128px; border-radius: 50%; object-fit: cover; margin-bottom: 16px; border: 4px solid var(--bg-secondary); }
.profile-name { font-family: var(--font-heading); font-size: 2rem; font-weight: 700; margin-bottom: 4px; }
.profile-handle { color: var(--text-secondary); font-size: 1rem; margin-bottom: 16px; }
.profile-bio { max-width: 500px; margin: 0 auto; color: var(--text-primary); line-height: 1.6; }
/* --- APPEND TO css/style.css --- */

/* --- PROFILE & AUTHOR PAGE --- */
.profile-wrapper {
    max-width: 700px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
}

.profile-avatar-lg {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 4px solid var(--bg-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.profile-name {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.2;
    color: var(--text-primary);
}

.profile-handle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-family: var(--font-mono);
}

.profile-bio {
    font-size: 1.05rem;
    color: var(--text-primary);
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto 24px auto;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.2rem;
    transition: all 0.2s;
}

.social-icon:hover {
    background: var(--text-primary);
    color: var(--bg-color);
}

/* --- SETTINGS PAGE LAYOUT --- */
.settings-grid {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 40px;
}

@media(max-width: 768px) {
    .settings-grid { grid-template-columns: 1fr; gap: 24px; }
    .settings-header { flex-direction: row; align-items: center; gap: 20px; }
}

.avatar-upload-box {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto;
    cursor: pointer;
    group: hover;
}

.avatar-edit-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.avatar-upload-box:hover .avatar-edit-overlay { opacity: 1; }

.form-group { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* --- SKELETON LOADERS --- */
.skel-avatar {
    width: 140px; height: 140px; border-radius: 50% !important;
    margin: 0 auto 20px auto;
}
/* --- APPEND TO css/style.css --- */

/* Feed Layout Enhancements */
.explore-header {
    margin-bottom: 60px;
    text-align: left;
}

.explore-header h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    letter-spacing: -2px;
    margin-bottom: 8px;
}

.explore-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Refined Blog Item for Feed */
.blog-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 32px 0;
    border-bottom: 1px solid var(--border-color);
}

.blog-item:first-child { padding-top: 0; }

.blog-item .blog-title {
    font-size: 1.8rem;
    line-height: 1.25;
    color: var(--text-primary);
    font-weight: 700;
}

.blog-item .blog-excerpt {
    font-size: 1.05rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 4px;
}

/* Explore Skeletons */
.skel-feed-item {
    padding: 32px 0;
    border-bottom: 1px solid var(--border-color);
}

.skel-feed-title { height: 32px; width: 85%; margin-bottom: 16px; border-radius: 4px; }
.skel-feed-meta { height: 16px; width: 30%; margin-bottom: 16px; border-radius: 4px; }
.skel-feed-line { height: 14px; width: 100%; margin-bottom: 8px; border-radius: 4px; }

.skel-text { height: 20px; border-radius: 4px; margin: 0 auto 10px auto; }
.skel-title { height: 40px; width: 50%; margin-bottom: 15px; }
.skel-meta { height: 15px; width: 30%; margin-bottom: 25px; }
.skel-line { width: 80%; }
.skel-card { height: 120px; margin-bottom: 20px; border-radius: 12px; }

/* Keyframe is in previous CSS, ensuring shimmer effect works */
/* --- UTILS --- */
.skeleton { background: linear-gradient(90deg, var(--bg-secondary), var(--border-color), var(--bg-secondary)); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.dropdown {
    position: absolute;
    top: 56px;
    right: 0;
    min-width: 220px;
    padding: 8px;

    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);

    display: none;
    flex-direction: column;
    gap: 6px;
    z-index: 1000;

    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.dropdown.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.dropdown a,
.dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;

    width: 100%;
    padding: 10px 14px;

    background: transparent;
    border: none;
    border-radius: var(--radius-sm);

    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;

    transition: background 0.15s ease, transform 0.1s ease;
}

.dropdown a:hover,
.dropdown button:hover {
    background: var(--bg-secondary);
}

.dropdown a:active,
.dropdown button:active {
    transform: scale(0.98);
}
/* --- RESPONSIVE --- */
@media(max-width: 768px) {
    .nav-links { display: none; }
    .post-header h1 { font-size: 2rem; }
    .mobile-menu-btn { display: block; }
}
/* --- EMBED MODAL & CARD STYLES --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; animation: fadeIn 0.2s forwards;
}

.modal-content {
    background: var(--bg-color);
    padding: 32px;
    border-radius: 12px;
    width: 90%; max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: translateY(20px); animation: slideUp 0.2s forwards;
}

@keyframes fadeIn { to { opacity: 1; } }
@keyframes slideUp { to { transform: translateY(0); } }

/* The Actual Embed Card Design */
.embed-card-modern {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    font-family: var(--font-ui);
    display: flex; flex-direction: column; gap: 12px;
    text-decoration: none; color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}
.embed-card-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.embed-header { display: flex; align-items: center; gap: 10px; }
.embed-avatar { width: 24px; height: 24px; border-radius: 50%; }
.embed-author { font-size: 0.85rem; font-weight: 600; }
.embed-meta { font-size: 0.8rem; color: var(--text-secondary); }

.embed-title-lg {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 4px 0;
    color: var(--text-primary);
}

.embed-excerpt {
    font-size: 0.95rem;
    color: var(--text-secondary);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.embed-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
}

.embed-logo { font-family: var(--font-heading); font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; gap: 4px; }
/* Styling for the copy-paste prompt if you want it cleaner */
.embed-code-box {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: var(--bg-secondary);
    padding: 10px;
    border-radius: var(--radius-sm);
    word-break: break-all;
}
/* --- SEARCH PAGE STYLES --- */
.search-page-container {
    max-width: 800px; /* Centered nicely like the rest of the site */
    margin: 0 auto;
    padding: 48px 24px;
    min-height: 80vh;
}

.search-header {
    font-family: var(--font-heading); /* This adds the Serif font */
    font-size: 2.8rem;
    margin-bottom: 40px;
    letter-spacing: -0.03em;
}

.search-tabs {
    display: flex;
    gap: 32px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.search-tab {
    background: none;
    border: none;
    padding-bottom: 16px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.search-tab.active {
    color: var(--text-primary);
    border-bottom: 1px solid var(--text-primary);
    font-weight: 500;
}

.search-card {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 32px 0;
    border-bottom: 1px solid var(--border-color);
}

.search-card-content { flex: 1; }

.search-card-thumbnail {
    width: 160px;
    height: 112px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--bg-secondary);
}

@media(max-width: 500px) {
    .search-card { flex-direction: column-reverse; }
    .search-card-thumbnail { width: 100%; height: auto; aspect-ratio: 16/9; }
}
/* --- DASHBOARD SPECIFIC --- */
.dash-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 48px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.stat-val {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

@media(max-width: 600px) {
    .dash-stats-grid { grid-template-columns: 1fr; gap: 12px; }
}

.dash-item-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}
/* --- MINIMAL AUTHOR PROFILE --- */
.profile-header-minimal {
    text-align: center;
    padding: 40px 0 0 0;
}

.avatar-lg-simple {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 24px;
    background: var(--bg-secondary);
}

.social-links-simple {
    display: flex;
    gap: 12px;
}

.social-links-simple a {
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.social-links-simple a:hover {
    color: var(--text-primary);
}
/* --- TABS LOGIC --- */
.tab-content { display: none; }
.tab-content.active { display: block !important; }

/* --- SKELETON LOADERS --- */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-color) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skel-avatar { width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 20px; }
.skel-title { height: 32px; width: 200px; margin: 0 auto 10px; }
.skel-handle { height: 18px; width: 120px; margin: 0 auto 30px; }
.skel-post { height: 140px; width: 100%; margin-bottom: 20px; }

/* --- SOCIAL ICONS --- */
.social-links { display: flex; gap: 12px; flex-wrap: wrap; }
.social-icon {
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--bg-secondary); border: 1px solid var(--border-color);
    color: var(--text-primary); font-size: 1.3rem; transition: 0.2s;
}
.social-icon:hover { 
    background: var(--text-primary); color: var(--bg-color);; 
}
.search-form {
    display: flex;
    align-items: center;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-secondary);
}

.search-input {
    padding: 9px 15px 9px 36px;
    border-radius: 99px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    outline: none;
    font-size: 0.9rem;
    width: 200px;
}
.search-input:focus{
    border: 1px solid var(--border-color);
}
.search-input:active{
    border: 1px solid var(--border-color);
}
@media (max-width: 768px) {
    .search-form {
        display: none;
    }
}
/* --- LANDING THEME ENGINE --- */
:root {
    --landing-bg: #f7f4ed; /* High-end cream */
    --landing-text: #000000;
    --landing-border: #000000;
    --landing-btn-bg: #000000;
    --landing-btn-text: #ffffff;
}

[data-theme="dark"] {
    --landing-bg: #000000; /* Pure Black */
    --landing-text: #ffffff;
    --landing-border: #27272a; /* Zinc-800 */
    --landing-btn-bg: #ffffff;
    --landing-btn-text: #000000;
}

/* Base Body Override for Home Only */
.landing-page {
    background-color: var(--landing-bg) !important;
    color: var(--landing-text) !important;
}

/* --- NAVBAR (Exact Styling) --- */
.landing-nav {
    background: var(--landing-bg) !important;
    height: 55px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
}



.nav-links-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links-static {
    display: flex;
    gap: 20px;
}

.nav-links-static a {
    font-size: 0.9rem;
    color: var(--landing-text);
}

/* Auth Buttons as Pills */
#nav-auth .btn-primary {
    background: var(--landing-btn-bg);
    color: var(--landing-btn-text);
    border-radius: 99px;
    font-size: 0.9rem;
    border: none;
}

#nav-auth .btn-secondary {
    border: none;
    background: transparent;
    font-size: 0.9rem;
    color: var(--landing-text);
}

.hero-section {
    border-bottom: 1px solid var(--border-color);
    padding: 50px 0;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-content {
    flex: 1.2;
}

.hero-heading {
    font-family: var(--font-heading);
    font-size: clamp(4rem, 8vw, 6.5rem); /* Exact massive size */
    line-height: 0.95;
    letter-spacing: -4px;
    margin-bottom: 32px;
}

.hero-description {
    font-size: 1.5rem;
    line-height: 1.25;
    max-width: 500px;
    margin-bottom: 48px;
    color: var(--landing-text);
}

.hero-buttons {
    display: flex;
    gap: 16px;
}

.btn-hero-pill {
    background: var(--landing-btn-bg);
    color: var(--landing-btn-text);
    padding: 14px 40px;
    border-radius: 99px;
    font-size: 1.2rem;
    font-weight: 500;
    text-decoration: none;
}

.btn-hero-secondary {
    border: 1px solid var(--landing-text);
    padding: 14px 40px;
    border-radius: 99px;
    font-size: 1.2rem;
    text-decoration: none;
    color: var(--landing-text);
}

.hero-visual {
    flex: 0.9;
    display: flex;
    justify-content: flex-end;
}

.gg-illustration {
    width: 100%;
    height: auto;
}

.landing-footer {
    padding: 40px 0;
    background: var(--landing-bg);
}

.footer-container {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-container a {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
}

@media (max-width: 900px) {
    .nav-links-static { display: none; }
    .hero-container { flex-direction: column; text-align: center; }
    .hero-heading { font-size: 4rem; letter-spacing: -2px; }
    .hero-description { margin: 0 auto 32px; }
    .hero-buttons { justify-content: center; flex-direction: column; }
    .hero-visual { order: -1; margin-bottom: 40px; }
    .gg-illustration { max-width: 320px; }
}
/* --- EDITOR SPECIFIC STYLES --- */
.editor-page {
    background: var(--bg-color);
}

.editor-container {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 100px;
}

/* STICKY TOOLBAR */
.editor-toolbar {
    position: sticky;
    top: 55px; /* Directly below navbar */
    z-index: 90;
    background: rgba(var(--bg-color-rgb, 255, 255, 255), 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Dark mode blur support */
[data-theme="dark"] .editor-toolbar {
    background: rgba(0, 0, 0, 0.8);
}

.toolbar-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.toolbar-group button {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 34px;
    height: 34px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: 0.2s;
}

.toolbar-group button:hover {
    background: var(--bg-secondary);
}

.divider-v {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 8px;
}

/* WRITING SURFACE */
.writing-surface {
    padding: 0 20px;
}

.editor-title-input {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    border-radius: 0px !important;
    border: none;
    background: transparent;
    padding: 0;
    margin-bottom: 10px;
    outline: none;
    color: var(--text-primary);
    width: 100%;
}

.editor-title-input::placeholder { opacity: 0.3; }

.editor-tags-input {
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0px !important;
    padding: 10px 0;
    font-size: 1rem;
    margin-bottom: 40px;
    background: transparent;
    color: var(--text-secondary);
}

.editor-content {
    outline: none;
    min-height: 60vh;
    font-size: 1.25rem;
    line-height: 1.8;
}
.editor-content:empty::before {
    content: attr(data-placeholder);
    color: var(--text-secondary);
    opacity: 0.5;
    pointer-events: none;
    display: block;
}
[contenteditable="true"]:empty:before {
    content: attr(data-placeholder);
    color: var(--text-secondary);
    opacity: 0.5;
    pointer-events: none;
}

/* Toolbar Buttons in Navbar */
.toolbar-actions {
    display: flex;
    gap: 12px;
}
.toolbar-group button {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 36px; /* Slightly wider for text */
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem; /* Adjust size for text buttons */
    transition: background 0.2s ease;
}

.toolbar-group button:hover {
    background: var(--bg-secondary);
}

/* Specific styling for the serif Italic 'I' to look editorial */
.toolbar-group button[onclick*="italic"] {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
}

.divider-v {
    width: 1px;
    height: 18px;
    background: var(--border-color);
    margin: 0 10px;
}
/* --- DYNAMIC SOCIAL PICKER --- */
.social-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.social-input-wrapper ion-icon.platform-icon {
    position: absolute;
    left: 16px;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.social-input-wrapper input {
    padding-left: 45px;
    padding-right: 45px; /* Space for delete btn */
}

.social-delete-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    padding: 5px;
}

/* Custom Social Dropdown Menu */
#social-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 50;
    display: none;
    flex-direction: column;
    padding: 8px;
    margin-top: 5px;
}

#social-menu.active { display: flex; }

.social-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: 0.2s;
}

.social-menu-item:hover { background: var(--bg-secondary); }

/* --- NEW FIXES (APPEND TO BOTTOM OF FILE) --- */

/* 1. Fix List elements going outside of the page inside prose */
.prose ul, .prose ol {
    list-style-position: inside !important;
    padding-left: 0;
    margin-bottom: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

/* 2. Make mobile blog layout exactly the same as desktop (no stacking) */
@media (max-width: 650px) {
    .blog-item, .search-card {
        flex-direction: row !important;
        align-items: center !important;
        gap: 16px !important;
    }
    .blog-item-thumbnail-link {
        width: 100px !important;
        height: 100px !important;
        flex-shrink: 0 !important;
    }
    .blog-item-image-wrapper, .blog-item-thumbnail, .search-card-thumbnail {
        width: 100px !important;
        height: 100px !important;
        aspect-ratio: 1 !important;
        margin-bottom: 0 !important;
        object-fit: cover !important;
        border-radius: 12px !important;
    }
    .blog-item-content {
        min-width: 0; /* Prevents text overflow breaking the flex layout */
        flex: 1 !important;
    }
    .blog-title {
        font-size: 1.25rem !important;
    }
    .blog-excerpt {
        font-size: 0.95rem !important;
        -webkit-line-clamp: 2 !important; 
    }
}
/* --- TYPOGRAPHY MENU STYLES --- */
.typography-menu {
    position: absolute;
    top: 45px;
    right: 0;
    width: 250px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 16px;
    z-index: 100;
    display: none;
    flex-direction: column;
    gap: 16px;
}

.typography-menu.active {
    display: flex;
    animation: slideInDown 0.2s ease-out forwards;
}

.typo-section h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.typo-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.typo-btn {
    background: var(--bg-secondary);
    border: 1px solid transparent;
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
    flex: 1;
    text-align: center;
}

.typo-btn:hover {
    border-color: var(--text-primary);
}

.typo-btn.active {
    background: var(--text-primary);
    color: var(--bg-color);
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
/* --- THEME-AWARE CODE BLOCKS & SYNTAX HIGHLIGHTING --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500&display=swap');

.prose blockquote {
    border-left: 3px solid var(--text-primary);
    padding-left: 20px;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1.25rem;
    quotes: "\201C" "\201D";
}

.prose blockquote::before { content: open-quote "\2009"; }
.prose blockquote::after  { content: "\2009" close-quote; }

/* Code Block (<pre>) - Using Google Sans Code */
.prose pre {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    padding: 24px;
    border-radius: 24px;
    overflow-x: auto;
    font-family: 'Google Sans Code', 'Roboto Mono', monospace !important;
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Inline code styling */
.prose p code, .prose li code {
    background: var(--bg-secondary);
    color: #ef4444; 
    padding: 3px 6px;
    border-radius: 6px;
    font-family: 'Google Sans Code', 'Roboto Mono', monospace !important;
    font-size: 0.9em;
}

/* Essential Highlight.js overrides (Removed color:inherit so colors work!) */
.hljs { background: transparent !important; padding: 0 !important; }

/* Tag Toast (Expanding text pushing content down) */
.tag-toast {
    flex-basis: 100%; /* Forces toast to its own full-width line */
    color: #ef4444;
    font-size: 0.85rem;
    font-weight: 600;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
    transition: all 0.3s ease;
}

.tag-toast.show {
    max-height: 30px;
    margin-top: 8px;
    opacity: 1;
}

/* FIX: Editor Placeholder Visibility */
.editor-content:empty::before,
.editor-content:has(> br:only-child)::before,
.editor-content:has(> p:only-child > br:only-child)::before {
    content: attr(data-placeholder);
    color: var(--text-secondary);
    opacity: 0.5;
    pointer-events: none;
    display: block;
}
/* --- NEW FIXES: EDITOR TAGS & MOBILE TOOLBAR SCROLL --- */

/* 1. Make the toolbar scrollable on mobile */
@media (max-width: 768px) {
    .editor-toolbar {
        overflow-x: auto;
        padding: 12px 20px; /* Add padding for scroll breathing room */
    }
    .editor-toolbar::-webkit-scrollbar {
        display: none; /* Hide scrollbar for clean look */
    }
    .toolbar-group, .toolbar-actions {
        flex-shrink: 0; /* Prevent buttons from squishing */
    }
}

/* 2. Visual Tag Editor Styles */
.tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    margin-bottom: 40px;
    position: relative;
    cursor: text;
}

.tag-pill-edit {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border-color);
    animation: popIn 0.2s ease-out;
}

.tag-pill-edit button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    padding: 0;
    margin-top: 2px;
    transition: color 0.2s;
}

.tag-pill-edit button:hover {
    color: #ef4444;
}

.tag-input-field {
    border: none !important;
    background: transparent;
    outline: none;
    color: var(--text-primary);
    flex: 1;
    min-width: 150px;
    font-size: 1rem;
    padding: 0 !important;
    border-radius: 0 !important;
}

.tag-input-field::placeholder {
    color: var(--text-secondary);
}

@keyframes popIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
/* Clean Minimal Copy Button */
.prose pre {
    position: relative;
}

.copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;

    width: 34px;
    height: 34px;
    border-radius: 50%;

    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
}

/* Icon */
.copy-code-btn ion-icon {
    font-size: 1.15rem;
}

/* Success (no border change, no extra effect) */
.copy-code-btn.success {
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

/* Hide on print */
@media print {
    .copy-code-btn { display: none; }
}