/* The back-office in the colours of Le Petit Crieur, on top of the Django admin styles.

   Colours and fonts of the public site (landing/styles.css): navy, yellow and cream,
   Alfa Slab One for the titles, Atkinson Hyperlegible for the text. Loaded after every
   admin stylesheet (admin/base_site.html). Each colour is an admin variable, redefined
   for dark mode the way the admin does it (dark_mode.css): the system setting unless the
   toggle forces light, then the toggle's dark. */

@font-face {
    font-family: "Alfa Slab One";
    src: url("../site/fonts/alfa-slab-one-latin-400-normal.a67b53512e75.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Atkinson Hyperlegible";
    src: url("../site/fonts/atkinson-hyperlegible-latin-400-normal.f1f8a8210104.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Atkinson Hyperlegible";
    src: url("../site/fonts/atkinson-hyperlegible-latin-700-normal.13a58e05dfd2.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}

html[data-theme="light"],
:root {
    --lpc-navy: #17233a;
    --lpc-yellow: #f4c542;
    --lpc-cream: #fff6da;
    --lpc-on-accent: #17233a;
    --lpc-card: #ffffff;
    --lpc-card-head: #faf7ef;
    --lpc-input: #ffffff;
    --lpc-shadow: 0 1px 2px rgba(23, 35, 58, 0.06);
    --lpc-focus: rgba(244, 197, 66, 0.45);
    --lpc-title-font: "Alfa Slab One", Georgia, serif;

    --primary: #2e4268;
    --secondary: #17233a;
    --accent: #f4c542;
    --primary-fg: #ffffff;

    --body-fg: #1e2738;
    --body-bg: #f5f3ec;
    --body-quiet-color: #5e6778;
    --body-medium-color: #3a4354;
    --body-loud-color: #17233a;

    --header-color: #fff6da;
    --header-branding-color: #fff6da;
    --header-bg: #17233a;
    --header-link-color: #fff6da;

    --breadcrumbs-fg: #5e6778;
    --breadcrumbs-link-fg: #23589c;
    --breadcrumbs-bg: transparent;

    --link-fg: #23589c;
    --link-hover-color: #17233a;
    --link-selected-fg: #17233a;

    --hairline-color: #e7e3d8;
    --border-color: #d3cec0;

    --error-fg: #b42318;

    --message-debug-bg: #efede6;
    --message-info-bg: #e3edf9;
    --message-success-bg: #e3f1e4;
    --message-warning-bg: #fff1c7;
    --message-error-bg: #fbe7e5;

    --darkened-bg: #faf8f2;
    --selected-bg: #edeae0;
    --selected-row: #fff6da;

    --button-fg: #ffffff;
    --button-bg: #17233a;
    --button-hover-bg: #2e4268;
    --default-button-bg: #f4c542;
    --default-button-hover-bg: #e6b52b;
    --close-button-bg: #6b7280;
    --close-button-hover-bg: #4b5563;
    --delete-button-bg: #b42318;
    --delete-button-hover-bg: #912018;

    --font-family-primary:
        "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, Arial,
        sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --lpc-on-accent: #17233a;
        --lpc-card: #162033;
        --lpc-card-head: #1a263b;
        --lpc-input: #0f1828;
        --lpc-shadow: none;
        --lpc-focus: rgba(244, 197, 66, 0.35);

        --primary: #2e4268;
        --secondary: #0a111d;
        --primary-fg: #f5f7fa;

        --body-fg: #e8ecf3;
        --body-bg: #0e1522;
        --body-quiet-color: #a4afc2;
        --body-medium-color: #cbd3e0;
        --body-loud-color: #ffffff;

        --header-bg: #0a111d;

        --breadcrumbs-fg: #a4afc2;
        --breadcrumbs-link-fg: #8fbcf2;
        --breadcrumbs-bg: transparent;

        --link-fg: #8fbcf2;
        --link-hover-color: #f4c542;
        --link-selected-fg: #f4c542;

        --hairline-color: #24314a;
        --border-color: #33415c;

        --error-fg: #f27a6e;

        --message-debug-bg: #262f3f;
        --message-info-bg: #1b3352;
        --message-success-bg: #173a26;
        --message-warning-bg: #4a3b10;
        --message-error-bg: #4c1d1a;

        --darkened-bg: #131c2c;
        --selected-bg: #1f2b41;
        --selected-row: #2e2a17;

        --button-bg: #2e4268;
        --button-hover-bg: #3b5482;
        --default-button-hover-bg: #ffd35c;
        --close-button-bg: #3a4558;
        --close-button-hover-bg: #4f5b70;
        --delete-button-bg: #c0392b;
        --delete-button-hover-bg: #a93226;

        color-scheme: dark;
    }
}

html[data-theme="dark"] {
    --lpc-on-accent: #17233a;
    --lpc-card: #162033;
    --lpc-card-head: #1a263b;
    --lpc-input: #0f1828;
    --lpc-shadow: none;
    --lpc-focus: rgba(244, 197, 66, 0.35);

    --primary: #2e4268;
    --secondary: #0a111d;
    --primary-fg: #f5f7fa;

    --body-fg: #e8ecf3;
    --body-bg: #0e1522;
    --body-quiet-color: #a4afc2;
    --body-medium-color: #cbd3e0;
    --body-loud-color: #ffffff;

    --header-bg: #0a111d;

    --breadcrumbs-fg: #a4afc2;
    --breadcrumbs-link-fg: #8fbcf2;
    --breadcrumbs-bg: transparent;

    --link-fg: #8fbcf2;
    --link-hover-color: #f4c542;
    --link-selected-fg: #f4c542;

    --hairline-color: #24314a;
    --border-color: #33415c;

    --error-fg: #f27a6e;

    --message-debug-bg: #262f3f;
    --message-info-bg: #1b3352;
    --message-success-bg: #173a26;
    --message-warning-bg: #4a3b10;
    --message-error-bg: #4c1d1a;

    --darkened-bg: #131c2c;
    --selected-bg: #1f2b41;
    --selected-row: #2e2a17;

    --button-bg: #2e4268;
    --button-hover-bg: #3b5482;
    --default-button-hover-bg: #ffd35c;
    --close-button-bg: #3a4558;
    --close-button-hover-bg: #4f5b70;
    --delete-button-bg: #c0392b;
    --delete-button-hover-bg: #a93226;

    color-scheme: dark;
}

/* Header: the masthead of the site, with the menu on a second row. */

#header {
    flex-wrap: wrap;
    gap: 6px 24px;
    padding: 12px 32px 0;
    border-bottom: 4px solid var(--lpc-yellow);
}

#branding {
    align-items: center;
}

#site-name {
    margin: 0;
    font-weight: 400;
    font-size: 1.375rem;
    line-height: 1.2;
}

