/*
  dept-styles.css
  Shared stylesheet — Division of Functional and Epilepsy Neurosurgery
  Norman Prince Neurosciences Institute · Brown University Health
  Author: Wael Asaad, MD, PhD
  © 2026. Please credit source if adapted or redistributed.
*/

/* ── CUSTOM PROPERTIES ─────────────────────────────────────── */
:root {
  --red:          #c8102e;
  --red-light:    #fce8ec;
  --teal:         #00897b;
  --teal-light:   #e0f2f0;
  --navy:         #1c3557;
  --navy-mid:     #264d7a;
  --navy-light:   #eaf0f8;
  --brown:        #4e3629;
  --amber:        #c97a00;
  --amber-light:  #fff3cd;
  --purple:       #6b3fa0;
  --purple-light: rgba(107,63,160,0.10);
  --gray-50:      #f8f9fa;
  --gray-100:     #f1f3f5;
  --gray-200:     #e9ecef;
  --gray-300:     #dee2e6;
  --gray-500:     #6c757d;
  --gray-700:     #3d4450;
  --white:        #ffffff;
  --text:         #1a2332;
  --text-light:   #4a5568;
  --shadow:       0 4px 20px rgba(28,53,87,0.10);
  --shadow-sm:    0 2px 8px rgba(28,53,87,0.07);
  --shadow-md:    0 4px 12px rgba(28,53,87,0.10), 0 2px 4px rgba(28,53,87,0.06);
  --shadow-lg:    0 12px 48px rgba(28,53,87,0.14);
  --radius:       12px;
  --radius-lg:    20px;
  --transition:   all 0.25s ease;
}

/* ── RESET / BASE ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; color: var(--text); background: #fff; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ── TOP BAR ───────────────────────────────────────────────── */
.topbar {
  background: var(--navy);
  color: rgba(255,255,255,0.75);
  font-size: 0.78rem;
  padding: 6px 0;
  text-align: center;
  letter-spacing: 0.02em;
}
.topbar a { color: rgba(255,255,255,0.85); }
.topbar a:hover { color: #fff; text-decoration: underline; }

/* ── HEADER / NAV ──────────────────────────────────────────── */
header {
  background: var(--white);
  border-bottom: 3px solid var(--red);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; gap: 16px;
}
.logo-block { display: flex; align-items: center; gap: 14px; }
.logo-mark  { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-text  { line-height: 1.2; }
.logo-text .institution {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gray-500);
}
.logo-text .dept {
  font-size: 1.05rem; font-weight: 700; color: var(--navy);
  font-family: 'Playfair Display', serif;
}
nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
nav a {
  font-size: 0.78rem; font-weight: 500; color: var(--gray-700);
  padding: 6px 9px; border-radius: 6px;
  transition: var(--transition); white-space: nowrap;
}
nav a:hover, nav a.active { background: var(--navy-light); color: var(--navy); }
.btn-appt {
  background: var(--red); color: white !important;
  padding: 8px 18px !important; border-radius: 8px !important; font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(200,16,46,0.3);
}
.btn-appt:hover { background: #a50d26 !important; box-shadow: 0 4px 14px rgba(200,16,46,0.4) !important; }

/* ── LAYOUT ────────────────────────────────────────────────── */
.section     { padding: 80px 24px; }
.section-alt { background: var(--gray-50); }
.section-navy { background: var(--navy); color: white; }
.container   { max-width: 1200px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 56px; }
.section-tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 14px; border-radius: 20px; margin-bottom: 14px;
  background: var(--navy-light); color: var(--navy);
}
.section-tag.teal   { background: rgba(0,137,123,0.10); color: var(--teal); }
.section-tag.purple { background: var(--purple-light); color: var(--purple); }
.section-tag.red    { background: rgba(200,16,46,0.08); color: var(--red); }
.section-tag.navy   { background: var(--navy-light); color: var(--navy); }
.section-header h2  { font-family: 'Playfair Display', serif; font-size: clamp(1.6rem,3vw,2.2rem); font-weight: 700; color: var(--navy); margin-bottom: 14px; }
.section-header p   { font-size: 1rem; color: var(--gray-500); max-width: 660px; margin: 0 auto; line-height: 1.65; }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn-primary {
  background: var(--red); color: #fff;
  padding: 13px 26px; border-radius: 10px; font-weight: 700;
  font-size: 0.95rem; border: none; cursor: pointer;
  font-family: inherit; transition: var(--transition);
}
.btn-primary:hover { background: #a50e28; transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: #fff;
  padding: 13px 26px; border-radius: 10px; font-weight: 700;
  font-size: 0.95rem; border: 2px solid rgba(255,255,255,0.45);
  cursor: pointer; font-family: inherit; transition: var(--transition);
}
.btn-outline:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.8); }

