/* ================================================================
   DETAIL PAGE STYLES — Buhay sa Patay
   ================================================================ */

/* ─── DETAIL HERO ─── */
.detail-hero {
  position: relative;
  min-height: 52vh;
  display: flex;
  align-items: flex-end;
  padding-top: 68px;
  background:
    url('https://images.unsplash.com/photo-1597983073494-ea9fafdcd04f?w=1600&q=80')
    center / cover no-repeat;
}

.detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(14,14,14,1) 0%,
    rgba(14,14,14,0.75) 50%,
    rgba(14,14,14,0.5) 100%
  );
}

.detail-hero-content {
  position: relative;
  padding: 60px 24px 56px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

.back-link:hover { color: var(--accent); }

.detail-hero-icon {
  font-size: 2.8rem;
  line-height: 1;
}

.detail-hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.8rem, 7vw, 5rem);
  font-weight: 900;
  color: #fff;
  line-height: 1;
  margin-top: 4px;
}

/* Tab links */
.detail-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.detail-tab {
  padding: 8px 20px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.detail-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(200,169,110,0.06);
}

.detail-tab.active-tab {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(200,169,110,0.12);
}

/* ─── MAIN CONTENT ─── */
.detail-main {
  background: var(--bg);
  padding: 64px 0 60px;
}

.detail-content {
  max-width: 1060px;
}

/* ─── NEWSPAPER MASTHEAD LINE ─── */
.detail-content::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(to right, var(--accent), transparent);
  margin-bottom: 48px;
  border-radius: 2px;
}

/* ─── SECTION BLOCK ─── */
.detail-section {
  padding: 0 0 52px;
}

/* Section heading — newspaper article title style */
.detail-section-label {
  border-top: 3px solid var(--accent);
  padding-top: 12px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dsec-number {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.detail-section-label h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ─── AUDIO BUTTON ─── */
.audio-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  vertical-align: middle;
}

.audio-btn svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.audio-btn:hover {
  background: var(--accent);
  color: #0e0e0e;
  transform: scale(1.1);
}

.audio-btn.playing {
  background: var(--accent);
  color: #0e0e0e;
  animation: audio-pulse 1.2s ease-in-out infinite;
}

@keyframes audio-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200,169,110,0.5); }
  50%       { box-shadow: 0 0 0 8px rgba(200,169,110,0); }
}