#site-name a:link,
#site-name a:visited {
    color: var(--header-branding-color);
}

#header #site-name a:hover {
    text-decoration: none;
}

.lpc-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.lpc-brand img {
    width: 40px;
    height: 40px;
}

.lpc-brand-name {
    font-family: var(--lpc-title-font);
}

.lpc-brand-tag {
    padding: 2px 8px;
    border-radius: 999px;
    background-color: var(--lpc-yellow);
    color: var(--lpc-on-accent);
    font-family: var(--font-family-primary);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

#user-tools,
#logout-form button {
    font-size: 0.8125rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

#user-tools a,
#logout-form button {
    border-bottom: none;
}

.lpc-nav {
    display: flex;
    flex-basis: 100%;
    flex-wrap: wrap;
    gap: 2px 6px;
    margin: 4px 0 0 -10px;
    padding-bottom: 8px;
}

#header .lpc-nav a {
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: 700;
    color: var(--header-link-color);
    opacity: 0.85;
}

#header .lpc-nav a:hover {
    opacity: 1;
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.08);
}

#header .lpc-nav a[aria-current="page"] {
    opacity: 1;
    color: var(--lpc-yellow);
    background-color: rgba(255, 255, 255, 0.12);
}

div.breadcrumbs,
ol.breadcrumbs {
    padding: 14px 32px 0;
    font-size: 0.8125rem;
}

/* Page */

#content {
    padding: 20px 32px 32px;
}

#content h1 {
    margin: 0 0 18px;
    font-family: var(--lpc-title-font);
    font-weight: 400;
    font-size: 1.625rem;
    line-height: 1.2;
    color: var(--body-loud-color);
    text-wrap: balance;
}

/* Cards: every admin module, the dashboard's and the review page's sections included. */

.module {
    background-color: var(--lpc-card);
    border: 1px solid var(--hairline-color);
    border-radius: 10px;
    box-shadow: var(--lpc-shadow);
    /* Rounds the corners of its content too; a table too wide scrolls inside the card. */
    overflow: auto;
}

.module h2,
.module caption,
.inline-group h2 {
    padding: 12px 16px;
    background: var(--lpc-card-head);
    border-bottom: 1px solid var(--hairline-color);
    color: var(--body-loud-color);
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.module caption a:link,
.module caption a:visited {
    color: var(--body-loud-color);
}

/* Tables */

td,
th {
    padding: 9px 12px;
    font-size: 0.875rem;
    line-height: 1.3;
}

thead th,
tfoot td {
    padding: 8px 12px;
    background: var(--lpc-card-head);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

tr:nth-child(odd),
.row-form-errors {
    background: var(--lpc-card);
}

/* Forms and buttons */

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="tel"],
input[type="search"],
textarea,
select,
.vTextField {
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--lpc-input);
    font-size: 0.875rem;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--lpc-yellow);
    box-shadow: 0 0 0 3px var(--lpc-focus);
    outline: none;
}

.button,
input[type="submit"],
input[type="button"],
.submit-row input,
a.button {
    border-radius: 6px;
    font-weight: 700;
}

/* Above the admin's "form .button" (2px 3px), meant for its inputs. */
form .button,
a.button {
    display: inline-block;
    padding: 7px 12px;
}

.button.default,
input[type="submit"].default,
.submit-row input.default {
    color: var(--lpc-on-accent);
    font-weight: 700;
}

ul.messagelist li {
    border-radius: 8px;
    font-size: 0.875rem;
}

/* Login page */

.login {
    background-color: var(--body-bg);
}

.login #container {
    background-color: var(--lpc-card);
    border-radius: 12px;
    box-shadow: var(--lpc-shadow);
}

.login #header {
    justify-content: center;
    padding: 18px 16px 14px;
}

/* After the admin's own responsive.css, loaded before this file. */

@media (max-width: 1024px) {
    #header {
        flex-direction: row;
        align-items: center;
        padding: 12px 20px 0;
    }

    #content {
        padding: 16px 20px 24px;
    }

    div.breadcrumbs,
    ol.breadcrumbs {
        padding: 12px 20px 0;
    }
}

@media (max-width: 767px) {
    #header {
        padding: 10px 16px 0;
    }

    #site-name {
        font-size: 1.125rem;
    }

    .lpc-brand img {
        width: 32px;
        height: 32px;
    }

    #content {
        padding: 14px 16px 20px;
    }

    div.breadcrumbs,
    ol.breadcrumbs {
        padding: 10px 16px 0;
    }

    #content h1 {
        font-size: 1.375rem;
    }
}
