/* =============================================================
   styles.css — Voies d'Eau d'Europe
   Custom styles layered on top of Bootstrap 4.6.
   Organisation:
     1.  Custom properties (CSS variables)
     2.  Global base
     3.  Bootstrap colour overrides
     4.  Navbar
     5.  Hero section
     6.  Section titles
     7.  Preface section
     8.  Document tome list
     9.  PDF modal & viewer
     10. Footer
     11. Accessibility utilities
     12. Responsive adjustments
   ============================================================= */


/* ------------------------------------------------------------------
   0. WEB FONTS (self-hosted, latin subset, SIL Open Font License)
      Variable fonts: one file covers every weight in the range.
   ------------------------------------------------------------------ */
@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/raleway-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/open-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


/* ------------------------------------------------------------------
   1. CUSTOM PROPERTIES
   ------------------------------------------------------------------ */
:root {
  /* Brand palette */
  --vde-blue:       #1b4f8a;   /* Primary navy blue                  */
  --vde-blue-mid:   #2e86c1;   /* Lighter accent blue                */
  --vde-gold:       #f0a500;   /* Golden accent / decorative line    */
  --vde-dark:       #212529;   /* Near-black body text               */
  --vde-light:      #f8f9fa;   /* Light section background           */

  /* Typography */
  --font-heading: 'Raleway', sans-serif;
  --font-body:    'Open Sans', sans-serif;

  /* Transitions */
  --transition: 0.25s ease;
}


/* ------------------------------------------------------------------
   2. GLOBAL BASE
   ------------------------------------------------------------------ */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--vde-dark);
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
}

/* Inline SVG icons (sprite in index.html); sized by the text around them */
.icon {
  display:        inline-block;
  height:         1em;
  overflow:       visible;
  vertical-align: -0.125em;
  fill:           currentColor;
}

.icon-lg {
  font-size:      1.333em;
  vertical-align: -0.2em;
}

/* Make anchor links land below the sticky navbar */
section[id] {
  scroll-margin-top: 70px;
}


/* ------------------------------------------------------------------
   3. BOOTSTRAP COLOUR OVERRIDES
   ------------------------------------------------------------------ */

/* Primary colour → brand blue */
.bg-primary,
.btn-primary,
.navbar-dark.bg-primary,
.modal-header.bg-primary {
  background-color: var(--vde-blue) !important;
  border-color:     var(--vde-blue) !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--vde-blue-mid) !important;
  border-color:     var(--vde-blue-mid) !important;
}

.btn-outline-primary {
  color:        var(--vde-blue);
  border-color: var(--vde-blue);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--vde-blue);
  border-color:     var(--vde-blue);
  color: #fff;
}

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


/* ------------------------------------------------------------------
   4. NAVBAR
   ------------------------------------------------------------------ */
.navbar {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.navbar-brand {
  font-family:    var(--font-heading);
  font-weight:    700;
  font-size:      1.2rem;
  letter-spacing: 0.02em;
}

.navbar-nav .nav-link {
  font-family:    var(--font-heading);
  font-weight:    600;
  font-size:      0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition:     opacity var(--transition);
}

.navbar-nav .nav-link:hover {
  opacity: 0.75;
}

.dropdown-menu {
  border: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border-radius: 0.375rem;
}

.dropdown-item {
  font-family: var(--font-body);
  font-size:   0.9rem;
  transition:  background-color var(--transition);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--vde-blue);
  color: #fff;
}


/* ------------------------------------------------------------------
   5. HERO SECTION
   ------------------------------------------------------------------ */
.hero-section {
  min-height: 80vh;
  padding: 6rem 1rem;
  /* To add a background photo, append it after the gradient:
       , url('../assets/hero-bg.jpg') center / cover no-repeat */
  background:
    linear-gradient(
      135deg,
      rgba(27, 79, 138, 0.90) 0%,
      rgba(46, 134, 193, 0.80) 100%
    );
}

.hero-title {
  font-weight:    700;
  letter-spacing: 0.02em;
  text-shadow:    0 2px 10px rgba(0, 0, 0, 0.35);
}

