/* =============================================================
   IEER — Institute for Excellence in Education and Research
   Design language: "The Masthead" — an academic publishing house.
   Paper ledger background, deep navy authority, brass seal accent.
   ============================================================= */

:root {
  --ink-900: #14213D;
  --ink-800: #1D2E4F;
  --ink-700: #29406B;
  --paper: #F0EEE3;
  --paper-raised: #F8F6EE;
  --brass: #A9822E;
  --brass-dark: #7E611F;
  --teal: #2F4C43;
  --text: #1C1F26;
  --text-muted: #565B66;
  --rule: #D6D0BC;
  --rule-dark: #B9B296;

  --font-display: "Source Serif 4", "Georgia", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--paper);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  color: var(--ink-900);
  font-weight: 600;
  letter-spacing: -0.01em;
}

a { color: var(--ink-700); text-decoration: none; }
a:hover { color: var(--brass-dark); }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass-dark);
}

.rule {
  border: none;
  border-top: 1px solid var(--rule-dark);
  margin: 0;
}

.container-narrow { max-width: 980px; margin-inline: auto; }

/* -------------------- Top bar -------------------- */
.top-strip {
  background: var(--ink-900);
  color: #C9D2E3;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
}
.top-strip a { color: #C9D2E3; }
.top-strip a:hover { color: #fff; }

/* -------------------- Navbar -------------------- */
.navbar-ieer {
  background: var(--paper-raised);
  border-bottom: 1px solid var(--rule-dark);
  padding-top: .9rem;
  padding-bottom: .9rem;
}
.navbar-ieer .navbar-brand {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 0;
}
.brand-logo {
  height: 62px;
  width: auto;
  display: block;
  transition: transform .2s ease;
  flex-shrink: 0;
}
.navbar-brand:hover .brand-logo { transform: scale(1.03); }
.footer-logo {
  height: 68px;
  width: auto;
  display: block;
}
.navbar-ieer .nav-link {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-800);
  margin-inline: 4px;
  padding: .5rem .85rem !important;
  position: relative;
}
.navbar-ieer .nav-link.active,
.navbar-ieer .nav-link:hover { color: var(--brass-dark); }
.navbar-ieer .nav-link.active::after {
  content: "";
  position: absolute;
  left: .85rem; right: .85rem; bottom: .18rem;
  height: 2px;
  background: var(--brass);
}

/* -------------------- Hero / Masthead -------------------- */
.masthead {
  background:
    repeating-linear-gradient(180deg, rgba(20,33,61,0.035) 0px, rgba(20,33,61,0.035) 1px, transparent 1px, transparent 34px),
    var(--paper);
  border-bottom: 1px solid var(--rule-dark);
  padding: 3.2rem 0 2.8rem;
  position: relative;
  overflow: hidden;
}
.masthead::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('../img/hero-bg.svg');
  background-repeat: no-repeat;
  background-position: right center;
  background-size: cover;
  opacity: .9;
  pointer-events: none;
  z-index: 0;
}
.masthead::after {
  content: "";
  position: absolute;
  top: -8%;
  right: -2%;
  width: 460px;
  height: 460px;
  background-image: url('../img/ieer-watermark.png');
  background-repeat: no-repeat;
  background-size: contain;
  opacity: .06;
  pointer-events: none;
  z-index: 0;
}
.masthead .container { position: relative; z-index: 1; }
.masthead-kicker {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: .6rem;
}
.masthead-kicker::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--teal);
  display: inline-block;
}
.masthead h1 {
  font-size: clamp(2.3rem, 4vw, 3.4rem);
  line-height: 1.08;
  margin: .7rem 0 1rem;
}
.masthead .lede {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 640px;
}
.masthead .reg-stamp {
  border: 1.5px solid var(--brass);
  color: var(--brass-dark);
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .05em;
  padding: .5rem .8rem;
  border-radius: 3px;
  display: inline-block;
  margin-top: 1.2rem;
  background: rgba(169,130,46,0.06);
}

