/* =========================
   Core Variables + Defaults
   ========================= */

:root{
  --brand-blue: #002047;
  --text-blue: #002047;

  /* NOTE: hero image is set via inline style in the PHP page */
  --hero-image: none;

  --nav-offset: 96px; /* used for scrollspy offset + anchor alignment */

  /* Default section colors (white background) */
  --section-text-color: var(--brand-blue);
  --bullet-color: var(--brand-blue);

  /* SVG bullets (base64) */
  --svg-bullet-filled: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMTAiIGZpbGw9ImJsYWNrIi8+PC9zdmc+");
  --svg-bullet-outline: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iYmxhY2siIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTEyIDJhMTAgMTAgMCAxIDEgMCAyMGExMCAxMCAwIDEgMSAwLTIwWm0wIDNhNyA3IDAgMSAwIDAgMTRhNyA3IDAgMSAwIDAtMTRaIi8+PC9zdmc+");
}

/* Standard sans-serif */
body{
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Helvetica Neue", "Noto Sans", "Liberation Sans", sans-serif;
  color: var(--text-blue);
  position: relative; /* required for ScrollSpy on body */
}

/* Blue background sections flip text/bullets/headings to white */
.bg-grey{
  background: #e7e7e7 !important;
  color: var(--text-blue);
}

/* =========================
   Section Color Switching
   ========================= */

/* Blue background sections flip text/bullets/headings to white */
.bg-brand{
  background: var(--brand-blue) !important;
  color: #fff !important;

  --section-text-color: #ffffff;
  --bullet-color: #ffffff;
}

/* Use variable-driven colors for headings + text inside sections */
section h1,
section h2,
section h3,
section h4,
section h5,
section h6{
  color: var(--section-text-color);
}

section p,
section li{
  color: var(--section-text-color);
}

/* If you still use .text-brand anywhere */
.text-brand{ color: var(--brand-blue) !important; }

/* =========================
   Top Nav Styling
   ========================= */

.topbar{
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  z-index: 1030;
}

.navbar-nav .nav-link{
  color: var(--brand-blue);
  font-weight: 600;
  border-radius: 999px;
  padding: .45rem .75rem;
  transition: background-color .15s ease, color .15s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus{
  color: #001634;
  text-decoration: none;
  background: rgba(0,32,71,.06);
}

/* ScrollSpy active link */
.navbar-nav .nav-link.active{
  color: #fff !important;
  background: var(--brand-blue);
}

/* =========================
   Logo + Company Name
   ========================= */

.site-logo{
  width: 150px;
  height: auto;
  display: block;
}

/* Company name alignment rules */
.site-company-name{
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--brand-blue); /* header is always white background */
  line-height: 1.2;
  white-space: nowrap;
  text-align: center; /* mobile default */
}

/* Desktop: left-aligned */
@media (min-width: 992px){
  .site-company-name{
    text-align: left;
  }
}

/* Hide on very small screens */
@media (max-width: 360px){
  .site-company-name{
    display: none;
  }
}

/* =========================
   Mobile Layout: Logo Center, Toggler Left
   ========================= */

@media (max-width: 991.98px){
  .navbar{
    position: relative;
    min-height: 70px;
  }

  .navbar-toggler{
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    border-color: rgba(0,0,0,.15);
  }

  .navbar-brand{
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0 !important;
  }

  /* Refined mobile collapse animation + panel styling */
  .navbar-collapse{
    background: #fff;
    border-top: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 10px 30px rgba(0,0,0,.10);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    margin-top: 70px; /* sit below the centered logo row */
    padding: .5rem;
  }

  .navbar-collapse.collapse:not(.show){
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
  }

  .navbar-collapse.show{
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .navbar-collapse.collapsing{
    opacity: 0.01;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease;
  }

  .navbar-nav .nav-link{
    padding: .65rem .9rem;
  }
}

/* =========================
   Hero / Section 2
   ========================= */

.hero{
  min-height: 100vh;
  height: 100vh;
  width: 100%;
  position: relative;
  color: #fff;
  overflow: hidden;
}

.hero::before{
  content:"";
  position:absolute;
  inset:0;
  z-index: 0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,.35), rgba(0,0,0,.55)),
    var(--hero-image);
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.hero-content{
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1rem;
}

