/* =====================================================================
   Sport and Advertising — integrazioni al tema originale
   (font self-hosted, accessibilità, form, cookie banner, news, legal)
   ===================================================================== */

/* Roboto self-hosted (sostituisce Google Fonts: niente IP inviati a terzi) */
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 100; font-display: swap; src: url('../fonts/roboto-100.woff2') format('woff2'); }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 300; font-display: swap; src: url('../fonts/roboto-300.woff2') format('woff2'); }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/roboto-400.woff2') format('woff2'); }
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/roboto-700.woff2') format('woff2'); }

:root { --sa-accent: #c14240; --sa-dark: #1c1c1c; --sa-muted: #6b6b6b; }

/* <main> eredita gli spazi delle <section> del tema */
main > [class*="container"] > .row > [class*="col-"] { margin-top: 10px; margin-bottom: 10px; }
.preloader { display: none !important; }

/* Accessibilità */
.sa-skip { position: absolute; left: -9999px; top: 0; z-index: 10000; background: var(--sa-accent); color: #fff; padding: 10px 16px; }
.sa-skip:focus { left: 10px; top: 10px; color: #fff; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--sa-accent); outline-offset: 2px; }
.toggle_menu { cursor: pointer; }

/* Contenuti */
.sa-content { background: #fff; padding: 24px; }
.sa-content h1 { font-size: 30px; margin-top: 0; margin-bottom: 20px; line-height: 1.2; }
.sa-content h2 { font-size: 22px; margin-top: 28px; }
.sa-content img { max-width: 100%; height: auto; }
.sa-content iframe { max-width: 100%; }
.mainmenu .lang-switch a { display: inline-block; padding-left: 4px; padding-right: 4px; }
.mainmenu .lang-switch img { vertical-align: middle; }
.h4.entry-title, h3.entry-title.h4 { font-size: 18px; }

/* Breadcrumb */
.sa-breadcrumb ol { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--sa-muted); }
.sa-breadcrumb li { display: inline; }
.sa-breadcrumb li + li:before { content: "›"; padding: 0 8px; color: #aaa; }
.sa-breadcrumb a { color: var(--sa-muted); }
.sa-breadcrumb a:hover { color: var(--sa-accent); }

/* Griglia news */
.sa-news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; margin-top: 10px; }
.sa-news-card { border: 1px solid #e6e6e6; padding: 12px; background: #fff; transition: box-shadow .2s, transform .2s; }
.sa-news-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); transform: translateY(-2px); }
.sa-news-img { display: flex; align-items: center; justify-content: center; height: 170px; overflow: hidden; background: #f5f5f5; margin-bottom: 12px; }
.sa-news-img img { max-height: 170px; width: auto; max-width: 100%; object-fit: contain; }
.sa-news-card h2, .sa-news-card h3 { margin: 6px 0 8px; font-size: 18px; line-height: 1.3; }
.sa-news-sub { color: var(--sa-muted); font-style: italic; }
.sa-pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin-top: 28px; }
.sa-related { margin-top: 24px; }
.sa-article .item-media img { width: 100%; height: auto; }
.sa-article-body { margin-top: 12px; }

/* Ricerca */
.sa-search { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.sa-search input { flex: 1 1 240px; }
.sa-result { border-bottom: 1px solid #eee; padding: 12px 0; }

/* Pagine legali */
.sa-legal .sa-legal-meta { color: var(--sa-muted); font-size: 13px; }
.sa-table { font-size: 14px; }
.sa-table th { background: #f6f6f6; }
.sa-legal { overflow-x: auto; }

/* Form contatti */
.sa-contact .sa-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.sa-contact .sa-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.4; margin-bottom: 10px; }
.sa-contact .sa-check input { margin-top: 3px; flex: 0 0 auto; }
.sa-contact .sa-check label { font-weight: 400; text-transform: none; letter-spacing: 0; margin: 0; }
.sa-contact .sa-check a { text-decoration: underline; }
.sa-contact .has-error .form-control, .sa-contact .form-control[aria-invalid="true"] { border-color: #e74c3c; box-shadow: 0 0 0 2px rgba(231,76,60,.25); }
.sa-contact .sa-field-err { color: #ff8a80; font-size: 12px; margin: 4px 0 0; }
.sa-form-msg { padding: 12px 14px; margin-bottom: 16px; border-radius: 4px; font-weight: 600; }
.sa-form-msg.is-ok, .sa-form-msg .sa-ok { background: #e8f8ee; color: #17803d; }
.sa-form-msg.is-err, .sa-form-msg .sa-err { background: #fdecea; color: #b3261e; }
.sa-form-msg p { margin: 0; }
.sa-contact button[disabled] { opacity: .6; cursor: wait; }
.sa-content .sa-contact label { display: block; }
.sa-content .sa-contact .sa-check label { display: inline; }
.sa-content .sa-contact i[class^="rt-icon2"] { display: none; }

/* Carosello loghi (sostituisce <marquee>) */
.slider-area h2 { text-align: center; font-size: 42px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; margin: 60px 0 30px; color: #000; }
.logo-marquee { overflow: hidden; border-radius: 180px; padding: 2rem 0; background: #fff; box-shadow: rgba(0,0,0,.25) 0 5px 15px; }
.logo-track { display: flex; width: max-content; animation: sa-marquee 40s linear infinite; align-items: center; }
.logo-marquee:hover .logo-track { animation-play-state: paused; }
.logo-item { padding: 0 24px; flex: 0 0 auto; }
.logo-item img { max-height: 70px; width: auto; }
@keyframes sa-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (max-width: 767px) { .slider-area h2 { font-size: 26px; } .logo-marquee { border-radius: 0; } }
@media (prefers-reduced-motion: reduce) { .logo-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; } .logo-item[aria-hidden="true"] { display: none; } }

/* Link "Modifica" per l'admin loggato */
.sa-admin-edit { position: fixed; right: 16px; bottom: 16px; z-index: 9998; background: var(--sa-accent); color: #fff !important; padding: 10px 16px; border-radius: 30px; box-shadow: 0 4px 14px rgba(0,0,0,.3); font-weight: 600; }

/* ---------------- Cookie banner ---------------- */
.sa-cc[hidden], .sa-cc [hidden] { display: none !important; }
.sa-cc-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 9999; max-width: 980px; margin: 0 auto; background: #fff; color: #222; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.35); padding: 22px 24px 18px; font-size: 14px; line-height: 1.5; }
.sa-cc-title { font-size: 17px; font-weight: 700; margin: 0 30px 6px 0; color: #111; }
.sa-cc-banner p { margin: 0 0 12px; }
.sa-cc a { color: var(--sa-accent); text-decoration: underline; }
.sa-cc-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.sa-cc-btn { border: 2px solid #222; background: #fff; color: #222; padding: 9px 18px; border-radius: 6px; font-weight: 700; cursor: pointer; font-size: 14px; min-width: 130px; }
.sa-cc-btn:hover { background: #222; color: #fff; }
.sa-cc-btn[data-cc="accept"], .sa-cc-btn[data-cc="reject"] { background: #222; color: #fff; }
.sa-cc-btn[data-cc="accept"]:hover, .sa-cc-btn[data-cc="reject"]:hover { background: var(--sa-accent); border-color: var(--sa-accent); }
.sa-cc-x { position: absolute; top: 8px; right: 12px; background: none; border: 0; font-size: 28px; line-height: 1; color: #555; cursor: pointer; padding: 4px 8px; }
.sa-cc-modal { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sa-cc-panel { position: relative; background: #fff; color: #222; border-radius: 10px; max-width: 560px; width: 100%; max-height: 90vh; overflow: auto; padding: 24px; font-size: 14px; }
.sa-cc-cat { border: 1px solid #e5e5e5; border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
.sa-cc-cat label { margin: 0; cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 400; }
.sa-cc-cat p { margin: 6px 0 0; color: #555; font-size: 13px; }
.sa-cc-small { margin: 12px 0 0; font-size: 12px; text-align: right; }
@media (max-width: 600px) { .sa-cc-btn { flex: 1 1 100%; } .sa-cc-banner { left: 8px; right: 8px; bottom: 8px; padding: 18px; } }

/* Il tema nasconde le label dei form (display:none): le rendiamo accessibili agli screen reader
   e visibili per le caselle privacy/marketing */
.contact-form.sa-contact label[for] { display: block; position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.contact-form.sa-contact .sa-check label[for] { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; display: inline; }
.sa-content .contact-form.sa-contact label[for] { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; display: block; }
.sa-content .contact-form.sa-contact .sa-check label[for] { display: inline; }
.page_footer .sa-contact .sa-check label, .page_footer .sa-contact .sa-check a { color: #ddd; }
.page_banners .item-content h4 { font-size: clamp(15px, 1.7vw, 26px); line-height: 1.25; }
.page_banners .item-content p { font-size: 13px; }

/* Captcha somma */
.sa-captcha { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.contact-form.sa-contact .sa-captcha .sa-captcha-q { font-size: 20px; font-weight: 700; letter-spacing: 1px; white-space: nowrap; color: inherit; }
.page_footer .contact-form.sa-contact .sa-captcha .sa-captcha-q { color: #fff; }
.sa-captcha-q small { font-size: 12px; font-weight: 400; letter-spacing: 0; opacity: .8; margin-right: 6px; }
.sa-captcha input[name="captcha"] { max-width: 110px; text-align: center; font-size: 18px; font-weight: 700; padding-left: 12px !important; }
.sa-content .sa-captcha label { flex-basis: 100%; }
.sa-content .sa-captcha .sa-captcha-q { display: none; }
