/* =========================================================================
   opr-archive.css
   Styles default WordPress / Total-theme category archive pages
   (e.g. /sv/category/kunskapsbank/, /sv/category/nyheter/) into the
   Opranic visual language.

   Loaded on body.archive only (so it never affects single posts).

   Author: Opranic + Claude session, 24 May 2026
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Page wrapper, hero-like top section
   ------------------------------------------------------------------------- */

body.archive #content-wrap {
    max-width: 1280px;
    padding: 40px 24px 80px;
}

/* The .term-description block contains the category description paragraph.
   We restyle it as a proper hero header instead of a bare paragraph. */
body.archive .term-description {
    text-align: center;
    margin: 0 auto 56px;
    max-width: 720px;
    padding: 0;
    border: none;
    background: transparent;
}

body.archive .term-description::before {
    content: attr(data-title);
    display: block;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #EE9305;
    margin-bottom: 12px;
}

body.archive .term-description p {
    font-size: 20px;
    line-height: 1.5;
    color: #262626;
    margin: 0;
    font-weight: 400;
}

/* Inject the category title above the description.
   Since WordPress doesn't render the H1 here, we use a CSS pseudo-element. */
body.archive.category-kunskapsbank .term-description::before { content: "Kunskapsbank"; }
body.archive.category-nyheter .term-description::before { content: "Nyheter"; }

/* Generic fallback for any other future category */
body.archive .term-description::before { content: "Arkiv"; }
body.archive.category-kunskapsbank .term-description::before { content: "Kunskapsbank"; }
body.archive.category-nyheter .term-description::before { content: "Nyheter"; }

/* -------------------------------------------------------------------------
   2. Posts grid
   ------------------------------------------------------------------------- */

body.archive #blog-entries {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin: 0;
    padding: 0;
}

@media (max-width: 1024px) {
    body.archive #blog-entries {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px;
    }
}

@media (max-width: 640px) {
    body.archive #blog-entries {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* Hide the entry-divider, gap handles separation */
body.archive .entry-divider {
    display: none !important;
}

/* -------------------------------------------------------------------------
   3. Individual post-card
   ------------------------------------------------------------------------- */

body.archive .blog-entry {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 200ms ease, transform 200ms ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
}

body.archive .blog-entry:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

body.archive .blog-entry-inner {
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* -------------------------------------------------------------------------
   4. Card image
   ------------------------------------------------------------------------- */

body.archive .blog-entry-media {
    margin: 0 !important;
    padding: 0;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f4f4f4;
}

body.archive .blog-entry-media-link {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body.archive .blog-entry-media-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 400ms ease;
}

body.archive .blog-entry:hover .blog-entry-media-img {
    transform: scale(1.04);
}

/* -------------------------------------------------------------------------
   5. Card header + meta
   ------------------------------------------------------------------------- */

body.archive .blog-entry-header {
    padding: 20px 22px 8px;
    margin: 0 !important;
}

body.archive .blog-entry-title {
    font-size: 19px !important;
    line-height: 1.35;
    margin: 0 !important;
    font-weight: 500;
    letter-spacing: -0.01em;
}

body.archive .blog-entry-title a {
    color: #262626;
    text-decoration: none;
    transition: color 150ms ease;
}

body.archive .blog-entry-title a:hover {
    color: #EE9305;
}

body.archive .blog-entry-meta {
    padding: 0 22px;
    margin: 0 0 12px !important;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 13px;
    color: #777;
}

body.archive .blog-entry-meta li {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

/* Hide the meta icons, they add visual clutter in a grid view */
body.archive .blog-entry-meta .meta-icon {
    display: none !important;
}

/* Hide the author meta-item entirely on archive cards (it's almost always "Opranic") */
body.archive .blog-entry-meta .meta-author {
    display: none !important;
}

/* The category meta is redundant on a category archive (every post says "Kunskapsbank" on the Kunskapsbank page).
   Only hide it on its own category archive. Show on multi-category archives. */
body.archive.category-kunskapsbank .blog-entry-meta .meta-category .term-17,
body.archive.category-nyheter .blog-entry-meta .meta-category a[href*="/category/nyheter/"] {
    display: none;
}
body.archive .blog-entry-meta .meta-category a {
    color: #EE9305;
    text-decoration: none;
}
body.archive .blog-entry-meta .meta-category a:hover {
    text-decoration: underline;
}

/* -------------------------------------------------------------------------
   6. Excerpt
   ------------------------------------------------------------------------- */

body.archive .blog-entry-excerpt {
    padding: 0 22px;
    margin: 0 0 18px !important;
    flex: 1 1 auto;
}

body.archive .blog-entry-excerpt p {
    font-size: 14px;
    line-height: 1.55;
    color: #555;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* -------------------------------------------------------------------------
   7. Read more button
   ------------------------------------------------------------------------- */

body.archive .blog-entry-readmore {
    padding: 0 22px 22px;
    margin: 0 !important;
}

body.archive .blog-entry-readmore .theme-button {
    background: transparent !important;
    color: #EE9305 !important;
    border: none !important;
    padding: 0 !important;
    font-size: 0 !important;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    display: inline-flex;
    align-items: center;
    box-shadow: none !important;
}

body.archive .blog-entry-readmore .theme-button::after {
    content: "Läs mer →";
    font-size: 14px !important;
    font-weight: 500;
    color: #EE9305;
    transition: transform 150ms ease;
    display: inline-block;
}

body.archive .blog-entry-readmore .theme-button:hover::after {
    transform: translateX(4px);
}

/* -------------------------------------------------------------------------
   8. Pagination
   ------------------------------------------------------------------------- */

body.archive .wpex-pagination {
    margin: 56px auto 0;
    text-align: center;
}

body.archive .wpex-pagination .page-numbers {
    display: inline-flex;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}

body.archive .wpex-pagination .page-numbers li {
    margin: 0;
    padding: 0;
}

body.archive .wpex-pagination .page-numbers .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #262626;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 150ms ease;
}

body.archive .wpex-pagination .page-numbers .page-numbers:hover {
    background: #F0F0F0;
    border-color: #EE9305;
    color: #EE9305;
}

body.archive .wpex-pagination .page-numbers .page-numbers.current {
    background: #EE9305;
    border-color: #EE9305;
    color: #ffffff;
}

body.archive .wpex-pagination .page-numbers-icon svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* -------------------------------------------------------------------------
   9. Hide breadcrumb on archive pages (optional, can comment out)
   The breadcrumb on /sv/category/X/ is just "HOME » X" which duplicates the
   hero title. Hiding it cleans the top.
   ------------------------------------------------------------------------- */

/*
body.archive .site-breadcrumbs {
    display: none;
}
*/
