/* ============================================================
   LSH — Search results page (pagina /{lang}/cerca)
   ------------------------------------------------------------
   La barra di ricerca vive nel banner-header (.lsh-search):
   qui stiliamo SOLO l'header pagina + le card risultato + gli
   anchor secondari. Le card riusano .article-card (porting
   dal partial link_correlati.php).
   ============================================================ */

.page-search {
    background: #fafafa;
}

.search {
    padding: 28px 0 56px;
}

.search .container {
    width: min(1000px, calc(100% - 32px));
    margin: 0 auto;
}
.page-search section.search {
    margin:auto !important;
    box-shadow:none !important;
}
.page-search section.search>.container {
    width:100% !important;
}
/* ── header ─────────────────────────────────────────────── */

.search__header {
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 3px solid #15543c;
}

.search__title {
    margin: 0 0 6px;
    font-size: clamp(1.7rem, 2.4vw, 2.2rem);
    font-weight: 800;
    color: #103226;
    letter-spacing: -0.01em;
}

.search__query-meta {
    margin: 0;
    font-size: 0.95rem;
    color: #4a5e56;
}

.search__hint,
.search__empty,
.search__error {
    padding: 14px 18px;
    background: #F2F7F3;
    border-radius: 10px;
    color: #2b2b2b;
    font-size: 0.98rem;
}

.search__error {
    background: #fcebea;
    color: #7a1a14;
}

/* ── lista card ─────────────────────────────────────────── */

.search__results {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Card articolo — porting da link_correlati.php */
.article-card {
    width: 100%;
    background: #ffffff;
}

.article-card__link {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    width: 100%;
    padding: 14px;
    text-decoration: none;
    color: inherit;
    background: #ffffff;
    border: 2px solid #e4e7e5;
    border-radius: 6px;
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
    box-sizing: border-box;
}

.article-card__link:hover,
.article-card__link:focus-visible {
    transform: translateY(-2px);
    border-color: #2D6A4F;
    box-shadow: 0 10px 24px rgba(25, 58, 53, 0.10);
    outline: none;
}

.article-card__media {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border-radius: 6px;
    background: #f3f5f4;
}

.article-card__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.article-card__link:hover .article-card__image {
    transform: scale(1.03);
}

.article-card__content {
    min-width: 0;
    padding-top: 2px;
}

.article-card__title {
    margin: 0 0 8px 0;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 700;
    color: #1f7a6d;
    overflow-wrap: anywhere;
    display: flex;
    align-items: baseline;
    gap: 10px;
    justify-content: space-between;
}

.article-card__link:hover .article-card__title {
    color: #165f56;
}

.article-card__meta {
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 700;
    color: #2a2a2a;
}

.article-card__excerpt {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: #222222;
}

.article-card__excerpt strong {
    font-weight: 700;
    color: #111111;
}

/* Score badge */
.search__score {
    flex-shrink: 0;
    display: inline-block;
    padding: 3px 9px;
    background: #2D6A4F;
    color: #fff;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
    vertical-align: middle;
}

/* ── anchor H2 secondari (sotto la card) ────────────────── */

.article-card__anchors {
    margin: 6px 14px 8px;
    padding: 8px 12px 10px;
    background: #f6f8f6;
    border-radius: 6px;
    font-size: 0.88rem;
}

.article-card__anchors-label {
    display: block;
    margin-bottom: 4px;
    color: #6b6b6b;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.article-card__anchors a {
    display: inline-block;
    margin: 2px 10px 2px 0;
    color: #15543c;
    text-decoration: none;
}

.article-card__anchors a:hover {
    text-decoration: underline;
}

/* ── mobile ─────────────────────────────────────────────── */

@media (max-width: 720px) {
    .search { padding: 18px 0 40px; }
    .article-card__link {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .article-card__title { font-size: 17px; }
}

/* ──────────────────────────────────────────────────────────────
 * Griglia card condivisa (.lsh-article-grid) — STESSO stile della
 * homepage (.lsh-home-articles), riusata da: ricerca, pagina autore,
 * articoli correlati. Replica i tweak di lsh-home.css così la card è
 * identica ovunque (la base .article-card è già definita qui sopra).
 * ────────────────────────────────────────────────────────────── */
.lsh-article-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.lsh-article-grid .article-card__link { align-items: stretch; }
.lsh-article-grid .article-card__content { padding-top: 0; }
.lsh-article-grid .article-card__media { height: 100%; }
.lsh-article-grid .article-card__image { height: 100%; aspect-ratio: auto; }
.lsh-article-grid .article-card__excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: justify;
}
.lsh-article-grid .article-card__link--no-media { grid-template-columns: 1fr; }
.article-card__badge {
    font-size: 12px;
    font-weight: 600;
    color: #6b7470;
    margin-left: 6px;
}
