/* ============================================================
   stile-teoria-limiti-notevoli.css
   Foglio di stile per la pagina "Limiti notevoli" (v3).
   Copia esatta di stile-teoria-limiti-standard.css (stesse
   variabili colore, header/breadcrumb/nav/footer, accordion,
   blocchi esempio, tabelle dati, widget-box, bottone "chiudi
   sezione"), solo rinominata per questa pagina.
   ============================================================ */

:root {
    --green: #009966;
    --green-dk: #00754d;
    --green-lt: #e6f5ee;
    --border: #e0e0e0;
    --muted: #777;
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 10px;
    background-color: #f8f9fa;
    color: #2c3e50;
}

.page-wrap {
    max-width: 1000px;
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    padding: 20px;
}

h1, h2, h3 { text-align: center; }
h2 { color: #2c3e50; }

/* ---------- Contenuti teoria (formule, grafici) ---------- */
.formula {
    display: block;
    text-align: center;
    margin: 15px 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}
/* Rete di sicurezza per le formule "display" non racchiuse in .formula
   (es. dentro .conclusion, .esempio, .box-azzurro): su schermi stretti
   scorrono invece di sporgere dal bordo della pagina. */
mjx-container[display="true"] {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}
.graph-container {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    height: 400px;
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    padding: 14px;
    box-sizing: border-box;
}
.graph-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ---------- Accordion di teoria ---------- */
.accordion-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.accordion-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    background: #ffffff;
}

