/*
 * Blue Lobster — indholdsklasser fra det gamle CMS.
 *
 * De 131 blogindlæg ligger i databasen som rå HTML med klasser fra den gamle
 * skabelon (.text-normal, .contentheadline, .table-article-2 …). Indlæggene kan
 * ikke laves om, så i stedet oversættes klasserne her til det nye designsprog.
 * Samme klasser bruges af beregnersiderne (låneberegner m.fl.).
 *
 * Indlæs KUN sammen med blue.css — tokens herfra bruges nedenfor.
 */

/* ---- Brødtekst ---------------------------------------------------------- */
/* De <br /> mellem afsnittene fjernes ved visning (tidy_article_html), så
   luften mellem afsnit styres her — ét sted — i stedet for af indholdet. */
.text-normal,
.text-normalt {
    color: var(--foreground);
    margin-block: 1.125rem;
    line-height: 1.75;
}

.text-main {
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1.3;
    color: var(--primary);
    margin-block: 2rem 0.75rem;
}

.text-main-2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    line-height: 1.35;
    color: var(--primary);
    margin-block: 1.75rem 0.75rem;
}

/* Overskrifter i indlæg. Var display:inline i det gamle tema — sat til block,
   da de altid står alene i deres egen tag efterfulgt af <br> eller <p>. */
h2.contentheadline,
h3.contentheadline,
h4.contentheadline,
h5.contentheadline {
    display: block;
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--primary);
    text-align: left;
    text-transform: none;
    letter-spacing: -0.01em;
    margin: 2.5rem 0 0.75rem;
    padding: 0;
}

h2.contentheadline { font-size: 1.5rem; }
h3.contentheadline { font-size: 1.25rem; }
h4.contentheadline { font-size: 1.0625rem; }
h5.contentheadline { font-size: 0.9375rem; }

/* ---- Lister ------------------------------------------------------------- */
.list {
    padding-top: 0.5rem;
    margin-left: 1.25rem;
    margin-bottom: 1.75rem;
}

.list-item {
    padding-left: 0.25rem;
    color: var(--foreground);
    line-height: 1.75;
}

/* ---- Tabeller ----------------------------------------------------------- */
/* Brede tabeller ruller i sig selv frem for at sprænge siden på mobil */
.table-wrap {
    overflow-x: auto;
    width: 100%;
    margin: 0.75rem auto;
}

.table-article-2 {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    font-size: 0.875rem;
}

.table-article-2 .h {
    font-weight: 600;
}

.table-article-2 th {
    background-color: var(--primary);
    color: var(--primary-foreground);
    padding: 0.625rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.table-article-2 td {
    color: var(--foreground);
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--border);
}

.table-article-2 tbody tr:nth-child(even) {
    background-color: var(--muted);
}

/* Beløbskolonnen — tal læses lettere med ens cifferbredde */
.table-article-2 td.data {
    font-weight: 500;
}

.table-article-2 td:not(.data) {
    font-variant-numeric: tabular-nums;
}

/* Negative beløb. Havde ingen styling i det gamle tema; markeres nu,
   da klassen tydeligvis er sat med det formål. */
.negativ {
    color: oklch(0.55 0.19 20);
}

/* ---- Billeder med tekstombrydning --------------------------------------- */
/* 9 indlæg bruger <figure class="left|right"> til at lade teksten løbe rundt om
   et billede. Det gamle tema floatede ALT til højre — også class="left", som
   ingen regel havde. Her følges klassen, som markup'et lægger op til. */
figure {
    float: right;
    max-width: 45%;
    margin: 0.5rem 0 1.25rem 1.75rem;
    padding: 0;
}

figure.left {
    float: left;
    margin: 0.5rem 1.75rem 1.25rem 0;
}

figure img {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

figure figcaption {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--muted-foreground);
}

/* Floats må ikke slippe ud af indlægget og lægge sig oven i kommentarer m.m. */
.article-body::after {
    content: "";
    display: table;
    clear: both;
}

/* På mobil er der ikke plads til at ombryde — billedet får hele bredden */
@media (max-width: 640px) {
    figure,
    figure.left {
        float: none;
        max-width: 100%;
        margin: 1.25rem 0;
    }
}

/* ---- Billeder og video -------------------------------------------------- */
.stor-img img {
    width: 100%;
    height: auto;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

/* 16:9-boks, så YouTube-embeds skalerer med spalten */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin-block: 1.5rem;
    border-radius: 0.75rem;
}

.video-container iframe,
.video-container object,
.video-container embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---- Bokse -------------------------------------------------------------- */
div.interne-links {
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background-color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.75;
    margin-block: 1.25rem;
    max-width: 25rem;
}

.spons {
    display: block;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    background-color: var(--muted);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
}

.spons a {
    color: var(--muted-foreground);
    text-decoration: underline;
}

/* ---- Webshop-bokse ------------------------------------------------------ */
/* Sættes ind i indlæg, hvor teksten indeholder <!--BOX--> (se artikel.php) */
.atable {
    margin-block: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    overflow: hidden;
}

.arow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-top: 1px solid var(--border);
    background-color: var(--card);
}

.arow:first-child {
    border-top: 0;
}

.acell {
    min-width: 0;
}

.aimgcell { flex: 0 0 auto; }
.atop     { flex: 1 1 14rem; }
.abtncell { flex: 0 0 auto; margin-left: auto; }

.aimg {
    width: 9.375rem;
    height: 3.75rem;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.aheadline {
    font-family: var(--font-display);
    font-size: 1.125rem;
    color: var(--primary);
    text-decoration: none;
}

.aheadline:hover {
    color: var(--accent);
}

.atop p {
    margin-top: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--muted-foreground);
}

.abtn {
    display: block;
    min-width: 7.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.375rem;
    background-color: var(--accent);
    color: var(--accent-foreground);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.15s;
}

.abtn:hover {
    background-color: color-mix(in oklch, var(--accent) 90%, black);
}

/* ---- Facebook-kommentarer ----------------------------------------------- */
.comments {
    margin-top: 4rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
}

/* ---- Beregnersider ------------------------------------------------------ */
.drill {
    background-color: var(--muted);
    border-radius: 1rem;
    padding: 2rem;
    margin-block: 2rem;
}

.drill-heading {
    width: 100%;
    margin: 0 auto 1rem;
}

.drill-content {
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
}

.text-drill-strong {
    font-weight: 600;
    color: var(--foreground);
}

.text-drill-light {
    color: var(--muted-foreground);
}

#loan-form,
#boern {
    background-color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-block: 1.5rem;
    font-size: 0.875rem;
}

#loan-form input,
#loan-form select,
#boern input,
#boern select {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background-color: var(--card);
    color: var(--foreground);
    max-width: 100%;
}

#loan-form input:focus,
#loan-form select:focus,
#boern input:focus,
#boern select:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

input.knap {
    width: auto;
    min-width: 9.375rem;
    background-color: var(--primary);
    color: var(--primary-foreground);
    border: 0;
    border-radius: 0.375rem;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s;
}

input.knap:hover {
    background-color: color-mix(in oklch, var(--primary) 90%, white);
}

@media (max-width: 640px) {
    .drill {
        padding: 1.25rem;
    }

    .drill-content {
        grid-template-columns: 1fr;
    }
}
