/* style.css - Estilos del Blog SOSPadres */

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

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #f9fafb;
    --white: #ffffff;
    --border: #e5e7eb;
    --success: #10b981;
    --error: #ef4444;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 1.5rem 0;
    box-shadow: var(--shadow-lg);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.header nav a {
    color: var(--white);
    text-decoration: none;
    margin-left: 1.5rem;
    transition: opacity 0.3s;
}

.header nav a:hover {
    opacity: 0.8;
}

.logout {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

/* Article Card */
.article-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.article-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.article-card:hover .article-image img {
    transform: scale(1.05);
}

.article-content {
    padding: 1.5rem;
}

.article-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.category {
    background: var(--primary-color);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.article-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.article-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.article-title a:hover {
    color: var(--primary-color);
}

.article-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.read-more {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s;
}

.read-more:hover {
    gap: 0.75rem;
}

/* Single Article */
.article-single {
    background: var(--white);
    border-radius: 12px;
    padding: 3rem;
    margin: 3rem 0;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.article-header {
    margin-bottom: 2rem;
}

.category-badge {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.article-single h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.article-featured-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 2rem;
}

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

.article-body {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-color);
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-tags {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.tag {
    display: inline-block;
    background: var(--bg-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin-right: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.article-navigation {
    text-align: center;
    margin: 2rem 0;
}

.btn-back {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-back:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* No Articles */
.no-articles {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--white);
    border-radius: 12px;
    margin: 3rem 0;
}

.no-articles p {
    font-size: 1.125rem;
    color: var(--text-light);
    margin: 0.5rem 0;
}

/* Footer */
.footer {
    background: var(--text-color);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Admin Panel */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-form {
    background: var(--white);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.login-form input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.login-form button {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.login-form button:hover {
    background: var(--secondary-color);
}

.error {
    background: #fee;
    color: var(--error);
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
}

.mensaje {
    background: #d1fae5;
    color: var(--success);
    padding: 1rem;
    border-radius: 8px;
    margin: 2rem 0;
    text-align: center;
    font-weight: 600;
}

.admin-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin: 3rem 0;
}

.admin-form, .admin-sidebar {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.admin-sidebar h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.articles-list {
    list-style: none;
}

.articles-list li {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.articles-list li:last-child {
    border-bottom: none;
}

.articles-list strong {
    display: block;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.articles-list small {
    color: var(--text-light);
    font-size: 0.875rem;
}

.no-articles-text {
    color: var(--text-light);
    text-align: center;
    padding: 2rem;
}

/* Form Styles */
.article-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-primary {
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: var(--secondary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .header nav {
        display: flex;
        gap: 1rem;
    }

    .header nav a {
        margin: 0;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .article-single {
        padding: 1.5rem;
    }

    .article-single h1 {
        font-size: 1.75rem;
    }

    .article-featured-image {
        height: 250px;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .article-body {
        font-size: 1rem;
    }
}