/* ─── FLOATING AUDIO PLAYER ─── */
.floating-player {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(18,18,18,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(200,169,110,0.35);
  border-radius: 50px;
  padding: 10px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  z-index: 9999;
  /* hidden by default */
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.floating-player.fp-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.fp-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.fp-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(200,169,110,0.15);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.fp-btn svg {
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.fp-btn:hover {
  background: var(--accent);
  color: #0e0e0e;
  transform: scale(1.1);
}

.fp-btn-stop:hover {
  background: #c0392b;
  color: #fff;
}

/* ─── NEWSPAPER BODY: text + image grid ─── */
/* ─── NEWSPAPER FLOAT BODY ─── */
.detail-section-body {
  display: block;
  overflow: hidden; /* clearfix */
}

.detail-section-body p {
  font-size: 0.97rem;
  color: var(--text-muted);
  line-height: 1.9;
  text-align: justify;
  margin-bottom: 14px;
}

/* Drop cap */
.detail-section-body p:first-of-type::first-letter {
  font-family: 'Playfair Display', serif;
  font-size: 3.8rem;
  font-weight: 900;
  color: var(--accent);
  float: left;
  line-height: 0.75;
  margin: 4px 10px 0 0;
}

/* Image floated into the top corner — JS adds .float-right or .float-left */
.detail-section-body .news-img,
.detail-section-body .news-img-placeholder {
  width: 300px;
  height: 220px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 16px;
}

/* First image on the page is larger */
.detail-section-body .news-img.news-img-first,
.detail-section-body .news-img-placeholder.news-img-first {
  width: 480px;
  height: 360px;
}

.detail-section-body .news-img.float-right,
.detail-section-body .news-img-placeholder.float-right {
  float: right;
  margin-left: 28px;
  margin-right: 0;
}

.detail-section-body .news-img.float-left,
.detail-section-body .news-img-placeholder.float-left {
  float: left;
  margin-right: 28px;
  margin-left: 0;
}

/* Placeholder styling */
.detail-section-body .news-img-placeholder {
  background: var(--surface);
  border: 1px dashed rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Image caption */
.detail-section-body .news-caption {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: -10px;
  margin-bottom: 14px;
  font-style: italic;
  opacity: 0.7;
}

/* ─── DIVIDER ─── */
.detail-divider {
  display: none;
}

/* ─── HANAPBUHAY NAV ─── */
.hbnav {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 64px 0;
  text-align: center;
}

.hbnav-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 32px;
}

/* ================================================================
   MANANALIKSIK PAGE — LAPIDA / GRAVESTONE STYLE
   ================================================================ */
.researchers-main { padding: 60px 0 80px; }

.researchers-page-intro {
  max-width: 640px;
  margin: 0 auto 64px;
  text-align: center;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.lapida-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 40px;
  padding-bottom: 60px;
  position: relative;
  z-index: 1;
}

/* ── Single gravestone card ── */
.lapida-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 260px;
  cursor: pointer;
}

.lapida-card--adviser {
  width: 300px;
  order: 0; /* stays in middle (2nd in HTML) */
}

/* Cross on top */
.lapida-top-cross {
  font-size: 1.6rem;
  color: #8a8a8a;
  margin-bottom: -6px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}
.lapida-top-cross--gold { color: var(--accent); }

/* The stone body */
.lapida-stone {
  width: 100%;
  background: linear-gradient(160deg, #2e2e2e 0%, #1a1a1a 60%, #222 100%);
  border: 1px solid #3a3a3a;
  border-radius: 50% 50% 4px 4px / 28px 28px 4px 4px;
  box-shadow:
    inset 0 2px 8px rgba(255,255,255,0.04),
    inset 0 -4px 12px rgba(0,0,0,0.5),
    0 8px 32px rgba(0,0,0,0.6),
    0 2px 0 #111;
  position: relative;
  overflow: hidden;
}

.lapida-stone--adviser {
  background: linear-gradient(160deg, #2a2519 0%, #1c1a10 60%, #211f10 100%);
  border-color: rgba(200,169,110,0.3);
  box-shadow:
    inset 0 2px 8px rgba(200,169,110,0.06),
    inset 0 -4px 12px rgba(0,0,0,0.5),
    0 8px 40px rgba(0,0,0,0.7),
    0 2px 0 #0a0900;
}

/* Arch engraving at top of stone */
.lapida-arch {
  height: 6px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin: 0 12px;
}
.lapida-arch--gold {
  background: linear-gradient(90deg, transparent, rgba(200,169,110,0.1), transparent);
  border-bottom-color: rgba(200,169,110,0.1);
}

/* Inner text area */
.lapida-inner {
  padding: 24px 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

/* Profile photo */
.lapida-photo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 3px solid #555;
  box-shadow: 0 4px 14px rgba(0,0,0,0.55);
  margin-bottom: 10px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.lapida-photo--gold {
  border-color: var(--accent);
  box-shadow: 0 4px 18px rgba(180,145,60,0.4);
}

.lapida-role {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7a7a7a;
  margin: 0;
}
.lapida-role--gold { color: var(--accent); opacity: 0.85; }

.lapida-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #d4d0c8;
  line-height: 1.3;
  margin: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  letter-spacing: 0.02em;
}

.lapida-card--adviser .lapida-name {
  font-size: 1.3rem;
  color: #e8e0cc;
}

.lapida-rule {
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #444, transparent);
  margin: 4px 0;
}
.lapida-rule--thin { opacity: 0.5; }
.lapida-rule--gold {
  background: linear-gradient(90deg, transparent, rgba(200,169,110,0.5), transparent);
}

.lapida-dates {
  font-size: 0.78rem;
  color: #6a6a6a;
  font-style: italic;
  margin: 0;
}

.lapida-sub {
  font-size: 0.8rem;
  color: #888;
  line-height: 1.5;
  margin: 0;
}

.lapida-desc {
  font-size: 0.8rem;
  color: #666;
  line-height: 1.7;
  margin: 4px 0 0;
}

/* Stone base / slab */
.lapida-base {
  width: 110%;
  height: 14px;
  background: linear-gradient(180deg, #252525 0%, #1a1a1a 100%);
  border: 1px solid #333;
  border-top: none;
  border-radius: 0 0 3px 3px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 2px 0 #111;
}
.lapida-base--gold {
  background: linear-gradient(180deg, #1e1a08 0%, #141200 100%);
  border-color: rgba(200,169,110,0.2);
}

/* Hover lift */
.lapida-card:hover .lapida-stone {
  transform: translateY(-6px);
  transition: transform 0.3s ease;
  box-shadow:
    inset 0 2px 8px rgba(255,255,255,0.05),
    inset 0 -4px 12px rgba(0,0,0,0.5),
    0 16px 48px rgba(0,0,0,0.7),
    0 2px 0 #111;
}
.lapida-card:hover .lapida-base {
  transform: translateY(-6px);
  transition: transform 0.3s ease;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .lapida-card--adviser { order: 0; }
}
@media (max-width: 600px) {
  .lapida-card, .lapida-card--adviser { width: 100%; max-width: 300px; }
  .lapida-grid { gap: 32px; }
}

.hbnav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 36px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.hbnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.25s ease;
}

.hbnav-item:not(.hbnav-item--active):hover {
  transform: translateY(-4px);
}

.hbnav-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
}

.hbnav-item span {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  max-width: 90px;
  transition: color 0.25s ease;
}

.hbnav-item:not(.hbnav-item--active):hover span {
  color: var(--accent);
}

/* Active state */
.hbnav-item--active {
  cursor: default;
  pointer-events: none;
}

.hbnav-item--active .hbnav-icon {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 20px rgba(200,169,110,0.3);
}

.hbnav-item--active > span {
  color: var(--accent);
}


.hbnav-footer {
  margin-top: 8px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .detail-section-body .news-img,
  .detail-section-body .news-img-placeholder {
    float: none !important;
    width: 100%;
    height: 200px;
    margin: 0 0 16px 0;
  }

  .detail-section-body p:first-of-type::first-letter {
    font-size: 2.8rem;
  }

  .detail-hero-title {
    font-size: 2.6rem;
  }

  .detail-main {
    padding: 32px 0 40px;
  }

  .hbnav-grid {
    gap: 12px;
    max-width: 340px;
  }

  .hbnav-icon {
    width: 52px;
    height: 52px;
    font-size: 1.4rem;
  }

  .hbnav-item span {
    font-size: 0.68rem;
    max-width: 80px;
  }
}

/* ─── RESEARCHER MODAL ─── */
.lapida-card[data-modal] { cursor: pointer; }
.lapida-card[data-modal]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.researcher-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.researcher-modal.is-open { display: flex; }

.researcher-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(5,4,3,0.88);
  backdrop-filter: blur(8px);
}

.researcher-modal__box {
  position: relative;
  z-index: 1;
  background: linear-gradient(160deg, #1e1c17 0%, #141210 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 40px 36px 36px;
  max-width: 520px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.8);
  animation: modalIn 0.28s cubic-bezier(0.34,1.4,0.64,1) both;
}
/* Spider canvas inside modal */
.modal-spider-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  border-radius: 12px;
  z-index: 0;
}
/* Keep modal content above canvas */
.researcher-modal__box > *:not(.modal-spider-canvas):not(.researcher-modal__close) { position: relative; z-index: 1; }
.researcher-modal__box--gold {
  background: linear-gradient(160deg, #211c0e 0%, #161206 100%);
  border-color: rgba(200,169,110,0.18);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.researcher-modal__close {
  position: absolute !important;
  top: 10px;
  right: 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ddd;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  z-index: 10;
}
.researcher-modal__close:hover { background: rgba(255,255,255,0.18); color: #fff; }
.researcher-modal__close--gold:hover { background: rgba(200,169,110,0.2); color: var(--accent); }

.researcher-modal__photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 3px solid #555;
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
  margin-bottom: 14px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.researcher-modal__photo--gold { border-color: var(--accent); box-shadow: 0 6px 22px rgba(180,145,60,0.45); }

.researcher-modal__role {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7a7a7a;
  margin: 0 0 6px;
}
.researcher-modal__role--gold { color: var(--accent); opacity: 0.85; }

.researcher-modal__name {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  color: #e8dfc8;
  margin: 0 0 10px;
}

.researcher-modal__rule {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 0 auto 18px;
  width: 60px;
}
.researcher-modal__rule--gold { background: rgba(200,169,110,0.35); }

.researcher-modal__body {
  text-align: justify;
  color: #b5a898;
  font-size: 0.9rem;
  line-height: 1.75;
}
.researcher-modal__body p { margin: 0 0 14px; }
.researcher-modal__body p:last-child { margin-bottom: 0; }

@media (max-width: 540px) {
  .researcher-modal__box { padding: 32px 20px 28px; }
  .researcher-modal__name { font-size: 1.2rem; }
}