/* ===========================
   Reset og grundindstillinger
   =========================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #1a1a1a;
    background-color: #f5f5f5;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    display: block;
}

/* ===========================
   App container
   =========================== */

   .app {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
   }


/* ===========================
   Site Header
   =========================== */

.site-header {
    background-color: #1e293b;
    padding: 1rem 0;
}

.site-header__inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-header__logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
}

.site-nav__link {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.95rem;
}

.site-nav__link:hover {
    color: #ffffff;
    text-decoration: none;
}

/* ===========================
   Site Main
   =========================== */

.site-main {
    /* max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem; */
    flex: 1;
}

.post-list {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* ===========================
   Site Footer
   =========================== */

.site-footer {
    background-color: #1e293b;
    padding: 1.5rem 0;
    margin-top: 4rem;
}

.site-footer__inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-footer__text {
    color: #94a3b8;
    font-size: 0.875rem;
}

/* ===========================
   Post List (forsiden)
   =========================== */

.post-list__heading {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

.post-list__items {
    list-style: none;
}

/* .post-list__item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
    gap: 1rem;
}

.post-list__link {
    font-size: 1.1rem;
    font-weight: 500;
    color: #1e293b;
    flex: 1;
} */

.post-list__item {
    display: block;
    align-items: baseline;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
    gap: 1rem;
}
.post-list__link {
    display: block;
    font-size: 1.4rem;
    font-weight: bold;
    color: #1e293b;
    flex: 1;
}

.post-list__link:hover {
    color: #2563eb;
    text-decoration: none;
}

.post-list__date {
    font-size: 0.875rem;
    color: #64748b;
    white-space: nowrap;
}

.post-list__excerpt {
    color: #666666;
    font-size: 0.9375rem;
    margin-top: 0.25rem;
    line-height: 1.6;
}

.post-list__empty {
    color: #64748b;
    font-style: italic;
}

/* ===========================
   Single Post
   =========================== */

.post {
    background: #ffffff;
    border-radius: 0.5rem;
    padding: 2rem;
}

.post__title {
    font-size: 2rem;
    line-height: 1.3;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.post__meta {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.post__content {
    line-height: 1.8;
    color: #334155;
}

.post__content p {
    margin-bottom: 1rem;
}

.post__footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.post__back-link {
    font-size: 0.95rem;
    color: #2563eb;
}

.error-message {
    background-color: #fef2f2;
    color: #b91c1c;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    border-left: 4px solid #ef4444;
}

.post__content h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.post__content h3 {
    font-size: 1.25rem;
    color: #2c3e50;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.post__content p {
    margin-bottom: 1rem;
}

.post__content ul,
.post__content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.post__content li {
    margin-bottom: 0.3rem;
}

.post__content blockquote {
    border-left: 4px solid #3498db;
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    color: #666666;
    font-style: italic;
}

.post__content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.post__content table th,
.post__content table td {
    border: 1px solid #e0e0e0;
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.post__content table th {
    background-color: #2c3e50;
    color: white;
}

/* === Admin-knapper på frontend === */

.admin-edit-btn {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background-color: #1e293b;
    color: #ffffff;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.admin-edit-btn:hover {
    opacity: 1;
    text-decoration: none;
    color: #ffffff;
}

.admin-edit-btn--secondary {
    background-color: #64748b;
}

.admin-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* ===========================
   Preview Banner
   =========================== */

.alert--preview {
    background-color: #fffbeb;
    color: #92400e;
    border-left: 4px solid #f59e0b;
    padding: 0.875rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* === Søgeside === */

.search-form > * {
    padding: .3rem .8rem;
}

.search-summary {
    font-size: 0.9375rem;
    color: var(--color-text-light);
    margin-bottom: 2rem;
}

mark {
    background-color: #fff3cd;
    color: inherit;
    padding: 0.1em 0.2em;
    border-radius: 0.2em;
}

/* ===  Header styling med søgeformular === */

.site-nav {
    display: flex;
    gap: 2rem;
}

.site-nav a {
    color: #fff;
}

.header-search {
    display: flex;
    gap: 0;
}

.header-search input[type="search"] {
    padding: 0.3rem 0.6rem;
    border: none;
    border-radius: 0.25rem 0 0 0.25rem;
    font-size: 0.875rem;
    width: 160px;
    background-color: rgba(255, 255, 255, 1);
    color: #333;
}

.header-search button {
    padding: 0.3rem 0.6rem;
    background-color: #ccc;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 0 0.25rem 0.25rem 0;
    cursor: pointer;
    font-size: 0.875rem;
}

/* ============================================================
   Hero Banner
   ============================================================ */

.hero {
    background-color: #181e29;
    color: #fff;
    padding: 5rem 2rem;
    text-align: center;
}

.hero__inner {
    max-width: 680px;
    margin: 0 auto;
}

.hero__label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.65;
    margin-bottom: 0.75rem;
}

.hero__title {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: bold;
    line-height: 1.15;
    margin-bottom: 1.25rem;
}

.hero__text {
    font-size: 1.125rem;
    opacity: 0.85;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.hero__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Call-to-action knapper */

.btn-hero {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-hero:hover {
    opacity: 0.9;
    text-decoration: none;
}

.btn-hero--primary {
    background-color: rgb(0 0 0 / .2);
    color: #fff;
}

.btn-hero--secondary {
    background-color: transparent;
    color: #fff;
    border: 2px solid rgb(255 255 255 / 0.55);
}

.btn-hero--secondary:hover {
    border-color: #fff;
    color: #fff;
}


@media (max-width: 700px) {
    .hero {
        padding: 3.5rem 1rem;
    }
}

/* ============================================================
   Seneste indlæg: section og overskrift
   ============================================================ */

.latest-posts {
    max-width: 1080px;
    margin: 0 auto;
    padding: 4rem 1.5rem;

}

.section-title {
    font-size: 1.125rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 2rem;
}

.see-all-posts {
    text-align: center;
    margin-top: 4rem;
}

.see-all-posts .btn-hero--secondary {
    color: #1e293b;
    border-color: #1e293b;
}

.see-all-posts .btn-hero--secondary:hover {
    background-color: #1e293b;
    color: #ffffff;
}

/* ============================================================
   Post Card
   ============================================================ */

.post-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.post-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.09);
    transform: translateY(-2px);
}

.post-card__image-link {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.post-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.post-card:hover .post-card__image {
    transform: scale(1.04);
}

.post-card__body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-card__meta {
    font-size: 0.8125rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.post-card__title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.35;
}

.post-card__title a {
    color: #1e293b;
    text-decoration: none;
}

.post-card__title a:hover {
    color: #2563eb;
}

.post-card__excerpt {
    font-size: 0.9375rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    flex: 1;
}

.post-card__cta {
    font-size: 0.875rem;
    font-weight: bold;
    color: #2563eb;
    text-decoration: none;
    margin-top: auto;
}

.post-card__cta:hover {
    text-decoration: underline;
}

/* ============================================================
   Featured post: fuld bredde, vandret layout
   ============================================================ */

.post-card--featured {
    flex-direction: row;
    margin-bottom: 2rem;
}

.post-card--featured .post-card__image-link {
    flex: 0 0 55%;
    aspect-ratio: auto;
    min-height: 320px;
}

.post-card--featured .post-card__body {
    padding: 2rem;
    justify-content: center;
}

.post-card--featured .post-card__title {
    font-size: 1.625rem;
}

/* ============================================================
   Post Grid: 2 kolonner til sekundære posts
   ============================================================ */

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 700px) {
    .post-card--featured {
        flex-direction: column;
    }

    .post-card--featured .post-card__image-link {
        flex: none;
        aspect-ratio: 16 / 9;
        min-height: auto;
    }

    .post-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Arkivside
   ============================================================ */

.archive {
    max-width: 1080px;
    margin: 4rem auto;
    padding: 0 1.5rem;
}

.archive-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 2rem;
}

.archive-count {
    font-size: 0.9375rem;
    color: #64748b;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.archive .admin-edit-btn {
    margin: 0 1.5rem 1.5rem 1.5rem;
}

@media (max-width: 900px) {
    .archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 580px) {
    .archive-grid {
        grid-template-columns: 1fr;
    }

    .archive-header {
        flex-direction: column;
        gap: 0.25rem;
    }
}