/* ==========================================================================
   AgenticEdge Blog — Lime-green theme
   ========================================================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

a { color: inherit; text-decoration: none; }

img { max-width: 100%; height: auto; display: block; }

/* ---------- Header ---------- */
.site-header {
    background: #1a1a2e;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-nav a {
    color: #ccc;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.header-nav a:hover,
.header-nav a.active {
    color: #fff;
}

.nav-user {
    color: #c5e636;
    font-size: 0.95rem;
    font-weight: 600;
}

.btn-new-item {
    background: #c5e636;
    color: #1a1a2e !important;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-new-item:hover {
    background: #b5d626;
}

/* ---------- Hero Section ---------- */
.hero {
    background: #c5e636;
    padding: 72px 24px 56px;
    text-align: center;
}

.hero-inner {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: #1a1a2e;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: #2d4a20;
    font-weight: 400;
}

/* ---------- Tag Filter ---------- */
.tag-filter {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 16px 24px;
}

.tag-filter-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-pill {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 20px;
    border: 2px solid #1a1a2e;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a1a2e;
    background: transparent;
    transition: all 0.2s;
}

.tag-pill:hover {
    background: #1a1a2e;
    color: #fff;
}

.tag-pill.active {
    background: #1a1a2e;
    color: #fff;
}

/* ---------- Tag Badge ---------- */
.tag-badge {
    display: inline-block;
    background: #2d5a27;
    color: #fff;
    padding: 3px 12px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* ---------- Featured Card ---------- */
.featured-section {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 0 24px;
}

.featured-card {
    background: #faf8f0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.featured-image {
    flex: 0 0 50%;
    max-width: 50%;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-content {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-content h2 {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.featured-content h2 a {
    color: #1a1a2e;
    transition: color 0.2s;
}

.featured-content h2 a:hover {
    color: #2d5a27;
}

.featured-teaser {
    color: #555;
    font-size: 1rem;
    margin-bottom: 16px;
    line-height: 1.6;
}

/* ---------- Post Meta ---------- */
.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #888;
    flex-wrap: wrap;
}

.meta-author { font-weight: 600; color: #555; }
.meta-sep { color: #ccc; }

/* ---------- Post Actions ---------- */
.post-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    align-items: center;
}

.inline-form { display: inline; }

.btn-edit {
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    background: #e8e8e8;
    color: #333;
    transition: background 0.2s;
}

.btn-edit:hover { background: #d0d0d0; }

.btn-delete {
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    background: #e74c3c;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-delete:hover { background: #c0392b; }

/* ---------- Grid Section ---------- */
.grid-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 24px;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.post-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 24px;
}

.card-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
}

.card-content h3 a {
    color: #1a1a2e;
    transition: color 0.2s;
}

.card-content h3 a:hover {
    color: #2d5a27;
}

.card-teaser {
    color: #666;
    font-size: 0.92rem;
    margin-bottom: 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Full Post ---------- */
.post-hero-image {
    width: 100%;
}

.post-hero-image img {
    width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: contain;
}

.post-full-inner {
    max-width: 780px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

.post-header {
    margin-bottom: 32px;
}

.post-header h1 {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.25;
    color: #1a1a2e;
    margin-bottom: 16px;
}

.post-body {
    font-size: 1.08rem;
    line-height: 1.8;
    color: #444;
}

.post-body p {
    margin-bottom: 1.2em;
}

.post-actions-full {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.post-back {
    margin-top: 40px;
}

.post-back a {
    color: #2d5a27;
    font-weight: 600;
    transition: color 0.2s;
}

.post-back a:hover {
    color: #1a3a15;
}

/* ---------- Empty State ---------- */
.empty-section {
    max-width: 600px;
    margin: 80px auto;
    text-align: center;
    padding: 0 24px;
}

.empty-section h2 {
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.empty-section code {
    background: #e8e8e8;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* ---------- Login ---------- */
.login-section {
    max-width: 440px;
    margin: 80px auto;
    padding: 0 24px;
}

.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.login-card h1 {
    font-size: 1.8rem;
    margin-bottom: 24px;
    color: #1a1a2e;
}

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

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

.form-optional {
    font-weight: 400;
    color: #999;
    font-size: 0.82rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

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

.form-group input[type="file"] {
    font-size: 0.92rem;
}

.form-help {
    margin-top: 4px;
    font-size: 0.82rem;
    color: #888;
}

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

.btn-primary {
    background: #c5e636;
    color: #1a1a2e;
    border: none;
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #b5d626;
}

.btn-secondary {
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    background: #e8e8e8;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #d8d8d8;
}

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.92rem;
}

.alert-error {
    background: #fdecea;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

/* ---------- Editor ---------- */
.editor-section {
    max-width: 780px;
    margin: 40px auto;
    padding: 0 24px;
}

.editor-card {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.editor-card h1 {
    font-size: 1.8rem;
    margin-bottom: 24px;
    color: #1a1a2e;
}

/* ---------- Image Upload / Paste ---------- */
.image-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 16px;
    transition: border-color 0.2s;
}

.image-upload-area:hover {
    border-color: #c5e636;
}

.paste-zone {
    margin-top: 10px;
}

.paste-zone p {
    color: #999;
    font-size: 0.88rem;
    margin: 0;
}

.image-preview {
    margin-top: 12px;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

/* ---------- Post Links ---------- */
.post-links {
    margin-top: 32px;
    padding: 24px;
    background: #faf8f0;
    border-radius: 8px;
}

.post-links h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 12px;
}

.link-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.link-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.link-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    color: #fff;
}

.link-icon-youtube { background: #ff0000; }
.link-icon-github { background: #24292e; }
.link-icon-huggingface { background: #ffbd45; color: #1a1a2e; }
.link-icon-twitter { background: #000; }
.link-icon-arxiv { background: #b31b1b; }

.link-url {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    color: #2d5a27;
    word-break: break-all;
    transition: color 0.2s;
}

.link-url:hover {
    color: #1a3a15;
    text-decoration: underline;
}

.btn-copy {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f5f5f5;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: #e8e8e8;
    color: #333;
}

.btn-copy.copied {
    background: #c5e636;
    border-color: #b5d626;
    color: #1a1a2e;
}

/* ---------- Tag Badges ---------- */
.tag-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

/* ---------- Footer ---------- */
.site-footer {
    background: #1a1a2e;
    color: #888;
    padding: 24px;
    text-align: center;
    font-size: 0.85rem;
    margin-top: auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .featured-card {
        flex-direction: column;
    }
    .featured-image {
        flex: none;
        max-width: 100%;
    }
    .hero h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 600px) {
    .post-grid {
        grid-template-columns: 1fr;
    }
    .header-inner {
        flex-direction: column;
        height: auto;
        padding: 12px 16px;
        gap: 10px;
    }
    .header-nav {
        gap: 14px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .hero {
        padding: 48px 16px 36px;
    }
    .hero h1 {
        font-size: 1.8rem;
    }
    .featured-content {
        padding: 24px;
    }
    .login-card,
    .editor-card {
        padding: 24px;
    }
}
