/* Bootstrap collision repair for _PortalLayout. Leo B. 09/17/2026.

   WHAT IS WRONG WITH THAT LAYOUT. It links three Bootstrap stylesheets:

       L60  ~/Css/bootstrap.min.css       Bootstrap 3.3.7
       L61  ~/Css/element.css             its line 1 is @import "bootstrap.min.css"
                                          -- 3.3.7 again, invisibly
       L69  ~/Content/bootstrap.min.css   Bootstrap 3.0.0, LAST, so it wins

   The two versions disagree about modal geometry, and because they are the same
   selector at the same specificity the browser resolves it PER PROPERTY, taking
   whichever file declared each one last. The result is a dialog neither version
   would produce on its own:

       position: relative     from 3.3.7  (3.0.0 never declares it)
       left: 50%              from 3.0.0  (3.3.7 never declares it)

   Alone, each is correct -- 3.0.0 positions the dialog itself, 3.3.7 centres it
   with auto margins. Together, `left: 50%` on a relatively positioned element
   shoves the dialog half its containing block to the right, so it is drawn hard
   against the right edge of the screen with half of it off-page.

   WHY THIS FILE EXISTS RATHER THAN A FIX ON EACH MODAL. Views/Membership/
   DataPrivacy.cshtml has carried a hand-written override of exactly this since
   08/22/2026, pinned to its own id, with a comment saying the real fix is to drop
   one of the two Bootstrap files and that doing so "reaches every membership page
   ... not done as a drive-by". That is still true. Meanwhile there are 29 views on
   this layout and only one of them has a modal, so the defect is currently
   invisible -- and the next modal added to any of the other 28 inherits it in
   full, silently, with nothing to tell whoever adds it. This closes that.

   WHY NOT JUST DROP A BOOTSTRAP. Because all 29 views are styled against 3.0.0
   today -- it is the one winning -- so removing it restyles the entire membership
   signup journey at every width, desktop included. The standing constraint on this
   work is that the laptop and desktop view does not move. The consolidation is
   worth doing and is recorded as deferred, needing its own sign-off and its own
   regression pass. This file is the half that carries the live risk and costs
   nothing on screen.

   SCOPE, DELIBERATELY NARROW. Only the properties that produce the defect are
   restated. 3.0.0's padding, the auto margins and the 600px width are all LEFT
   ALONE even where 3.3.7 would have done it differently, because changing them
   would move a dialog that renders correctly today. DataPrivacy.cshtml's own
   override also stays exactly as it is: it sets width:auto and max-width:820px at
   (1,1,0), which still outranks everything here, so that dialog is byte-for-byte
   what it was. Nothing on screen changes today; the other 28 views stop being a
   trap.

   LINKED FROM _PortalLayout ONLY. _LayoutDashboard and _LoginLayout load Bootstrap
   4 and have none of this. */


/* Neutralising `left` is the whole repair. `right` is restated with it because
   3.0.0 sets the pair together and a future edit that reintroduces one should not
   be able to leave the other behind. */
.modal-dialog {
    right: auto;
    left: auto;
}

@media (min-width: 768px) {
    /* The band 3.0.0 actually declares `left: 50%` in -- see its
       `@media screen and (min-width:768px)` block. The base rule above covers the
       narrow case; this one is where the defect lives. */
    .modal-dialog {
        right: auto;
        left: auto;
    }
}

@media (min-width: 992px) {
    /* .modal-lg postdates 3.0.0 entirely, so the class has been inert on this
       layout -- a view asking for a large dialog silently got a 600px one. This is
       3.3.7's own value. It changes nothing today: the only modal on this layout
       overrides its own width at higher specificity. */
    .modal-lg {
        width: 900px;
    }
}
