/* =========================================================
   RAGGE.NU – FRONTEND
   style.css
   ========================================================= */


/* =========================================================
   1. RESET
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {
    margin: 0;
    padding: 0;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    font-size: 16px;
    line-height: 1.7;

    color: #222;
    background: #f5f5f5;
}


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


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


button,
input,
textarea,
select {
    font: inherit;
}


/* =========================================================
   2. CONTAINER
   ========================================================= */

.container {
    width: 100%;
    max-width: 1200px;

    margin-left: auto;
    margin-right: auto;

    padding-left: 24px;
    padding-right: 24px;
}


/* =========================================================
   3. SITE HEADER
   ========================================================= */

.site-header {
    background: #ffffff;

    border-bottom:
        1px solid
        #e5e5e5;

    position: sticky;
    top: 0;

    z-index: 1000;
}


.site-header .container {
    min-height: 72px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 30px;
}


/* =========================================================
   4. LOGOTYP
   ========================================================= */

.site-logo {
    display: inline-block;

    font-size: 1.6rem;

    font-weight: 700;

    letter-spacing: -0.03em;

    color: #111;

    transition:
        opacity
        0.2s
        ease;
}


.site-logo:hover {
    opacity: 0.7;
}


/* =========================================================
   5. HUVUDNAVIGATION
   ========================================================= */

.main-navigation {
    display: flex;

    align-items: center;

    gap: 24px;
}


.main-navigation a {
    position: relative;

    padding:
        8px
        0;

    color: #555;

    font-size: 0.95rem;

    font-weight: 500;

    transition:
        color
        0.2s
        ease;
}


.main-navigation a:hover {
    color: #111;
}


.main-navigation a.active {
    color: #111;

    font-weight: 600;
}


.main-navigation a.active::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;

    bottom: 0;

    height: 2px;

    background: #111;
}


/* =========================================================
   6. MAIN
   ========================================================= */

.site-main {
    min-height: calc(
        100vh - 150px
    );

    padding:
        60px
        0
        80px;
}


/* =========================================================
   7. PAGE HEADER
   ========================================================= */

.page-header {
    max-width: 800px;

    margin:
        0
        auto
        40px;

    text-align: center;
}


.page-header h1 {
    margin:
        0
        0
        12px;

    font-size:
        clamp(
            2rem,
            5vw,
            3rem
        );

    line-height: 1.2;

    letter-spacing: -0.04em;

    color: #111;
}


.page-header p {
    margin: 0;

    color: #666;

    font-size: 1.05rem;
}


/* =========================================================
   8. CATEGORY FILTER
   ========================================================= */

.category-filter {
    display: flex;

    flex-wrap: wrap;

    justify-content: center;

    gap: 10px;

    margin:
        0
        auto
        50px;
}


.category-filter a {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 38px;

    padding:
        7px
        16px;

    border:
        1px solid
        #d8d8d8;

    border-radius: 999px;

    background: #ffffff;

    color: #555;

    font-size: 0.9rem;

    transition:
        background
        0.2s
        ease,

        color
        0.2s
        ease,

        border-color
        0.2s
        ease;
}


.category-filter a:hover {
    border-color: #999;

    color: #111;
}


.category-filter a.active {
    background: #222;

    border-color: #222;

    color: #ffffff;
}


/* =========================================================
   9. POST LIST
   ========================================================= */

.post-list {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(
                0,
                1fr
            )
        );

    gap: 30px;
}


/* =========================================================
   10. POST CARD
   ========================================================= */

.post-card {
    display: flex;

    flex-direction: column;

    overflow: hidden;

    background: #ffffff;

    border:
        1px solid
        #e5e5e5;

    border-radius: 10px;

    transition:
        transform
        0.2s
        ease,

        box-shadow
        0.2s
        ease;
}


.post-card:hover {
    transform:
        translateY(
            -3px
        );

    box-shadow:
        0
        10px
        30px
        rgba(
            0,
            0,
            0,
            0.08
        );
}


