/* ════════════════════════════════════════════════════════
   PLACE BRIDGE — portal skin
   Maroon #6F0D0E · Gold #D4B78C · taken from the public site

   Tailwind's config (partials/pb-theme.blade.php) retargets the
   utility palette. This file does the three things a config
   cannot:

     1. the tokens themselves, for hand-written CSS
     2. typography — DM Serif Display on headings
     3. the vendor widgets, which ship their own colours and
        would otherwise sit on the page in Bootstrap blue:
        DataTables, select2, toastr, SweetAlert, Bootstrap.

   Dark mode keys off html.dark, which is what the portal has
   always toggled, and mirrors data-theme so anything lifted
   from the public site works unchanged.
   ════════════════════════════════════════════════════════ */

:root {
    --maroon: #6F0D0E;
    --maroon-deep: #4E0A0B;
    --gold: #D4B78C;
    --gold-deep: #B99763;

    --accent: #6F0D0E;
    --accent-soft: #F6EFE3;
    --gold-soft: #FAF4EA;

    --paper: #F5F0E6;
    --surface: #F1E9DC;
    --surface-2: #EBE0CE;
    --card: #FDFCFA;

    --ink: #1C1A19;
    --body: #514B45;
    --mute: #847C72;
    --line: #E4D8C2;

    --eyebrow: #7A5620;

    /* Aliases. Views and the older stylesheets reach for --brand and
       --brand-color, mostly with no fallback, so they resolved to nothing and
       the odd one fell through to a teal left over from an earlier palette.
       Defining them here is what makes those places brand-coloured at all. */
    --brand: #6F0D0E;
    --brand-color: #6F0D0E;

    --sh-sm: 0 1px 3px rgba(28, 26, 25, .05);
    --sh-md: 0 8px 28px rgba(111, 13, 14, .07);
    --sh-lg: 0 24px 60px rgba(111, 13, 14, .10);

    --r: 12px;
    --ease: cubic-bezier(.22, .68, .28, 1);
}

html.dark,
[data-theme="dark"] {
    --maroon: #5A0A0B;
    --maroon-deep: #3A0607;
    --gold: #DCC299;
    --gold-deep: #C2A87F;

    --accent: #E0C49C;
    --accent-soft: #241C14;
    --gold-soft: #241D16;

    --paper: #12100F;
    --surface: #191514;
    --surface-2: #201A18;
    --card: #1C1817;

    --ink: #F6F1EA;
    --body: #BEB4AC;
    --mute: #8B8078;
    --line: #302825;

    --eyebrow: #C2A87F;

    --brand: #E0C49C;
    --brand-color: #E0C49C;

    --sh-sm: 0 1px 3px rgba(0, 0, 0, .4);
    --sh-md: 0 8px 28px rgba(0, 0, 0, .45);
    --sh-lg: 0 24px 60px rgba(0, 0, 0, .55);
}

/* ════════ TYPOGRAPHY ════════ */

body {
    background: var(--paper);
    color: var(--body);
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* The serif is the site's signature. Applied to real headings only:
   the portal uses <h2> for card titles that are set in bold sans by a
   utility class, and those keep their utility — `font-display` is the
   opt-in for anything that wants the serif deliberately. */
h1,
.font-display {
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
    color: var(--ink);
    letter-spacing: -.015em;
    line-height: 1.12;
}

.pb-eyebrow {
    display: block;
    font-size: 11px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--eyebrow);
    font-weight: 700;
}

::selection {
    background: var(--gold);
    color: #1C1A19;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ════════ SCROLLBARS ════════
   A cold grey scrollbar on a warm page is the kind of detail that
   makes a skin look half-applied. */

* {
    scrollbar-color: var(--line) transparent;
    scrollbar-width: thin;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 100px;
    border: 2px solid transparent;
    background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--gold-deep);
    background-clip: content-box;
}

/* ════════ FORM CONTROLS ════════
   Browsers paint these from the accent colour; without this they stay
   system blue against a maroon page. */

input,
select,
textarea,
button {
    font-family: inherit;
}

input[type="checkbox"],
input[type="radio"],
progress,
input[type="range"] {
    accent-color: var(--maroon);
}

/* ════════ BOOTSTRAP ════════
   Loaded for its grid and a few components. Its buttons, links and
   focus rings are Bootstrap blue out of the box. */

