/* =====================================================================
   Studio Taglione - Ponte tra il vecchio template e la nuova grafica
   File: assets/css/st-legacy.css
   Caricato DOPO style.css nelle pagine convertite (body.st-legacy):
   riallinea titoli, pulsanti, card, moduli e colori del vecchio template
   all'aspetto di home, modelli e guide. Le regole usano :where() dove
   serve a non scavalcare gli stili propri di ciascuna pagina.
   ===================================================================== */

body.st-legacy { background: #ffffff; color: var(--st-ink); }

/* ---------- Tipografia ---------- */
:where(.st-legacy) :is(h1, h2, h3, h4, h5, h6) {
    font-family: "Poppins", system-ui, sans-serif;
    color: var(--st-ink);
    font-weight: 600;
    line-height: 1.25;
}
:where(.st-legacy) h1 { font-size: 40px; font-weight: 700; line-height: 1.15; margin-bottom: 14px; }
:where(.st-legacy) h2 { font-size: 28px; }
:where(.st-legacy) h3 { font-size: 22px; }
:where(.st-legacy) h4 { font-size: 19px; }
:where(.st-legacy) h5 { font-size: 17px; }
:where(.st-legacy) p { color: var(--st-muted); font-size: 16px; line-height: 1.75; }
@media (max-width: 767.98px) {
    :where(.st-legacy) h1 { font-size: 30px; }
    :where(.st-legacy) h2 { font-size: 24px; }
}

/* Titoli di sezione del template */
.st-legacy .section-title { margin-bottom: 32px; }
.st-legacy .section-title span {
    display: block; font-size: 14px; font-weight: 600; color: var(--st-accent-text);
    text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px;
}
.st-legacy .section-title :is(h1, h2) { text-transform: none; font-size: 36px; font-weight: 700; color: var(--st-ink); }
.st-legacy .section-title h1 { font-size: 40px; }
.st-legacy .section-title :is(h1, h2)::after, .st-legacy .section-title :is(h1, h2)::before { display: none; }
@media (max-width: 767.98px) {
    .st-legacy .section-title :is(h1, h2) { font-size: 28px; }
}

/* ---------- Link ---------- */
:where(.st-legacy) a:visited { color: var(--st-accent-dark); }
:where(.st-legacy) a:hover, :where(.st-legacy) a:focus { color: var(--st-accent-text); }
.st-legacy a:is(.btn, [class*="btn-"], .primary-btn, .site-btn, .call_to_action):visited,
.st-legacy a:is(.btn, [class*="btn-"], .primary-btn, .site-btn, .call_to_action):hover { color: #fff; }
.st-legacy a:is([class*="btn-outline"], .btn-light, .btn-link):visited { color: var(--st-ink); }

/* ---------- Spaziature ---------- */
.st-legacy .spad { padding-top: 56px; padding-bottom: 64px; }
@media (max-width: 767.98px) { .st-legacy .spad { padding-top: 36px; padding-bottom: 44px; } }
.st-legacy .container { max-width: 1180px; }

/* ---------- Pulsanti ---------- */
.st-legacy :is(.primary-btn, .site-btn, .call_to_action, .btn-primary, .btn-success, .latest__btn) {
    background: var(--st-accent) !important; border: 1px solid var(--st-accent) !important; color: #fff !important;
    border-radius: 8px !important; font-family: inherit; font-weight: 700; letter-spacing: 0;
    text-transform: none; box-shadow: none; transition: background .15s;
}
.st-legacy :is(.primary-btn, .site-btn, .call_to_action, .btn-primary, .btn-success, .latest__btn):hover {
    background: var(--st-accent-dark) !important; border-color: var(--st-accent-dark) !important; color: #fff !important;
}
.st-legacy :is(.primary-btn, .call_to_action, .site-btn)::before,
.st-legacy :is(.primary-btn, .call_to_action, .site-btn)::after { display: none !important; }
.st-legacy .call_to_action { display: block; text-align: center; padding: 14px 20px; font-size: 16px; }
.st-legacy .call_to_action + .call_to_action { margin-top: 12px; }
.st-legacy .call_to_action:first-child { background: var(--st-navy) !important; border-color: var(--st-navy) !important; }
.st-legacy .btn-outline-primary { color: var(--st-accent-dark); border-color: var(--st-accent); border-radius: 8px; }
.st-legacy .btn-outline-primary:hover { background: var(--st-accent); color: #fff; }
.st-legacy .btn-outline-secondary { border-radius: 8px; }
.st-legacy .btn-lg { font-size: 18px; padding: 12px 28px; }
.st-legacy .btn:focus, .st-legacy .btn:focus-visible { box-shadow: 0 0 0 3px rgba(200, 75, 6, .25); }

/* ---------- Card e riquadri ---------- */
.st-legacy .card { border: 1px solid var(--st-line); border-radius: var(--st-radius); overflow: hidden; }
.st-legacy .card-title { font-weight: 600; color: var(--st-ink); }
.st-legacy .card-footer { background: #fff; border-top: 1px solid var(--st-line); }
.st-legacy .alert { border-radius: 10px; }
.st-legacy .alert-info { background: #f1f5f9; border-color: #dbe3ec; color: var(--st-text); }
.st-legacy .table { color: var(--st-text); }
.st-legacy .table thead th { background: var(--st-bg); border-bottom-width: 1px; }

/* Card di blog, guide e servizi del vecchio template */
.st-legacy :is(.services__item, .blog__item, .latest__item) {
    background: #fff; border: 1px solid var(--st-line); border-radius: var(--st-radius); overflow: hidden;
    box-shadow: none; transition: box-shadow .15s, transform .15s;
}
.st-legacy :is(.services__item, .blog__item, .latest__item):hover { box-shadow: 0 8px 24px rgba(26, 43, 60, .10); transform: translateY(-2px); }
.st-legacy :is(.services__item, .blog__item, .latest__item) img { width: 100%; height: auto; display: block; }
.st-legacy :is(.blog__item__text, .latest__item__text) { padding: 18px 20px; }
.st-legacy :is(.blog__item__text, .latest__item__text) :is(h2, h4, h5) { text-transform: none !important; font-size: 16px !important; line-height: 1.4; font-weight: 600; }

/* Barra laterale */
.st-legacy :is(.blog__sidebar__about, .blog__sidebar__item, .sidebar-box) {
    background: #fff; border: 1px solid var(--st-line); border-radius: var(--st-radius); padding: 22px;
}

/* ---------- Moduli ---------- */
.st-legacy :is(.form-control, .form-select, .contact__form input, .contact__form textarea) {
    border: 1px solid var(--st-field); border-radius: 8px; font-family: inherit; font-size: 16px; color: var(--st-ink);
}
.st-legacy :is(.form-control, .form-select):focus { border-color: var(--st-accent); box-shadow: 0 0 0 3px rgba(200, 75, 6, .18); }
.st-legacy :is(.form-control, .form-select) { min-height: 44px; }
.st-legacy textarea.form-control { min-height: 96px; }
.st-legacy label { color: var(--st-ink); font-weight: 500; }
.st-legacy .input-group-text { border-radius: 0 8px 8px 0; border-color: var(--st-field); }

/* ---------- Testi lunghi (blog, policy, schede) ---------- */
.st-legacy :is(.blog__details__text, .blog__details__content) { color: var(--st-text); }
.st-legacy .blog__details__text :is(p, li) { color: var(--st-text); font-size: 17px; line-height: 1.8; }
.st-legacy .blog__details__title h1 { font-size: 40px; }
@media (max-width: 767.98px) {
    .st-legacy .blog__details__text :is(p, li) { font-size: 16px; }
    .st-legacy .blog__details__title h1 { font-size: 30px; }
}

/* Breadcrumb Bootstrap */
.st-legacy .breadcrumb { background: transparent; padding: 0; margin-bottom: 18px; font-size: 13px; }
.st-legacy .breadcrumb a { color: var(--st-soft); }

/* Accordion / FAQ con <details> */
.st-legacy details { border: 1px solid var(--st-line); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; background: #fff; }
.st-legacy details summary { font-weight: 600; color: var(--st-ink); cursor: pointer; }

/* Icone dei pagamenti, sfondi scuri del template */
.st-legacy .set-bg { background-size: cover; background-position: center; }

/* Testo giustificato del vecchio template: allineato a sinistra (piu' leggibile, niente buchi su mobile) */
.st-legacy :is(.text-justify, [style*="text-align: justify"], [style*="text-align:justify"], .blog__details__text, .blog__details__text p) { text-align: left !important; }

/* Link nel testo sottolineati (accessibilita') */
.st-legacy :is(.blog__details__text, .seo-content, .seo-faq, .sezione, .contact__text) p a,
.st-legacy :is(.blog__details__text, .seo-content) li a { text-decoration: underline; text-underline-offset: 2px; }

/* Pagine dei libri: titolo chiaro sul fondo blu */
.st-legacy .libro-hero :is(h1, h2, h3) { color: #fff; }

/* Tabelle larghe: scorrono dentro il riquadro invece di allargare la pagina */
@media (max-width: 767.98px) {
    .st-legacy :is(.table-custom, .blog__details__text table, .blog__details__content table) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Pulsanti delle schede strumenti e pulsanti "info" */
.st-legacy :is(.btn-tool, .btn-info) {
    background: var(--st-accent) !important; border-color: var(--st-accent) !important; color: #fff !important; border-radius: 8px;
}
.st-legacy :is(.btn-tool, .btn-info):hover { background: var(--st-accent-dark) !important; border-color: var(--st-accent-dark) !important; }

/* Card guide/blog del vecchio template: testo con margini interni */
.st-legacy .services__item { padding-bottom: 14px; cursor: pointer; }
.st-legacy .services__item > :is(h4, h5, p, span) { padding-left: 18px; padding-right: 18px; }
.st-legacy .services__item > :is(h4, h5) { margin-top: 14px; font-size: 16px; line-height: 1.4; }

/* Contrasto e area cliccabile dei link nelle barre laterali dei calcolatori */
.st-legacy .text-primary { color: var(--st-accent-dark) !important; }
.st-legacy :is(.card-body, .related-tools, aside) li a,
.st-legacy .card-body a.d-block { display: inline-block; min-height: 24px; padding: 3px 0; }
.st-legacy :is(.stp, .tool-category) { color: #5b6878 !important; }
