/* Ficha Técnica Theme (Accordion Auto-Enhance)
   Drop-in stylesheet for Ghost themes.
   Author: Generated Helper
   -----------------------------------------------------------------------
   DESIGN PRINCIPLES
   - Neutral, readable base (light)
   - Accent color configurable via data-accent attribute on root container
   - Works with tables, lists, or simple div/group patterns
   - Minimal overrides: namespaced under .ficha-tecnica-shell
*/

:root {
  --ft-accent: #6366f1;
  --ft-accent-rgb: 99 102 241;
  --ft-radius-sm: 4px;
  --ft-radius-md: 8px;
  --ft-radius-lg: 14px;
  --ft-bg: #ffffff;
  --ft-bg-alt: #f8fafc;
  --ft-surface: #ffffff;
  --ft-border: #e2e8f0;
  --ft-border-strong: #cbd5e1;
  --ft-text: #1e293b;
  --ft-text-light: #64748b;
  --ft-shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --ft-shadow: 0 4px 14px -4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.08);
  --ft-transition: 300ms cubic-bezier(.4,0,.2,1);
  --ft-font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
  --ft-font-mono: 'JetBrains Mono', 'SF Mono', 'ui-monospace', 'Cascadia Mono', Menlo, Consolas, monospace;
  --ft-section-spacing: 0.85rem;
}