.btn-primary,
.bg-primary {
    --bs-btn-bg: var(--maroon);
    --bs-btn-border-color: var(--maroon);
    --bs-btn-hover-bg: var(--maroon-deep);
    --bs-btn-hover-border-color: var(--maroon-deep);
    --bs-btn-active-bg: var(--maroon-deep);
    --bs-btn-active-border-color: var(--maroon-deep);
    --bs-btn-disabled-bg: var(--maroon);
    --bs-btn-disabled-border-color: var(--maroon);
    background-color: var(--maroon);
    border-color: var(--maroon);
}

.btn-outline-primary {
    --bs-btn-color: var(--maroon);
    --bs-btn-border-color: var(--maroon);
    --bs-btn-hover-bg: var(--maroon);
    --bs-btn-hover-border-color: var(--maroon);
    --bs-btn-active-bg: var(--maroon);
}

.text-primary {
    color: var(--maroon) !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--gold-deep);
    box-shadow: 0 0 0 .2rem rgba(111, 13, 14, .12);
}

.page-item.active .page-link {
    background-color: var(--maroon);
    border-color: var(--maroon);
}

.page-link {
    color: var(--maroon);
}

/* ════════ DATATABLES ════════
   The student list is a DataTable, so these controls are on the screen
   the team spends its day in. */

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    color: var(--body) !important;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 6px 10px;
    color: var(--ink);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px !important;
    border: 1px solid transparent !important;
    color: var(--body) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--maroon) !important;
    border-color: var(--maroon) !important;
    color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--accent-soft) !important;
    border-color: var(--line) !important;
    color: var(--maroon) !important;
}

table.dataTable thead th {
    border-bottom-color: var(--line) !important;
    color: var(--mute);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: 11px;
}

table.dataTable tbody td {
    border-top-color: var(--line) !important;
}

/* ════════ SELECT2 ════════ */

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 9px;
    min-height: 40px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--ink);
    line-height: 38px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px;
}

.select2-dropdown {
    background: var(--card);
    border-color: var(--line);
    border-radius: 12px;
    box-shadow: var(--sh-lg);
    overflow: hidden;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted {
    background: var(--maroon);
    color: #fff;
}

.select2-container--default .select2-results__option[aria-selected="true"] {
    background: var(--accent-soft);
    color: var(--maroon);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--accent-soft);
    border-color: var(--line);
    color: var(--maroon);
    border-radius: 6px;
}

.select2-search--dropdown .select2-search__field {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
}

/* ════════ TOASTR ════════
   Success and error keep their green and red — a confirmation that
   matched the brand would stop reading as a confirmation. Only the
   neutral ones move. */

#toast-container > .toast-info {
    background-color: var(--maroon) !important;
}

#toast-container > div {
    border-radius: 10px !important;
    box-shadow: var(--sh-md) !important;
}

/* ════════ SWEETALERT ════════ */

.swal2-popup {
    border-radius: 16px;
    background: var(--card);
    color: var(--body);
    font-family: 'DM Sans', sans-serif;
}

.swal2-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
    color: var(--ink);
}

.swal2-styled.swal2-confirm {
    background: var(--maroon) !important;
    border-radius: 9px !important;
}

.swal2-styled.swal2-cancel {
    background: transparent !important;
    border: 1.5px solid var(--line) !important;
    color: var(--body) !important;
    border-radius: 9px !important;
}

/* ════════ FULLCALENDAR ════════
   The placement roster. Its own chrome is blue-grey by default. */

.fc .fc-button-primary {
    background: var(--maroon);
    border-color: var(--maroon);
}

.fc .fc-button-primary:hover,
.fc .fc-button-primary:not(:disabled).fc-button-active {
    background: var(--maroon-deep);
    border-color: var(--maroon-deep);
}

.fc .fc-toolbar-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
    color: var(--ink);
}

.fc-theme-standard td,
.fc-theme-standard th,
.fc-theme-standard .fc-scrollgrid {
    border-color: var(--line);
}

.fc .fc-day-today {
    background: var(--accent-soft) !important;
}

/* The placement window highlight, defined here rather than inline so
   it follows the theme. */
.fc-day-in-range {
    background: var(--gold-soft);
}

html.dark .fc-day-in-range {
    background: rgba(212, 183, 140, .08);
}

/* ════════ THE LOADER ════════ */

.loader-ring {
    border-color: var(--line) !important;
    border-top-color: var(--maroon) !important;
}

/* ════════ PRINT ════════
   Paper stock on paper is a waste of toner. */

@media print {
    body {
        background: #fff;
    }
}
