/*
 * dflag.se front page: Material 3 in a pink tone (David 2026-10-22: "låt huvudsidan gå i en rosa ton"), built like
 * Lunchklubben's theme: Nunito, quiet tinted surfaces instead of outlines, rounded shapes, light and dark after the
 * device. Every text colour pair is at least 4.5:1 (WCAG AA), white on the primary 5.9:1.
 */

@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/nunito-latin-400-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/nunito-latin-700-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Nunito";
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url("../fonts/nunito-latin-800-normal.woff2") format("woff2");
}

:root {
    color-scheme: light dark;
    --primary: #c2185b;
    --on-primary: #ffffff;
    --container: #ffd9e2;
    --on-container: #6b0d32;
    --bg: #fff8f9;
    --surface: #fff0f3;
    --surface-high: #ffe3ea;
    --text: #22191c;
    --text-2: #6c5a61;
    --radius-card: 24px;
    --font: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #ffb1c8;
        --on-primary: #5e1133;
        --container: #76153b;
        --on-container: #ffd9e2;
        --bg: #181114;
        --surface: #2b1f23;
        --surface-high: #3b2a30;
        --text: #f3e8eb;
        --text-2: #cbb7be;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1,
h2,
p {
    margin: 0;
}

/* top app bar */

.app-bar {
    padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}

.app-bar__inner {
    display: flex;
    align-items: center;
    max-width: 1080px;
    height: 64px;
    margin: 0 auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
    border-radius: 14px;
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary);
    color: var(--on-primary);
}

.brand__mark .icon {
    width: 26px;
    height: 26px;
}

.brand__name {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.brand__tld {
    color: var(--primary);
}

/* page */

.page {
    /* the same 1080 px of content as the app bar: the padding is inside this box */
    max-width: calc(1080px + 32px);
    margin: 0 auto;
    padding: 0 max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
}

.hero {
    padding: 20px 0 8px;
}

.hero h1 {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.hero p {
    margin-top: 8px;
    color: var(--text-2);
    font-size: 1.08rem;
}

.group {
    margin-top: 28px;
}

.group__title {
    margin-bottom: 12px;
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.25;
}

/* cards: the whole card is the link */

.cards {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.card {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
    min-height: 88px;
    padding: 16px;
    border-radius: var(--radius-card);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: background-color 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.card:hover {
    background: var(--surface-high);
}

.card:active {
    transform: scale(0.985);
}

.card:focus-visible,
.brand:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
}

.card__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--container);
    color: var(--on-container);
}

.card__icon .icon {
    width: 28px;
    height: 28px;
}

.card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.card__title {
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.card__text {
    color: var(--text-2);
    font-size: 0.95rem;
    line-height: 1.4;
}

.card__go {
    flex: none;
    width: 20px;
    height: 20px;
    color: var(--text-2);
    fill: currentColor;
}

.card:hover .card__go {
    color: var(--primary);
}

.icon {
    display: block;
    fill: currentColor;
}

.badge {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 9px;
    border-radius: 999px;
    background: var(--primary);
    color: var(--on-primary);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.6;
    vertical-align: 2px;
    white-space: nowrap;
}

.footer {
    padding: 40px 16px max(32px, env(safe-area-inset-bottom));
    color: var(--text-2);
    font-size: 0.875rem;
    text-align: center;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* wider screens: two and then three columns */

@media (min-width: 640px) {
    .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .hero {
        padding-top: 32px;
    }

    .hero h1 {
        font-size: 2.4rem;
    }
}

@media (min-width: 1000px) {
    .cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .group {
        margin-top: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .card {
        transition: none;
    }

    .card:active {
        transform: none;
    }
}
