/* ==========================================================================
   Biotecno – stile del sito pubblico (Bootstrap 5 + personalizzazioni)
   ========================================================================== */
:root {
    --brand-blue: #00528c;
    --brand-blue-dark: #003a63;
    --brand-green: #5aab2e;
    --brand-green-dark: #458a21;
    --surface: #f5f8fb;
    --ink: #1c2733;
    --muted: #5c6b7a;
    --radius: 14px;

    --bs-primary: var(--brand-blue);
    --bs-primary-rgb: 0, 82, 140;
    --bs-link-color: var(--brand-blue);
    --bs-link-color-rgb: 0, 82, 140;
    --bs-link-hover-color: var(--brand-blue-dark);
    --bs-body-color: var(--ink);
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body { background: #fff; display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; }
h1, h2, h3, h4, h5 { font-weight: 700; letter-spacing: -0.01em; }
.text-muted { color: var(--muted) !important; }

.btn-primary { --bs-btn-bg: var(--brand-blue); --bs-btn-border-color: var(--brand-blue); --bs-btn-hover-bg: var(--brand-blue-dark); --bs-btn-hover-border-color: var(--brand-blue-dark); --bs-btn-active-bg: var(--brand-blue-dark); }
.btn-success { --bs-btn-bg: var(--brand-green); --bs-btn-border-color: var(--brand-green); --bs-btn-hover-bg: var(--brand-green-dark); --bs-btn-hover-border-color: var(--brand-green-dark); --bs-btn-active-bg: var(--brand-green-dark); }
.btn-outline-primary { --bs-btn-color: var(--brand-blue); --bs-btn-border-color: var(--brand-blue); --bs-btn-hover-bg: var(--brand-blue); --bs-btn-hover-border-color: var(--brand-blue); }

/* Header ---------------------------------------------------------------- */
.site-header { background: rgba(255,255,255,.96); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid #e6ecf1; }
.site-header .navbar-brand img { height: 42px; width: auto; }
.site-header .nav-link { font-weight: 500; color: var(--ink); }
.site-header .nav-link:hover, .site-header .nav-link.active { color: var(--brand-blue); }
.site-header .search-form { max-width: 280px; }
.mega-menu { min-width: 300px; max-height: 70vh; overflow-y: auto; }
.quote-badge { position: absolute; top: 2px; right: -4px; font-size: .65rem; }
.topbar { background: var(--brand-blue); color: #dbe8f3; font-size: .85rem; }
.topbar a { color: #fff; text-decoration: none; }

/* Hero ------------------------------------------------------------------ */
.hero { background: linear-gradient(135deg, var(--brand-blue) 0%, #0a6db4 55%, var(--brand-green) 140%); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -80px; top: -60px; width: 420px; height: 420px; background: url("../images/logo_biotecno_small-44Syd8N.png") no-repeat center / contain; opacity: .35; mix-blend-mode: multiply; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
.hero .lead { color: #e3eef7; max-width: 640px; }
.hero .search-hero { max-width: 560px; }

.page-header { background: var(--surface); border-bottom: 1px solid #e6ecf1; }
.breadcrumb { --bs-breadcrumb-divider-color: #9aa8b5; font-size: .9rem; margin: 0; }

.section-title { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section-title h2 { margin: 0; }
.section-title h2::after { content: ""; display: block; width: 48px; height: 4px; border-radius: 2px; background: var(--brand-green); margin-top: .5rem; }

/* Card ------------------------------------------------------------------ */
.tile { border: 1px solid #e3e9ef; border-radius: var(--radius); overflow: hidden; background: #fff; height: 100%; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s, border-color .2s; color: inherit; text-decoration: none; position: relative; }
.tile:hover { box-shadow: 0 10px 30px rgba(0, 50, 90, .12); transform: translateY(-3px); border-color: #cfdbe6; color: inherit; }
.tile-img { aspect-ratio: 4 / 3; background: #fff; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid #eef2f6; }
.tile-img img { width: 100%; height: 100%; object-fit: contain; }
.tile-body { padding: 1rem 1.1rem 1.2rem; flex: 1; display: flex; flex-direction: column; }
.tile-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .25rem; overflow-wrap: anywhere; hyphens: auto; }
.tile-meta { font-size: .82rem; color: var(--muted); }
.tile-text { font-size: .9rem; color: var(--muted); margin-top: .5rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile-badge { position: absolute; top: 12px; left: 12px; z-index: 2; color: #fff; font-weight: 600; font-size: .75rem; padding: .3em .7em; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.tile-type { position: absolute; top: 12px; right: 12px; z-index: 2; }

.category-pill { display: flex; align-items: center; gap: .9rem; padding: .75rem 1rem; border: 1px solid #e3e9ef; border-radius: var(--radius); background: #fff; text-decoration: none; color: var(--ink); height: 100%; transition: border-color .2s, box-shadow .2s; }
.category-pill:hover { border-color: var(--brand-blue); box-shadow: 0 4px 14px rgba(0, 50, 90, .08); color: var(--brand-blue); }
.category-pill img { width: 56px; height: 56px; object-fit: contain; flex-shrink: 0; }

/* Scheda articolo -------------------------------------------------------- */
.gallery-main { border: 1px solid #e3e9ef; border-radius: var(--radius); background: #fff; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: zoom-in; }
.gallery-main img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }
.gallery-thumbs button { border: 2px solid transparent; border-radius: 10px; padding: 0; background: #fff; width: 72px; height: 72px; overflow: hidden; }
.gallery-thumbs button.active, .gallery-thumbs button:hover { border-color: var(--brand-blue); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.product-specs dt { color: var(--muted); font-weight: 500; }
.quote-box { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; border: 1px solid #e3e9ef; }
.rich-content { overflow-wrap: anywhere; }
.rich-content img { max-width: 100%; height: auto; }
.rich-content iframe { max-width: 100%; }
.rich-content table { width: 100% !important; margin-bottom: 1rem; border-collapse: collapse; display: block; overflow-x: auto; }
.rich-content table td, .rich-content table th { border: 1px solid #dee5ec; padding: .4rem .6rem; vertical-align: top; }
.attachment-list a { display: flex; align-items: center; gap: .75rem; padding: .65rem .9rem; border: 1px solid #e3e9ef; border-radius: 10px; text-decoration: none; color: var(--ink); }
.attachment-list a:hover { border-color: var(--brand-blue); color: var(--brand-blue); }
.attachment-list i { font-size: 1.4rem; color: #c0392b; }

/* News ------------------------------------------------------------------- */
.news-date { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-green-dark); font-weight: 600; }

/* Footer ----------------------------------------------------------------- */
.site-footer { background: #0d2233; color: #b6c4d1; font-size: .92rem; }
.site-footer a { color: #e3ecf3; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer h5 { color: #fff; font-size: 1rem; margin-bottom: 1rem; }
.site-footer .social a { font-size: 1.3rem; margin-right: .8rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); font-size: .82rem; }

.map-embed { border: 0; width: 100%; min-height: 360px; border-radius: var(--radius); }
.admin-edit-link { position: fixed; bottom: 18px; right: 18px; z-index: 1050; }

@media (max-width: 991.98px) {
    .site-header .search-form { max-width: none; margin: .75rem 0; }
}

/* Slider news in homepage ------------------------------------------------- */
.news-slider { background: var(--surface); }
.news-slide { background: #fff; border: 1px solid #e3e9ef; border-radius: var(--radius); overflow: hidden; min-height: 360px; }
.news-slide-img { background: #fff; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.news-slide-img img { width: 100%; height: 100%; max-height: 340px; object-fit: contain; }
.news-slide-body { padding: 1.75rem 2rem; display: flex; flex-direction: column; }
.news-slide-text { position: relative; max-height: 190px; overflow: hidden; color: var(--muted); font-size: .95rem; }
.news-slide-text::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 48px; background: linear-gradient(rgba(255,255,255,0), #fff); }
/* i testi importati hanno stili inline (colori, dimensioni): li uniformiamo nell'anteprima */
.news-slide-text * { font-size: inherit !important; color: inherit !important; text-align: left !important; }
.news-slide-text img, .news-slide-text iframe, .news-slide-text table { display: none; }
.news-carousel .carousel-item { transition-duration: .5s; }
.news-carousel-nav .carousel-indicators [data-bs-target] { background-color: var(--brand-blue); width: 24px; height: 4px; border-radius: 2px; border: 0; margin: 0 3px; opacity: .3; }
.news-carousel-nav .carousel-indicators .active { opacity: 1; }
.news-carousel-nav .btn { width: 34px; height: 34px; padding: 0; border: 1px solid #dbe3ea; flex-shrink: 0; }
.news-carousel-nav .carousel-indicators { flex-wrap: wrap; justify-content: center; row-gap: 6px; }
@media (max-width: 767.98px) {
    .news-slide-img img { max-height: 220px; }
    .news-slide-body { padding: 1.25rem; }
    .news-carousel-nav { gap: .5rem !important; }
    .news-carousel-nav .carousel-indicators [data-bs-target] { width: 14px; margin: 0 2px; }
}
