/* VPN World — style.css (FINAL, drop-in replacement)
   Includes:
   - responsive SVG/table wrappers
   - SVG text always readable (black on white card)
   - VIDEO wrap
   - author box
   - cookie banner
   - related block (dark wide card w/ green accent)
   - HARD TABLE FIX (white background + black text) + CAPTION fix (so captions never go black-on-black)
*/

:root{
  --bg:#0b1220;
  --panel:#0f1a2b;
  --muted:#8aa0bf;
  --text:#e6eefc;
  --brand:#4cc2ff;
  --brand-2:#26e7a6;
  --card:#0d1726;
  --border:#1e3352;
  --shadow:0 10px 30px rgba(0,0,0,.35);

  /* hard table palette (always readable on dark theme) */
  --t-bg:#ffffff;
  --t-text:#000000;
  --t-border:rgba(0,0,0,.18);
  --t-head:#f3f4f6;
  --t-zebra:#fafafa;
}

/* ===== Base ===== */
*{box-sizing:border-box}
html{scroll-behavior:smooth}
html,body{
  margin:0;
  padding:0;
  background:var(--bg);
  color:var(--text);
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  line-height:1.6;
}
a{color:var(--brand); text-underline-offset:2px}
a:hover{opacity:.9}
img{max-width:100%;height:auto}
.container{max-width:1120px;margin:0 auto;padding:0 20px}

/* Make article area not overflow on long content */
.article{min-width:0}
.article > *{max-width:100%}

/* ===== Header ===== */
.site-header{
  position:sticky; top:0; z-index:50;
  background:rgba(11,18,32,.7);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);
}
.header-inner{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:.4rem;
  padding:.5rem 0;
}
.header-main{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:var(--text);
  white-space:nowrap;
}
.logo{width:28px;height:28px}
.brand-text{font-weight:700;letter-spacing:.4px;font-size:1rem}

