/* 🌿 === Fælles Farver & Typografi === */
:root {
    --primary: #064635;
    --secondary: #1e735a;
    --accent: #2563eb;
    --danger: #ef4444;
    --success: #10b981;
    --light-bg: #f9fafb;
    --text-dark: #1e293b;
    --text-gray: #475569;
    --radius: 14px;
    --shadow: 0 6px 18px rgba(0,0,0,0.08);
    --font: 'Segoe UI', sans-serif;
}

/* ============================
   📰 FRONTEND NYHEDER (Bruger)
============================ */
.latest-news-section {
    background-color: #fdfdfd;
    padding: 80px 20px;
    font-family: var(--font);
}

.latest-news-section .container {
    max-width: 1200px;
    margin: 0 auto;
}

.latest-news-section h2 {
    font-size: 2.4rem;
    text-align: center;
    color: var(--primary);
    margin-bottom: 12px;
}

.news-intro {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 50px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.news-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

.news-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-content h3 {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 10px;
    line-height: 1.3;
}

.news-tags {
    margin-bottom: 10px;
}

.news-tags span {
    display: inline-block;
    background-color: #e2f1eb;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    margin-right: 6px;
    margin-bottom: 5px;
}

.news-content p {
    font-size: 0.95rem;
    color: #444;
    flex-grow: 1;
    line-height: 1.5;
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #777;
}

.read-more-btn {
    background-color: var(--secondary);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.2s ease;
}

.read-more-btn:hover {
    background-color: var(--primary);
    transform: translateY(-2px);
}

/* =============================
   ⚙️ ADMINPANEL: NYHEDER (CRUD)
============================= */
.news-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
    align-items: flex-start;
    margin-top: 30px;
    font-family: var(--font);
}

.news-form {
    flex: 1 1 350px;
    background: #ffffff;
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.news-form h2 {
    margin-bottom: 15px;
    color: var(--text-dark);
}

.news-form input,
.news-form textarea {
    width: 100%;
    margin-bottom: 12px;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.news-form input:focus,
.news-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
    outline: none;
}

.news-form textarea {
    min-height: 100px;
    resize: vertical;
}

/* === KNAPPER === */
.btn {
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn.add { background-color: var(--accent); }
.btn.add:hover { background-color: #1d4ed8; transform: translateY(-1px); }

.btn.update { background-color: var(--success); }
.btn.update:hover { background-color: #059669; transform: translateY(-1px); }

.btn.edit { background-color: #3b82f6; }
.btn.edit:hover { background-color: #2563eb; transform: translateY(-1px); }

.btn.delete { background-color: var(--danger); }
.btn.delete:hover { background-color: #dc2626; transform: translateY(-1px); }

/* === LISTE === */
.news-list {
    flex: 2 1 600px;
}
.news-grid.admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.news-card.admin {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}
.news-card.admin:hover {
    transform: translateY(-4px);
}
.news-card.admin img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}
.news-content.admin {
    padding: 15px;
}
.news-content.admin h3 {
    margin: 0 0 8px;
    font-size: 18px;
}
.news-actions {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px 15px;
}

/* === BESKEDER === */
.admin-message {
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 600;
}
.admin-message.success { background: #d1fae5; color: #065f46; }
.admin-message.danger { background: #fee2e2; color: #991b1b; }

/* === RESPONSIVT DESIGN === */
@media (max-width: 1024px) {
    .news-grid { gap: 25px; }
}

@media (max-width: 768px) {
    .news-grid, .news-grid.admin {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    .news-form, .news-list {
        flex: 1 1 100%;
    }
}

@media (max-width: 480px) {
    .news-grid, .news-grid.admin {
        grid-template-columns: 1fr;
    }
    .latest-news-section h2 {
        font-size: 1.8rem;
    }
}
