@extends('public.layouts.app')

@section('title', $pagina->titulo)

@section('styles')
<style>
.page-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #1a1040 100%);
    padding: 5rem 0 3.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,.18) 0%, transparent 70%);
}
.page-hero-title {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    position: relative;
    z-index: 1;
}
.page-hero-title span {
    background: linear-gradient(135deg, #818cf8, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.page-content-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem 5rem;
}
/* Estilos para el contenido HTML del editor */
.page-content-body {
    color: var(--text-primary, #e2e8f0);
    line-height: 1.85;
    font-size: 1.05rem;
}
.page-content-body h1, .page-content-body h2, .page-content-body h3,
.page-content-body h4 {
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: #f1f5f9;
}
.page-content-body h1 { font-size: 2rem; }
.page-content-body h2 { font-size: 1.6rem; }
.page-content-body h3 { font-size: 1.3rem; }
.page-content-body p  { margin-bottom: 1.2rem; }
.page-content-body ul, .page-content-body ol {
    padding-left: 1.5rem; margin-bottom: 1.2rem;
}
.page-content-body li { margin-bottom: .4rem; }
.page-content-body a  { color: #818cf8; }
.page-content-body blockquote {
    border-left: 4px solid #6366f1;
    margin: 1.5rem 0;
    padding: .75rem 1.2rem;
    background: rgba(99,102,241,.08);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #94a3b8;
}
.page-content-body pre {
    background: #0f172a;
    border: 1px solid rgba(99,102,241,.2);
    border-radius: 10px;
    padding: 1.2rem;
    overflow-x: auto;
    margin-bottom: 1.2rem;
}
.page-content-body img {
    max-width: 100%;
    border-radius: 10px;
    margin: 1rem 0;
}
.page-content-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}
.page-content-body th, .page-content-body td {
    border: 1px solid rgba(99,102,241,.2);
    padding: .6rem .9rem;
    text-align: left;
}
.page-content-body th {
    background: rgba(99,102,241,.1);
    color: #818cf8;
    font-weight: 600;
}
</style>
@endsection

@section('content')
<!-- Hero de la página -->
<section class="page-hero">
    <div class="container">
        <div class="page-hero-title">
            <span>{{ $pagina->titulo }}</span>
        </div>
    </div>
</section>

<!-- Contenido -->
<section>
    <div class="page-content-wrap">
        <div class="page-content-body">
            {!! $pagina->contenido !!}
        </div>

        <!-- Volver al inicio -->
        <div style="margin-top:3rem;padding-top:2rem;border-top:1px solid rgba(99,102,241,.15);display:flex;gap:1rem;align-items:center;">
            <a href="{{ route('home') }}" class="btn btn-secondary">
                <i class="bi bi-arrow-left"></i> Volver al inicio
            </a>
        </div>
    </div>
</section>
@endsection
