/* Ricerca: pagina dei risultati (/?s=) e overlay. Colori coerenti con home.css / falegnameria.css. */

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

mark {
    background: rgba(247, 161, 69, 0.35);
    color: inherit;
    padding: 0 2px;
    border-radius: 3px;
}

/* ---------- Campo di ricerca (hero) ---------- */
.cnc-search-form {
    display: flex;
    gap: 10px;
    max-width: 640px;
    margin: 28px auto 0;
}
.cnc-search-form input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    height: 56px;
    padding: 0 20px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: #fff;
    color: #1f2428;
    font-size: 17px;
    box-shadow: none;
    -webkit-appearance: none;
}
.cnc-search-form input[type="search"]:focus {
    outline: none;
    border-color: #f7a145;
}
.cnc-search-form button {
    flex: 0 0 auto;
    height: 56px;
    padding: 0 30px;
    border: 0;
    border-radius: 12px;
    background: #f7a145;
    color: #1f2428;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}
.cnc-search-form button:hover {
    background: #fbb766;
}

/* ---------- Hero ---------- */
.cnc-search-hero {
    padding: 72px 0 64px;
    background: #1f2428;
    border-bottom: 5px solid #f7a145;
    text-align: center;
}
.cnc-search-hero__kicker {
    margin: 0 0 12px;
    color: #f7a145;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.cnc-search-hero__title {
    margin: 0;
    color: #fff;
    font-size: clamp(30px, 4.4vw, 48px);
    font-weight: 800;
    line-height: 1.15;
}
.cnc-search-hero__count {
    margin: 14px 0 0;
    color: #d9d3cb;
    font-size: 17px;
}

/* ---------- Corpo ---------- */
.cnc-search-body {
    padding: 56px 0 80px;
    background: #f6f2ed;
}
.cnc-search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 36px;
}
.cnc-search-filters--center {
    justify-content: center;
    margin-bottom: 0;
}
.cnc-search-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 999px;
    background: #fff;
    color: #1f2428;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(31, 36, 40, 0.12);
    transition: background 0.2s, color 0.2s;
}
.cnc-search-chip span {
    min-width: 24px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(31, 36, 40, 0.08);
    font-size: 13px;
    text-align: center;
}
.cnc-search-chip:hover {
    background: #f7a145;
    color: #1f2428;
}
.cnc-search-chip.is-active {
    background: #1f2428;
    color: #fff;
}
.cnc-search-chip.is-active span {
    background: rgba(255, 255, 255, 0.18);
}

/* ---------- Card ---------- */
.cnc-search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 28px;
}
.cnc-search-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-bottom: 4px solid #f7a145;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 22px rgba(31, 36, 40, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}
.cnc-search-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(31, 36, 40, 0.14);
}
.cnc-search-card__media {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #eee7de;
}
.cnc-search-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cnc-search-card__media--placeholder img {
    padding: 22%;
    object-fit: contain;
    opacity: 0.55;
}
.cnc-search-card__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 24px 26px;
}
.cnc-search-card__badge {
    margin-bottom: 12px;
    padding: 3px 11px;
    border-radius: 999px;
    background: rgba(247, 161, 69, 0.2);
    color: #8a4b00;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.cnc-search-card__title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}
.cnc-search-card__title a {
    color: #1f2428;
}
.cnc-search-card__title a:hover {
    color: #b86a0f;
}
.cnc-search-card__text {
    margin: 0 0 18px;
    color: #3b444b;
    font-size: 15px;
    line-height: 1.7;
}
.cnc-search-card__more {
    margin-top: auto;
    color: #b86a0f;
    font-size: 15px;
    font-weight: 700;
}
.cnc-search-card__more:hover {
    color: #1f2428;
}

/* ---------- Paginazione ---------- */
.cnc-search-pagination {
    margin-top: 48px;
}
.cnc-search-pagination ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.cnc-search-pagination li {
    margin: 0;
}
.cnc-search-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    background: #fff;
    color: #1f2428;
    font-weight: 700;
}
.cnc-search-pagination a.page-numbers:hover {
    background: #f7a145;
}
.cnc-search-pagination .page-numbers.current {
    background: #1f2428;
    color: #fff;
}

