/*
   THIS IS WHERE YOU PLACE ALL THE CUSTOM CSS THAT YOU MAY NEED
   THE STANDARD DNR STYLE STANDARDS ARE ALREADY APPLIED IN THE
   BOOTSTRAP.MODIFIED.CSS FILE

   ==========================================================================
   CHANGES IN THIS REVISION
   ==========================================================================
   1. .ms-n6 was declared TWICE (-3.5rem, then -3rem). The second silently
      won, which made .ms-n6 a duplicate of .ms-n5. Since .ms-6 is 3.5rem,
      -3.5rem is the intended pair, so the -3rem copy is removed.
      >> BEHAVIOUR CHANGE: anything using .ms-n6 shifts 0.5rem further left.

   2. Hard-coded hex values replaced with USWDS tokens from
      uswds-bootstrap-bridge.css. Each var() carries its literal as a
      fallback, so this file still renders correctly on its own if the
      bridge is ever not loaded.
        #0d6efd glow -> USWDS primary ring   (was Bootstrap's default blue,
                                              the last off-palette colour)
        gray         -> --u-base-darker
        #ccc, #ced4da-> --u-base-light
        #cfd3d7      -> --u-base-lighter
        #dee2e6      -> --u-base-lighter
        #e9ecef      -> --u-base-lightest
        #6c757d      -> --u-base-darker  (also raises contrast to 7:1)
        #ccecf2      -> --u-info-lighter

   3. .rt-usa-card__heading now sets font-family. It previously set only
      font-size, so it inherited Merriweather from the bridge's h3 rule --
      serif metrics shifted the -0.6em offset off the border line.

   4. Layout offsets (.sidebar, .mobile-menu-btn, .scroll-target) were magic
      numbers measured against the old 12.8px type. They are hoisted into
      variables at the top so they can be retuned in one place now that the
      app runs at USWDS 17px. VALUES ARE UNCHANGED -- re-measure and adjust.

   5. `table thead th { white-space: nowrap }` was an unscoped element
      selector, so it also hit the bootstrap-datepicker calendar and any
      layout table. Scoped to real data tables.

   6. Removed the empty .dock-planner-page rule.
   ========================================================================== */

:root {
    /* Retune these after confirming the header height at USWDS type sizes.
       --dnr-sticky-top must clear the fixed header; --dnr-scroll-offset
       should be a little larger so anchored targets are not flush to it. */
    --dnr-sticky-top: 60px;
    --dnr-mobile-menu-top: 155px;
    --dnr-scroll-offset: 200px;
    --dnr-sidebar-width: 250px;
    /* Widened from 160px is likely needed at 1.06rem body text; left at the
       original value so nothing moves until you have looked at it. */
    --dnr-rt-label-width: 160px;
}


/* ==========================================================================
   DATATABLES
   ========================================================================== */

table.dataTable th div.dt-column-header {
    flex-direction: row !important;
}

/* Keep column headings on one line. Scoped so it does not reach the
   datepicker's internal calendar table or plain layout tables. */
.table thead th,
table.dataTable thead th {
    white-space: nowrap;
}


/* ==========================================================================
   UTILITIES
   ========================================================================== */

.scroll-target {
    scroll-margin-top: var(--dnr-scroll-offset);
}

.fs-7 {
    font-size: 0.95rem !important;
}

.ms-6 {
    margin-left: 3.5rem;
}

.ms-n1 {
    margin-left: -0.25rem !important;
}

.ms-n2 {
    margin-left: -0.5rem !important;
}

.ms-n3 {
    margin-left: -1rem !important;
}

.ms-n4 {
    margin-left: -1.5rem !important;
}

.ms-n5 {
    margin-left: -3rem !important;
}

/* Pairs with .ms-6 (3.5rem). The duplicate -3rem declaration was removed. */
.ms-n6 {
    margin-left: -3.5rem !important;
}

.max-w-1000 {
    max-width: 1000px;
}


/* ==========================================================================
   IMAGES AND BOXES
   ========================================================================== */

/* Mobile first: stacked, no overlay */
.dnr-hero {
    background-image: none; /* kill the USWDS default */
    padding: 0; /* USWDS ships 5rem top/bottom */
    display: flex;
    flex-direction: column; /* column-reverse puts text above the photo */
}

    .dnr-hero > .dnr-hero__container {
        padding: 0; /* USWDS ships 5rem top/bottom */
    }

.dnr-hero__img {
    display: block;
    width: 100%;
    height: 14rem; /* crop the photo, don't let it eat the fold */
    object-fit: cover;
    object-position: center 60%;
}

/* Tablet and up: overlay */
@media (min-width: 40em) { /* USWDS $theme-tablet, 640px */
    .dnr-hero {
        display: block;
        position: relative;
        min-height: 30rem;
        padding: 5rem 0;
    }

    .dnr-hero__img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
    }

    .dnr-hero__container {
        position: relative; /* lift the callout above the img */
        z-index: 1;
    }

    .dnr-hero__callout {
        max-width: 20rem; /* narrower than the grid container */
    }
}

