/* 🧱 Pagine RSN sul sito (Thema 1.12.0). Colori e caratteri vengono dalla
   veste del sito (variabili --rsn-studio-*), così ogni pagina è uguale alle altre. */
.rp {
    --rp-bg: var(--rsn-studio-bg-color, #fff);
    --rp-text: var(--rsn-studio-body-text-color, #1f2937);
    --rp-head: var(--rsn-studio-heading-color, #0b1f3a);
    --rp-link: var(--rsn-studio-body-link-color, #1d5f93);
    --rp-acc: var(--rsn-studio-button-bg, #0b1f3a);
    --rp-acc-text: var(--rsn-studio-button-text, #fff);
    --rp-scuro: var(--rsn-studio-footer-bg, #0b1f3a);
    --rp-scuro-text: var(--rsn-studio-footer-text, #e5e7eb);
    --rp-r: var(--rsn-studio-button-radius, 8px);
    --rp-w: 1180px;
    --rp-card: color-mix(in srgb, var(--rp-text) 5%, var(--rp-bg));
    --rp-line: color-mix(in srgb, var(--rp-text) 14%, transparent);
    color: var(--rp-text);
    overflow-x: clip;
}
.rp-s { padding: clamp(44px, 7vw, 96px) 0; position: relative; }
.rp-in { max-width: var(--rp-w); margin: 0 auto; padding: 0 20px; position: relative; }
.rp-stretto { max-width: 800px; }
.rp-centro { text-align: center; }
.rp h1, .rp h2, .rp h3 { color: var(--rp-head); margin: 0 0 .5em; line-height: 1.2; }
/* I titoli scritti dentro il testo (h2…h6): colore e maiuscole del Thema, anche se un altro plugin (es. gli stili
   globali di Elementor rimasti dopo il passaggio a Pagine RSN) li colora o mette le Iniziali Maiuscole (Thema 1.18.2). */
body .rp :is(h1, h2, h3, h4, h5, h6) { color: var(--rp-head); text-transform: var(--rsn-studio-heading-text-transform, none); }
.rp-h { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.rp-in > .rp-h, .rp-in > .rp-intro { text-align: center; }
.rp-centro > .rp-h { text-align: center; }
.rp-stretto:not(.rp-centro) > .rp-h { text-align: left; }
.rp-intro { max-width: 720px; margin: 0 auto 32px; font-size: 1.1em; opacity: .85; }
.rp-lead { font-size: clamp(1.05rem, 1.8vw, 1.3rem); opacity: .9; margin: 0 0 28px; }
.rp-testo { font-size: 1.05em; line-height: 1.7; }
.rp-testo a, .rp-scheda a, .rp-faq a { color: var(--rp-link); }
.rp-testo > :last-child { margin-bottom: 0; }

/* Sfondi */
.rp-bg-normale { background: var(--rp-bg); }
.rp-bg-tenue { background: var(--rp-card); --rp-card: var(--rp-bg); }
.rp-bg-scuro { background: var(--rp-scuro); color: var(--rp-scuro-text); --rp-head: #fff; --rp-link: #fbbf24; --rp-card: rgba(255, 255, 255, .06); --rp-line: rgba(255, 255, 255, .14); }
.rp-bg-colore { background: var(--rp-acc); color: var(--rp-acc-text); --rp-head: var(--rp-acc-text); --rp-link: var(--rp-acc-text); --rp-card: rgba(255, 255, 255, .1); --rp-line: rgba(255, 255, 255, .25); }
.rp-bg-colore .rp-btn { background: var(--rp-acc-text); color: var(--rp-acc); }
.rp-sfumato { background-color: var(--rp-scuro); }
.rp-bg-normale.rp-sfumato { --rp-card: rgba(255, 255, 255, .55); --rp-line: rgba(0, 0, 0, .1); }
.rp-titolo { padding-bottom: 0; }
.rp-titolo h1 { font-size: clamp(2rem, 4.4vw, 3rem); }

/* Pulsanti */
.rp-btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: inherit; }
.rp-centro .rp-btns { justify-content: center; }
.rp-btn { display: inline-block; padding: 14px 28px; border-radius: var(--rp-r); background: var(--rp-acc); color: var(--rp-acc-text) !important; font-weight: 700; text-decoration: none !important; border: 2px solid transparent; transition: transform .15s, box-shadow .15s; }
.rp-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, .18); }
.rp-btn--2 { background: transparent !important; border-color: currentColor; color: inherit !important; }
.rp-tf-testo .rp-btn { margin-top: 18px; }

/* Copertina */
.rp-copertina { display: flex; align-items: center; min-height: 52vh; overflow: hidden; }
.rp-alt-bassa { min-height: 36vh; }
.rp-alt-piena { min-height: calc(100vh - 80px); }
.rp-copertina .rp-in { width: 100%; }
.rp-copertina .rp-in > .rp-h { text-align: left; }
.rp-copertina h1, .rp-copertina h2 { font-size: clamp(2.2rem, 5.6vw, 4rem); max-width: 900px; }
.rp-copertina .rp-lead { max-width: 680px; }
.rp-cop-foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rp-con-foto { color: #fff; --rp-head: #fff; background: #000; }
.rp-con-foto::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(0, 0, 0, .72) 0%, rgba(0, 0, 0, .45) 55%, rgba(0, 0, 0, .25) 100%); }
.rp-con-foto .rp-in { z-index: 2; }

/* Testo e foto */
.rp-tf { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.rp-tf--sx .rp-tf-foto { order: -1; }
.rp-tf-foto img, .rp-foto { width: 100%; height: auto; border-radius: 14px; display: block; box-shadow: 0 14px 40px rgba(0, 0, 0, .14); }
.rp-tf > .rp-tf-testo:only-child { grid-column: 1 / -1; max-width: 800px; }

/* Griglie e schede */
/* Griglie: le schede che non riempiono la riga stanno al centro, non a sinistra con un buco. */
.rp-griglia { --rp-gap: 22px; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--rp-gap); }
.rp-griglia > * { flex: 1 1 260px; max-width: 420px; min-width: 0; }
.rp-griglia.rp-col-2 > * { flex: 0 1 calc((100% - var(--rp-gap)) / 2); max-width: none; }
.rp-griglia.rp-col-3 > * { flex: 0 1 calc((100% - 2 * var(--rp-gap)) / 3); max-width: none; }
.rp-griglia.rp-col-4 > * { flex: 0 1 calc((100% - 3 * var(--rp-gap)) / 4); max-width: none; }
.rp-galleria.rp-col-2 { grid-template-columns: repeat(2, 1fr); }
.rp-galleria.rp-col-3 { grid-template-columns: repeat(3, 1fr); }
.rp-galleria.rp-col-4 { grid-template-columns: repeat(4, 1fr); }
.rp-scheda { background: var(--rp-card); border: 1px solid var(--rp-line); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 6px; }
.rp-scheda p { margin: 0; opacity: .9; }
.rp-scheda h3 { font-size: 1.2rem; margin: 6px 0 2px; }
.rp-scheda-foto { width: calc(100% + 48px); max-width: none; margin: -24px -24px 10px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 14px 14px 0 0; height: auto; }
.rp-foto-intera .rp-scheda-foto { object-fit: contain; padding: 18px; box-sizing: border-box; background: color-mix(in srgb, var(--rp-text) 4%, transparent); }
.rp-icona { font-size: 40px; line-height: 1; }
.rp-link { margin-top: auto; padding-top: 8px; font-weight: 700; text-decoration: none; }

/* Domande */
.rp-faq { border-bottom: 1px solid var(--rp-line); }
.rp-faq summary { cursor: pointer; padding: 18px 36px 18px 0; font-weight: 700; font-size: 1.08em; list-style: none; position: relative; color: var(--rp-head); }
.rp-faq summary::-webkit-details-marker { display: none; }
.rp-faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 1.5em; font-weight: 400; transition: transform .2s; }
.rp-faq[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.rp-faq > div { padding: 0 0 18px; opacity: .9; }

/* Galleria */
.rp-galleria { display: grid; gap: 10px; }
.rp-galleria a { display: block; border-radius: 10px; overflow: hidden; }
.rp-galleria img { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; display: block; transition: transform .3s; }
.rp-galleria a:hover img { transform: scale(1.04); }

/* Video */
.rp-video { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; margin: 10px 0 16px; background: #000; }
.rp-video iframe { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }

/* Piani */
.rp-piani { align-items: stretch; }
.rp-piano { position: relative; background: var(--rp-card); border: 1px solid var(--rp-line); border-radius: 16px; padding: 28px 24px; display: flex; flex-direction: column; text-align: center; }
.rp-piano--top { border: 2px solid var(--rp-acc); box-shadow: 0 14px 40px rgba(0, 0, 0, .12); }
.rp-badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--rp-acc); color: var(--rp-acc-text); font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.rp-prezzo { font-size: 2.4rem; font-weight: 800; color: var(--rp-head); line-height: 1.1; }
.rp-sotto { opacity: .7; font-size: .95em; }
.rp-piano ul { list-style: none; margin: 18px 0; padding: 0; text-align: left; }
.rp-piano li { padding: 7px 0 7px 26px; position: relative; border-bottom: 1px solid var(--rp-line); }
.rp-piano li::before { content: "✓"; position: absolute; left: 2px; color: var(--rp-acc); font-weight: 800; }
.rp-bg-scuro .rp-piano li::before, .rp-bg-colore .rp-piano li::before { color: inherit; }
.rp-piano .rp-btn { margin-top: auto; }

/* Numeri */
.rp-numeri { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(20px, 6vw, 80px); }
.rp-numero strong { display: block; font-size: clamp(2.4rem, 6vw, 3.8rem); line-height: 1; color: var(--rp-head); }
.rp-numero span { display: block; margin-top: 8px; opacity: .8; text-transform: uppercase; letter-spacing: .06em; font-size: .85em; }
.rp-bg-scuro .rp-numero strong { color: #fbbf24; }

/* Testimonianze */
.rp-tes { margin: 0; background: var(--rp-card); border: 1px solid var(--rp-line); border-radius: 14px; padding: 24px; }
.rp-tes blockquote { margin: 0 0 16px; padding: 0; border: 0; font-size: 1.05em; font-style: italic; line-height: 1.6; }
.rp-tes blockquote::before { content: "“"; display: block; font-size: 3em; line-height: .6; color: var(--rp-acc); font-style: normal; }
.rp-tes figcaption { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.rp-tes-foto { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }

.rp-funz, .rp-cod { margin-top: 10px; }
/* Le funzioni RSN hanno colori propri pensati per il chiaro: su una sezione scura o
   colorata stanno dentro un pannello chiaro, e la fascia fa da cornice (Roberto, 16/10). */
.rp-bg-scuro .rp-funz, .rp-bg-colore .rp-funz {
    background: #fff; color: #1f2937; border-radius: 18px; padding: clamp(16px, 3vw, 32px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
    --rp-head: #0b1f3a; --rp-text: #1f2937; --rp-link: #1d5f93; --rp-card: #f8fafc; --rp-line: #e5e7eb;
}
.rp-bg-scuro .rp-funz h1, .rp-bg-scuro .rp-funz h2, .rp-bg-scuro .rp-funz h3, .rp-bg-scuro .rp-funz h4,
.rp-bg-colore .rp-funz h1, .rp-bg-colore .rp-funz h2, .rp-bg-colore .rp-funz h3, .rp-bg-colore .rp-funz h4 { color: #0b1f3a; }
.rp-cod iframe { max-width: 100%; }
.rp-cod--largo iframe { width: 100%; display: block; }
.rp-codice-wrap-largo { padding: 0; }

@media (max-width: 900px) {
    .rp-griglia.rp-col-3 > *, .rp-griglia.rp-col-4 > * { flex-basis: calc((100% - var(--rp-gap)) / 2); }
    .rp-galleria.rp-col-3, .rp-galleria.rp-col-4 { grid-template-columns: repeat(2, 1fr); }
    .rp-tf { grid-template-columns: 1fr; }
    .rp-tf .rp-tf-foto { order: -1; }
}
@media (max-width: 600px) {
    .rp-griglia.rp-col-2 > *, .rp-griglia.rp-col-3 > *, .rp-griglia.rp-col-4 > * { flex-basis: 100%; }
    .rp-galleria.rp-col-2 { grid-template-columns: 1fr; }
    .rp-galleria.rp-col-3, .rp-galleria.rp-col-4 { grid-template-columns: repeat(2, 1fr); }
    .rp-btn { width: 100%; text-align: center; }
}

/* 🎞️ Slide (Thema 1.22.0): il disegno è quello del widget RSN Hero (hero.css); qui solo la sezione a tutta larghezza. */
.rp-s.rp-slide { padding: 0; }
.rp-slide .rsn-hero { min-height: 340px; }

/* 🧩 Griglia libera (Thema 1.22.0): 12 colonne, ogni riquadro prende la sua parte dallo schema. */
.rp-gr { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 22px; grid-auto-flow: dense; }
.rp-gx-3 { grid-column: span 3; } .rp-gx-4 { grid-column: span 4; } .rp-gx-6 { grid-column: span 6; } .rp-gx-8 { grid-column: span 8; }
.rp-gr--mosaico .rp-gr-alto { grid-row: span 2; }
.rp-gr-box { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--rsn-studio-radius, 14px); }
.rp-gr-box .rp-gr-foto { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.rp-gr-alto .rp-gr-foto { flex: 1; aspect-ratio: auto; min-height: 260px; }
.rp-gr-testo { padding: 18px 20px 22px; }
.rp-gr-testo h3 { margin: 0 0 6px; }
.rp-gr-testo p { margin: 0 0 12px; }
.rp-gr .rp-icona { font-size: 40px; padding: 20px 20px 0; }
.rp-gr--schede .rp-gr-box { background: var(--rp-card, #fff); border: 1px solid var(--rp-line, #e5e7eb); box-shadow: 0 6px 18px rgba(0, 0, 0, .06); }
.rp-gr--semplice .rp-gr-testo { padding-left: 0; padding-right: 0; }
.rp-gr--semplice .rp-gr-box { border-radius: 0; }
.rp-gr--semplice .rp-gr-foto { border-radius: var(--rsn-studio-radius, 14px); }
/* Foto con il testo sopra: la foto copre il riquadro, il testo sta in basso sulla foto scurita. */
.rp-gr--foto .rp-gr-box { position: relative; min-height: 260px; background: #0b1f3a; color: #fff; justify-content: flex-end; }
.rp-gr--foto .rp-gr-foto { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.rp-gr--foto .rp-gr-con-foto::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, .05) 65%); }
.rp-gr--foto .rp-gr-testo, .rp-gr--foto .rp-icona { position: relative; z-index: 1; }
html body .rp-gr--foto .rp-gr-testo :is(h3, p) { color: #fff; }
@media (max-width: 900px) {
    .rp-gx-3 { grid-column: span 6; } .rp-gx-4, .rp-gx-8 { grid-column: span 12; } .rp-gx-6 { grid-column: span 12; }
    .rp-gr--mosaico .rp-gr-alto { grid-row: auto; }
}
@media (max-width: 600px) { .rp-gr-box { grid-column: span 12 !important; } }
/* Griglia: riquadri con solo la foto (foto piena) o solo il testo, testo al centro, funzioni RSN dentro. */
.rp-gr-solo-foto { background: transparent !important; border: 0 !important; box-shadow: none !important; }
.rp-gr-solo-foto .rp-gr-foto { height: 100%; min-height: 220px; aspect-ratio: auto; border-radius: var(--rsn-studio-radius, 14px); }
.rp-gr--foto .rp-gr-solo-foto::after { display: none; }
.rp-gr-solo-testo { justify-content: flex-start; }
.rp-gr-centro .rp-gr-testo, .rp-gr-centro_v .rp-gr-testo { text-align: center; }
.rp-gr-centro_v { justify-content: center; }
.rp-gr-fun { margin-top: 10px; }
.rp-gx-9 { grid-column: span 9; } .rp-gx-12 { grid-column: span 12; }
@media (max-width: 900px) { .rp-gx-9 { grid-column: span 12; } }

/* 🔠 Titolo grande */
.rp-tit-sopra { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--rp-link, #b45309); }
.rp-tit .rp-tit-h { margin: 0 0 10px; line-height: 1.1; }
.rp-tit--medio .rp-tit-h { font-size: clamp(26px, 3.4vw, 36px); }
.rp-tit--grande .rp-tit-h { font-size: clamp(32px, 5vw, 54px); }
.rp-tit--enorme .rp-tit-h { font-size: clamp(40px, 8vw, 84px); }
.rp-tit--linea .rp-tit-h::after { content: ""; display: block; width: 72px; height: 4px; margin: 16px 0 0; border-radius: 4px; background: var(--rsn-studio-button-bg, #f59e0b); }
.rp-tit--linea.rp-centro .rp-tit-h::after { margin-left: auto; margin-right: auto; }

/* 📜 Testo che scorre */
.rp-s.rp-scorrevole { padding: 0; }
.rp-scorri { display: flex; align-items: stretch; overflow: hidden; font-weight: 600; }
.rp-scorri-eti { flex: 0 0 auto; display: flex; align-items: center; padding: 12px 18px; background: rgba(0, 0, 0, .25); font-weight: 800; letter-spacing: .04em; white-space: nowrap; z-index: 1; }
.rp-scorri-fin { flex: 1; overflow: hidden; display: flex; align-items: center; }
.rp-scorri-nastro { display: inline-flex; white-space: nowrap; padding: 12px 0; animation: rp-scorri 38s linear infinite; will-change: transform; }
.rp-scorri:hover .rp-scorri-nastro { animation-play-state: paused; }
.rp-scorri--destra .rp-scorri-nastro { animation-direction: reverse; }
.rp-scorri-voce { padding: 0 18px; }
.rp-scorri-sep { opacity: .6; }
@keyframes rp-scorri { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ✨ Animazioni all'arrivo sullo schermo (solo se il JavaScript le accende: senza, la sezione si vede subito). */
.rp-anim-on .rp-anim:not(.rp-visto) { opacity: 0; }
.rp-anim-on .rp-anim { transition: opacity .8s ease, transform .8s ease; }
.rp-anim-on .rp-anim--sale:not(.rp-visto) { transform: translateY(40px); }
.rp-anim-on .rp-anim--sinistra:not(.rp-visto) { transform: translateX(-60px); }
.rp-anim-on .rp-anim--destra:not(.rp-visto) { transform: translateX(60px); }
.rp-anim-on .rp-anim--zoom:not(.rp-visto) { transform: scale(.92); }
.rp { overflow-x: clip; }
@media (prefers-reduced-motion: reduce) {
    .rp-scorri-nastro { animation: none; white-space: normal; flex-wrap: wrap; }
    .rp-anim-on .rp-anim { opacity: 1 !important; transform: none !important; transition: none; }
}
