/* PotterHead — Páginas legales (v5.5) */
.ph-legal-page{
  --lg-ink:#2a1a0a; --lg-brown:#5c3a1e; --lg-gold:#c8960c; --lg-gold-l:#f0c040;
  position:relative;z-index:1;max-width:1120px;margin:0 auto;
  padding:120px 1.25rem 5rem;
}

/* ---------- Hero ---------- */
.ph-legal-hero{text-align:center;margin-bottom:1.75rem}
.ph-legal-orn{display:flex;align-items:center;justify-content:center;gap:.9rem;color:var(--lg-gold-l);margin-bottom:.9rem}
.ph-legal-orn i{display:block;height:1px;width:min(90px,18vw);background:linear-gradient(90deg,transparent,var(--lg-gold-l))}
.ph-legal-orn i:last-child{transform:scaleX(-1)}
.ph-legal-orn b{font-weight:400;font-size:1.1rem;text-shadow:0 0 12px rgba(240,192,64,.8)}
.ph-legal-hero h1{
  font-family:'Cinzel Decorative',serif;font-weight:700;
  font-size:clamp(1.5rem,4.2vw,2.6rem);line-height:1.25;margin:0 0 .8rem;
  background:linear-gradient(180deg,#fff3c4 0%,#f0c040 55%,#b8860b 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent;
  filter:drop-shadow(0 2px 10px rgba(0,0,0,.7));
}
.ph-legal-fan{font-style:italic;color:var(--parchment,#f5e6c8);opacity:.85;margin:0 auto .9rem;max-width:640px;font-size:1.05rem}
.ph-legal-meta{
  display:inline-block;font-family:'Cinzel',serif;font-size:.72rem;letter-spacing:.12em;text-transform:uppercase;
  color:var(--lg-gold-l);border:1px solid rgba(240,192,64,.4);border-radius:999px;padding:.3rem .95rem;
  background:rgba(10,13,20,.55);backdrop-filter:blur(4px);
}

/* ---------- Tabs ---------- */
.ph-legal-tabs{display:flex;flex-wrap:wrap;justify-content:center;gap:.6rem;margin:0 0 2rem}
.ph-legal-tabs a{
  display:inline-flex;align-items:center;gap:.5rem;text-decoration:none;
  font-family:'Cinzel',serif;font-size:.8rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;
  color:#e9d9b0;padding:.65rem 1.2rem;border-radius:999px;
  background:rgba(10,13,20,.7);border:1px solid rgba(240,192,64,.3);backdrop-filter:blur(6px);
  transition:all .25s ease;
}
.ph-legal-tabs a:hover{border-color:var(--lg-gold-l);color:#fff;transform:translateY(-2px);box-shadow:0 6px 20px rgba(240,192,64,.18)}
.ph-legal-tabs a.is-current{
  background:linear-gradient(180deg,#f7d56a,#c8960c);color:#2a1a0a;border-color:#ffe08a;
  box-shadow:0 4px 18px rgba(240,192,64,.35);
}
.ph-tab-ico{font-size:1rem}

/* ---------- Layout ---------- */
.ph-legal-layout{display:grid;grid-template-columns:250px minmax(0,1fr);gap:1.75rem;align-items:start}
.ph-legal-layout:has(.ph-legal-toc[hidden]){grid-template-columns:minmax(0,1fr)}
.ph-legal-layout:has(.ph-legal-toc[hidden]) .ph-legal-sheet{max-width:860px;margin:0 auto;width:100%}

/* ---------- TOC ---------- */
.ph-legal-toc{
  position:sticky;top:96px;max-height:calc(100vh - 120px);overflow:auto;
  background:rgba(10,13,20,.78);backdrop-filter:blur(8px);
  border:1px solid rgba(240,192,64,.3);border-radius:14px;padding:1.1rem 1rem 1rem;
  box-shadow:0 12px 40px rgba(0,0,0,.5);scrollbar-width:thin;scrollbar-color:#8a6a1c transparent;
}
.ph-toc-title{font-family:'Cinzel',serif;font-size:.75rem;letter-spacing:.18em;text-transform:uppercase;color:var(--lg-gold-l);margin:0 0 .7rem;padding-bottom:.6rem;border-bottom:1px solid rgba(240,192,64,.25)}
.ph-toc-list{list-style:none;margin:0;padding:0;counter-reset:none}
.ph-toc-list li{margin:0}
.ph-toc-list a{
  display:flex;gap:.55rem;align-items:baseline;text-decoration:none;
  font-family:'Crimson Text',serif;font-size:.98rem;line-height:1.35;color:#d9c9a3;
  padding:.38rem .5rem;border-radius:8px;border-left:2px solid transparent;transition:all .2s;
}
.ph-toc-list a span{font-family:'Cinzel',serif;font-size:.72rem;color:var(--lg-gold);min-width:1.3rem}
.ph-toc-list a:hover{background:rgba(240,192,64,.08);color:#fff}
.ph-toc-list a.is-active{background:rgba(240,192,64,.14);color:#ffe9a8;border-left-color:var(--lg-gold-l)}

/* ---------- Hoja de pergamino ---------- */
.ph-legal-sheet{
  position:relative;border-radius:10px;padding:3rem 3.25rem 2.25rem;
  background:
    radial-gradient(ellipse at top,rgba(255,252,240,.55),transparent 60%),
    linear-gradient(180deg,#f4e5c2 0%,#ead6aa 100%);
  box-shadow:0 30px 70px rgba(0,0,0,.65),inset 0 0 70px rgba(139,90,43,.18),0 0 0 1px rgba(120,80,30,.5);
  color:var(--lg-ink);overflow:hidden;
}
.ph-legal-sheet::before{ /* marco interior dorado */
  content:'';position:absolute;inset:10px;border:1px solid rgba(160,110,30,.45);border-radius:6px;pointer-events:none;
  box-shadow:inset 0 0 0 3px rgba(244,229,194,.6),inset 0 0 0 4px rgba(160,110,30,.25);
}
.ph-legal-sheet::after{ /* barra de casas */
  content:'';position:absolute;left:0;right:0;top:0;height:5px;
  background:linear-gradient(90deg,#740001 0 25%,#ecb939 25% 50%,#0e1a40 50% 75%,#1a472a 75% 100%);
}

/* ---------- Tipografía del contenido ---------- */
.ph-legal-body{position:relative;font-family:'Crimson Text',Georgia,serif;font-size:1.14rem;line-height:1.75;color:var(--lg-ink)}
.ph-legal-body p,.ph-legal-body li{margin:.55rem 0}
.ph-legal-body strong{color:#3a2208}
.ph-legal-body a{color:#8a3d08;text-decoration:underline;text-decoration-color:rgba(138,61,8,.4);text-underline-offset:3px;transition:color .2s}
.ph-legal-body a:hover{color:#b3560c;text-decoration-color:currentColor}
.ph-legal-body code{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.88em;background:rgba(92,58,30,.12);padding:.08rem .38rem;border-radius:4px}

.ph-legal-body .ph-updated{display:none} /* ya se muestra en el hero */

.ph-legal-body h2{
  display:flex;align-items:center;gap:.8rem;scroll-margin-top:100px;
  font-family:'Cinzel',serif;font-weight:700;font-size:1.22rem;line-height:1.3;color:#4a2a0a;
  margin:2.6rem 0 .9rem;padding-bottom:.7rem;border-bottom:1px solid rgba(120,80,30,.3);position:relative;
}
.ph-legal-body h2::after{content:'';position:absolute;left:0;bottom:-1px;width:70px;height:2px;background:linear-gradient(90deg,var(--lg-gold),transparent)}
.ph-legal-body h2 .ph-num{
  flex:0 0 auto;display:inline-grid;place-items:center;min-width:2.2rem;height:2.2rem;padding:0 .35rem;border-radius:50%;
  font-size:.9rem;color:#fff3c4;background:radial-gradient(circle at 30% 25%,#a02a1c,#740001 70%);
  box-shadow:0 2px 6px rgba(0,0,0,.35),inset 0 0 0 2px rgba(240,192,64,.6);
}
.ph-legal-body h3{font-family:'Cinzel',serif;font-size:1rem;color:var(--lg-brown);margin:1.4rem 0 .4rem}
.ph-legal-body ul{list-style:none;padding:0;margin:.7rem 0}
.ph-legal-body ul li{position:relative;padding-left:1.6rem}
.ph-legal-body ul li::before{content:'✦';position:absolute;left:.15rem;top:.05rem;color:var(--lg-gold);font-size:.8rem}
.ph-legal-body .ph-clause{font-family:'Cinzel',serif;font-weight:700;font-size:.82em;color:#8a5a12;margin-right:.15rem}

/* Aviso "sitio de fans" */
.ph-legal-body blockquote{
  position:relative;margin:0 0 1.8rem;padding:1.15rem 1.3rem 1.15rem 4.1rem;border-radius:10px;
  background:linear-gradient(135deg,rgba(116,0,1,.1),rgba(240,192,64,.18));
  border:1px solid rgba(160,110,30,.45);font-size:1.05rem;font-weight:600;color:#3a1a05;
}
.ph-legal-body blockquote::before{
  content:'⚡';position:absolute;left:1rem;top:50%;transform:translateY(-50%);
  width:2.2rem;height:2.2rem;display:grid;place-items:center;border-radius:50%;
  background:radial-gradient(circle at 30% 25%,#a02a1c,#740001 70%);color:#ffe08a;font-size:1rem;
  box-shadow:0 2px 6px rgba(0,0,0,.35),inset 0 0 0 2px rgba(240,192,64,.6);
}

/* Tablas */
.ph-legal-table-wrap{overflow-x:auto;margin:1.2rem 0;border-radius:10px;border:1px solid rgba(120,80,30,.4);background:rgba(255,250,235,.45);-webkit-overflow-scrolling:touch}
.ph-legal-body table{width:100%;border-collapse:collapse;font-size:.98rem;margin:0;min-width:520px}
.ph-legal-body th{
  background:linear-gradient(180deg,#5c3a1e,#3f2410);color:#f6dd9a;
  font-family:'Cinzel',serif;font-size:.74rem;letter-spacing:.1em;text-transform:uppercase;text-align:left;padding:.75rem .85rem;
}
.ph-legal-body td{padding:.7rem .85rem;border-top:1px solid rgba(120,80,30,.22);vertical-align:top;line-height:1.5}
.ph-legal-body tbody tr:nth-child(even) td{background:rgba(120,80,30,.07)}
.ph-legal-body tbody tr:hover td{background:rgba(240,192,64,.16)}
.ph-legal-body td:first-child{font-weight:600}

.ph-legal-todo{background:#ffe08a;color:#5a3b00;padding:0 .25rem;border-radius:3px}

/* Pie */
.ph-legal-foot{position:relative;text-align:center;margin-top:2.8rem;padding-top:1.3rem;border-top:1px solid rgba(120,80,30,.3)}
.ph-legal-foot .ph-legal-orn{color:#a8741a;margin-bottom:.6rem}
.ph-legal-foot .ph-legal-orn i{background:linear-gradient(90deg,transparent,#a8741a)}
.ph-legal-foot p{margin:.3rem 0;font-size:1.05rem}
.ph-legal-foot a{color:#8a3d08}
.ph-legal-mischief{font-family:'Cinzel Decorative',serif;font-size:.85rem!important;letter-spacing:.1em;color:#7a5a2a}

/* Volver arriba */
.ph-legal-top{
  position:fixed;right:1.2rem;bottom:1.2rem;width:44px;height:44px;border-radius:50%;display:grid;place-items:center;
  background:linear-gradient(180deg,#f7d56a,#c8960c);color:#2a1a0a;text-decoration:none;font-weight:700;font-size:1.2rem;
  box-shadow:0 6px 20px rgba(0,0,0,.5);opacity:0;pointer-events:none;transform:translateY(10px);transition:all .3s;z-index:50;
}
.ph-legal-top.is-visible{opacity:1;pointer-events:auto;transform:none}

/* ---------- Responsive ---------- */
@media(max-width:940px){
  .ph-legal-layout{grid-template-columns:1fr!important}
  .ph-legal-toc{position:relative;top:0;max-height:none}
  .ph-toc-list{display:grid;grid-template-columns:repeat(2,1fr);gap:0 .5rem}
}
@media(max-width:600px){
  .ph-legal-page{padding:96px .75rem 4rem}
  .ph-legal-sheet{padding:2.2rem 1.25rem 1.6rem}
  .ph-legal-sheet::before{inset:6px}
  .ph-legal-body{font-size:1.04rem}
  .ph-legal-body h2{font-size:1.05rem;gap:.6rem}
  .ph-legal-body blockquote{padding:1rem 1rem 1rem 3.6rem;font-size:1rem}
  .ph-toc-list{grid-template-columns:1fr}
  .ph-legal-tabs a{font-size:.7rem;padding:.55rem .9rem}
}
@media(prefers-reduced-motion:reduce){.ph-legal-page *{transition:none!important}}
@media print{
  body{background:#fff!important}.ph-legal-tabs,.ph-legal-toc,.ph-legal-top,.ph-legal-hero .ph-legal-orn{display:none!important}
  .ph-legal-sheet{box-shadow:none;background:#fff}.ph-legal-hero h1{color:#000;-webkit-text-fill-color:#000;background:none}
}
