/* ═══════════════════════════════════════════════════════════════════
   PaperHub — Custom Styles
   ═══════════════════════════════════════════════════════════════════ */

/* ── Hero ─────────────────────────────────────────────────────────── */
.ph-hero {
  position: relative;
  overflow: hidden;
  background: #0f1c33;
  min-height: 520px;
}
/* Slideshow background layer */
.ph-hero-slides {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.ph-hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  will-change: opacity;
}
.ph-hero-slide.active { opacity: 1; }
/* Dark overlay */
.ph-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(165deg, rgba(15,28,51,.82) 0%, rgba(22,37,66,.72) 40%, rgba(30,49,88,.68) 80%, rgba(15,28,51,.82) 100%);
  pointer-events: none;
}
/* Content panels — stacked absolutely, fixed height, opacity transition */
.ph-hero-panels {
  position: relative;
  z-index: 2;
  height: 600px;
}
.ph-hero-panel {
  position: absolute;
  inset: 0;
  padding: 80px 0 60px;
  display: flex;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  pointer-events: none;
}
.ph-hero-panel.active {
  opacity: 1;
  pointer-events: auto;
}
.ph-hero-panel .container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}
/* Vertical alignment */
.ph-hero-panel--v-top .container    { justify-content: flex-start; }
.ph-hero-panel--v-center .container { justify-content: center; }
.ph-hero-panel--v-bottom .container { justify-content: flex-end; }
/* Horizontal alignment */
.ph-hero-panel--h-left   { text-align: left; }
.ph-hero-panel--h-center { text-align: center; }
.ph-hero-panel--h-right  { text-align: right; }
.ph-hero-panel--h-center .ph-hero-caption,
.ph-hero-panel--h-center .ph-hero-search,
.ph-hero-panel--h-center .ph-hero-stats { margin-left: auto; margin-right: auto; }
.ph-hero-panel--h-right .ph-hero-caption,
.ph-hero-panel--h-right .ph-hero-search,
.ph-hero-panel--h-right .ph-hero-stats { margin-left: auto; }
/* Caption */
.ph-hero-caption { max-width: 760px; }
/* Badge */
.ph-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 50px;
  padding: 6px 16px 6px 8px;
  margin-bottom: 24px;
  font-size: .8rem;
  color: rgba(255,255,255,.7);
  font-family: 'DM Sans', sans-serif;
}
.ph-hero-badge-dot {
  width: 8px; height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: ph-pulse 2s infinite;
}
.ph-hero-badge--info { border-color: rgba(91,155,213,.3); background: rgba(91,155,213,.12); }
@keyframes ph-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
/* Heading */
.ph-hero h1 {
  font-family: 'DM Sans', sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin-bottom: 20px;
}
.ph-hero h1 em {
  font-style: italic;
  color: #5b9bd5;
  position: relative;
}
.ph-hero p.ph-hero-sub {
  color: rgba(255,255,255,.6);
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 32px;
  font-family: 'DM Sans', sans-serif;
}
/* Search */
.ph-hero-search {
  display: flex;
  background: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 8px;
  padding: 5px;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.ph-hero-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #333;
  font-size: .95rem;
  padding: 12px 16px;
  font-family: 'DM Sans', sans-serif;
}
.ph-hero-search input::placeholder { color: rgba(0,0,0,.4); }
.ph-hero-search button {
  background: var(--ph-btn-primary-bg, #3b6cb5);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  transition: background .2s;
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}
.ph-hero-search button:hover { background: var(--ph-btn-primary-hover, #2d5594); }
/* Stats */
.ph-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  overflow: hidden;
}
.ph-hero-stat {
  padding: 14px 16px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,.06);
}
.ph-hero-stat:last-child { border-right: none; }
.ph-hero-stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-bottom: 4px;
}
.ph-hero-stat-num span { color: #5b9bd5; font-size: 1rem; }
.ph-hero-stat-label {
  color: rgba(255,255,255,.45);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
}
/* Indicators */
.ph-hero-indicators {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 10px;
}
.ph-hero-indicator {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: all .3s;
}
.ph-hero-indicator.active {
  background: var(--ph-accent-color, #5b9bd5);
  border-color: var(--ph-accent-color, #5b9bd5);
  transform: scale(1.15);
}
.ph-hero-indicator:hover { border-color: rgba(255,255,255,.8); }
/* Responsive */
@media (max-width: 768px) {
  .ph-hero h1 { font-size: 1.8rem; }
  .ph-hero-panel { padding: 50px 0 60px; }
  .ph-hero-panels { height: 440px; }
}

/* ── Navbar ────────────────────────────────────────────────────────── */
.ph-navbar,
.ph-navbar .landing-navbar {
  background: #1e3158 !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
  box-shadow: none !important;
}
.ph-navbar .nav-link,
.ph-navbar .landing-navbar .nav-link {
  color: rgba(255,255,255,.8) !important;
}
.ph-navbar .nav-link:hover,
.ph-navbar .landing-navbar .nav-link:hover {
  color: #fff !important;
}
.ph-navbar .dropdown-toggle .theme-icon-active,
.ph-navbar .nav-link i {
  color: rgba(255,255,255,.8) !important;
}
.ph-navbar .app-brand-text {
  color: #fff !important;
}
.ph-navbar .navbar-toggler i,
.ph-navbar .navbar-toggler {
  color: rgba(255,255,255,.8) !important;
}
.ph-brand-icon {
  border-radius: 50%;
}

/* ── Mega Menu (Elsevier-style dropdown) ─────────────────────────── */
.ph-navbar {
  position: relative;
  z-index: 1100;
}
.ph-navbar .mega-dropdown .dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}
/* Hide Bootstrap's default caret, we use our own icon */
.ph-navbar .mega-dropdown .dropdown-toggle::after {
  display: none !important;
}
.ph-navbar .mega-dropdown .dropdown-toggle .ri-arrow-down-s-line {
  font-size: .7rem;
  transition: transform .2s;
}
.ph-navbar .mega-dropdown .dropdown-toggle[aria-expanded="true"] .ri-arrow-down-s-line {
  transform: rotate(180deg);
}

/* Mega dropdown panel — positioned absolute to <nav> */
.ph-mega-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  border-top: 2px solid var(--bs-primary, #666cff);
  background: var(--bs-body-bg, #fff);
  z-index: 1050;
}
.ph-mega-menu.show {
  display: block;
  animation: phMegaFadeIn .2s ease;
}
@keyframes phMegaFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ph-mega-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 32px 0;
}
.ph-mega-col {
  padding: 0 24px;
  border-right: 1px solid var(--bs-border-color, #e7e7e8);
}
.ph-mega-col:last-child {
  border-right: none;
}
.ph-mega-col-title {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
  color: var(--bs-heading-color, #2e263d);
  margin-bottom: 16px;
  padding-bottom: 8px;
}
.ph-mega-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ph-mega-item {
  margin-bottom: 4px;
}
.ph-mega-link {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--bs-body-color, #2e263d);
  transition: background .15s, color .15s;
  font-size: .88rem;
}
.ph-mega-link:hover {
  background: rgba(var(--ph-content-accent-rgb, 102,108,255), .08);
  color: var(--ph-content-accent, #666cff);
}
.ph-mega-item-icon {
  font-size: 1.1rem;
  color: var(--ph-content-accent, #666cff);
  margin-top: 2px;
  flex-shrink: 0;
}
.ph-mega-item-title {
  display: block;
  font-weight: 500;
  font-size: .88rem;
  line-height: 1.35;
}
.ph-mega-item-desc {
  display: block;
  font-size: .78rem;
  color: var(--bs-secondary-color, #8a8d93);
  line-height: 1.4;
  margin-top: 2px;
}
.ph-mega-item--rich .ph-mega-link {
  padding: 8px;
}
.ph-mega-item--rich + .ph-mega-item--rich {
  margin-top: 2px;
}
.ph-mega-external {
  font-size: .7rem;
  margin-left: 4px;
  opacity: .5;
}
.ph-mega-col-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bs-border-color, #e7e7e8);
}
.ph-mega-footer-link {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ph-content-accent, #666cff);
  text-decoration: none;
}
.ph-mega-footer-link:hover {
  text-decoration: underline;
}

/* Mega menu responsive */
@media (max-width: 991px) {
  .ph-mega-menu {
    position: static !important;
    box-shadow: none;
    border-top: 1px solid var(--bs-border-color, #e7e7e8);
    animation: none;
  }
  .ph-mega-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px 0;
  }
  .ph-mega-col {
    border-right: none;
    border-bottom: 1px solid var(--bs-border-color, #e7e7e8);
    padding: 0 0 16px;
  }
  .ph-mega-col:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
}

/* ── Mega Tabs ─────────────────────────────────────────────────────── */
.ph-mega-tabs { position: relative; z-index: 10; background: var(--ph-navbar-bg, #162542); }
.ph-tabs-bar {
  background: var(--ph-navbar-bg, #162542);
  border-radius: 0;
  border: none;
}
.ph-tabs-bar .nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 20px;
  color: rgba(255,255,255,.7);
  font-size: .88rem;
  font-weight: 500;
  border: none;
  border-radius: 0;
  white-space: nowrap;
  transition: all .25s;
}
.ph-tabs-bar .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.06);
  border: none;
}
.ph-tabs-bar .nav-link.active {
  background: var(--bs-body-bg, #f5f5f9);
  color: var(--bs-body-color, #2e3f5e);
  border: none;
}
.ph-tab-panels {
  background: var(--bs-body-bg, #f5f5f9);
  border-top: 1px solid var(--bs-border-color, #d5dce8);
}
.ph-panel-card {
  text-decoration: none;
  transition: all .3s;
}
.ph-panel-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(22,37,66,.08);
}
.ph-arrow-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--bs-primary, #666cff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bs-primary, #666cff);
  transition: all .25s;
  flex-shrink: 0;
}
.ph-panel-card:hover .ph-arrow-btn {
  background: var(--bs-primary, #666cff);
  color: #fff;
  transform: translateX(3px);
}
@media (max-width: 768px) {
  .ph-tabs-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .ph-tabs-bar .nav-link { font-size: .78rem; padding: 12px 14px; }
}

/* ── Shared Section Components ─────────────────────────────────────── */
.ph-section-label {
  text-transform: uppercase;
  font-weight: 600;
  display: block;
  margin-bottom: .5rem;
  letter-spacing: .12em;
  font-size: .72rem;
}
.ph-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
}
.ph-section-link {
  font-weight: 500;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .88rem;
}

/* ── Latest Articles ───────────────────────────────────────────────── */
.ph-section-articles {
  padding: 1rem 0 4rem;
}
.ph-featured-col {
  border-right: 1px solid var(--bs-border-color);
}
.ph-article-featured {
  padding-bottom: 1.5rem;
}
.ph-featured-item-border {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--bs-border-color);
}
.ph-badge {
  font-size: .7rem;
  font-weight: 600;
}
.ph-badge-new {
  background: rgba(var(--ph-content-accent-rgb, 59, 130, 246), 0.1);
  color: var(--ph-content-accent, #5b9bd5);
}
.ph-badge-oa {
  background: var(--ph-accent-light, #e8f0fb);
  color: var(--ph-accent-color, #3b6cb5);
}
.ph-badge-journal {
  background: var(--ph-content-light-bg, #edf1f7);
  color: var(--ph-content-accent, #2e3f5e);
}
.ph-article-date {
  font-size: .78rem;
}
.ph-featured-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  line-height: 1.35;
}
.ph-article-authors {
  font-size: .82rem;
}
.ph-article-excerpt {
  font-size: .88rem;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ph-article-item-border {
  border-bottom: 1px solid var(--bs-border-color);
}
.ph-article-num {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #d5dce8;
  min-width: 32px;
  line-height: 1;
  padding-top: 4px;
}
.ph-article-list-title {
  font-size: .92rem;
  line-height: 1.4;
}
.ph-article-list-authors {
  font-size: .78rem;
}
.ph-article-list-meta {
  font-size: .78rem;
}

/* ── Browse Journals ───────────────────────────────────────────────── */
.ph-browse-journals {
  padding: 3rem 0 4rem;
  background: #f5f5f9 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.ph-wide-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.ph-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.ph-section-label-blue {
  color: var(--ph-content-accent, #3b5998);
}
.ph-section-title-dark {
  color: #2e3f5e;
}
.ph-journals-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
@media (max-width: 991px) {
  .ph-journals-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575px) {
  .ph-journals-grid { grid-template-columns: 1fr; }
}
.ph-journal-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  transition: transform .2s, box-shadow .2s;
}
.ph-journal-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
}
.ph-journal-thumb {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ph-journal-body {
  padding: 1rem 1.25rem 1.25rem;
}
.ph-journal-title {
  font-weight: 700;
  font-size: .95rem;
  color: #2e3f5e;
  margin: 0 0 .5rem;
}
.ph-journal-issn {
  font-size: .78rem;
  font-family: monospace;
  color: #8a94a6;
  margin: 0 0 .75rem;
}
.ph-journal-tags {
  display: flex;
  gap: .5rem;
  margin-bottom: .75rem;
}
.ph-journal-tag {
  background: #f0f2f5;
  color: #4a5568;
  font-size: .72rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 50px;
}
.ph-journal-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
  color: #8a94a6;
}
.ph-journal-meta strong {
  color: #2d3748;
}

/* ── Browse by Subject ─────────────────────────────────────────────── */
.ph-section-subjects {
  padding: 3rem 0 4rem;
}
.ph-subject-tag {
  background: var(--ph-content-light-bg, #f5f7fa);
  color: #2d3748;
  border: 1px solid rgba(var(--ph-content-accent-rgb, 59, 130, 246), 0.15);
  padding: 10px 20px;
  font-size: .88rem;
  font-weight: 500;
}
.ph-subject-tag .ph-subject-count {
  font-size: .78rem;
}

/* ── Indexed In ────────────────────────────────────────────────────── */
.ph-indexed-section {
  background: linear-gradient(135deg, #eef4fb, #e6eef8, #dfe9f5);
  padding: 48px 0 56px;
}
.ph-indexed-label {
  color: #5a7394;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .05em;
  display: block;
  margin-bottom: 28px;
}
.ph-indexed-logos {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
}
.ph-indexed-logo-link {
  display: flex;
  align-items: center;
  transition: opacity .2s;
}
.ph-indexed-logo-link:hover {
  opacity: .7;
}
.ph-indexed-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
}

/* ── Footer ────────────────────────────────────────────────────────── */
.ph-footer {
  background: var(--ph-footer-bg-start, #162542);
}
.ph-footer-top {
  padding: 60px 0 40px;
}
.ph-footer-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--ph-accent-color, #3b5998);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ph-footer-brand-letter {
  color: #fff;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.1rem;
}
.ph-footer-brand-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.25rem;
  color: #fff;
  font-weight: 600;
}
.ph-footer-brand-text span {
  font-weight: 400;
}
.ph-footer-desc {
  color: rgba(255,255,255,.55);
  font-size: .9rem;
  line-height: 1.7;
  max-width: 340px;
}
.ph-footer-col-title {
  color: rgba(255,255,255,.85);
  text-transform: uppercase;
  font-size: .75rem;
  letter-spacing: .1em;
  font-weight: 600;
}
.ph-footer .footer-link {
  color: rgba(255,255,255,.55);
  font-size: .88rem;
  text-decoration: none;
}
.ph-footer .footer-link:hover {
  color: rgba(255,255,255,.8);
}
.ph-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
}
.ph-footer-copyright {
  color: rgba(255,255,255,.4);
  font-size: .85rem;
}
.ph-footer-bottom-link {
  color: rgba(255,255,255,.4);
  font-size: .85rem;
  text-decoration: none;
}
.ph-footer-bottom-link:hover {
  color: rgba(255,255,255,.7);
}
