@extends('layouts.app') @push('json-ld') @endpush @section('content') @php $beforeImage = $project->media->firstWhere('collection', 'before')?->url; $afterImage = $project->media->firstWhere('collection', 'after')?->url; $galleryMedia = $project->media->whereNotIn('collection', ['before', 'after'])->values(); $lightboxImages = $galleryMedia ->map(fn ($media): array => [ 'url' => $media->url, 'alt' => $media->alt_text ?? $project->title, ]) ->values() ->all(); if ($lightboxImages === []) { $lightboxImages = [['url' => $project->image, 'alt' => $project->title]]; } $year = $project->completed_at?->format('Y'); // Use + type merge into ONE classification line (they used to repeat // across the eyebrow and the meta line). Location + year stay in meta. $classification = collect([$project->useLabel(), $project->typeLabel()])->filter()->join(' · '); $metaLine = collect([$project->location, $year])->filter()->join(' · '); // Full-bleed obra band shows the gallery photos after the cover. $bandMedia = $galleryMedia->slice(1)->take(3); if ($bandMedia->isEmpty()) { $bandMedia = $galleryMedia->take(3); } @endphp {{-- The whole obra is one article: its hero, data panel, photos and before/after, with a single H1 and per-photo figures. --}}
{{-- Compact dark header: breadcrumbs, classification, H1 and meta in one short band so the work photos are visible without scrolling. --}}

Obra {{ $classification }} · Piedra natural

{{ $project->title }}

@if ($metaLine !== '')

{{ $metaLine }}

@endif
{{-- Detail: sticky data panel next to the photo gallery. --}}

Ficha y fotos de la obra

@if ($project->description)

{{ $project->description }}

@endif
@forelse ($galleryMedia as $media)
{{ $media->alt_text ?? $project->title }}
@empty {{-- Missing-media resilience (A9): an obra without photos degrades to the neutral placeholder and keeps the figure/lightbox contract intact. --}}
{{ $project->title }}
@endforelse
{{-- Full-bleed photo band for the gallery/obra. --}} @if ($bandMedia->isNotEmpty())
@foreach ($bandMedia as $media)
{{ $media->alt_text ?? $project->title }}
@endforeach
@endif {{-- Before/after comparison, when the project carries the media pair. --}} @if ($beforeImage && $afterImage) @endif {{-- Closing CTA to the catalog and the projects listing. --}}

¿Inspirado?

Lleva la piedra natural a tu proyecto

Ver colecciones Más obras
@endsection