
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

/* ==========================================
   SvenskaSajter.com
   Modern design - CodeIgniter 4
   ========================================== */

:root {
    color-scheme: light;
    --ink: #172840;
    --muted: #62748b;
    --blue: #185a9d;
    --blue-dark: #123e70;
    --pale: #edf5ff;
    --line: #dfe7f0;
    --bg: #f7f9fc;
    --white: #fff;
    --yellow: #f4ac38;
    --shadow: 0 8px 28px rgba(22, 63, 103, .07);
    --shadow-hover: 0 14px 35px rgba(22, 63, 103, .13);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.62 'DM Sans', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: Manrope, Arial, sans-serif;
    line-height: 1.3;
    letter-spacing: -.025em;
}

a {
    color: var(--blue);
}

a:hover {
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 3px;
}

.wrap {
    width: min(1180px, calc(100% - 40px));
    margin-inline: auto;
}

.skip {
    position: absolute;
    top: -60px;
    left: 10px;
    background: white;
    padding: 10px 16px;
    z-index: 100;
}

.skip:focus {
    top: 10px;
}

/* ==========================================
   SIDHUVUD OCH LOGOTYP
   ========================================== */

.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--line);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    min-height: 110px;
}

.brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.brand img {
    display: block;
    width: min(355px, 47vw);
    height: auto;
    max-height: 95px;
    object-fit: contain;
    object-position: left center;
}

.nav nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

.nav nav a {
    position: relative;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
    padding: 10px 0;
    transition: color .2s ease;
}

.nav nav a:hover {
    color: var(--blue);
}

.nav nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 5px;
    width: 0;
    height: 2px;
    background: var(--blue);
    transition: width .2s ease;
}

.nav nav a:hover::after {
    width: 100%;
}

/* ==========================================
   STARTSIDANS HERO
   ========================================== */

.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(115deg, #153b69 0%, #185a9d 58%, #2879b8 100%);
    border-radius: 22px;
    color: white;
    padding: 64px 70px;
    margin: 38px 0 56px;
    box-shadow: 0 16px 40px rgba(22, 63, 103, .14);
}

.hero::after {
    content: '';
    position: absolute;
    width: 340px;
    height: 340px;
    right: -125px;
    top: -150px;
    border: 55px solid rgba(255, 255, 255, .045);
    border-radius: 50%;
    pointer-events: none;
}

.hero h1 {
    position: relative;
    font-size: clamp(30px, 4.8vw, 52px);
    margin: 5px 0 18px;
    max-width: 750px;
    font-weight: 800;
}

.hero p {
    position: relative;
    max-width: 640px;
    color: #e5f2ff;
    font-size: 1.08rem;
}

.eyebrow {
    letter-spacing: .14em;
    text-transform: uppercase;
    font-size: .77rem;
    font-weight: 800;
}

/* ==========================================
   SÖKFÄLT
   ========================================== */

.searchbar {
    position: relative;
    display: flex;
    align-items: stretch;
    max-width: 760px;
    gap: 8px;
    margin-top: 30px;
    background: white;
    padding: 7px;
    border-radius: 12px;
    box-shadow: 0 5px 22px rgba(0, 0, 0, .09);
}

.searchbar input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    font: inherit;
    padding: 13px 16px;
    color: var(--ink);
    border-radius: 8px;
}

.searchbar input::placeholder {
    color: #8898aa;
}

.searchbar button,
.cta {
    background: var(--yellow);
    color: #152b42;
    padding: 12px 25px;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s ease, transform .2s ease;
}

.searchbar button:hover,
.cta:hover {
    background: #ffbd52;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ==========================================
   SEKTIONER
   ========================================== */

.section {
    margin: 48px 0 75px;
}

.section h2 {
    font-size: 1.6rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 23px;
}

.section-header h2 {
    margin: 0;
}

.section-header p {
    margin: 0;
    color: var(--muted);
}

/* ==========================================
   KATEGORIKORT
   ========================================== */

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 78px;
    padding: 18px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: 0 2px 9px rgba(22, 63, 103, .025);
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}

.category-card:hover {
    border-color: #a9c7e5;
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
    text-decoration: none;
}

/* Ersätter gamla snedstreck med en tydlig symbol */

.category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 37px;
    width: 37px;
    height: 37px;
    padding: 0;
    background: var(--pale);
    color: var(--blue);
    border-radius: 10px;
    font-size: 0;
    line-height: 1;
}

.category-icon::before {
    content: '\2197';
    font-family: Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.chevron {
    margin-left: auto;
    color: #8ca7c2;
    font-size: 24px;
    line-height: 1;
    transition: transform .2s ease, color .2s ease;
}

.category-card:hover .chevron {
    color: var(--blue);
    transform: translateX(3px);
}

/* ==========================================
   WEBBPLATSKORT
   ========================================== */

.site-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.site-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 230px;
    padding: 27px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 15px;
    box-shadow: 0 3px 12px rgba(22, 63, 103, .025);
    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}