.hero-subtitle {
  font-size:   1.2rem;
  max-width:   600px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.hero-logo {
  max-height: 120px;
  width:      auto;
  filter:     drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}


/* ------------------------------------------------------------------
   6. SECTION TITLES
   ------------------------------------------------------------------ */
.section-title {
  font-weight:    700;
  font-size:      2rem;
  color:          var(--vde-blue);
  padding-bottom: 0.6rem;
  margin-bottom:  1.5rem;
}

/* Decorative gold underline */
.section-title::after {
  content:          '';
  display:          block;
  width:            3rem;
  height:           3px;
  background-color: var(--vde-gold);
  margin-top:       0.5rem;
}

/* Centre the underline when the heading is centred */
.text-center .section-title::after {
  margin-left:  auto;
  margin-right: auto;
}


/* ------------------------------------------------------------------
   7. PREFACE SECTION
   ------------------------------------------------------------------ */
.preface-text {
  max-width: 820px;
  font-size: 1rem;
  line-height: 1.9;
}

.preface-figure {
  text-align: center;
}

.preface-img {
  max-width: 100%;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.preface-signature {
  margin-top:  2rem;
  font-weight: 600;
  font-family: var(--font-heading);
  color:       var(--vde-blue);
}

.preface-note {
  font-size: 0.9rem;
}


/* ------------------------------------------------------------------
   8. DOCUMENT TOME LIST
   ------------------------------------------------------------------ */
.tome-heading {
  font-family:    var(--font-heading);
  font-size:      1.25rem;
  font-weight:    700;
  color:          var(--vde-blue);
  padding-bottom: 0.4rem;
  margin-bottom:  0.75rem;
  border-bottom:  2px solid var(--vde-gold);
}

.tome-section .list-group-item {
  font-size: 0.95rem;
}

.tome-section .list-group-item span {
  color: var(--vde-dark);
}


/* ------------------------------------------------------------------
   9. PDF MODAL & VIEWER
   ------------------------------------------------------------------ */

/* Tall iframe container for comfortable desktop reading */
.pdf-container {
  position:         relative;
  width:            100%;
  /* 75 % of the viewport — readable without scrolling on most screens */
  height:           75vh;
  background-color: #525659; /* Matches browser/Acrobat PDF chrome  */
  overflow:         hidden;
}

#pdf-viewer {
  position: absolute;
  top:    0;
  left:   0;
  width:  100%;
  height: 100%;
  border: none;
}

/* Loading spinner overlay inside the PDF container */
.pdf-loading-spinner {
  position: absolute;
  top:    0;
  left:   0;
  width:  100%;
  height: 100%;
  z-index: 10;
  background-color: #525659;
}

/* Error message shown when the PDF fails to load */
.pdf-error-message {
  position: absolute;
  top:    0;
  left:   0;
  width:  100%;
  height: 100%;
  z-index: 10;
  background-color: #525659;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.pdf-error-message a {
  color: var(--vde-gold);
}


/* ------------------------------------------------------------------
   10. FOOTER
   ------------------------------------------------------------------ */
.footer a {
  text-decoration: none;
  transition:      color var(--transition);
}

.footer a:hover {
  color:           #ffffff !important;
  text-decoration: none;
}


/* ------------------------------------------------------------------
   11. ACCESSIBILITY UTILITIES
   ------------------------------------------------------------------ */

/* Skip-to-content link — visible only when focused via keyboard */
.skip-link {
  position:   absolute;
  top:        -100%;
  left:       0;
  background: var(--vde-gold);
  color:      var(--vde-dark);
  padding:    0.5rem 1.25rem;
  font-weight: 700;
  font-family: var(--font-heading);
  z-index:    9999;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

/* Enhanced focus ring for keyboard navigation (all browsers) */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline:        3px solid var(--vde-gold);
  outline-offset: 2px;
}


/* ------------------------------------------------------------------
   12. RESPONSIVE ADJUSTMENTS
   ------------------------------------------------------------------ */

/* Smaller hero on short / narrow viewports */
@media (max-width: 576px) {
  .hero-section {
    min-height: 60vh;
    padding: 4rem 1rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  /* Reduce PDF iframe height on phones */
  .pdf-container {
    height: 55vh;
  }

  /* Use full-width modal on small screens */
  .modal-dialog.modal-xl {
    margin: 0.5rem;
  }
}

@media (max-width: 767px) {
  .section-title {
    font-size: 1.6rem;
  }
}
