/* Katalogsidene /katalog og lesevisningen.
   Var inline i catalog-styles.blade.php - flyttet hit 7. sep 2026 så nettleseren cacher den (ett år via .htaccess, ?v=filemtime). */

.kat-intro { max-width: 60ch; color: var(--muted); margin: 0 0 26px; }

.kat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 22px;
    margin: 0 0 40px;
    padding: 0;
    list-style: none;
}

.kat-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.kat-card:hover {
    transform: translateY(-3px);
    border-color: var(--brand);
    box-shadow: 0 10px 24px rgba(17, 24, 39, .10);
}

.kat-cover {
    position: relative;
    aspect-ratio: 3 / 4;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}
.kat-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kat-cover svg { width: 54px; height: 54px; color: var(--line); }

.kat-badge {
    position: absolute;
    left: 10px;
    top: 10px;
    background: var(--brand);
    color: #fff;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.kat-body { padding: 13px 15px 16px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.kat-title { font-size: .98rem; font-weight: 700; color: var(--ink); line-height: 1.35; }
.kat-desc  { font-size: .82rem; color: var(--muted); line-height: 1.45; }
.kat-meta  { margin-top: auto; padding-top: 8px; font-size: .76rem; color: var(--muted); }

.kat-empty {
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
    margin-bottom: 34px;
}

/* ── Lesevisning ────────────────────────────────────────── */

.kat-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}
.kat-head h1 { margin: 0 0 4px; }
.kat-head-meta { color: var(--muted); font-size: .85rem; }
.kat-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.kat-viewer {
    width: 100%;
    height: min(82vh, 1100px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    display: block;
}

/* Mobilnettlesere nekter stort sett å vise PDF i en ramme —
   der får kunden forsiden og en knapp i stedet. */
.kat-mobile { display: none; }

@media (max-width: 780px) {
    .kat-viewer { display: none; }
    .kat-mobile {
        display: block;
        text-align: center;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        padding: 22px 18px 26px;
        background: var(--surface);
    }
    .kat-mobile img {
        max-width: 260px;
        width: 100%;
        border-radius: 6px;
        border: 1px solid var(--line);
        margin-bottom: 18px;
    }
}

/* Tilbake til oversikten — leseren fyller skjermen, så
   veien tilbake må finnes både over og under den. */
.kat-back { display: inline-flex; align-items: center; gap: 6px; }
.kat-back svg { width: 15px; height: 15px; }
.kat-back-foot { margin: 16px 0 0; font-size: .88rem; }
.kat-back-foot a { color: var(--brand); font-weight: 600; text-decoration: none; }
.kat-back-foot a:hover { text-decoration: underline; }

.kat-more { margin: 38px 0 0; }
.kat-more h2 { font-size: 1.05rem; margin: 0 0 14px; }