.hero h1, .hero h3{ color:#fff; }

.hero h1{
  font-weight: 800;
  letter-spacing: .5px;
}

.hero h3{
  font-weight: 600;
  opacity: .95;
}

/* Down arrow circle */
.hero-scroll{
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  text-decoration: none;
  color: #fff;
}

.scroll-circle{
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.9);
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.15);
  backdrop-filter: blur(2px);
  animation: blink 2.2s ease-in-out infinite;
}

@keyframes blink{
  0%, 100% { opacity: 1; transform: translateY(0); }
  50% { opacity: .35; transform: translateY(2px); }
}

/* =========================
   Section Spacing
   ========================= */

section{
  scroll-margin-top: var(--nav-offset);
  padding: 72px 0;
}

.section-title{
  font-weight: 800;
  letter-spacing: .2px;
}

/* =========================
   Publications Cards + Link Icon
   ========================= */

.pub-card{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 18px 18px;
  height: 100%;
  position: relative;
  padding-bottom: 56px; /* guaranteed space below text for icon */
}

.pub-card-link{
  position: absolute;
  right: 10px;
  bottom: 10px;
  color: #ffffff;
  font-size: 2rem; /* Font Awesome 2x */
  transition: color .2s ease, transform .2s ease;
}

.pub-card-link:hover,
.pub-card-link:focus{
  color: #4da3ff;
  transform: translateX(3px);
  text-decoration: none;
}

/* =========================
   Subjects List SVG Bullets
   ========================= */

.subjects-list, .subjects-list ul{
  list-style: none;
  margin: 0;
  padding: 0;
}

.subjects-list > li{
  position: relative;
  padding-left: 34px;
  margin-bottom: 14px;
}

.subjects-list > li > ul{
  margin-top: 10px;
  margin-left: 6px;
}

.subjects-list > li > ul > li{
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
}

/* Fallback (always works): CSS circles */
.subjects-list > li::before,
.subjects-list > li > ul > li::before{
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 14px;
  height: 14px;
  display: block;
}

/* Main bullet: filled circle fallback */
.subjects-list > li::before{
  background: var(--bullet-color);
  border-radius: 999px;
}

/* Sub bullet: outlined circle fallback */
.subjects-list > li > ul > li::before{
  background: transparent;
  border: 2px solid var(--bullet-color);
  border-radius: 999px;
}

/* Preferred: SVG mask bullets (overrides fallback when supported) */
@supports (-webkit-mask-image: url("")) or (mask-image: url("")) {
  .subjects-list > li::before{
    background: var(--bullet-color);
    border: 0;
    border-radius: 0;

    -webkit-mask-image: var(--svg-bullet-filled);
    mask-image: var(--svg-bullet-filled);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
  }

  .subjects-list > li > ul > li::before{
    background: var(--bullet-color);
    border: 0;
    border-radius: 0;

    -webkit-mask-image: var(--svg-bullet-outline);
    mask-image: var(--svg-bullet-outline);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
  }
}

/* Ensure section titles respect section background color */
section .section-title{
  color: var(--section-text-color) !important;
}

/* About photo tweaks */
.about-photo{
  width: 100%;
  height: auto;
}

@media (min-width: 768px){
  .about-photo{
    aspect-ratio: 4 / 3;     /* matches 1200x900 */
    object-fit: cover;       /* keeps it nicely framed */
  }
}

/* =========================
   Footer (bottom of scrolling content)
   ========================= */

footer.site-footer{
  background: var(--brand-blue);
  color: #fff;
  border-top: 1px solid rgba(255,255,255,.15);
}

footer.site-footer a{
  color: #fff;
  text-decoration: none;
}

footer.site-footer a:hover,
footer.site-footer a:focus{
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-icon{
  width: 28px;
  display: inline-grid;
  place-items: center;
}
