/*
 * Where the site deliberately differs from the WordPress theme's own CSS (SPEC.md D26, D27), and the styles of what
 * the port added (the banner's buttons, the grid's icons, »Knap«). On every page, after the theme's files
 * (Views/Layout.cshtml), and in the backoffice previews (appsettings.json, BlockPreview). The theme's files are kept
 * as WordPress served them, so the corrections live here. The layout check applies this file to WordPress too
 * (tests/parity/layout.mjs), so it still catches everything else.
 */

/* ---------- Lists in the editor's texts (Trello 440, D26) ---------- */

/*
 * Cards. The theme moves a card's bullet to the left twice: left: -1em (.wp-block-list li::before) and
 * margin-left: -1em (.card-body li:before). It ended up outside the card, and the slider cut it off on the first
 * card. Once is enough: the bullet stands just inside the card's edge.
 */
.card-body .wp-block-list li::before { margin-left: 0 !important; }

/*
 * A list in a centred text: the text above a card row or above the questions, and an answer. The bullet stays at the
 * left edge of the column while the item's text is centred, hundreds of pixels apart. Centre the list as a block
 * instead, as wide as its longest item, with its items reading from the left and their bullets beside them.
 * Not in cards or other left-aligned boxes inside a centred section; not a list that is itself marked centred, as
 * WordPress's editor did; not a list inside a list.
 */
.text-center .wp-block-list:not(.text-center):not(.card-body .wp-block-list):not(.text-start .wp-block-list):not(li > .wp-block-list) {
    display: table;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

/* ---------- The first block under the banner (Trello 442, D27) ---------- */

/*
 * A page's intro or an article with an image beside its text: the theme starts the text column 130px down. The
 * column sticks to the top of the window while the page scrolls (position: sticky; top: 0), and the 130px keep its
 * heading clear of the fixed header. Before any scrolling they were 138px of empty space between the breadcrumb and
 * the heading. Now the column starts 40px down and sticks 90px from the top: the same place while it sticks, and
 * the heading 90px closer to the banner.
 */
@media (min-width: 992px) {
    .site-content.single .entry-content .scroll, .scroll {
        padding-top: 40px;
        top: 90px;
    }
}

/* ---------- The top banner's buttons (Lea, 5 Oct 2026) ---------- */

/*
 * »Knappens link« and »Link til knap nummer to« on a banner slide (Views/Partials/Chrome/Hero.cshtml): a white button
 * and a see-through one beside it, on the darkened picture. On hover both turn the theme's blue (child/style.css,
 * .btn:hover).
 */
.bmg-hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.5rem;
}
.bmg-hero-btn {
    color: rgb(44, 62, 80);
    background-color: #fff;
    border-color: #fff;
    text-shadow: none;
}
.bmg-hero-btn--ghost {
    color: #fff;
    background-color: transparent;
    border-color: rgba(255, 255, 255, .85);
}

/* ---------- The icons in »Gitter · 3 kolonner« (Lea, 5 Oct 2026) ---------- */

/*
 * An item's own »Ikon« (Font Awesome), drawn like the theme's calendar it replaces (Chrome/LinkGridIcon.cshtml): the
 * same pale circle, the same dark colour, filling the same quarter of the card.
 */
.bmg-grid-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border-radius: 50%;
    background-color: #e6edef;
    color: #313e4f;
    container-type: inline-size;
}
.bmg-grid-icon i {
    font-size: 44cqi;
}

/* ---------- »Knap« in the editors' texts (Lea, 5 Oct 2026) ---------- */

/* A button in a centred text (above a card row or the questions) stands in the middle too (Rendering/Text.Buttons). */
.text-center .wp-block-buttons.bmg-knap {
    justify-content: center;
}

/* ---------- Links in the editors' texts (Trello 456, D32) ---------- */

/*
 * A link Lea writes in a text is bold and BmyGuest blue. The theme printed it black, without an underline, at
 * almost the weight of the text around it (child/style.css, p a), so a reader could not see it was a link.
 * Only links in a paragraph, list item or table cell of the page's own text (inside <main>) or of a section (the
 * bands after </main>, .fade-in-element, as in WordPress): not the breadcrumb, the buttons (the tabbed carousel's
 * among them), or the support guides and the self-service page, which have link styles of their own. Not the cards
 * either: there a link usually is the whole text or list item (WordPress's cards on /visitor-management/), and the
 * card would turn bold and blue. Nor the shared sections' cards and logos (»Én platform, flere moduler«, »Logobånd«),
 * whose links are whole cards and pictures. The theme's weight is !important, so this one must be too. :host is the
 * backoffice preview, which has neither.
 */
:is(.site-main:not(.bmg-support):not(.ss), .fade-in-element) :is(p, li, td) a:not(nav a):not(.card a):not(.read-more):not(.btn):not(.bmg-tc__btn):not(.bmg-modules__card):not(.bmg-logos__link),
:host :is(p, li, td) a:not(nav a):not(.card a):not(.read-more):not(.btn):not(.bmg-tc__btn):not(.bmg-modules__card):not(.bmg-logos__link) {
    color: #2a5d87;
    font-weight: 700 !important;
    font-variation-settings: "wght" 700 !important;
}

/* ---------- The search (Trello 476, D33) ---------- */

/*
 * The field and its button side by side: in the magnifier's dropdown in the header (wide screens), in the bar under
 * the header on phones, and on the search page (Chrome/SearchForm.cshtml, Views/Search.cshtml).
 */
.bmg-search-form {
    display: flex;
    gap: .5rem;
}
.bmg-search-form .form-control {
    flex: 1 1 auto;
    min-width: 0;
}
/* The dropdown: the theme's menus have no frame and a link style of their own; this one is a small white panel. */
#nav-main .bmg-search__menu {
    width: 24rem;
    padding: 1rem;
    border-radius: .75rem;
    box-shadow: 0 .5rem 1.5rem rgba(10, 24, 53, .15);
}
.bmg-search-results {
    list-style: none;
    padding: 0;
    margin: 0;
}
.bmg-search-results li {
    padding: 1.25rem 0;
    border-top: 1px solid rgba(10, 24, 53, .12);
}
.bmg-search-results__title {
    display: inline-block;
    font-size: 1.25rem;
    margin-bottom: .25rem;
}
.bmg-search-results__text {
    margin: 0;
}
.bmg-search-results mark {
    padding: 0 .1em;
    background-color: #fff1a8;
    color: inherit;
}

/* ---------- The cookie banner's categories (D29) ---------- */

/*
 * Their headings were <h2 class="accordion-header">: five headings before the page's H1. They are divs now
 * (Chrome/CookieBanner.cshtml) and keep what the theme gave the h2: its 32px above, and the line height and weight
 * the button inside inherits. So the banner looks as before.
 */
#cookieAccordion .accordion-header {
    margin-top: 2rem;
    line-height: 1.2;
    font-weight: 700;
    font-variation-settings: "wght" 700;
}