/* ── CONTACT SECTION ───────────────────────────────────────── */
.contact-section { background: linear-gradient(135deg, var(--navy) 0%, #0e2240 100%); color: #fff; }
.contact-inner   { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
@media (max-width: 760px) { .contact-inner { grid-template-columns: 1fr; } }
.contact-text h2 { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 700; margin-bottom: 16px; }
.contact-text p  { color: rgba(255,255,255,0.8); line-height: 1.7; margin-bottom: 24px; }
.contact-items   { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.contact-item    { display: flex; align-items: flex-start; gap: 14px; }
.ci-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.ci-text strong  { display: block; color: white; font-size: 0.88rem; margin-bottom: 2px; }
.ci-text span, .ci-text a { color: rgba(255,255,255,0.65); font-size: 0.85rem; display: block; }
.ci-text a       { color: #4dd0c4; }
.contact-form {
  background: rgba(255,255,255,0.08); border-radius: var(--radius-lg);
  padding: 28px; border: 1px solid rgba(255,255,255,0.15);
}
.contact-form h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 18px; }
.form-row        { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-group      { margin-bottom: 14px; }
.form-label      { display: block; font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.85); margin-bottom: 5px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 13px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.10); color: #fff;
  font-family: inherit; font-size: 0.9rem;
}
.form-input::placeholder { color: rgba(255,255,255,0.4); }
.form-select option      { background: var(--navy); color: #fff; }
.form-textarea   { resize: vertical; min-height: 80px; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--teal); background: rgba(255,255,255,0.15);
}
.form-submit {
  width: 100%; padding: 12px; border-radius: 8px; border: none;
  background: var(--red); color: #fff; font-weight: 700;
  font-size: 0.95rem; cursor: pointer; font-family: inherit;
  transition: var(--transition); margin-top: 4px;
}
.form-submit:hover { background: #a50d26; transform: translateY(-1px); }
.form-disclaimer { font-size: 0.75rem; color: rgba(255,255,255,0.5); text-align: center; margin-top: 10px; }

/* ── SURGICAL SAFETY PANELS ────────────────────────────────── */
.sa-safety-block {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 40px;
}
@media (max-width: 820px) { .sa-safety-block { grid-template-columns: 1fr; } }
.sa-safety-panel         { border-radius: 14px; padding: 26px 28px; }
.sa-safety-panel.risks   { background: #fdf4f5; border: 1px solid #f0cdd2; }
.sa-safety-panel.program { background: #f0f8f7; border: 1px solid #b2dbd8; }
.sa-safety-heading       { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sa-safety-icon          { font-size: 1.5rem; flex-shrink: 0; }
.sa-safety-heading h3    { margin: 0; font-size: 1.05rem; font-weight: 700; color: #1a1a2e; }
.sa-safety-panel p       { font-size: 0.9rem; color: #444; line-height: 1.7; margin-bottom: 12px; }
.sa-safety-panel p:last-child { margin-bottom: 0; }
.sa-safety-panel.program strong { color: var(--teal); }

/* ── FOOTER ─────────────────────────────────────────────────── */
footer { background: #0d1b2e; color: rgba(255,255,255,0.6); padding: 40px 24px; }
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px;
}
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-brand .fb-logo   { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand p          { font-size: 0.82rem; line-height: 1.7; color: rgba(255,255,255,0.5); }
.footer-col h4 {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: rgba(255,255,255,0.5);
  margin-bottom: 14px; font-family: 'Inter', sans-serif;
}
.footer-col a     { display: block; font-size: 0.85rem; color: rgba(255,255,255,0.65); margin-bottom: 8px; transition: var(--transition); }
.footer-col a:hover { color: white; }
.footer-bottom {
  max-width: 1200px; margin: 32px auto 0; padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; font-size: 0.78rem;
}

/* ── DISCLAIMER BAR ─────────────────────────────────────────── */
.disclaimer-bar {
  background: #0a1525; padding: 16px 24px; text-align: center;
  font-size: 0.85rem; color: rgba(255,255,255,0.65);
}

/* ── GLOSSARY TOOLTIP SYSTEM ────────────────────────────────── */
/* Shared across all pages. Dictionary and applyGlossary() call  */
/* live in each page's own <script>; the popup markup and CSS    */
/* are injected automatically by dept-components.js.            */
.gterm {
  color: var(--teal); cursor: pointer; display: inline;
  border-radius: 3px;
}
.gterm:hover { background: rgba(0,137,123,0.10); }
#glossary-popup {
  display: none; position: fixed; z-index: 9999;
  max-width: 320px; background: white; border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
  padding: 18px 20px 16px; font-family: inherit; pointer-events: auto;
}
#glossary-popup.visible { display: block; }
#glossary-popup-term {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--teal); margin-bottom: 6px;
}
#glossary-popup-def { font-size: 0.9rem; color: #2d3a4a; line-height: 1.58; }
#glossary-popup-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; font-size: 1.1rem;
  color: #888; cursor: pointer; padding: 2px 6px; border-radius: 50%;
}
#glossary-popup-close:hover { background: #f0f0f0; color: #333; }