/* =========================================================
   11. POST IMAGE
   ========================================================= */

.post-image {
    width: 100%;

    aspect-ratio:
        16 / 9;

    background:
        linear-gradient(
            135deg,
            #eeeeee,
            #dcdcdc
        );

    overflow: hidden;
}


.post-image img {
    width: 100%;

    height: 100%;

    object-fit: cover;
}


/* =========================================================
   12. POST CONTENT
   ========================================================= */

.post-content {
    display: flex;

    flex-direction: column;

    flex: 1;

    padding: 28px;
}


.post-meta {
    display: flex;

    flex-wrap: wrap;

    align-items: center;

    gap: 10px;

    margin-bottom: 12px;

    color: #777;

    font-size: 0.8rem;
}


.post-meta span {
    font-weight: 600;

    color: #555;
}


.post-meta time {
    color: #888;
}


.post-meta span::after {
    content: "•";

    margin-left: 10px;

    color: #bbb;
}


/* =========================================================
   13. POST TITLE
   ========================================================= */

.post-card h2 {
    margin:
        0
        0
        14px;

    font-size:
        clamp(
            1.3rem,
            2vw,
            1.65rem
        );

    line-height: 1.3;

    letter-spacing: -0.025em;

    color: #111;
}


.post-card h2 a {
    transition:
        color
        0.2s
        ease;
}


.post-card h2 a:hover {
    color: #666;
}


/* =========================================================
   14. POST EXCERPT
   ========================================================= */

.post-card p {
    margin:
        0
        0
        20px;

    color: #666;

    font-size: 0.95rem;

    line-height: 1.7;
}


/* =========================================================
   15. READ MORE
   ========================================================= */

.read-more {
    display: inline-flex;

    align-items: center;

    margin-top: auto;

    padding-top: 10px;

    color: #222;

    font-size: 0.9rem;

    font-weight: 600;

    transition:
        color
        0.2s
        ease;
}


.read-more:hover {
    color: #777;
}


/* =========================================================
   16. EMPTY STATE
   ========================================================= */

.empty-state {
    grid-column:
        1 /
        -1;

    padding:
        60px
        30px;

    text-align: center;

    background: #ffffff;

    border:
        1px solid
        #e5e5e5;

    border-radius: 10px;
}


.empty-state h2 {
    margin:
        0
        0
        10px;

    color: #222;
}


.empty-state p {
    margin: 0;

    color: #777;
}


/* =========================================================
   17. PAGINATION
   ========================================================= */

.pagination {
    display: flex;

    align-items: center;

    justify-content: center;

    gap: 20px;

    margin-top: 50px;
}


.pagination a {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 40px;

    padding:
        8px
        16px;

    border:
        1px solid
        #d8d8d8;

    border-radius: 6px;

    background: #ffffff;

    color: #333;

    font-size: 0.9rem;

    transition:
        background
        0.2s
        ease,

        border-color
        0.2s
        ease;
}


.pagination a:hover {
    background: #f1f1f1;

    border-color: #aaa;
}


.pagination span {
    color: #777;

    font-size: 0.9rem;
}


/* =========================================================
   18. FOOTER
   ========================================================= */

.site-footer {
    padding:
        30px
        0;

    background: #ffffff;

    border-top:
        1px solid
        #e5e5e5;
}


.site-footer p {
    margin: 0;

    text-align: center;

    color: #888;

    font-size: 0.85rem;
}


/* =========================================================
   19. RESPONSIV – TABLET
   ========================================================= */

@media (
    max-width: 900px
) {


    .site-main {
        padding:
            45px
            0
            60px;
    }


    .post-list {
        grid-template-columns:
            1fr;
    }


}


/* =========================================================
   20. RESPONSIV – MOBIL
   ========================================================= */