.border-box {
    height: 100%;
    width: 100%;
    border: 1px solid var(--u-base-darker, #565c65);
}

.border-box-title {
    width: fit-content;
    margin-top: -11px;
    margin-left: 10px;
    padding-left: 3px;
    padding-right: 3px;
    background: var(--u-white, #fff);
    font-weight: bold;
}


/* ==========================================================================
   KONVA DOCK PLANNER
   ========================================================================== */

/* Konva container: enforce constraints */
.konva-wrapper {
    width: 100%; /* fill parent width */
    height: 80vh; /* fallback: 80% of viewport height */
    background: var(--u-white, #ffffff);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--u-base-lighter, #dee2e6);
    border-radius: var(--u-radius-md, 0.25rem);
}

.konva-stage {
    width: 100%;
    height: 100%;
}

.stage-col {
    min-width: 0;
}

/* Legend styling */
.legend-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: var(--u-radius-sm, 2px);
    border: 1px solid var(--u-base-light, #a9aeb1);
}

/* Legend scale section */
.legend-scale .scale-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.legend-scale .scale-ruler {
    gap: 8px;
}

.legend-scale .ruler-track {
    position: relative;
    width: 24px;
    height: 10px;
    background: var(--u-base-lightest, #f0f0f0);
    border: 1px solid var(--u-base-light, #a9aeb1);
    border-radius: var(--u-radius-sm, 2px);
    flex: 0 0 auto;
}

.legend-scale .ruler-segment {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--u-base-lighter, #dfe1e2);
}

.legend-scale .ruler-tick {
    position: absolute;
    width: 1px;
    height: 14px;
    background: var(--u-base-darker, #565c65);
    top: -2px;
}

    .legend-scale .ruler-tick.start {
        left: 0;
    }

    .legend-scale .ruler-tick.end {
        right: 0;
    }


/* ==========================================================================
   LAYOUT CHROME
   ========================================================================== */

.sidebar {
    width: var(--dnr-sidebar-width);
    position: sticky;
    top: var(--dnr-sticky-top);
}

/* Always render above Bootstrap modals/backdrops (~1050-1060), toastr
   notifications (999999), and any other overlay in the app. */
.global-loader {
    z-index: 1000000 !important;
}

.mobile-menu-btn {
    width: 20px;
    height: 52px;
    /*z-index: 1055;  above headers and most content, below modals if needed */
    display: inline-flex;
    align-items: center;
    /*justify-content: center;*/
    padding-left: 1px;
    padding-right: 1px;
    top: var(--dnr-mobile-menu-top);
}

.layout-wrap .flex-grow-1 {
    min-width: 0; /* critical for flex items with wide content */
}


/* ==========================================================================
   SELECTED TOGGLE BUTTONS
   Used by the classType radio buttons on RiparianDockAddress.
   --dnr-primary-selected is defined in bootstrap.modified.5.3.css and again
   in uswds-bootstrap-bridge.css; the literal fallback below means the fill
   still resolves even if neither is loaded. Without a fallback an undefined
   var() makes the declaration invalid at computed-value time and
   background-color falls back to transparent, which produced white text on
   no fill.
   ========================================================================== */

.btn-outline-primary.selected,
.btn-outline-primary.selected:focus {
    color: var(--u-white, #fff);
    background-color: var(--dnr-primary-selected, #005ea2);
    border-color: var(--dnr-primary-selected, #005ea2);
    box-shadow: inset 0 0 0 2px var(--dnr-primary-selected, #005ea2);
}

.btn-outline-primary.selected:focus-visible {
    outline: 0.25rem solid var(--u-focus, #2491ff);
    outline-offset: 0;
}


/* ==========================================================================
   MISC COMPONENTS
   ========================================================================== */

.ia-card-link:hover {
    background-color: var(--u-info-lighter, #e7f6f8);
    cursor: pointer;
}

.centerCheckBox::before {
    position: relative !important;
}

.placeholder-nickname {
    color: var(--u-base-darker, #565c65);
    font-style: italic;
    opacity: 1;
}


/* ==========================================================================
   ReviewTransfer four-card layout
   ========================================================================== */

.rt-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.rt-usa-card {
    border: 1px solid var(--u-base-darker, #565c65);
    border-radius: var(--u-radius-sm, 2px);
    padding: 16px 20px 20px;
    position: relative;
}

/* font-family is required here: setting only font-size let this inherit
   Merriweather from the global h3 rule, and serif metrics pushed the
   -0.6em offset off the card border. */
h3.rt-usa-card__heading {
    position: absolute;
    top: -0.6em;
    left: 12px;
    background: var(--u-white, #fff);
    padding: 0 6px;
    font-family: var(--u-font-sans, "Source Sans Pro Web", Helvetica, Arial, sans-serif);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--u-ink, #1b1b1b);
    white-space: nowrap;
}

.rt-field-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.rt-field-label {
    text-align: right;
    font-weight: 400;
    color: var(--u-ink, #1b1b1b);
    min-width: var(--dnr-rt-label-width);
    flex-shrink: 0;
}

.rt-field-value {
    min-width: 180px;
    color: var(--u-ink, #1b1b1b);
}

.rt-address-continuation {
    display: flex;
    gap: 6px;
    margin-top: 2px;
}

    .rt-address-continuation .rt-field-label {
        visibility: hidden;
    }

.rt-field-list {
    margin: 0;
}

    .rt-field-list dd {
        margin-inline-start: 0;
    }

@media (max-width: 700px) {
    .rt-card-grid {
        grid-template-columns: 1fr;
    }
}

.btn-visually-disabled {
    opacity: 0.65;
    cursor: not-allowed;
}