/* ---------- Nessun risultato ---------- */
.cnc-search-empty {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 32px;
    border-bottom: 4px solid #f7a145;
    border-radius: 16px;
    background: #fff;
    text-align: center;
}
.cnc-search-empty h2 {
    margin: 0 0 12px;
    color: #1f2428;
    font-size: 26px;
    font-weight: 800;
}
.cnc-search-empty p {
    margin: 0 0 16px;
    color: #3b444b;
    font-size: 17px;
}
.cnc-search-empty__label {
    margin-top: 28px !important;
    font-size: 13px !important;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.cnc-search-contact {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid #eee7de;
}
.cnc-search-contact a {
    display: inline-block;
    margin: 0 12px;
    color: #b86a0f;
    font-weight: 700;
}

/* ---------- Overlay ---------- */
.search-overlay {
    background: #fff;
    z-index: 100000;
}
body.admin-bar .search-overlay {
    top: 32px;
}
.search-overlay__top {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 22px 0;
    background: #1f2428;
    border-bottom: 4px solid #f7a145;
}
.search-overlay__top .container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
}
.search-overlay__form {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 14px;
    margin: 0;
}
.search-overlay__icon {
    margin: 0;
    color: #f7a145;
    font-size: 24px;
}
.search-overlay .search-term {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    padding: 10px 0;
    border: 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    color: #fff;
    font-size: 22px;
    font-weight: 400;
}
.search-overlay .search-term::placeholder {
    color: rgba(255, 255, 255, 0.55);
}
.search-overlay .search-term:focus {
    outline: none;
    border-bottom-color: #f7a145;
}
.search-overlay__submit {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 22px;
    border: 0;
    border-radius: 10px;
    background: #f7a145;
    color: #1f2428;
    font-weight: 700;
    cursor: pointer;
}
.search-overlay .search-overlay__close {
    position: static;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
}
.search-overlay .search-overlay__close:hover {
    background: #f7a145;
    color: #1f2428;
}
#search-overlay__results {
    padding: 36px 0 70px;
}
.cnc-sr-hint,
.cnc-sr-empty {
    max-width: 640px;
    margin: 28px auto 0;
    color: #3b444b;
    text-align: center;
    font-size: 17px;
}
.cnc-sr-hint .cnc-search-filters {
    margin-top: 18px;
}
.cnc-sr-group {
    margin-bottom: 34px;
}
.cnc-sr-group__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee7de;
}
.search-overlay .cnc-sr-group__title {
    margin: 0;
    color: #1f2428;
    font-size: 20px;
    font-weight: 800;
}
.cnc-sr-group__title span {
    margin-left: 6px;
    color: #8a8f94;
    font-size: 15px;
    font-weight: 600;
}
.cnc-sr-group__all {
    color: #b86a0f;
    font-size: 14px;
    font-weight: 700;
}
.cnc-sr-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.cnc-sr-item {
    display: flex;
    gap: 14px;
    padding: 12px;
    border-radius: 14px;
    background: #f6f2ed;
    color: #3b444b;
    transition: background 0.2s;
}
.cnc-sr-item:hover,
.cnc-sr-item:focus {
    background: #f1e5d3;
    color: #3b444b;
}
.cnc-sr-item__thumb {
    flex: 0 0 84px;
    height: 84px;
    overflow: hidden;
    border-radius: 10px;
    background: #eee7de;
}
.cnc-sr-item__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cnc-sr-item__thumb--placeholder img {
    padding: 14px;
    object-fit: contain;
    opacity: 0.55;
}
.cnc-sr-item__body {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}
.cnc-sr-item__body strong {
    color: #1f2428;
    font-size: 16px;
    line-height: 1.3;
}
.cnc-sr-item__text {
    display: -webkit-box;
    overflow: hidden;
    color: #3b444b;
    font-size: 14px;
    line-height: 1.5;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.cnc-sr-all {
    display: block;
    max-width: 360px;
    margin: 12px auto 0;
    padding: 15px 24px;
    border-radius: 12px;
    background: #1f2428;
    color: #fff;
    font-weight: 700;
    text-align: center;
}
.cnc-sr-all:hover {
    background: #f7a145;
    color: #1f2428;
}

@media (max-width: 767px) {
    .cnc-search-hero {
        padding: 48px 0 44px;
    }
    .cnc-search-form {
        flex-direction: column;
    }
    .cnc-search-form button {
        width: 100%;
    }
    .search-overlay .search-term {
        font-size: 18px;
    }
    .search-overlay__submit {
        display: none;
    }
    body.admin-bar .search-overlay {
        top: 46px;
    }
}

/* ---------- Blocco nativo "Dettagli" (accordion, es. pagina FAQ) ---------- */
/* normalize.css imposta summary { display: block }, che nasconde la freccia di apertura. */
.wp-block-details > summary {
    display: list-item;
    cursor: pointer;
}
.wp-block-details > summary::marker {
    color: #f7a145;
}