@media (
    max-width: 600px
) {


    .container {
        padding-left: 16px;

        padding-right: 16px;
    }


    .site-header .container {
        min-height: 64px;

        flex-direction: column;

        justify-content: center;

        gap: 5px;

        padding-top: 10px;

        padding-bottom: 10px;
    }


    .site-logo {
        font-size: 1.4rem;
    }


    .main-navigation {
        gap: 18px;
    }


    .main-navigation a {
        font-size: 0.85rem;
    }


    .site-main {
        padding:
            35px
            0
            50px;
    }


    .page-header {
        margin-bottom: 30px;
    }


    .page-header h1 {
        font-size: 2rem;
    }


    .page-header p {
        font-size: 0.95rem;
    }


    .category-filter {
        justify-content: flex-start;

        margin-bottom: 35px;
    }


    .category-filter a {
        font-size: 0.85rem;

        padding:
            6px
            13px;
    }


    .post-content {
        padding: 22px;
    }


    .post-card h2 {
        font-size: 1.35rem;
    }


    .pagination {
        flex-wrap: wrap;

        gap: 12px;
    }


}


/* =========================================================
   21. TILLGÄNGLIGHET
   ========================================================= */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline:
        3px
        solid
        #777;

    outline-offset: 3px;
}


/* =========================================================
   22. PREFERS REDUCED MOTION
   ========================================================= */

@media (
    prefers-reduced-motion: reduce
) {


    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        transition-duration:
            0.01ms !important;

        animation-duration:
            0.01ms !important;

        animation-iteration-count:
            1 !important;
    }
}

/* =========================================================
   23. FOR SEARCH-page
   ========================================================= */
.search-form {
    display: flex;
    max-width: 650px;
    margin: 25px auto;
    gap: 10px;
}

.search-form input {
    flex: 1;
    min-width: 0;
    padding: 12px 15px;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    background: #fff;
}

.search-form button {
    padding: 12px 20px;
    border: 0;
    border-radius: 6px;
    background: #222;
    color: #fff;
    cursor: pointer;
}

.search-form button:hover {
    background: #444;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 600px) {
    .search-form {
        flex-direction: column;
    }
}

/* =========================================================
   24. FOR ARCHIVE-page
   ========================================================= */
.archive-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 30px;
    align-items: start;
}

.archive-box {
    padding: 22px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
}

.archive-box h2 {
    margin: 0 0 20px;
}

.archive-box h3 {
    margin: 20px 0 8px;
    font-size: 1rem;
}

.archive-box h3:first-of-type {
    margin-top: 0;
}

.archive-months {
    margin: 0;
    padding: 0;
    list-style: none;
}

.archive-months li + li {
    margin-top: 4px;
}

.archive-months a {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 5px 0;
    color: #555;
}

.archive-months a:hover,
.archive-box h3 a:hover {
    color: #111;
}

.archive-months span {
    color: #999;
}

@media (max-width: 800px) {
    .archive-layout {
        grid-template-columns: 1fr;
    }
}

/*
25. FOR TINYMCE_EDITOR
*/
.single-post-content h2 {
    margin: 2em 0 .6em;
    font-size: 1.7rem;
    line-height: 1.3;
}

.single-post-content h3 {
    margin: 1.8em 0 .5em;
    font-size: 1.35rem;
}

.single-post-content p {
    margin: 0 0 1.5em;
}

.single-post-content ul,
.single-post-content ol {
    margin: 0 0 1.5em;
    padding-left: 1.5em;
}

.single-post-content blockquote {
    margin: 2em 0;
    padding: 10px 0 10px 25px;
    border-left: 4px solid #222;
    color: #555;
    font-style: italic;
}

.single-post-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 2em auto;
    border-radius: 8px;
}

.single-post-content figure {
    margin: 2em 0;
}

.single-post-content figcaption {
    margin-top: 8px;
    color: #777;
    text-align: center;
    font-size: .85rem;
}

.single-post-content table {
    width: 100%;
    margin: 2em 0;
    border-collapse: collapse;
}

.single-post-content th,
.single-post-content td {
    padding: 10px 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.single-post-content pre {
    overflow-x: auto;
    padding: 20px;
    border-radius: 8px;
    background: #1e293b;
    color: #f8fafc;
}

