/* ══════════════════════════════════════════════════════════════
   PAGES-COMMON.CSS
   Shared styles for utility pages (health, sim-card, scams, etc.)
   ══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", Verdana, sans-serif;
  font-size: 19px;
  line-height: 1.7;
  color: rgba(255,255,255,0.88);
  background: linear-gradient(180deg, #1a2a3a 0%, #142230 40%, #1a2a3a 100%);
  min-height: 100vh;
}

/* ── Parallax background ── */
.parallax-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.parallax-bg-layer {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(22px) saturate(1.3) brightness(0.9);
  opacity: 0;
  transition: opacity 1.4s ease-in-out;
}
.parallax-bg-layer.active { opacity: 0.55; }
.parallax-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8,17,26,0.72) 0%, rgba(8,17,26,0.82) 50%, rgba(8,17,26,0.88) 100%);
  pointer-events: none;
}

/* ── Page header ── */
.page-header {
  text-align: center;
  padding: 32px 24px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: relative;
}
.page-header h1 {
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(26px, 3.5vw, 34px);
  color: #fff;
  font-weight: 700;
}
.page-header p {
  margin-top: 6px;
  color: rgba(255,255,255,0.55);
  font-size: 17px;
}

/* ── Content layout ── */
.content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 24px 36px;
  position: relative;
}
.layout { display: block; width: 100%; }
.main-content { min-height: 0; }

/* ── Sidebar TOC ── */
.sidebar-toc {
  position: fixed;
  top: 50%;
  left: 24px;
  transform: translateY(-50%);
  width: 220px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  z-index: 10;
  background: rgba(14,28,42,0.5);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 14px 34px rgba(14,28,42,0.18);
}
.sidebar-toc h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 10px;
}
.sidebar-toc ul { list-style: none; margin: 0; padding: 0; }
.sidebar-toc li { margin-bottom: 2px; }
.sidebar-toc a {
  display: block;
  padding: 5px 10px 5px 14px;
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  border-radius: 4px;
}
.sidebar-toc a:hover {
  color: #fff;
  background: rgba(14,28,42,0.4);
  border-left-color: rgba(255,255,255,0.15);
}
.sidebar-toc a.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-left-color: rgba(212,160,23,0.7);
  font-weight: 600;
}
.sidebar-toc .toc-icon {
  display: inline-block;
  min-width: 22px;
  margin-right: 4px;
  font-size: 16px;
}

/* ── Menu toggle (mobile) ── */
.menu-toggle {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 220;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  background: rgba(14,28,42,0.6);
  color: rgba(255,255,255,0.95);
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  font-size: 19px;
  cursor: pointer;
  display: none;
  backdrop-filter: blur(10px);
}
.menu-toggle:hover { transform: translateY(-2px); }
.nav-scrim {
  position: fixed;
  inset: 0;
  background: rgba(8,17,26,0.64);
  z-index: 180;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
body.menu-open .nav-scrim { opacity: 1; pointer-events: auto; }

/* ── Horizontal gallery ── */
.glass-section {
  background: none;
  border: none;
  box-shadow: none;
}
.glass-section-body {
  display: flex;
  gap: 20px;
  padding: 0;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none;
  scrollbar-width: none;
  align-items: flex-start;
}
.glass-section-body::-webkit-scrollbar { display: none; }
.chapter {
  flex: 0 0 100%;
  scroll-snap-align: center;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 24px 24px 20px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.10);
}

/* ── Swipe hint ── */
.swipe-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 4px 0 0;
  margin-bottom: 14px;
  color: rgba(255,255,255,0.35);
  font-size: 13px;
  letter-spacing: 0.04em;
  user-select: none;
  transition: opacity 0.6s ease;
}
.swipe-hint.hidden { opacity: 0; pointer-events: none; }
.swipe-hint .hint-arrow {
  display: inline-block;
  font-size: 16px;
  animation: hintPulse 2s ease-in-out infinite;
}
.swipe-hint .hint-arrow:first-child { animation-name: hintLeft; }
.swipe-hint .hint-arrow:last-child  { animation-name: hintRight; }
@keyframes hintLeft {
  0%, 100% { transform: translateX(0); opacity: 0.5; }
  50%      { transform: translateX(-5px); opacity: 1; }
}
@keyframes hintRight {
  0%, 100% { transform: translateX(0); opacity: 0.5; }
  50%      { transform: translateX(5px); opacity: 1; }
}

/* ── Swipe dots ── */
.swipe-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 8px 0 0;
}
.swipe-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: background 0.3s, transform 0.3s;
  cursor: pointer;
  position: relative;
}
.swipe-dot::before {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
}
.swipe-dot:hover { background: rgba(255,255,255,0.45); }
.swipe-dot.active {
  background: rgba(212,160,23,0.7);
  transform: scale(1.3);
}

/* ── Chapter title ── */
.chapter-title {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(20px, 2.2vw, 24px);
  letter-spacing: 0.04em;
  color: #fff;
  margin: 0 0 14px 0;
  padding: 0 0 0 24px;
}
.chapter-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  border-radius: 999px;
  background: rgba(212,160,23,0.6);
  box-shadow: 0 0 12px rgba(212,160,23,0.12);
}
.chapter-title .section-icon {
  font-size: 20px;
  line-height: 1;
}

/* ── Chapter content typography ── */
.glass-section-body p { margin-bottom: 10px; line-height: 1.6; font-size: 16px; }
.glass-section-body h3 {
  font-size: 17px;
  color: rgba(255,255,255,0.95);
  margin-bottom: 8px;
  margin-top: 16px;
  font-weight: 700;
}
.glass-section-body h3:first-child { margin-top: 0; }
.glass-section-body ul { margin-left: 18px; margin-bottom: 10px; }
.glass-section-body li { margin-bottom: 4px; line-height: 1.6; font-size: 16px; }

/* ── Responsive ── */
@media (max-width: 1340px) {
  .content { padding-left: 260px; }
}
@media (max-width: 980px) {
  .content { padding: 16px 14px 32px; }
  .sidebar-toc {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    max-height: none;
    overflow-y: auto;
    transform: translateX(-110%);
    transition: transform 0.3s ease;
    z-index: 200;
    border-radius: 0;
    padding-top: 70px;
    box-shadow: 0 16px 36px rgba(0,0,0,0.34);
  }
  body.menu-open .sidebar-toc { transform: translateX(0); }
  .menu-toggle { display: block; }
}
@media (max-width: 600px) {
  .chapter-title {
    gap: 8px;
    padding: 0 0 0 20px;
    font-size: 18px;
  }
  .chapter-title::before { height: 18px; }
  .chapter { padding: 18px 16px 14px; }
  .swipe-hint { font-size: 12px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .parallax-bg-layer { filter: blur(28px); transition: none; }
  .glass-section-body { scroll-behavior: auto; scroll-snap-type: none; }
  .swipe-hint .hint-arrow { animation: none; }
}