/* -------------------- Masthead journal-cover stack (hero visual) -------------------- */
.masthead-visual {
  position: relative;
  height: 118px;
  margin-bottom: 1.5rem;
}
.cover-stack { position: relative; width: 100%; height: 100%; }
.cover-stack-item {
  position: absolute;
  top: 0;
  width: 92px;
  height: 122px;
  object-fit: cover;
  border-radius: 4px;
  border: 3px solid var(--paper-raised);
  box-shadow: 0 16px 30px -14px rgba(20,33,61,0.45);
  transition: transform .3s ease, box-shadow .3s ease;
}
.cs-1 { left: 0;   transform: rotate(-9deg);  z-index: 1; }
.cs-2 { left: 68px; transform: rotate(4deg);   z-index: 2; }
.cs-3 { left: 136px; transform: rotate(-4deg); z-index: 3; }
.masthead-visual:hover .cs-1 { transform: rotate(-14deg) translateY(-4px); }
.masthead-visual:hover .cs-2 { transform: rotate(7deg) translateY(-8px); }
.masthead-visual:hover .cs-3 { transform: rotate(-2deg) translateY(-4px); }
.masthead-visual::after {
  content: "";
  position: absolute;
  left: 190px; top: 10px;
  width: 130px; height: 130px;
  background: radial-gradient(circle, rgba(169,130,46,0.16), transparent 70%);
  border-radius: 50%;
  z-index: 0;
}
@media (max-width: 991.98px) {
  .masthead-visual { height: 110px; margin-bottom: 1.8rem; }
  .cover-stack-item { width: 78px; height: 104px; }
  .cs-2 { left: 58px; }
  .cs-3 { left: 116px; }
}

.masthead-panel {
  background: var(--paper-raised);
  border: 1px solid var(--rule-dark);
  border-radius: 4px;
  padding: 1.6rem;
}
.masthead-panel .stat-row + .stat-row {
  border-top: 1px dashed var(--rule-dark);
  margin-top: .95rem;
  padding-top: .95rem;
}
.stat-row { display: flex; align-items: baseline; justify-content: space-between; }
.stat-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.9rem;
  color: var(--ink-900);
}
.stat-label {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: right;
}

/* -------------------- Buttons -------------------- */
.btn-ieer-primary {
  background: var(--ink-900);
  color: #F6F3EC;
  border: 1px solid var(--ink-900);
  border-radius: 3px;
  font-weight: 600;
  font-size: .92rem;
  padding: .68rem 1.4rem;
  transition: background .15s ease, color .15s ease, transform .1s ease;
}
.btn-ieer-primary:hover {
  background: var(--brass-dark);
  border-color: var(--brass-dark);
  color: #fff;
}
.btn-ieer-outline {
  background: transparent;
  color: var(--ink-900);
  border: 1px solid var(--ink-900);
  border-radius: 3px;
  font-weight: 600;
  font-size: .92rem;
  padding: .66rem 1.4rem;
  transition: all .15s ease;
}
.btn-ieer-outline:hover {
  background: var(--ink-900);
  color: var(--paper);
}

/* -------------------- Section shell -------------------- */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--paper-raised); border-top: 1px solid var(--rule-dark); border-bottom: 1px solid var(--rule-dark); }
.section-head { margin-bottom: 2.1rem; }
.section-head h2 {
  font-size: clamp(1.7rem, 2.6vw, 2.2rem);
  margin: .5rem 0 .6rem;
  position: relative;
  display: inline-block;
}
.section-head h2::after {
  content: "";
  position: absolute;
  left: 0; bottom: -.35rem;
  height: 2px;
  width: 46px;
  background: var(--brass);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform .5s ease .1s;
}
.reveal.in h2::after,
.reveal.in.section-head h2::after { transform: scaleX(1); }
.section-head p { color: var(--text-muted); max-width: 620px; }

/* -------------------- Activity list (numbered, real sequence-free but ordered listing) -------------------- */
.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-list li {
  display: flex;
  gap: 1.1rem;
  padding: 1.15rem 0;
  border-top: 1px solid var(--rule);
}
.activity-list li:last-child { border-bottom: 1px solid var(--rule); }
.activity-list .a-index {
  font-family: var(--font-mono);
  color: var(--brass-dark);
  font-size: .85rem;
  flex-shrink: 0;
  width: 2rem;
  padding-top: .15rem;
}
.activity-list h4 { font-size: 1.02rem; margin: 0 0 .25rem; color: var(--ink-900); }
.activity-list p { margin: 0; color: var(--text-muted); font-size: .92rem; }

