/* ==========================================================================
   Theme variables
   ========================================================================== */
:root {
  --primary-blue: #005792;
  --primary-blue-dark: #003f63;
  --max-width: 800px;

  /* Layout spacers for fixed header/footer */
  --nav-height: 64px;
  --footer-height: 80px; /* adjust if your social footer is taller */
}

/* ==========================================================================
   Parallax background layer
   ========================================================================== */
.background-layer {
  background-image: url('/assets/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: -2;
}

/* ==========================================================================
   Main scrolling layer (adds space for fixed header/footer)
   ========================================================================== */
.main-layer {
  position: relative;
  z-index: 1;
  padding-top: calc(var(--nav-height) + 8px);
  padding-bottom: calc(var(--footer-height) + 16px);
}

/* ==========================================================================
   Base
   ========================================================================== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  color: #212529;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-nav{
  position:fixed; top:0; left:0; right:0;
  background:rgba(255,255,255,0.95);
  z-index:1000;
  display:flex; align-items:center; gap:1rem;
  padding:.75rem 1rem;
  border-bottom:1px solid rgba(0,0,0,.06);
  flex-wrap:wrap;
}
.site-nav .brand{
  display:inline-flex; align-items:center;
  font-weight:700; font-size:1rem;
  padding:.5rem .75rem;
  color:var(--primary-blue);
  text-decoration:none!important;
}
.site-nav .brand:hover{ color:var(--primary-blue-dark); }

.site-nav .nav-links a,
.site-nav .dropbtn{
  display:inline-flex; align-items:center; gap:.35rem;
  padding:.5rem .75rem; border-radius:6px;
  font-weight:600;
  color:var(--primary-blue);
  background:transparent; border:0;
  text-decoration:none!important;
}
.site-nav .nav-links a:hover,
.site-nav .dropbtn:hover{
  background:rgba(0,87,146,.08);
  color:var(--primary-blue-dark);
}
/* Match dropdown button font to nav links */
.site-nav .dropbtn {
  font-size: inherit;      /* match parent (same as nav links) */
  font-weight: 600;    /* match the boldness */
  line-height: normal;     /* match link vertical spacing */
  font-family: inherit;    /* ensure same typeface */
}
.nav-toggle{
  display:none; margin-left:auto;
  font-size:1.5rem; background:transparent; border:0; line-height:1; cursor:pointer;
}

.dropdown{ position:relative; }
.dropdown-content{
  display:none; position:absolute; top:100%; left:0; min-width:220px;
  background:#fff; padding:.5rem 0;
  border:1px solid rgba(0,0,0,.06);
  box-shadow:0 6px 18px rgba(0,0,0,.08);
  z-index:1001;
}
.dropdown-content a{ display:block; padding:.6rem .9rem; }

/* ==========================================================================
   Content card
   ========================================================================== */
.content-wrapper {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 2rem;
  background: rgba(255,255,255,0.85);
  border-radius: 12px;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Typography */
h1, h2, h3 { color: var(--primary-blue); transition: color 0.3s ease; }
a { color: #007bff; transition: color 0.3s ease; }

/* Details/Summary */
details {
  background: #fff; border: 1px solid #ccc; border-radius: 6px;
  padding: 1rem; margin-bottom: 1rem; box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
summary {
  font-weight: bold; cursor: pointer; color: var(--primary-blue);
  font-size: 1.1rem; transition: color 0.3s ease;
}
summary:hover { text-decoration: underline; color: var(--primary-blue-dark); }

/* Circular Headshot */
.headshot {
  width: 200px; height: 200px;
  object-fit: cover; border-radius: 50%;
  margin: 1rem auto; display: block;
  transition: transform 0.3s ease;
}
.headshot:hover { transform: scale(1.05); }

/* Back to Top Button */
#topBtn {
  display: none; position: fixed;
  right: 30px; bottom: 80px;
  z-index: 1100;
  font-size: 1rem; border: none; outline: none;
  background-color: var(--primary-blue); color: white;
  cursor: pointer; padding: 0.75rem 1rem;
  border-radius: 50px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: background-color 0.3s ease;
}
#topBtn:hover { background-color: var(--primary-blue-dark); }

/* ==========================================================================
   Card grid
   ========================================================================== */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  list-style: none;
  margin: 2rem auto;
  padding: 0;
  max-width: var(--max-width);
}
.card-grid .content-wrapper { margin: 0; }
@media (min-width: 800px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Buttons */
.button {
  display: inline-block;
  background-color: var(--primary-blue);
  color: #ffffff !important;
  padding: 0.75rem 1rem;
  border: none; outline: none; border-radius: 50px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  text-decoration: none !important; font-size: 1rem; cursor: pointer;
  transition: background-color 0.3s ease;
}
.button:hover { background-color: var(--primary-blue-dark); }

/* ==========================================================================
   Social footer
   ========================================================================== */
.social-footer {
  position: fixed;
  bottom: 0; left: 0; width: 100%;
  background: rgba(255,255,255,0.95);
  padding: 1rem 0;
  z-index: 1000;
  border-top: 1px solid rgba(0,0,0,0.06);
  text-align: center;
}
.social-icons {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}
.social-icon {
  width: 32px; height: 32px; font-size: 32px;
  color: var(--primary-blue);
  transition: color 0.3s ease, transform 0.3s ease;
}
.social-icon:hover { color: var(--primary-blue-dark); transform: scale(1.1); }
.svg-icon { display: block; }
.social-icon.psychology-today { width: 48px; height: 48px; }

/* ==========================================================================
   Accessibility
   ========================================================================== */
.social-icons a:focus-visible,
.site-nav a:focus-visible,
.site-nav .dropbtn:focus-visible {
  outline: 3px solid var(--primary-blue);
  outline-offset: 4px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   Google Scholar
   ========================================================================== */
.scholar-publications {
  list-style: none;
  padding-left: 0;
  margin: 2rem 0;
}
.scholar-publications li { margin-bottom: 1rem; }
.scholar-publications a { text-decoration: underline; color: #0A66C2; }

/* ==========================================================================
   Quick Links (About)
   ========================================================================== */
.quick-links { list-style: none; padding: 0; margin: 0 0 2rem 0; }
.quick-links li { margin-bottom: 0.75rem; }
.quick-link-icon {
  width: 1.2em; height: 1.2em; vertical-align: middle; margin-right: 0.4em;
}

/* ==========================================================================
   Fluid type
   ========================================================================== */
h1 { font-size: clamp(1.5rem, 2.5vw + 1rem, 2.25rem); }
h2 { font-size: clamp(1.25rem, 2vw + .75rem, 1.6rem); }
body { font-size: clamp(16px, 1.2vw + 12px, 18px); }

/* ==========================================================================
   Mobile (≤ 800px)
   ========================================================================== */
@media (max-width: 800px) {
  :root { --nav-height: 56px; }

  .nav-toggle { display: inline-block; }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(255,255,255,0.98);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: .5rem 0;
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
    z-index: 1000;
  }
  .nav-links.open { display: flex; }

  .site-nav .brand,
  .site-nav .nav-links a,
  .site-nav .dropbtn { padding: .9rem 1rem; }

  .dropdown-content {
    position: static; display: none; box-shadow: none; border: 0; padding: 0;
  }

  .content-wrapper {
    background: rgba(255,255,255,0.95);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin: 1rem;
    padding: 1.5rem;
  }
}
/* ==========================================================================
   Desktop header alignment (≥ 801px)
   Keeps brand + links on one line; mobile unaffected
   ========================================================================== */
@media (min-width: 801px) {
  .site-nav {
    flex-wrap: nowrap;              /* no wrapping on desktop */
    justify-content: flex-start;
  }
  .site-nav .brand {
    margin-right: 2rem;             /* space between Home and first link */
  }
  /* Make the links row sit on the same line as the brand */
  .nav-links {
    display: flex !important;       /* force flex on desktop */
    flex: 1;                        /* take remaining space */
    justify-content: flex-start;    /* links flow left-to-right */
    align-items: center;
    gap: 0.5rem;
    position: static;               /* ensure it's not fixed on desktop */
  }
  /* Desktop dropdown stays positioned absolutely under the button */
  .dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.06);
  }
}