/* Accent Variants */
[data-accent="blue"] { --ft-accent:#2563eb; --ft-accent-rgb:37 99 235; }
[data-accent="green"] { --ft-accent:#059669; --ft-accent-rgb:5 150 105; }
[data-accent="orange"] { --ft-accent:#ea580c; --ft-accent-rgb:234 88 12; }
[data-accent="red"] { --ft-accent:#dc2626; --ft-accent-rgb:220 38 38; }
[data-accent="teal"] { --ft-accent:#0d9488; --ft-accent-rgb:13 148 136; }
[data-accent="slate"] { --ft-accent:#475569; --ft-accent-rgb:71 85 105; }

/* SHELL WRAPPER */
.ficha-tecnica-shell { position:relative; font-family:var(--ft-font-sans); color:var(--ft-text); --_accent-soft: color-mix(in srgb, var(--ft-accent) 10%, #ffffff); }
.ficha-tecnica-shell * { box-sizing:border-box; }

.ficha-tecnica-shell .ft-heading { font-size:.82rem; font-weight:600; text-transform:uppercase; letter-spacing:.06em; margin:0 0 .9rem; display:flex; align-items:center; gap:.75rem; color:var(--ft-text); }
.ficha-tecnica-shell .ft-heading::after { content:""; flex:1; height:1px; background:linear-gradient(90deg,var(--ft-accent),transparent); opacity:.4; }

.ficha-tecnica-shell .ft-accordion { display:flex; flex-direction:column; gap:var(--ft-section-spacing); }

/* CATEGORY BLOCK */
.ficha-tecnica-shell .ft-block { background:var(--ft-surface); border:1px solid var(--ft-border); border-radius:var(--ft-radius-md); box-shadow:var(--ft-shadow-sm); overflow:hidden; position:relative; transition:box-shadow var(--ft-transition), border-color var(--ft-transition); }
.ficha-tecnica-shell .ft-block::before { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--ft-accent); opacity:.65; }
.ficha-tecnica-shell .ft-block:hover { box-shadow:var(--ft-shadow); border-color:var(--ft-border-strong); }

/* HEADER */
.ficha-tecnica-shell .ft-block-header { all:unset; display:flex; align-items:center; gap:.65rem; width:100%; cursor:pointer; padding:.7rem .85rem; font-size:.63rem; letter-spacing:.07em; font-weight:600; text-transform:uppercase; color:var(--ft-text-light); position:relative; transition:background var(--ft-transition), color var(--ft-transition); }
.ficha-tecnica-shell .ft-block-header:focus-visible { outline:2px solid var(--ft-accent); outline-offset:2px; }
.ficha-tecnica-shell .ft-block.open .ft-block-header { background:var(--_accent-soft); color:var(--ft-text); }
.ficha-tecnica-shell .ft-chevron { margin-left:auto; font-size:.65rem; line-height:1; transform:rotate(0deg); transition:transform var(--ft-transition), opacity var(--ft-transition); opacity:.6; }
.ficha-tecnica-shell .ft-block.open .ft-chevron { transform:rotate(180deg); opacity:1; }

/* CONTENT AREA */
.ficha-tecnica-shell .ft-block-content { max-height:0; overflow:hidden; transition:max-height var(--ft-transition), padding var(--ft-transition); padding:0 .2rem; }
.ficha-tecnica-shell .ft-block.open .ft-block-content { padding:.25rem .25rem .65rem; }

/* TABLE STYLE (auto-extracted) */
.ficha-tecnica-shell table { width:100%; border-collapse:collapse; font-size:.63rem; line-height:1.35; }
.ficha-tecnica-shell tbody { display:table-row-group; }
.ficha-tecnica-shell tr { border-bottom:1px solid var(--ft-border); }
.ficha-tecnica-shell tr:last-child { border-bottom:0; }
.ficha-tecnica-shell td { padding:.4rem .55rem .45rem; vertical-align:top; }
.ficha-tecnica-shell td:first-child { width:44%; font-weight:600; color:var(--ft-text); letter-spacing:.015em; }
.ficha-tecnica-shell td:last-child { color:var(--ft-text-light); font-weight:500; }

/* LIST FALLBACK */
.ficha-tecnica-shell ul, .ficha-tecnica-shell ol { margin:0; padding:0; list-style:none; }
.ficha-tecnica-shell .ft-list-row { display:grid; grid-template-columns:44% 1fr; padding:.4rem .55rem .45rem; font-size:.63rem; border-bottom:1px solid var(--ft-border); }
.ficha-tecnica-shell .ft-list-row:last-child { border-bottom:0; }
.ficha-tecnica-shell .ft-list-role { font-weight:600; color:var(--ft-text); }
.ficha-tecnica-shell .ft-list-value { color:var(--ft-text-light); font-weight:500; }

/* MULTI-PERSON LIST */
.ficha-tecnica-shell .ft-multi span + span::before { content:", "; }

/* BADGES (optional highlight people) */
.ficha-tecnica-shell .ft-badge { display:inline-block; background:var(--_accent-soft); color:var(--ft-accent); font-size:.55rem; font-weight:500; padding:.25rem .45rem .3rem; border-radius:var(--ft-radius-sm); margin:0 .25rem .25rem 0; line-height:1.05; }

/* ONE-AT-A-TIME (Accordion logic aided by JS) */
.ficha-tecnica-shell .ft-block:not(.open) .ft-block-content > * { opacity:0; transition:opacity 120ms linear; }
.ficha-tecnica-shell .ft-block.open .ft-block-content > * { opacity:1; transition:opacity 320ms ease 120ms; }

/* CLICK-OUTSIDE OVERLAY (managed by JS) */
.ficha-tecnica-overlay-dismiss { position:fixed; inset:0; background:transparent; z-index:5; display:none; }
.ficha-tecnica-overlay-dismiss.active { display:block; }

/* RESPONSIVE */
@media (max-width: 1200px){
  .ficha-tecnica-shell { position:relative; top:0; max-height:none; }
}
@media (max-width: 740px){
  .ficha-tecnica-shell .ft-heading { font-size:.74rem; }
  .ficha-tecnica-shell .ft-block-header { font-size:.58rem; }
  .ficha-tecnica-shell td, .ficha-tecnica-shell .ft-list-row { font-size:.6rem; }
}

/* DARK MODE (prefers-color-scheme) */
@media (prefers-color-scheme: dark){
  .ficha-tecnica-shell { --ft-bg:#0f172a; --ft-bg-alt:#1e293b; --ft-surface:#1e293b; --ft-border:#334155; --ft-border-strong:#475569; --ft-text:#f1f5f9; --ft-text-light:#94a3b8; }
  .ficha-tecnica-shell .ft-block { background:var(--ft-surface); }
  .ficha-tecnica-shell .ft-block.open .ft-block-header { background:rgba(var(--ft-accent-rgb) / .18); }
  .ficha-tecnica-shell .ft-heading::after { opacity:.55; }
}

/* === LITE MODE (direct Ghost HTML paste) === */
.ficha-tecnica[data-lite], .ficha-tecnica-lite { font-family:var(--ft-font-sans); border:1px solid var(--ft-border); border-radius:var(--ft-radius-md); padding:.75rem .85rem; background:var(--ft-bg); }
.ficha-tecnica[data-lite] .ficha-section { border:1px solid var(--ft-border); border-radius:var(--ft-radius-sm); margin:0 0 .55rem; overflow:hidden; background:var(--ft-surface); }
.ficha-tecnica[data-lite] .ficha-section.open { box-shadow:var(--ft-shadow-sm); }
.ficha-tecnica[data-lite] .section-header { all:unset; cursor:pointer; display:flex; align-items:center; gap:.5rem; width:100%; padding:.55rem .7rem; font-size:.62rem; letter-spacing:.05em; font-weight:600; text-transform:uppercase; color:var(--ft-text-light); position:relative; }
.ficha-tecnica[data-lite] .ficha-section.open > .section-header { color:var(--ft-text); background:color-mix(in srgb,var(--ft-accent) 12%, transparent); }
.ficha-tecnica[data-lite] .section-header .section-icon { margin-left:auto; font-size:.6rem; transition:transform .3s ease; }
.ficha-tecnica[data-lite] .ficha-section.open .section-icon { transform:rotate(180deg); }
.ficha-tecnica[data-lite] .section-content { max-height:0; overflow:hidden; transition:max-height .35s cubic-bezier(.4,0,.2,1), padding .25s; padding:0 .7rem; }
.ficha-tecnica[data-lite] .ficha-section.open > .section-content { padding:.35rem .7rem .7rem; }
.ficha-tecnica[data-lite] .team-row { display:grid; grid-template-columns:42% 1fr; gap:.4rem .75rem; font-size:.63rem; padding:.3rem 0; border-bottom:1px solid var(--ft-border); }
.ficha-tecnica[data-lite] .team-row:last-child { border-bottom:0; }
.ficha-tecnica[data-lite] .team-role { font-weight:600; color:var(--ft-text); }
.ficha-tecnica[data-lite] .team-name { color:var(--ft-text-light); font-weight:500; }
.ficha-tecnica[data-lite][data-accent="purple"], .ficha-tecnica-lite[data-accent="purple"] { --ft-accent:#6d28d9; --ft-accent-rgb:109 40 217; }

/* === PLUS MODE ADDITIONS === */
.ficha-plus-root { position:relative; border:1px solid var(--ft-border); border-radius:var(--ft-radius-md); padding:.75rem .85rem; background:var(--ft-bg); }
.ficha-plus-root .ficha-section { border:1px solid var(--ft-border); border-radius:var(--ft-radius-sm); margin:0 0 .6rem; background:var(--ft-surface); overflow:hidden; }
.ficha-plus-root .ficha-section.open { box-shadow:var(--ft-shadow-sm); }
.ficha-plus-root .section-header { cursor:pointer; display:flex; align-items:center; gap:.5rem; padding:.6rem .7rem; font-size:.62rem; letter-spacing:.05em; font-weight:600; text-transform:uppercase; color:var(--ft-text-light); background:var(--ft-surface); border:none; outline:none; width:100%; position:relative; }
.ficha-plus-root .ficha-section.open > .section-header { color:var(--ft-text); background:color-mix(in srgb,var(--ft-accent) 12%, transparent); }
.ficha-plus-root .section-header:focus-visible { outline:2px solid var(--ft-accent); outline-offset:2px; }
.ficha-plus-root .section-icon { margin-left:auto; font-size:.6rem; transition:transform .35s ease; }
.ficha-plus-root .ficha-section.open .section-icon { transform:rotate(180deg); }
.ficha-plus-root .section-content { max-height:0; overflow:hidden; transition:max-height .35s cubic-bezier(.4,0,.2,1), padding .25s; padding:0 .7rem; }
.ficha-plus-root .ficha-section.open > .section-content { padding:.4rem .7rem .8rem; }
.ficha-plus-root .team-row { display:grid; grid-template-columns:42% 1fr; gap:.4rem .75rem; font-size:.63rem; padding:.32rem 0; border-bottom:1px solid var(--ft-border); }
.ficha-plus-root .team-row:last-child { border-bottom:0; }
.ficha-plus-root .team-role { font-weight:600; color:var(--ft-text); }
.ficha-plus-root .team-name { color:var(--ft-text-light); font-weight:500; }
.ficha-plus-root.ficha-hidden-mobile { display:none; }

/* Static sidebar mode */
.ficha-plus-root.ficha-static-sidebar { position:fixed; top:0; right:0; width:340px; max-width:90vw; height:100vh; z-index:1000; border-left:1px solid var(--ft-border); border-radius:0; padding:0; display:flex; flex-direction:column; background:var(--ft-surface); box-shadow:-6px 0 18px -4px rgba(0,0,0,.2), -1px 0 4px rgba(0,0,0,.08); }
.ficha-plus-root.ficha-static-sidebar .ficha-static-inner { padding:1rem .95rem 2.2rem; overflow-y:auto; -webkit-overflow-scrolling:touch; }
.ficha-plus-root.ficha-static-sidebar .ficha-section { margin:0 0 .55rem; }
.ficha-plus-root.ficha-static-sidebar .ficha-section.open > .section-header { background:color-mix(in srgb,var(--ft-accent) 18%, transparent); }
body.has-ficha-sidebar { padding-right:340px; }
@media (max-width:1000px){ body.has-ficha-sidebar { padding-right:0; } .ficha-plus-root.ficha-static-sidebar { position:static; width:auto; height:auto; box-shadow:none; border-left:none; } }


/* Table formatting */
.ficha-plus-root table.ficha-table { width:100%; border-collapse:collapse; table-layout:fixed; font-size:.62rem; margin:.4rem 0 .2rem; }
.ficha-plus-root table.ficha-table thead th { text-align:left; font-weight:600; padding:.45rem .55rem; background:color-mix(in srgb, var(--ft-accent) 14%, #fff); color:var(--ft-text); }
.ficha-plus-root table.ficha-table td { padding:.45rem .55rem; border-top:1px solid var(--ft-border); vertical-align:top; color:var(--ft-text-light); }
.ficha-plus-root table.ficha-table tr:nth-child(even) td { background:color-mix(in srgb,var(--ft-accent) 6%, transparent); }

/* Drawer & Tab */
/* Reverted: drawer fixed to viewport */
.ficha-drawer { position:fixed; top:0; right:0; width:min(380px, 90vw); height:var(--ficha-drawer-vh, 100vh); background:var(--ft-surface); border-left:1px solid var(--ft-border); box-shadow:-2px 0 18px -4px rgba(0,0,0,.18), -1px 0 3px rgba(0,0,0,.08); transform:translateX(100%); transition:transform .45s cubic-bezier(.33,1,.68,1); z-index:1002; display:flex; flex-direction:column; }
.ficha-drawer.open { transform:translateX(0); }
.ficha-drawer-header { display:flex; align-items:center; justify-content:space-between; padding:.9rem 1rem; border-bottom:1px solid var(--ft-border); background:linear-gradient(135deg, color-mix(in srgb,var(--ft-accent) 18%, #fff), var(--ft-surface)); }
.ficha-drawer-title { margin:0; font-size:.8rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--ft-text); }
.ficha-drawer-close { background:none; border:none; font-size:1.3rem; line-height:1; cursor:pointer; color:var(--ft-text-light); padding:.25rem .4rem; border-radius:6px; }
.ficha-drawer-close:hover { background:rgba(var(--ft-accent-rgb) / .12); color:var(--ft-text); }
.ficha-drawer-body { position:relative; overflow:hidden; flex:1; display:flex; }
.ficha-drawer-content { overflow-y:auto; padding:1rem .95rem 2.25rem; width:100%; scrollbar-width:thin; }
.ficha-drawer-content::-webkit-scrollbar { width:10px; }
.ficha-drawer-content::-webkit-scrollbar-track { background:transparent; }
.ficha-drawer-content::-webkit-scrollbar-thumb { background:linear-gradient(var(--ft-accent), color-mix(in srgb,var(--ft-accent) 60%, #888)); border-radius:6px; }
.ficha-drawer-tab { position:fixed; top:140px; right:0; z-index:1001; padding:0; width:54px; background:linear-gradient(180deg,var(--ft-accent) 0%,color-mix(in srgb,var(--ft-accent) 60%,#14181f) 100%); color:#fff; border:0; cursor:pointer; display:flex; align-items:center; justify-content:center; border-radius:14px 0 0 14px; box-shadow:0 4px 18px -4px rgba(0,0,0,.5),0 0 0 1px rgba(255,255,255,.08); -webkit-backdrop-filter:blur(5px) saturate(160%); backdrop-filter:blur(5px) saturate(160%); transition:top .25s ease, background .35s, box-shadow .35s, opacity .25s; overflow:visible; isolation:isolate; }
.ficha-drawer-tab-text { writing-mode:vertical-rl; text-orientation:mixed; transform:rotate(180deg); display:block; font-family:var(--font-primary,"Inter",system-ui,sans-serif); font-weight:700; font-size:15px; line-height:1; letter-spacing:.12em; padding:20px 12px 22px; text-align:center; text-transform:uppercase; text-shadow:0 2px 4px rgba(0,0,0,.45); -webkit-font-smoothing:antialiased; font-feature-settings:"kern" 1, "liga" 1; }
.ficha-drawer-tab:hover:not(.open) { filter:brightness(1.05); }
.ficha-drawer-tab:focus-visible { outline:none; box-shadow:0 0 0 2px #fff,0 0 0 5px var(--ft-accent); }
.ficha-drawer-tab.open { right:0; background:linear-gradient(180deg,color-mix(in srgb,var(--ft-accent) 92%,#060709) 0%,var(--ft-accent) 85%); box-shadow:0 6px 24px -6px rgba(0,0,0,.55),0 0 0 1px rgba(255,255,255,.10); }
.ficha-drawer-tab.dragging { transition:none; }

@keyframes fichaPullPulse { 0%,70%,100%{ box-shadow:0 4px 18px -4px rgba(0,0,0,.5),0 0 0 1px rgba(255,255,255,.08);} 40%{ box-shadow:0 4px 22px -4px rgba(0,0,0,.6),0 0 0 1px rgba(255,255,255,.16);} }
.ficha-drawer-tab:not(.open){ animation:fichaPullPulse 4s ease-in-out 1.2s 3; }

/* Removed global force-right override so scroll-follow logic can manage position */
.ficha-tab-anchor { position:relative; }
.ficha-tab-anchor .ficha-drawer-tab.anchored { right:-34px !important; position:absolute !important; transition:right .45s cubic-bezier(.34,1.56,.64,1), background .35s, box-shadow .35s; }
.ficha-tab-anchor .ficha-drawer-tab.anchored.open { right:0 !important; }
.ficha-tab-anchor .ficha-drawer-tab.anchored:hover:not(.open){ right:-28px !important; }
.ficha-drawer-tab.ficha-vert-constrained { transition:opacity .25s ease, top .25s ease; }
.ficha-drawer-tab { opacity:1; visibility:visible; pointer-events:auto; }
.ficha-drawer-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.25); -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px); opacity:0; visibility:hidden; transition:opacity .35s ease; z-index:1000; }
.ficha-drawer-backdrop.open { opacity:1; visibility:visible; }
body.ficha-drawer-open { overflow:hidden; }

@media (max-width:640px){
  .ficha-drawer { width:min(88%,380px); }
  .ficha-drawer-tab { right:0; width:50px; }
  .ficha-drawer-tab-text { font-size:14px; padding:18px 10px 20px; letter-spacing:.11em; }
  .ficha-drawer-tab.open { right:0; }
}
@media (max-width:420px){
  .ficha-drawer { width:min(92%,400px); }
  .ficha-drawer-tab { right:0; width:48px; }
  .ficha-drawer-tab-text { font-size:13px; padding:16px 10px 18px; letter-spacing:.10em; }
  .ficha-drawer-tab.open { right:0; }
}

/* Pull tab concealed offset (desktop stays flush) */
@media (max-width: 640px){
  .ficha-drawer-tab { position:fixed; }
}