/* -------------------- Citation / Journal cards -------------------- */
.citation-card {
  background: var(--paper-raised);
  border: 1px solid var(--rule-dark);
  border-left: 4px solid var(--teal);
  border-radius: 3px;
  padding: 1.4rem 1.4rem 1.3rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: box-shadow .18s ease, transform .18s ease, border-left-color .18s ease;
}
.citation-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px -18px rgba(20,33,61,0.35);
  border-left-color: var(--brass);
}
.citation-card.scope-medicine { border-left-color: #6E5A9C; }
.citation-card.scope-social { border-left-color: #2F4C43; }
.citation-card.scope-business { border-left-color: #A9822E; }
.citation-card.scope-engineering { border-left-color: #2A5D74; }
.citation-card.scope-humanities { border-left-color: #8C4B3B; }
.citation-card.scope-multi { border-left-color: #4A4A4A; }

.citation-thumb {
  width: 100%;
  /* aspect-ratio: 4/3; */
  object-fit: cover;
  border: 1px solid var(--rule-dark);
  border-radius: 2px;
  margin-bottom: 1rem;
  background: #fff;
}
.citation-scope {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.citation-card h3 {
  font-size: 1.04rem;
  line-height: 1.32;
  margin: .35rem 0 .6rem;
}
.citation-card h3 a { color: var(--ink-900); }
.citation-card h3 a:hover { color: var(--brass-dark); }
.citation-issn {
  font-family: var(--font-mono);
  font-size: .74rem;
  color: var(--text-muted);
  margin-bottom: .9rem;
}
.citation-badges { margin-top: auto; display: flex; flex-wrap: wrap; gap: .4rem; padding-top: .6rem; }
.badge-seal {
  font-family: var(--font-mono);
  font-size: .64rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid var(--rule-dark);
  color: var(--ink-800);
  border-radius: 20px;
  padding: .28rem .62rem;
  background: #fff;
}
.citation-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px dashed var(--rule-dark);
}
.citation-visit {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-900);
}
.citation-visit:hover { color: var(--brass-dark); }

/* -------------------- Journals: category jump nav -------------------- */
.cat-jumpnav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rule-dark);
  border: 1px solid var(--rule-dark);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 2.2rem;
}
.cat-jump-link {
  background: var(--paper-raised);
  color: var(--ink-900);
  padding: 1rem 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  font-size: .82rem;
  line-height: 1.35;
  transition: background .15s ease, color .15s ease;
}
.cat-jump-link:hover { background: var(--ink-900); color: var(--paper); }
.cat-jump-link:hover .cat-jump-num { color: var(--brass); }
.cat-jump-link small { font-family: var(--font-mono); font-weight: 400; opacity: .75; font-size: .72rem; }
.cat-jump-num {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--brass-dark);
  flex-shrink: 0;
}

/* -------------------- Journals: category section -------------------- */
.cat-section { margin-bottom: 3.5rem; scroll-margin-top: 90px; }
.cat-section-head {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding-bottom: 1.1rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--ink-900);
}
.cat-badge-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--paper);
  background: var(--ink-900);
  width: 52px; height: 52px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cat-section-head h2 { font-size: 1.4rem; margin: 0; line-height: 1.25; }
.cat-range {
  font-family: var(--font-mono);
  font-size: .76rem;
  color: var(--brass-dark);
  letter-spacing: .02em;
  margin-top: .2rem;
}
.cat-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--rule-dark);
  border-radius: 20px;
  padding: .35rem .8rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.citation-title-full {
  /* full titles always shown in full — never truncated */
  overflow-wrap: break-word;
}

/* -------------------- Filter pills -------------------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: .55rem; }
.filter-pill {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid var(--rule-dark);
  background: var(--paper-raised);
  color: var(--text);
  border-radius: 20px;
  padding: .42rem .95rem;
  cursor: pointer;
  transition: all .15s ease;
}
.filter-pill:hover { border-color: var(--ink-900); }
.filter-pill.active {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: var(--paper);
}

/* -------------------- Indexing marquee (homepage) -------------------- */
.marquee-wrap {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  animation: marquee-scroll 34s linear infinite;
}
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }
.marquee-tile { width: 168px; flex-shrink: 0; height: 96px; }
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* -------------------- Indexing grid -------------------- */
.index-tile {
  background: #fff;
  border: 1px solid var(--rule-dark);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.1rem;
  height: 108px;
  transition: box-shadow .15s ease, transform .15s ease;
}
.index-tile:hover { box-shadow: 0 10px 22px -16px rgba(20,33,61,0.4); transform: translateY(-2px); }
.index-tile img { max-height: 62px; max-width: 100%; object-fit: contain; filter: grayscale(15%); }

