/* =========================================================
   1. Variables
   ========================================================= */
:root {
  --brand-bg: darkblue;
  --brand-fg: white;
  --brand-hover: orange;
  --font-base: 'Trebuchet MS', Helvetica, sans-serif;
}

/* =========================================================
   2. Base / Layout / Typography
   ========================================================= */
html {
    font-size: 15px;
    position: relative;
    min-height: 100%;
    overflow-y: auto;
}
@media (min-width: 768px) {
  html { font-size: 17px; }
}
body {
  font-family: Arial, Helvetica, sans-serif;
  margin-bottom: 60px;
}

/* Constrained content width (readability) */
@media (min-width: 992px)  { .container-lg { max-width: 1040px; } }
@media (min-width: 1200px) { .container-lg { max-width: 1080px; } }

/* Running text */
main p,
main li {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}
main h1,
main h2,
main h3,
main h4,
main h5,
main h6 { text-align: left; }

/* Section headers */
.section-header {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 2.2rem;
    margin-bottom: 1.1rem;
    color: #1a237e;
    letter-spacing: 0.01em;
}

/* Opt-out */
.no-justify p,
.no-justify li {
  text-align: left;
  text-justify: auto;
  hyphens: manual;
}

/* =========================================================
   3. Focus / Accessibility
   ========================================================= */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem dodgerblue;
}

/* =========================================================
   4. Primary Navigation (Navbar)
   ========================================================= */
.navbar { background-color: var(--brand-bg) !important; }

.navbar .navbar-nav.me-auto > .nav-item:first-child > .nav-link {
  padding-left: 0;
 }
 
.navbar .nav-link,
.language-link,
.signin-link,
.signout-link,
.navbar .navbar-text {
  font-family: var(--font-base);
  font-weight: bold;
  color: var(--brand-fg) !important;
  background: transparent;
  text-decoration: none;
  transition: color .2s;
  cursor: pointer;
}

.navbar-nav.me-auto > .nav-item > .nav-link {
  font-size: 1.1rem;
  text-transform: uppercase;
}

.language-link,
.signin-link,
.signout-link,
.navbar .navbar-text {
  font-size: 0.95rem;
  text-transform: none;
}

.navbar .navbar-text {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
}

.navbar .nav-link.active,
.navbar .nav-link:active,
.navbar .nav-link:hover,
.language-link.active,
.language-link:hover,
.signin-link:hover,
.signout-link:hover {
  color: var(--brand-hover) !important;
}

.language-separator {
  color: var(--brand-fg) !important;
  margin: 0 0.25rem;
}

/* =========================================================
   5. Section Submenu (Secondary Nav)
   ========================================================= */
.section-subnav { margin-top: -.25rem; }

.section-subnav .nav-pills .nav-link {
  font-family: var(--font-base);
  font-weight: 600;
  color: var(--brand-bg);
  background: transparent;
  border: 1px solid rgba(0,0,0,0.15);
  padding: .35rem .9rem;
  transition: background .15s, color .15s, border-color .15s;
}
.section-subnav .nav-pills .nav-link:hover {
  color: var(--brand-hover);
  border-color: var(--brand-hover);
  text-decoration: none;
}
.section-subnav .nav-pills .nav-link.active {
  background: var(--brand-hover);
  color: #000 !important;
  border-color: var(--brand-hover);
}

/* =========================================================
   6. Media Rows (Equal-height Image Strips)
   ========================================================= */
.media-row {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
}
.media-row.wrap { flex-wrap: wrap; }

.media-row figure {
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.media-row img {
  height: var(--row-h, 280px);
  width: auto;
  object-fit: contain;
  display: block;
  border-radius: .25rem;
}
.media-row figcaption {
  margin-top: .3rem;
  max-width: 100%;
  text-align: center;
}

/* Mobile stacking */
@media (max-width: 576px) {
  .media-row { flex-direction: column; }
  .media-row figure { width: 100%; }
  .media-row img { height: auto; width: 100%; }
}

/* =========================================================
   7. Image Modal (shrink-wrap to image, no extra width)
   ========================================================= */
.modal-open { padding-right: 0 !important; } /* prevent body shift */

#imageModal .modal-dialog.modal-image-auto {
    max-width: none;
    width: auto;
    margin: 0 auto;
}

#imageModal .modal-image-content {
    display: inline-block;
    background: transparent;
    border: 0;
}

#imageModal .modal-body {
    padding: 0;
    margin: 0;
    text-align: center;
}

#imageModal .modal-image-box {
    position: relative;
    display: inline-block; /* shrink to image */
    line-height: 0; /* remove inline gap */
}

#imageModal .modal-image-img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0;
    user-select: none;
}

#imageModal .modal-image-close {
    position: absolute;
    top: .5rem;
    right: .5rem;
    background-color: rgba(255,255,255,.85);
    border-radius: 50%;
    padding: .4rem;
    box-shadow: 0 0 0 2px rgba(0,0,0,.15);
}

    #imageModal .modal-image-close:hover,
    #imageModal .modal-image-close:focus {
        background-color: rgba(0,0,0,.6);
        filter: invert(1);
        box-shadow: 0 0 0 2px rgba(255,255,255,.4);
    }

/* =========================================================
   8. Interaction Helpers
   ========================================================= */
.enlargeable-thumb { cursor: pointer; }

/* =========================================================
   9. Utility / Future Extension Placeholders
   ========================================================= */
/* (Add dark-mode overrides, print styles, etc. here if needed) */
