<!DOCTYPE html>
<html lang="pt-BR">
<head>
    <meta charset="utf-8">
    <title>{{ __('Linha do tempo') }} — {{ $timeline->name }}</title>
    <style>
        body { font-family: DejaVu Sans, sans-serif; font-size: 11pt; }
        h1 { font-size: 16pt; }
        h2 { font-size: 13pt; margin-top: 1.2em; }
        .meta { margin-bottom: 1em; }
        .block { margin-bottom: 1em; page-break-inside: avoid; }
    </style>
</head>
<body>
    <h1>{{ $timeline->name }}</h1>
    <div class="meta">
        <div>{{ __('Data do marco zero') }}: {{ $timeline->event_date?->format('d/m/Y') }}</div>
        @if($timeline->description)
            <div>{{ __('Descrição / resumo') }}: {{ $timeline->description }}</div>
        @endif
    </div>
    <h2>{{ __('Processo') }}</h2>
    <div class="block">{!! $timeline->process_text !!}</div>

    <h2>{{ __('Pontos históricos') }}</h2>
    @foreach($timeline->historicalPoints as $p)
        <div class="block">
            <strong>{{ $p->name }}</strong> — {{ $p->event_date?->format('d/m/Y H:i') }}
            <div>{!! $p->process_text !!}</div>
            @if($p->activeNotes->isNotEmpty())
                <div><em>{{ __('Notas') }}:</em></div>
                <ul>
                    @foreach($p->activeNotes as $n)
                        <li>{{ strip_tags($n->content) }}</li>
                    @endforeach
                </ul>
            @endif
        </div>
    @endforeach
</body>
</html>