/* -------------------- About / mission split -------------------- */
.mission-figure {
  border: 1px solid var(--rule-dark);
  background: var(--paper-raised);
  padding: .5rem;
  border-radius: 4px;
}
.mission-figure img { width: 100%; border-radius: 2px; display: block; }

/* -------------------- Timeline (events empty state) -------------------- */
.empty-state {
  border: 1px dashed var(--rule-dark);
  background: var(--paper-raised);
  border-radius: 6px;
  padding: 3.5rem 2rem;
  text-align: center;
}
.empty-state .glyph {
  width: 56px; height: 56px;
  border: 1.5px solid var(--brass);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.2rem;
  color: var(--brass-dark);
  font-family: var(--font-display);
  font-size: 1.4rem;
}

/* -------------------- Contact -------------------- */
.contact-card {
  background: var(--paper-raised);
  border: 1px solid var(--rule-dark);
  border-radius: 4px;
  padding: 1.5rem;
}
.contact-card-fill { height: 100%; }
.contact-card .eyebrow { margin-bottom: .4rem; display:block; }
.form-control-ieer {
  border: 1px solid var(--rule-dark);
  border-radius: 3px;
  background: #fff;
  padding: .7rem .85rem;
  font-family: var(--font-body);
  font-size: .95rem;
}
.form-control-ieer:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(169,130,46,0.15);
  outline: none;
}
label.form-label-ieer {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .35rem;
}

.alert-ieer-success {
  border: 1px solid var(--teal);
  background: rgba(47,76,67,0.08);
  color: var(--teal);
  border-radius: 3px;
  padding: .85rem 1rem;
  font-size: .9rem;
}
.alert-ieer-error {
  border: 1px solid #8C4B3B;
  background: rgba(140,75,59,0.08);
  color: #8C4B3B;
  border-radius: 3px;
  padding: .85rem 1rem;
  font-size: .9rem;
}

/* -------------------- Map CTA (replaces iframe embed — avoids CSP frame-src issues) -------------------- */
.map-cta-block {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 2rem 1.5rem;
  background: var(--paper-raised);
  color: var(--ink-900);
  transition: background .15s ease;
}
.map-cta-block:hover { background: var(--paper); color: var(--brass-dark); }
.map-cta-icon {
  width: 52px; height: 52px;
  border: 1.5px solid var(--brass);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--brass-dark);
  flex-shrink: 0;
}
.map-cta-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: inherit;
}
.map-cta-sub {
  font-size: .88rem;
  color: var(--text-muted);
}

/* -------------------- Footer -------------------- */
.footer-ieer {
  background: var(--ink-900);
  color: #B7C1D6;
  padding: 3.5rem 0 1.5rem;
}
.footer-ieer h5 {
  color: #fff;
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}
.footer-ieer a { color: #B7C1D6; }
.footer-ieer a:hover { color: var(--brass); }
.footer-ieer .footer-brand {
  font-family: var(--font-display);
  color: #fff;
  font-size: 1.2rem;
}
.footer-rule { border-top: 1px solid #2B3B5C; margin: 2.5rem 0 1.4rem; }
.footer-bottom { font-size: .8rem; color: #8592AB; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.social-dot {
  width: 36px; height: 36px;
  border: 1px solid #2B3B5C;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  margin-right: .5rem;
  transition: border-color .15s ease, background .15s ease;
}
.social-dot:hover { border-color: var(--brass); background: rgba(169,130,46,0.12); }

/* -------------------- Back to top -------------------- */
.back-to-top {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  width: 44px; height: 44px;
  background: var(--ink-900);
  color: var(--paper);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all .2s ease;
  z-index: 999;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--brass-dark); }

/* -------------------- Reveal on scroll -------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* -------------------- Misc -------------------- */
.text-brass { color: var(--brass-dark) !important; }
.text-teal { color: var(--teal) !important; }
.bg-paper-raised { background: var(--paper-raised); }
.divider-dot { color: var(--rule-dark); margin-inline: .5rem; }

@media (max-width: 767.98px) {
  .section { padding: 3rem 0; }
  .masthead { padding: 3rem 0 2.5rem; text-align: left; }
  .cat-jumpnav { grid-template-columns: repeat(2, 1fr); }
  .cat-section-head { flex-wrap: wrap; }
  .cat-count { margin-left: 0; }
  .brand-logo { height: 46px; }
}

@media (max-width: 480px) {
  .cat-jumpnav { grid-template-columns: 1fr; }
}