.primary-nav a{
  text-decoration:none;
  color:var(--muted);
  font-weight:600;
  font-size:.9rem;
}
.primary-nav a:hover{color:#fff}

.lang-switch{
  display:flex;
  flex-wrap:wrap;
  gap:.4rem .8rem;
  font-size:.9rem;
}
.lang-switch a{
  text-decoration:none;
  color:var(--muted);
  font-weight:600;
  white-space:nowrap;
}
.lang-switch a.active{color:#fff}

@media (min-width:769px){
  .header-inner{flex-direction:row;align-items:center;justify-content:space-between}
  .lang-switch{justify-content:flex-end}
}

/* ===== Typography inside article ===== */
.article h1,.article h2,.article h3,.article h4{line-height:1.25}
.article h2{margin:1.6rem 0 .65rem}
.article h3{margin:1.25rem 0 .45rem}
.article p{margin:.6rem 0}
.article ul,.article ol{margin:.65rem 0 .85rem;padding-left:1.2rem}
.article li{margin:.3rem 0}
.article dl{margin:.8rem 0}
.article dt{font-weight:800;margin:.85rem 0 .25rem}
.article dd{margin:0 0 .65rem 0;color:var(--muted)}

/* ===== Hero ===== */
.hero{
  background:
    radial-gradient(80% 120% at 80% 20%, rgba(76,194,255,.15), transparent 60%),
    radial-gradient(70% 100% at 0% 0%, rgba(38,231,166,.12), transparent 60%),
    linear-gradient(180deg, rgba(12,21,35,.8), rgba(11,18,32,1));
  border-radius:16px;
  overflow:hidden;
  margin:2rem 0;
  box-shadow:var(--shadow);
}
.hero-inner{
  display:flex;
  flex-wrap:wrap;
  gap:1.5rem;
  padding:1.8rem 2rem 2rem;
}
.hero-copy{flex:1 1 280px;min-width:0}
.hero-media{
  flex:0 1 260px;
  min-width:220px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.hero-art{width:100%;max-width:360px}
.hero-art img{
  width:100%;
  border-radius:14px;
  box-shadow:0 10px 30px rgba(0,0,0,.45);
  display:block;
}
.hero-copy h1{margin:0 0 .6rem;font-size:1.9rem}
.hero-copy p{margin:.4rem 0;color:var(--muted)}

.hero-author{
  display:flex;
  align-items:center;
  gap:.75rem;
  margin-top:.9rem;
}
.hero-author img{
  width:44px;height:44px;border-radius:50%;
  object-fit:cover;
  box-shadow:0 0 0 2px rgba(76,194,255,.4);
}
.hero-author-text{
  display:flex;
  flex-direction:column;
  font-size:.85rem;
}
.hero-author-label{color:var(--muted)}
.hero-author-name{font-weight:600;color:#fff}
.hero-author-name a{color:#fff;text-decoration:none}
.meta{color:var(--muted);font-size:.85rem;margin-top:.15rem}

/* ===== Sections ===== */
.section{margin:2.5rem 0}
.section-alt{
  margin:2.5rem 0;
  background:var(--panel);
  border-radius:16px;
  padding:1.8rem 2rem;
  box-shadow:var(--shadow);
}

/* ===== Note / Key takeaway ===== */
.note{
  background:rgba(15,26,43,.9);
  border-left:3px solid var(--brand-2);
  border-radius:10px;
  padding:.75rem 1rem;
  margin:1rem 0 1.2rem;
  font-size:.95rem;
  color:var(--text);
}
.note strong{color:#fff}
.human-note{
  margin-top:1.2rem;
  font-size:.95rem;
  color:var(--muted);
  font-style:italic;
}
.key-takeaway{
  margin:1rem 0 1.35rem;
  padding:.75rem 1rem;
  border:1px solid rgba(76,194,255,.25);
  background:rgba(10,18,32,.65);
  border-radius:12px;
  color:var(--text);
}
.key-takeaway strong{color:#fff}

/* ===== Meta points ===== */
.meta-points{
  list-style:none;
  padding:0;
  margin:1rem 0 0;
  display:flex;
  flex-wrap:wrap;
  gap:.5rem;
  font-size:.85rem;
}
.meta-points li{
  padding:.25rem .6rem;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(10,18,32,.85);
}

/* ===== Cards ===== */
.card-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
  gap:1.2rem;
  margin-top:1.4rem;
}
.card{
  background:var(--card);
  border-radius:12px;
  padding:1.2rem 1.3rem;
  border:1px solid var(--border);
  box-shadow:0 6px 18px rgba(0,0,0,.28);
}
.card h3{margin:0 0 .4rem}
.card p{margin:0;color:var(--muted)}

/* =======================================================================
   TABLES — HARD FIX (ALWAYS READABLE)
   ======================================================================= */

.article table{
  width:100%;
  border-collapse:collapse;
  margin:1.2rem 0;
  font-size:.95rem;
  background:var(--t-bg) !important;
  color:var(--t-text) !important;
  border:1px solid var(--t-border);
  border-radius:12px;
  overflow:hidden;
}
.article th,.article td{
  border:1px solid var(--t-border) !important;
  padding:.75rem .85rem;
  text-align:left;
  color:var(--t-text) !important;
  background:var(--t-bg) !important;
}
.article thead th{
  background:var(--t-head) !important;
  font-weight:900;
}
.article tbody tr:nth-child(even) td{
  background:var(--t-zebra) !important;
}
.article table a{color:#0b63ff}
.comparison-table{width:100%}

.table-scroll{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  border-radius:12px;
  border:1px solid var(--t-border) !important;
  background:var(--t-bg) !important;
  margin:1.2rem 0;
}
.table-scroll table{
  margin:0;
  width:100%;
  border-collapse:collapse;
  background:var(--t-bg) !important;
  color:var(--t-text) !important;
}
.table-scroll th,.table-scroll td{
  border:1px solid var(--t-border) !important;
  padding:.75rem .85rem;
  text-align:left;
  color:var(--t-text) !important;
  background:var(--t-bg) !important;
  white-space:nowrap;
}
.table-scroll thead th{
  background:var(--t-head) !important;
  font-weight:900;
}
.table-scroll tbody tr:nth-child(even) td{
  background:var(--t-zebra) !important;
}
.table-scroll a{color:#0b63ff}

.table-scroll caption,
.article table > caption{
  caption-side:top;
  text-align:left;
  color:var(--t-text) !important;
  background:var(--t-bg) !important;
  font-weight:900;
  padding:10px 12px;
  border:1px solid var(--t-border);
  border-bottom:none;
  border-radius:12px 12px 0 0;
  margin:0;
}
.table-scroll caption + thead th,
.article table > caption + thead th{
  border-top:none !important;
}

/* ===== CTA buttons ===== */
.cta-buttons{
  display:flex;
  flex-wrap:wrap;
  gap:.8rem;
  margin:1.5rem 0;
}
.cta-buttons a{
  padding:.8rem 1.4rem;
  font-weight:900;
  border-radius:12px;
  text-decoration:none;
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 8px 18px rgba(0,0,0,.22);
}
.cta-buttons a.nordvpn{
  background:rgba(76,194,255,.18);
  color:#e6f4ff;
}
.cta-buttons a.surfshark{
  background:rgba(38,231,166,.16);
  color:#eafff7;
}
.cta-buttons a.proton{
  background:rgba(176,107,255,.16);
  color:#f3ecff;
}
.cta-buttons a:hover{transform:translateY(-1px)}

/* CTA box */
.cta-box{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:12px;
  padding:1.4rem 1.6rem;
  margin:2rem 0;
  box-shadow:0 5px 15px rgba(0,0,0,.25);
}
.cta-note{color:var(--muted);margin:.25rem 0 1rem}
.cta-box h2,.cta-box h3{margin:.2rem 0 .6rem}
.cta-box h3{color:var(--brand-2)}

/* ===== Video wrap ===== */
.video-wrap{
  position:relative;
  width:100%;
  aspect-ratio:16/9;
  border-radius:14px;
  overflow:hidden;
  border:1px solid var(--border);
  box-shadow:0 10px 28px rgba(0,0,0,.35);
  background:#000;
}
.video-wrap iframe{
  position:absolute; inset:0;
  width:100%; height:100%;
}

/* ===== Author box ===== */
.author-box{
  display:flex;
  gap:1rem;
  align-items:flex-start;
  padding:1.2rem 1.3rem;
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:0 8px 22px rgba(0,0,0,.22);
}
.author-avatar{
  width:64px;height:64px;
  border-radius:50%;
  object-fit:cover;
  box-shadow:0 0 0 2px rgba(76,194,255,.35);
}
.author-box h3{margin:.1rem 0 .4rem}
.author-box p{margin:0;color:var(--muted)}
.author-box a{color:#fff;text-decoration:none}

/* ===== Related block (NEW STANDARD) ===== */
.related-strip{
  margin:1.05rem 0 1.25rem;
  padding:.8rem 1rem;
  border-radius:14px;
  background:rgba(8,14,26,.92);
  border:1px solid rgba(255,255,255,.10);
  box-shadow:0 10px 26px rgba(0,0,0,.25);
  position:relative;
}
.related-strip:before{
  content:"";
  position:absolute;
  left:10px; top:10px; bottom:10px;
  width:4px;
  border-radius:999px;
  background:var(--brand-2);
}
.related-strip .related-label{
  color:var(--muted);
  font-weight:700;
  margin-right:.35rem;
}
.related-strip a{
  color:#eafff7;
  font-weight:900;
  text-decoration:underline;
  text-decoration-thickness:2px;
}

/* ===== SVG / White-card readability + responsiveness (MANDATORY) ===== */
.svg-card{
  margin:1.2rem 0;
  padding:18px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.10);
  background:#fff;
  box-shadow:0 8px 22px rgba(0,0,0,.06);
}
.svg-card h3,.svg-card p{color:#000 !important}
.svg-scroll{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  padding-bottom:6px;
}
.svg-scroll svg{
  display:block;
  max-width:100%;
  height:auto;
  color:#000 !important;
}
.svg-scroll svg text{
  fill:#000 !important;
  font-weight:800 !important;
}
.svg-scroll svg line,
.svg-scroll svg path,
.svg-scroll svg rect,
.svg-scroll svg circle,
.svg-scroll svg polyline,
.svg-scroll svg polygon{
  stroke:#000;
  stroke-width:3.2;
}

/* ===== Footer ===== */
.site-footer{
  background:var(--panel);
  border-top:1px solid var(--border);
  padding:2rem 0 1rem;
  margin-top:3rem;
}
.site-footer p{margin:.4rem 0;color:var(--muted)}
.site-footer strong{color:#fff}
.site-footer a{color:var(--muted);text-decoration:none}
.site-footer a:hover{color:#fff}

/* ===== Cookie banner (base) ===== */
.cookie-banner,
.privacy-banner{
  position:fixed;
  bottom:1rem;
  left:1rem;
  right:1rem;
  background:var(--panel);
  border:1px solid var(--border);
  padding:1rem;
  border-radius:12px;
  font-size:.9rem;
  z-index:60;
  box-shadow:0 10px 30px rgba(0,0,0,.35);
}
.cookie-banner p,
.privacy-banner p{margin:0 0 .75rem;color:var(--muted)}
.cookie-actions{display:flex;gap:.6rem;flex-wrap:wrap}

/* buttons */
.btn{
  border:1px solid rgba(255,255,255,.14);
  background:rgba(76,194,255,.18);
  color:#fff;
  padding:.55rem .9rem;
  border-radius:10px;
  font-weight:900;
  cursor:pointer;
}
.btn:hover{transform:translateY(-1px)}
.btn-compact{padding:.35rem .8rem;border-radius:8px}
.btn-secondary{
  background:rgba(255,255,255,.06);
  color:#fff;
}

/* ===== Mobile ===== */
@media (max-width:768px){
  .hero-inner{padding:1.4rem 1.2rem 1.6rem}
  .hero-copy h1{font-size:1.5rem}
  .section-alt{padding:1.4rem 1.3rem}
  .author-box{flex-direction:column}
  .author-avatar{width:58px;height:58px}
  .cta-buttons a{width:100%;text-align:center}
}
@media (max-width:480px){
  .svg-card{padding:14px}
  th,td{padding:.65rem .7rem}
}

/* =======================================================================
   COOKIE BANNER: iOS / overlay hard-fix (UPDATED)
   - Ensures banner is always on top and tappable
   - Fixes "buttons look disabled" on white banner
   ======================================================================= */
#cookie-banner{
  position: fixed !important;
  left: 12px !important;
  right: 12px !important;
  bottom: 12px !important;

  z-index: 2147483647 !important;
  pointer-events: auto !important;

  transform: translate3d(0,0,0) !important;
  -webkit-transform: translate3d(0,0,0) !important;
  isolation: isolate !important;

  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 14px !important;
  box-shadow: 0 12px 40px rgba(0,0,0,.35) !important;
}

/* text inside banner must be readable */
#cookie-banner p{
  color:#000 !important;
  margin:0 0 .75rem !important;
}

/* everything inside must be tappable */
#cookie-banner *{
  pointer-events: auto !important;
}

/* actions row */
#cookie-banner .cookie-actions{
  display:flex !important;
  gap:10px !important;
  flex-wrap:wrap !important;
}

/* IMPORTANT: fix "disabled-looking" buttons on white banner */
#cookie-banner button,
#cookie-banner .btn{
  appearance:none !important;
  -webkit-appearance:none !important;
  border:1px solid rgba(0,0,0,.18) !important;
  background:#e8f3ff !important;
  color:#000 !important;
  font-weight:900 !important;
  border-radius:10px !important;
  padding:.55rem .95rem !important;
  cursor:pointer !important;
  opacity:1 !important;
  filter:none !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
}
#cookie-banner button:active,
#cookie-banner .btn:active{
  transform: translateY(1px) !important;
}

/* secondary button */
#cookie-banner .btn-secondary{
  background:#f3f4f6 !important;
  color:#000 !important;
}

/* Often taps are stolen by pseudo overlays */
.hero::before, .hero::after,
.section::before, .section::after,
main::before, main::after,
.site-header::before, .site-header::after{
  pointer-events: none !important;
}
/* === SVG readability fix (VPN World Gold Standard) === */
.svg-card svg {
  color: #000;
}

.svg-card svg text {
  fill: #000 !important;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.svg-card svg rect,
.svg-card svg path,
.svg-card svg line {
  stroke: #000;
  stroke-width: 3.5;
}
/* =========================================================
   GLOBAL DARK-CARD TEXT FIX (Stage 2.5)
   All captions/titles inside dark UI blocks must be WHITE
   ========================================================= */

/* Any headings inside dark cards */
.note h1, .note h2, .note h3,
.tip h1, .tip h2, .tip h3,
.keytakeaway h1, .keytakeaway h2, .keytakeaway h3,
.svg-card h1, .svg-card h2, .svg-card h3,
.video-wrap h1, .video-wrap h2, .video-wrap h3,
.related-wide h1, .related-wide h2, .related-wide h3 {
  color: #ffffff !important;
  font-weight: 800 !important;
}

/* Paragraphs + spans inside dark cards */
.note, .note p, .note span,
.tip, .tip p, .tip span,
.keytakeaway, .keytakeaway p, .keytakeaway span,
.related-wide, .related-wide p, .related-wide span {
  color: #ffffff !important;
}

/* Strong emphasis inside dark blocks */
.note strong,
.tip strong,
.keytakeaway strong,
.related-wide strong {
  color: #ffffff !important;
}

/* Diagram titles everywhere */
.diagram-title,
.svg-title,
.svg-card .svg-title,
.svg-card h3 {
  color: #ffffff !important;
}

/* Table captions must always be readable */
.table-scroll caption {
  color: #ffffff !important;
  font-weight: 800 !important;
}

/* If table header is dark → force white */
.table-scroll thead th {
  color: #ffffff !important;
}


/* === VPN World Cookie Consent — hard clickability (Stage 2.5) === */
#cookie-consent-layer{ z-index:2147483647 !important; pointer-events:auto !important; }
#cookie-banner{ z-index:2147483647 !important; pointer-events:auto !important; }
#cookie-banner *{ pointer-events:auto !important; }