.site-card:hover {
    border-color: #b9d0e5;
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.site-card h3 {
    font-size: 1.09rem;
    margin: 0 0 13px;
    overflow-wrap: anywhere;
}

.site-card h3 a {
    color: var(--ink);
    text-decoration: none;
}

.site-card h3 a:hover {
    color: var(--blue);
}

.site-card p {
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.72;
    margin: 0 0 21px;
    flex: 1;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    overflow: hidden;
}

.read-more {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 6px;
    font-size: .94rem;
    font-weight: 700;
    text-decoration: none;
    margin-top: auto;
}

.read-more:hover {
    text-decoration: underline;
}

/* ==========================================
   BRÖDSMULOR OCH UNDERSIDOR
   ========================================== */

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 11px;
    color: var(--muted);
    font-size: .9rem;
    margin: 34px 0;
}

.breadcrumb a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--blue);
    text-decoration: underline;
}

.page-heading {
    padding: 16px 0 26px;
}

.page-heading h1 {
    font-size: clamp(29px, 4vw, 44px);
    margin: 4px 0 14px;
}

.page-heading > p {
    max-width: 760px;
    color: var(--muted);
}

.page-heading .searchbar {
    border: 1px solid var(--line);
    max-width: 800px;
}

/* ==========================================
   DETALJSIDOR
   ========================================== */

.detail {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: clamp(25px, 5vw, 58px);
    margin-bottom: 80px;
    box-shadow: var(--shadow);
}

.detail h1 {
    overflow-wrap: anywhere;
}

.detail-category {
    color: var(--muted);
}

.description {
    line-height: 1.9;
    white-space: normal;
    margin: 34px 0;
    overflow-wrap: anywhere;
}

.cta {
    display: inline-block;
}

.empty {
    color: var(--muted);
}

/* ==========================================
   SIDNUMRERING
   ========================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    margin: 35px 0;
}

.pagination a {
    font-weight: 700;
    text-decoration: none;
}

.pagination a:hover {
    text-decoration: underline;
}

/* ==========================================
   SIDFOT
   ========================================== */

.footer {
    background: #192f49;
    color: #d7e4f4;
    margin-top: 75px;
    padding: 32px 0;
}

.footer .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer a {
    color: #edf5ff;
}

/* ==========================================
   TILLGÄNGLIGHET
   ========================================== */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* ==========================================
   SURFPLATTOR
   ========================================== */

@media (max-width: 900px) {
    .wrap {
        width: min(100% - 32px, 1180px);
    }

    .category-grid,
    .site-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero {
        padding: 48px;
    }

    .brand img {
        width: min(300px, 43vw);
    }

    .nav nav {
        gap: 18px;
    }
}

/* ==========================================
   MOBIL
   ========================================== */

@media (max-width: 600px) {
    .wrap {
        width: calc(100% - 28px);
    }

    .nav {
        min-height: 85px;
        gap: 12px;
    }

    .brand img {
        width: min(205px, 49vw);
        max-height: 75px;
    }

    .nav nav {
        gap: 12px;
        font-size: .85rem;
    }

    .nav nav a {
        padding: 8px 0;
    }

    .hero {
        margin: 20px 0 38px;
        padding: 36px 23px;
        border-radius: 15px;
    }

    .hero h1 {
        font-size: clamp(29px, 7vw, 39px);
    }

    .hero p {
        font-size: 1rem;
    }

    .hero::after {
        opacity: .5;
    }

    .searchbar {
        gap: 5px;
        padding: 5px;
        margin-top: 24px;
    }

    .searchbar input {
        padding: 12px 9px;
        font-size: .92rem;
    }

    .searchbar button {
        padding: 11px 15px;
        font-size: .91rem;
    }

    .category-grid,
    .site-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .category-card {
        min-height: 72px;
        padding: 15px;
    }

    .site-card {
        min-height: 195px;
        padding: 23px;
    }

    .section {
        margin: 36px 0 55px;
    }

    .section-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .section h2 {
        font-size: 1.4rem;
    }

    .detail {
        margin-bottom: 45px;
    }

    .footer {
        margin-top: 50px;
    }

    .footer .wrap {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 380px) {
    .nav {
        flex-wrap: wrap;
        justify-content: center;
        padding: 14px 0;
    }

    .brand img {
        width: min(250px, 75vw);
    }

    .nav nav {
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .category-card,
    .site-card,
    .chevron,
    .searchbar button,
    .cta,
    .nav nav a {
        transition: none;
    }
}

