@font-face {
    font-family: 'LidingoLogical';
    src: url('../fonts/LidingoLogical-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* =========================
   TYPOGRAPHY
   Base font size: 16px
   ========================= */

:root {
    font-size: 16px;
    --font-h1: 2.8125rem; /* 45px */
    --font-h2: 2.3125rem; /* 37px */
    --font-h3: 1.9375rem; /* 31px */
    --font-h4: 1.625rem; /* 26px */
    --font-body: 1.125rem; /* 18px */
}

/* =========================
   GENERAL LAYOUT
   ========================= */

html, body {
    height: 100%;
}
html {
    scrollbar-gutter: stable;
}
body {
    font-family: 'LidingoLogical', Arial, sans-serif;
    font-size: var(--font-body);
    line-height: 1.5;
    background: #f4f6f9;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

/* =========================
   HEADINGS
   ========================= */

h1 {
    font-size: var(--font-h1);
    letter-spacing: -0.5px;
}

h2 {
    font-size: var(--font-h2);
}

h3 {
    font-size: var(--font-h3);
}

h4 {
    font-size: var(--font-h4);
}

/* =========================
   HEADER / NAVIGATION
   ========================= */

.navbar {
    padding: 0.75rem 0;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.2rem;
    padding: 16px 0;
}

    .navbar-brand .logo {
        width: 148px;
        height: 64px;
        object-fit: contain;
    }

.navbar-nav .nav-link {
    font-weight: 500;
    font-size: 1.125rem;
    color: #FFFFFF;
    padding: 0.5rem 1rem;
}

    .navbar-nav .nav-link:hover {
        color: #FFFFFF;
    }

/* =========================
   FOOTER
   ========================= */

footer {
    background-color: #002B49;
    padding: 15px 0;
    position: static;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
    color: #FFFFFF;
}

    footer span {
        color: #FFFFFF;
    }

    footer.footer {
        position: static !important;
        bottom: auto !important;
    }

/* =========================
   SEARCH FORM
   ========================= */

.search-input {
    font-family: 'LidingoLogical', Arial, sans-serif;
    font-size: 1.625rem; /* 26px */
    padding: 13px 24px !important;
    border-radius: 10px;
    line-height: 1.5;
}

    .search-input::placeholder {
        font-size: 1.625rem;
        opacity: 0.7;
    }

form .form-control,
form .form-select {
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    padding: 10px 14px;
    transition: all 0.2s ease;
}

    form .form-control:focus,
    form .form-select:focus {
        border-color: #111;
        box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
    }

/* Används av Index.cshtml och ExternalImageArchive.cshtml */
.searchform {
    padding-bottom: 1em;
}

    .searchform .form-control {
        height: 100%;
    }

    .searchform .btn {
        height: 100%;
        padding: 10px 16px;
    }

/* =========================
   BUTTONS
   ========================= */

.btn-dark {
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
}

    .btn-dark:hover {
        transform: translateY(-1px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    }

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 12px;
    background: #fff;
    color: #111;
    font-weight: 500;
    font-size: 0.95rem;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.25s ease;
}

    .back-btn:hover {
        background: #f4f4f4;
        transform: translateY(-2px);
        box-shadow: 0 6px 15px rgba(0,0,0,0.08);
        text-decoration: none;
    }

/* =========================
   GALLERY CARDS
   ========================= */

/* 3 × 440 px + 2 × 40 px = 1400 px, plus containerns padding 2 × 12 px */
.gallery-container {
    max-width: 1424px;
}

.gallery-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
}

.gallery-col {
    width: 440px;
    max-width: 100%;
}

.gallery-card {
    border: none;
    overflow: hidden;
    background: #fff;
}

    /* Bildyta 440 x 220 */
    .gallery-card .image-link {
        display: block;
        width: 100%;
        aspect-ratio: 2 / 1;
        overflow: hidden;
    }

        .gallery-card .image-link img {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center;
            transition: opacity 0.2s ease;
        }

    .gallery-card .card-body {
        padding: 10px 12px;
    }

    .gallery-card .gallery-card-title {
        font-size: 1.625rem; /* 26px */
        line-height: 40px;
        margin: 0;
        color: #555;
    }

    /* Hover */
    .gallery-card:hover .image-link img {
        opacity: 0.9;
    }

    .gallery-card:hover .gallery-card-title {
        text-decoration: underline;
    }

    /* Hela kortet är klickbart (bildlänken har klassen stretched-link),
       så rubriken visar samma tillstånd vid tangentbordsfokus */
    .gallery-card:focus-within {
        outline: 3px solid #4d7ea8;
        outline-offset: 2px;
    }

        .gallery-card:focus-within .gallery-card-title {
            text-decoration: underline;
        }

        .gallery-card .image-link:focus-visible {
            outline: none;
        }

/* =========================
   BILDARKIV – INFORMATIONSRUTA (_ArchiveInfo.cshtml)
   ========================= */

.archive-info {
    background: #fff;
    border-radius: 6px;
    padding: 40px 48px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 32px 64px;
    margin-bottom: 40px;
}

.archive-info-text {
    flex: 999 1 520px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.archive-info-eyebrow {
    margin: 0;
    font-size: 0.875rem; /* 14px */
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #3D5266;
}

.archive-info-title {
    margin: 0;
    font-size: 2.75rem; /* 44px */
    line-height: 1.1;
    font-weight: 600;
    color: #002B49;
}

.archive-info-lead {
    max-width: 720px;
    font-size: 1.1875rem; /* 19px */
    line-height: 1.55;
    color: #24313F;
}

    .archive-info-lead p {
        margin: 0 0 0.75em;
    }

        .archive-info-lead p:last-child {
            margin-bottom: 0;
        }

/* Sökfältet i rutan använder den gemensamma .site-search (se längst ned) */

/* Spridningsförbud */
/* Spridningsförbud – fast storlek uppe till höger */
.archive-notice {
    flex: 0 0 340px;
    max-width: 100%;
    background: #EAF0F5;
    border-radius: 6px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.archive-notice-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #002B49;
    font-size: 1.25rem;
}

.archive-notice-title {
    margin: 0;
    font-size: 1.125rem; /* 18px */
    font-weight: 600;
    color: #002B49;
}

.archive-notice-text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    color: #1F2933;
}

/* =========================
   PAGINATION
   ========================= */

.pagination .page-link {
    border-radius: 8px;
    margin: 0 3px;
    border: none;
    color: #333;
}

.pagination .page-item.active .page-link {
    background: #111;
    color: #fff;
}

/* =========================
   GLOBAL TRANSITIONS
   ========================= */

* {
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* =========================
   IMAGE VIEW
   ========================= */

.main-image {
    cursor: zoom-in;
    width: 100%;
    max-height: 75vh;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.image-card {
    position: relative;
    min-height: 300px;
}

    .image-card:hover .main-image {
        transform: scale(1.02);
    }

/* Info panel */

.info-card {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}

    .info-card h3 {
        font-weight: 600;
        letter-spacing: -0.3px;
    }

/* Metadata */

.meta p {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #444;
}

.meta span {
    color: #888;
    font-weight: 500;
}

/* Description */

.description {
    margin-top: 15px;
    color: #666;
    line-height: 1.5;
}

/* Download button */

.download-btn {
    border-radius: 12px;
    margin-top: 20px;
    padding: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

    .download-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    }

/* Navigation buttons */

.nav-buttons {
    display: flex;
    gap: 10px;
}

.nav-btn {
    padding: 10px 14px;
    border-radius: 10px;
    background: #f4f4f4;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

    .nav-btn:hover {
        background: #111;
        color: #fff;
        transform: translateY(-2px);
    }

/* =========================
   SPINNER
   ========================= */

.spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.6);
    z-index: 10;
}

    .spinner-overlay.fade-out {
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

.spinner {
    animation: rotate 1s linear infinite;
    width: 50px;
    height: 50px;
}

    .spinner .path {
        stroke: #333;
        stroke-linecap: round;
        animation: dash 1.5s ease-in-out infinite;
    }

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* =========================
   LIGHTBOX
   ========================= */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    z-index: 1050;
    cursor: zoom-out;
}

    .lightbox img {
        max-width: 90%;
        max-height: 90%;
        border-radius: 5px;
        box-shadow: 0 0 30px rgba(0,0,0,0.7);
        animation: fadeIn 0.3s ease;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================
   TOGGLE
   ========================= */

.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

    .toggle input {
        display: none;
    }

.slider {
    width: 42px;
    height: 22px;
    background: #ccc;
    border-radius: 999px;
    position: relative;
    transition: 0.2s;
}

    .slider::before {
        content: "";
        position: absolute;
        width: 18px;
        height: 18px;
        background: white;
        border-radius: 50%;
        top: 2px;
        left: 2px;
        transition: 0.2s;
    }

.toggle input:checked + .slider {
    background: #198754;
}

    .toggle input:checked + .slider::before {
        transform: translateX(20px);
    }

.label-text {
    font-size: 0.95rem;
}

/* =========================
   HERO SEARCH
   ========================= */

.hero-search {
    background-image: url('../images/hero.jpg');
    background-size: cover;
    background-position: center;
    min-height: 500px;
    display: flex;
    align-items: center;
    position: relative;
    color: white;
}

    .hero-search::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.5);
    }

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5em;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 25px;
    opacity: 0.9;
}

.hero-search .form-control {
    border: none;
    border-radius: 6px;
    padding: 12px;
}

.hero-search .btn {
    border-radius: 6px;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 991px) {
    .main-image {
        max-height: 60vh;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1rem;
    }

    .navbar-collapse {
        margin-top: 10px;
        padding: 10px 0;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    .archive-info {
        padding: 24px 20px;
    }

    .archive-info-title {
        font-size: 2rem;
    }
    .archive-notice {
        flex-basis: 100%;
    }
}
/* PDF-kort – visa hela sidan i stället för att beskära */
.pdf-card .image-link {
    aspect-ratio: 4 / 3; /* 440 x 330 */
    background: #EAF0F5;
    padding: 20px;
    box-sizing: border-box;
}

    .pdf-card .image-link img {
        object-fit: contain;
        filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
    }

/* =========================
   SAMLAD SÖKNING (startsidan)
   ========================= */

.search-page {
    background: #CDD5DE;
    padding: 3rem 0 4rem;
    min-height: 100%;
}

.search-page-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

.search-page-title {
    font-size: var(--font-h1);
    font-weight: 500;
    color: #2b2b2b;
    margin-bottom: 1.75rem;
}

/* Sökfält + mörk knapp */
.search-page-form {
    display: flex;
    box-shadow: 0 6px 20px rgba(0, 43, 73, 0.08);
}

.search-page-input {
    flex: 1;
    min-width: 0;
    font-family: inherit;
    font-size: 1.125rem;
    padding: 0.9rem 1.25rem;
    border: 1px solid #8a9aab;
    border-right: none;
    border-radius: 0;
    background: #fff;
}

    .search-page-input:focus {
        outline: 3px solid #4d7ea8;
        outline-offset: -3px;
    }

.search-page-button {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 2rem;
    border: none;
    background: #002B49;
    color: #fff;
    font-family: inherit;
    font-size: 1.5rem;
    transition: background 0.2s ease;
}

    .search-page-button:hover,
    .search-page-button:focus-visible {
        background: #0b3d63;
    }

.search-page-count {
    font-size: 0.9rem;
    color: #3d4a57;
    margin: 0.85rem 0 1.5rem;
}

/* Filterknappar */
.search-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.25rem;
}

.search-tab {
    display: inline-block;
    padding: 0.45rem 1.6rem;
    border: 1px solid #2b2b2b;
    border-radius: 999px;
    color: #2b2b2b;
    font-size: 1rem;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

    .search-tab:hover {
        background: rgba(255, 255, 255, 0.5);
        color: #2b2b2b;
    }

    .search-tab.is-active {
        background: #002B49;
        border-color: #002B49;
        color: #fff;
    }

/* Träfflista */
.search-results {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.search-result {
    position: relative;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    background: #fff;
    padding: 1.4rem 1.4rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

    .search-result:hover {
        box-shadow: 0 8px 22px rgba(0, 43, 73, 0.14);
        transform: translateY(-2px);
    }

.search-result-thumb {
    flex: 0 0 180px;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #EAF0F5;
}

    .search-result-thumb img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* PDF: visa hela sidan */
    .search-result-thumb.is-document {
        padding: 8px;
    }

        .search-result-thumb.is-document img {
            object-fit: contain;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
        }

.search-result-body {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0 0 0.4rem;
    line-height: 1.3;
}

    .search-result-title a {
        color: #2b2b2b;
        text-decoration: none;
    }

    .search-result:hover .search-result-title a,
    .search-result-title a:focus-visible {
        text-decoration: underline;
    }

.search-result-text {
    font-size: 1rem;
    color: #2b2b2b;
    max-width: 62ch;
    margin: 0 0 0.9rem;
}

.search-result-meta {
    font-size: 0.95rem;
    color: #6b7680;
    margin: 0;
}

.search-results mark {
    background: #F7E9C6;
    color: inherit;
    padding: 0 0.15em;
}

/* "Visa fler" och meddelanden */
.search-more a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0 0.75rem;
    color: #002B49;
    font-weight: 500;
    text-decoration: none;
}

    .search-more a:hover {
        text-decoration: underline;
    }

.search-notice {
    background: rgba(255, 255, 255, 0.6);
    padding: 1rem 1.4rem;
    color: #3d4a57;
}

.search-empty {
    background: #fff;
    padding: 2rem;
}

    .search-empty h2 {
        font-size: var(--font-h4);
    }

    .search-empty ul {
        margin: 0;
        padding-left: 1.2rem;
    }

@media (max-width: 576px) {
    .search-page {
        padding-top: 2rem;
    }

    .search-page-title {
        font-size: 2rem;
    }

    .search-page-button {
        padding: 0 1.1rem;
        font-size: 1.2rem;
    }

    .search-result {
        flex-direction: column;
        gap: 1rem;
    }

    .search-result-thumb {
        flex-basis: auto;
        width: 100%;
    }
}

/* =========================
   TILLBAKALÄNK (detaljsidor)
   ========================= */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.4rem 0.5rem 1.1rem;
    border: 1px solid #002B49;
    border-radius: 999px;
    background: transparent;
    color: #002B49;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

    .back-link .bi {
        font-size: 1.1rem;
        transition: transform 0.15s ease;
    }

    .back-link:hover,
    .back-link:focus-visible {
        background: #002B49;
        color: #fff;
    }

        .back-link:hover .bi {
            transform: translateX(-3px);
        }

    .back-link:focus-visible {
        outline: 3px solid #4d7ea8;
        outline-offset: 2px;
    }

/* =========================
   SÖKRUTA (gemensam)
   Används på startsidan (hero) och i informationsrutan
   på Images, ExternalImageArchive m.fl. (_ArchiveInfo)
   ========================= */

.site-search {
    display: flex;
    width: 100%;
    max-width: 560px;
    background: #fff;
}

.site-search-input {
    flex: 1;
    min-width: 0;
    height: 56px;
    padding: 0 1.25rem;
    border: none;
    border-radius: 0;
    background: #fff;
    color: #2b2b2b;
    font-family: inherit;
    font-size: 1.375rem;
}

    .site-search-input::placeholder {
        color: #5f6b77;
        opacity: 1;
    }

    .site-search-input:focus {
        outline: 3px solid #4d7ea8;
        outline-offset: -3px;
    }

.site-search-button {
    flex: 0 0 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0;
    background: #002B49;
    color: #fff;
    font-size: 1.35rem;
    transition: background 0.15s ease;
}

    .site-search-button:hover {
        background: #0b3d63;
    }

    .site-search-button:focus-visible {
        outline: 3px solid #fff;
        outline-offset: -5px;
    }

/* På startsidan: centrerad, med skugga mot den mörka bilden */
.site-search--hero {
    margin: 0 auto 1em;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

/* I den vita informationsrutan: vänsterställd, med kant i stället för skugga */
.site-search--archive {
    margin-top: 14px;
    max-width: 720px;
    border: 1px solid #9AA5B1;
}

    .site-search--archive:focus-within {
        border-color: #002B49;
    }
