/* Pagina del dipartimento ChiBioFarAm (scienze chimiche, biologiche, farmaceutiche e ambientali): "la tavola periodica".
   Intro da laboratorio (esagoni delle molecole, bolle che salgono, una molecola con i suoi gruppi), indice come tavola periodica
   (cinque elementi veri con il loro numero atomico), sezioni come esperimenti, divisori con l'anello di benzene,
   finale come equazione di reazione. Si appoggia a mift.css e dipartimento.css. Prefisso cf-. */

/* ---------- intro ---------- */
.mf-hero.cf-hero { position: relative; isolation: isolate; overflow: hidden; margin-bottom: 52px; color: #1a1c1e; text-align: left; background-color: #e8f3fb; }
.mf-hero.cf-hero::before { display: block; content: ""; position: absolute; inset: 0; z-index: -2; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 66L0 50V16L28 0l28 16v34zM28 100L0 84V66m28 0l28 16v18' fill='none' stroke='%231B6FA8' stroke-opacity='.2' stroke-width='1.5'/%3E%3C/svg%3E") 0 0 / 56px 100px; }
/* bolle: salgono dal fondo e svaniscono */
.cf-bolla { position: absolute; z-index: -1; bottom: -30px; left: var(--x); width: var(--s); height: var(--s); border: 2px solid #1B6FA8; border-radius: 50%; background: rgba(143,208,255,.25); opacity: 0; animation: cf-sale var(--t) ease-in infinite; animation-delay: var(--d); }
@keyframes cf-sale { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: .75; } 100% { transform: translate(var(--dx), -520px); opacity: 0; } }
/* la molecola */
.cf-mol { position: absolute; z-index: -1; top: 14px; right: 24px; width: 240px; height: auto; pointer-events: none; opacity: .55; }
.cf-mol path, .cf-mol circle { fill: none; stroke: #005687; stroke-width: 2; stroke-linecap: round; }
.cf-mol text { fill: #005687; font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 17px; }

.cf-in { max-width: 1280px; margin: 0 auto; padding: 44px 16px 52px; display: grid; gap: 34px; }
.cf-testo { align-self: center; }
.cf-pre { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #1B6FA8; }
.cf-pre::before { content: ""; width: 22px; height: 3px; background: #1B6FA8; }
.mf-hero.cf-hero .cf-testo h1 { max-width: 12ch; margin: 0; font-size: clamp(38px, 11vw, 54px); line-height: 1.02; letter-spacing: -.02em; color: #005687; text-wrap: balance; }
.mf-hero.cf-hero .cf-testo h1 em { color: #005687; font-style: normal; background: linear-gradient(transparent 60%, #8fd0ff 60% 92%, transparent 92%); padding: 0 4px; margin: 0 -4px; }
.mf-hero.cf-hero .dp-lead { max-width: 30rem; margin: 20px 0 0; font-size: 17px; line-height: 1.55; color: #1a1c1e; }

/* ---------- la tavola periodica: l'indice ---------- */
.cf-tavola-w { align-self: center; justify-self: center; width: 100%; max-width: 500px; }
.cf-tavola { padding: 16px 14px 14px; border: 2px solid #005687; border-radius: 12px; background: #fff; box-shadow: 7px 7px 0 #1B6FA8; }
.cf-t-t { display: flex; justify-content: space-between; gap: 8px; margin: 0 4px 12px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #1B6FA8; }
.cf-t-t b { color: #005687; }
.cf-el { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cf-el li:last-child { grid-column: 1 / -1; }
.mf-pagina .cf-el a, .cf-el a { position: relative; display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: center; gap: 4px 12px; min-height: 76px; padding: 8px 12px 8px 8px; border: 2px solid #005687; border-radius: 8px; background: var(--cf-t, #e3eefa); color: #1a1c1e; text-decoration: none; transition: transform 150ms ease, box-shadow 150ms ease; }
.cf-el li:nth-child(1) a { --cf-t: #e3eefa; } .cf-el li:nth-child(2) a { --cf-t: #d3e6f7; } .cf-el li:nth-child(3) a { --cf-t: #c4def4; } .cf-el li:nth-child(4) a { --cf-t: #d3e6f7; } .cf-el li:nth-child(5) a { --cf-t: #e3eefa; }
.cf-el a:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 #005687; }
.cf-el a:active { transform: none; box-shadow: none; }
.cf-el a:focus-visible { outline: 3px solid #005687; outline-offset: 3px; }
.cf-sim { position: relative; display: flex; align-items: center; justify-content: center; align-self: stretch; min-height: 58px; border-radius: 6px; background: #fff; border: 2px solid #005687; font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 27px; color: #005687; }
.cf-sim small { position: absolute; top: 2px; left: 5px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 10.5px; font-weight: 700; color: #1B6FA8; }
.cf-nm { display: grid; gap: 1px; min-width: 0; }
.cf-nm b { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 15px; line-height: 1.2; color: #005687; }
.cf-nm span { font-size: 12.5px; line-height: 1.35; color: #41474f; }
.cf-t-f { margin: 12px 4px 0; padding-top: 10px; border-top: 2px dashed #9ec0de; font-size: 12px; letter-spacing: .06em; color: #5c6670; text-align: center; }

@media (min-width: 900px) {
  .cf-in { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; padding: 64px 40px 72px; }
  .mf-hero.cf-hero .cf-testo h1 { font-size: 68px; line-height: 1; }
  .mf-hero.cf-hero .dp-lead { font-size: 19px; }
  .cf-tavola-w { justify-self: end; }
  .cf-mol { right: auto; left: 40%; top: 18px; width: 300px; }
}

/* ---------- sezioni come esperimenti ---------- */
.dp-pagina .mf-sh .cf-kk { gap: 12px; color: #1B6FA8; }
.cf-tag { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 14px 0 8px; border-radius: 6px; background: #005687; color: #fff; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-weight: 700; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; }
.cf-tag::before { content: ""; width: 14px; height: 16px; background: #8fd0ff; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }

/* ---------- divisori: anello di benzene ---------- */
.dp-div.cf-div { gap: 16px; }
.dp-div.cf-div::before, .dp-div.cf-div::after { height: 6px; border-top: 2px solid #1B6FA8; border-bottom: 2px solid #1B6FA8; border-radius: 0; background: none; }
.cf-div span { position: relative; flex: none; width: 52px; height: 58px; background: #005687; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.cf-div span::after { content: ""; position: absolute; inset: 0; margin: auto; width: 26px; height: 26px; border: 3px solid #fff; border-radius: 50%; }

/* ---------- finale: l'equazione ---------- */
.mf-cta.cf-cta { max-width: 860px; margin: 56px auto; padding: 34px 24px 30px; border: 2px solid #005687; border-radius: 12px; background: #fff; box-shadow: 7px 7px 0 #1B6FA8; text-align: center; }
.mf-cta.cf-cta .cf-fin { display: block; margin: 0 auto 14px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #1B6FA8; }
.mf-cta.cf-cta h2 { max-width: 26ch; margin: 0 auto 12px; font-size: clamp(26px, 6.4vw, 38px); line-height: 1.1; color: #005687; text-wrap: balance; }
.mf-cta.cf-cta p:not(.cf-fin):not(.cf-eq) { max-width: 34rem; margin: 0 auto 24px; font-size: 17px; line-height: 1.55; color: #1a1c1e; }
.mf-cta.cf-cta .cf-eq { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; margin: 0 auto 28px; font-size: 16px; }
.cf-eq span, .cf-eq b { padding: 7px 16px; border: 2px solid #005687; border-radius: 9999px; background: #e3eefa; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-weight: 700; color: #005687; }
.cf-eq b { background: #005687; color: #fff; }
.cf-eq i { font-style: normal; font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 22px; color: #1B6FA8; }
.mf-cta.cf-cta .mf-az { justify-content: center; }
.mf-pagina .cf-cta .mf-btn-pieno { background: #005687; color: #fff; }
.mf-pagina .cf-cta .mf-btn-pieno:hover { background: #00466f; }
.mf-pagina .cf-cta .mf-btn-vuoto { background: #fff; color: #005687; border-color: #005687; }
.mf-pagina .cf-cta .mf-btn-vuoto:hover { background: #e3eefa; }
@media (max-width: 520px) { .mf-cta.cf-cta { padding: 28px 18px 24px; } .mf-cta.cf-cta .mf-az { flex-direction: column; } .mf-cta.cf-cta .mf-btn { width: 100%; } }

@media (max-width: 640px) { .cf-mol { display: none; } }
@media (max-width: 480px) { .cf-el { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) {
  .cf-el { gap: 8px; }
  .cf-el a { grid-template-columns: 52px minmax(0, 1fr); gap: 4px 8px; padding-right: 8px; }
  .cf-sim { font-size: 23px; }
  .cf-nm b { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .cf-bolla { animation: none; opacity: .5; bottom: 20%; }
  .cf-el a { transition: none; }
}