.accordion-btn {
    display: block;
    width: 100%;
    text-align: left;
    background-color: var(--green-lt);
    border: none;
    border-left: 5px solid var(--green);
    color: var(--green-dk);
    font-size: 1.05rem;
    font-weight: 700;
    padding: 14px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.accordion-btn:hover { background-color: #d7ede1; }
.accordion-btn::before {
    content: "▸ ";
    display: inline-block;
    margin-right: 4px;
}

.accordion-section {
    display: none;
    padding: 18px 22px 22px;
    border-top: 1px solid var(--border);
    line-height: 1.6;
}
.accordion-section h2 {
    text-align: left;
    color: var(--green-dk);
    font-size: 1.05rem;
    margin: 20px 0 8px;
}
.accordion-section h2:first-child { margin-top: 0; }
.accordion-section h3 {
    text-align: left;
    color: var(--green-dk);
    font-size: 1rem;
    margin: 0 0 8px;
}

/* ---------- Blocchi "esempio svolto" ---------- */
.esempio {
    margin-top: 15px;
    padding: 15px;
    background-color: var(--green-lt);
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

/* ---------- Tabelle di dati (es. tabelle a doppia entrata) ---------- */
.tabella-dati {
    border-collapse: collapse;
    margin: 15px auto;
    font-size: 0.95rem;
    background: #ffffff;
    border: 3px solid var(--green);
}
.tabella-dati th, .tabella-dati td {
    border: 1px solid var(--border);
    padding: 7px 10px;
    text-align: center;
}
.tabella-dati th {
    background-color: var(--green);
    color: #ffffff;
    font-weight: 600;
}
.tabella-dati tr:first-child th:not(:first-child) {
    background-color: #eaf3fb;
    color: #1a5f9e;
    font-weight: 700;
}
.tabella-dati td:first-child, .tabella-dati th:first-child {
    background-color: #f3f4f4;
    color: var(--green-dk);
    font-weight: 600;
    border-left: 3px solid var(--green);
}
.tabella-dati th:first-child {
    background-color: #f3f4f4;
    color: var(--green-dk);
    font-weight: 700;
    border-left: 3px solid var(--green);
}

/* ---------- Header v3 (dashed border, logo, breadcrumb) ---------- */
.header-box {
    border: 2px dashed var(--green);
    padding: 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    row-gap: 8px;
    background-color: #ffffff;
    cursor: pointer;
    margin-bottom: 15px;
    border-radius: 6px;
}
.header-box .brand-left,
.header-box .brand-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.header-box img { height: 50px; width: auto; }
.header-box .site-url { font-size: 0.85rem; color: #555; font-weight: 600; }
.header-box .logo-block { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.header-box .since { font-size: 0.72rem; color: #999; font-style: italic; }

.breadcrumb {
    font-size: 0.9rem;
    margin-bottom: 20px;
    color: #666;
}
.breadcrumb a {
    color: var(--green);
    text-decoration: none;
    font-weight: 600;
}

.main-menu {
    background-color: #f4f7f5;
    border: 1px solid #009900;
    border-radius: 8px;
    margin-bottom: 25px;
    padding: 5px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.main-menu a {
    display: inline-block;
    padding: 10px 20px;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.main-menu a:hover, .main-menu a.current {
    background-color: var(--green);
    color: #ffffff;
}

.main-page-title {
    color: var(--green);
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.sottotitolo {
    text-align: center;
    color: var(--muted);
    font-size: 1.05rem;
    font-style: italic;
    margin-top: 0;
    margin-bottom: 20px;
}
.dsa-link {
    text-align: center;
    margin: 8px 0 20px;
}
.dsa-link a {
    color: #e68a00;
    font-weight: bold;
    text-decoration: none;
    border-bottom: 2px solid #e68a00;
}

.page-intro {
    background-color: #eaf3fb;
    border: 1px solid var(--border);
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    line-height: 1.6;
}

.box-azzurro {
    background-color: #eaf3fb;
    border: 1px solid var(--border);
    padding: 12px 20px;
    margin: 15px 0;
    border-radius: var(--radius);
}
.box-azzurro .formula { margin: 8px 0; }

/* ---------- Barra di collegamento rapido a pagine correlate ---------- */
.quick-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 0 25px;
    padding: 10px;
    background-color: #eaf7f1;
    border: 1px solid var(--green);
    border-radius: 8px;
}
.quick-links a {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 999px;
    background: #f4f7f5;
    border: 1.5px solid #a8d9c4;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.quick-links a:hover {
    background: #eaf3fb;
    border-color: #3b82c4;
    color: #3b82c4;
}
@media (max-width: 600px) {
    .quick-links {
        flex-direction: column;
    }
    .quick-links a {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

/* ---------- Footer v3 ---------- */
footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 0.88rem;
    color: #555;
}
.license-box {
    background-color: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    font-size: 0.8rem;
    color: #777;
}
.footer-nav-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}
.footer-nav-btn {
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.footer-nav-btn.btn-index { background-color: #7b1f2e; }
.footer-nav-btn.btn-index:hover { background-color: #5a1722; }
.footer-nav-btn.btn-standard { background-color: #3498db; }
.footer-nav-btn.btn-standard:hover { background-color: #2980b9; }
.footer-nav-btn.btn-questionario { background-color: var(--green-dk); }
.footer-nav-btn.btn-questionario:hover { background-color: #00563a; }
.footer-nav-btn.btn-dsa { background-color: #ff9800; }
.footer-nav-btn.btn-dsa:hover { background-color: #e68a00; }
.footer-nav-btn.btn-stampa { background-color: #9c27b0; }
.footer-nav-btn.btn-stampa:hover { background-color: #7b1fa2; }
.footer-nav-btn.btn-questionario2 { background-color: #00838f; }
.footer-nav-btn.btn-questionario2:hover { background-color: #006064; }

p.contatore {
    margin-top: 12px;
    font-size: 0.8rem;
    color: #aaa;
    font-style: italic;
}
.validation-link {
    margin-top: 15px;
    font-size: 0.8rem;
    color: #999;
}
.validation-link a {
    color: #999;
    text-decoration: none;
}
.validation-link a:hover {
    text-decoration: underline;
}

/* ---- Bottone torna su (flottante, appare dopo 300px di scroll) ---- */
#btn-top {
    position: fixed;
    bottom: 20px;
    right: 4px;
    background: #9C27B0;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: background 0.2s;
}
#btn-top:hover { background: #7a00cc; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

@media print {
    #btn-top, .main-menu, footer, .header-box, .quick-links {
        display: none !important;
    }
}

@media (max-width: 420px) {
    .header-box img { height: 36px; }
    .header-box .site-url { font-size: 0.75rem; }
}

/* ---------- Contenitore con scroll orizzontale per tabelle larghe ---------- */
.tabella-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 15px 0;
    box-sizing: border-box;
}
.tabella-scroll .tabella-dati {
    margin: 0 auto;
}
@media (max-width: 480px) {
    .tabella-dati { font-size: 0.85rem; }
    .tabella-dati th, .tabella-dati td { padding: 5px 7px; }
}

/* ---------- Widget interattivo di calcolo ---------- */
.widget-box {
    margin-top: 15px;
    padding: 15px 18px;
    background-color: #ffffff;
    border: 2px solid var(--green);
    border-radius: var(--radius);
}
.widget-box h3 {
    text-align: left;
    color: var(--green-dk);
    margin: 0 0 8px;
}
.widget-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
}
.widget-controls label {
    font-weight: 600;
    color: #2c3e50;
}
.widget-controls input[type="number"] {
    width: 90px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
}
.widget-btn {
    background-color: var(--green);
    color: #ffffff;
    border: none;
    padding: 9px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
.widget-btn:hover { background-color: var(--green-dk); }
.widget-risultato {
    min-height: 1.4rem;
    padding: 10px 14px;
    background-color: var(--green-lt);
    border-radius: 6px;
    font-size: 1.05rem;
    word-break: break-all;
}
.widget-risultato.warning {
    background-color: #fff3e0;
    color: #b25900;
}

/* ---------- Diagrammi/grafici a coppia (funzione + immagine) ---------- */
.grafici-coppia {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 18px 0;
}
.grafici-coppia figure {
    margin: 0;
    text-align: center;
    flex: 1 1 260px;
    max-width: 320px;
}
.grafici-coppia img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.grafici-coppia figcaption {
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--muted);
}
.solution .conclusion,
.esempio .conclusion,
.conclusion {
    background: var(--green-lt);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 16px;
    margin-top: 14px;
    font-weight: 600;
}

/* ---------- Pulsante "Chiudi sezione" in fondo a ciascuna sezione dell'accordion ---------- */
.btn-nascondi-wrap { text-align: center; }
.btn-nascondi {
    background-color: white;
    color: #e65100;
    border: 2px solid #e65100;
    padding: 10px 25px;
    cursor: pointer;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    display: inline-block;
    margin: 10px auto;
    transition: all 0.3s ease;
}
.btn-nascondi:hover { background-color: #e65100; color: white; box-shadow: 0 4px 8px rgba(230,81,0,0.3); transform: translateY(-2px); }

/* ---------- Segnaposto sezioni ancora da sviluppare ---------- */
.da-sviluppare {
    background-color: #fff8e1;
    border: 1px dashed #e6a800;
    border-radius: var(--radius);
    padding: 14px 18px;
    color: #8a6d00;
    font-style: italic;
}
