﻿/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */

a.navbar-brand {
  white-space: normal;
  text-align: center;
  word-break: break-all;
}

/* Provide sufficient contrast against white background */
a {
  /* color: #0366d6; */
}

.btn-primary {
  color: #fff;
  background-color: #1b6ec2;
  border-color: #1861ac;
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
  color: #fff;
  background-color: #1b6ec2;
  border-color: #1861ac;
}

/* Sticky footer styles
-------------------------------------------------- */
html {
  font-size: 14px;
}
@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.border-top {
  border-top: 1px solid #e5e5e5;
}
.border-bottom {
  border-bottom: 1px solid #e5e5e5;
}

.box-shadow {
  box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

button.accept-policy {
  font-size: 1rem;
  line-height: inherit;
}

/* Sticky footer styles
-------------------------------------------------- */
html {
  position: relative;
  min-height: 100%;
}

body {
  /* Margin bottom by footer height */
  margin-bottom: 60px;
}
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 60px; /* Vertically center the text there */
}

/* Plain text typed into a textarea, shown with its paragraphs intact.
   Deliberately not the HtmlString display template: that one exists for Quill rich text and renders raw,
   which would turn author-typed text into markup on a page external signers open. */
.text-lines {
    white-space: pre-line;
}

.table-row-borderless > td {
    border-top: none;
}

/* Signature Pad
-------------------------------------------------- */

/* Sized here rather than inline, which is safe because site.css is cache-busted (asp-append-version).
   The geometry is deliberately IDENTICAL to the inline style it replaced, down to the 1px border.

   THE BORDER WIDTH IS LOAD-BEARING. Bootstrap sets box-sizing: border-box, so the border eats into the
   drawing area, while both of signature_pad's coordinate paths use the BORDER box: resizeCanvas() sizes the
   bitmap from offsetWidth/offsetHeight, and signature_pad's _createPoint subtracts getBoundingClientRect()
   left/top. Bitmap and content box therefore disagree by exactly the border, and the ink lands offset from
   the finger by that much. At 1px the error is invisible; a 10px frame (which is what used to be here, dead,
   because an inline `border: 1px solid blue` was overriding it) puts the ink 10px from the finger and
   compresses it ~10% vertically — worst on a phone, where the canvas is narrowest.

   So: do not thicken this border without first changing resizeCanvas() to measure the content box. */
#signature-pad-canvas {
    width: 600px;
    height: 200px;
    max-width: 100%;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.02) inset;
}

/* Signature images
--------------------------------------------------
   One width per context, set here and never on the tag, because the presentational `width`/`height`
   attributes lose to an author `height: auto` rule and were silently ignored. */

.signature-image {
    max-width: 100%;
    height: auto;
}

/* Beside a name, in a table cell or a list row. */
.signature-image-row {
    width: 120px;
}

/* On a page whose subject is the signature itself. Capped at the composite's own 600px so it is never
   upscaled past the resolution actually stored. */
.signature-image-detail {
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Inside the enlarge popover, at the size it was stored and never larger: the composite is 600px wide, so
   stretching it to the popover only blurs the ink and the names. It is still much bigger than the row, and
   it shrinks only when the popover is narrower than the image. */
.signature-image-zoom {
    width: auto;
}

/* The enlarge popover (Shared/_SignatureImage). The browser centres it in the top layer; Bootstrap 4 has no
   rule for the `popover` attribute, so the card look is borrowed from .modal-content. */
.signature-popover {
    width: min(92vw, 44rem);
    max-height: 92vh;
    padding: 1rem;
    color: inherit;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.3rem;
}

.signature-popover::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

/* The image is the whole control, so strip what btn-link would otherwise contribute. */
.signature-zoom {
    line-height: 1;
}

/* Page action bar
--------------------------------------------------
   The row of buttons at the foot of a page, rendered by Shared/_PageActions. Bootstrap 4 has no gap
   utility, so the spacing lives on the children; the bottom margin is what keeps two rows apart once the
   bar wraps on a narrow screen. */

.page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.page-actions > .btn {
    margin-right: .5rem;
    margin-bottom: .5rem;
}

/* Closed-book notice of a minutes form
--------------------------------------------------
   A minutes form has one notice per book type (Shared/_BookClosureNotice), because the book that covers a minutes
   is only known once the user picks its type. Each notice is hidden until the matching radio is checked: no script.
   One rule per MinutesBookType, kept complete by BookClosureNoticeConventionTests. */

.book-closure-notice {
    display: none;
}

main:has(input[name="MinutesBookType"][value="GeneralAssembly"]:checked) .book-closure-notice[data-book-closure-type="GeneralAssembly"],
main:has(input[name="MinutesBookType"][value="OrdinaryGeneralAssembly"]:checked) .book-closure-notice[data-book-closure-type="OrdinaryGeneralAssembly"],
main:has(input[name="MinutesBookType"][value="ExtraordinaryGeneralAssembly"]:checked) .book-closure-notice[data-book-closure-type="ExtraordinaryGeneralAssembly"],
main:has(input[name="MinutesBookType"][value="BoardOfDirectors"]:checked) .book-closure-notice[data-book-closure-type="BoardOfDirectors"],
main:has(input[name="MinutesBookType"][value="AdministrativeCouncil"]:checked) .book-closure-notice[data-book-closure-type="AdministrativeCouncil"],
main:has(input[name="MinutesBookType"][value="FiscalCouncil"]:checked) .book-closure-notice[data-book-closure-type="FiscalCouncil"] {
    display: flex;
}
