/* Stili base App-web - stile app chiaro, indipendenti dal tema */

/* CONTENITORI BASE */
.app-web-home-slide,
.app-web-home-article,
.app-web-events,
.app-web-alert {
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.app-web-link-grid {
    margin-bottom: 18px;
}

/* CAROSELLO SLIDE (Home-Slide) */
.app-web-home-slide {
    overflow: hidden;
}

.app-web-home-slide-inner {
    display: flex;
    transition: transform 0.35s ease;
}

.app-web-slide-card {
    min-width: 100%;
    max-width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background-color: #ffffff;
}

.app-web-slide-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.app-web-slide-thumb img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    display: block;
}

.app-web-slide-thumb-placeholder {
    width: 100%;
    height: 210px;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

/* Titolo slide: margine basso ridotto per eliminare spazio vuoto */
.app-web-slide-title {
    font-size: 1.05rem;
    margin: 10px 12px 4px;
    line-height: 1.35;
}

/* Indicatori del carosello */
.app-web-slide-dots {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 4px;
}

.app-web-slide-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    border: none;
    padding: 0;
    background: rgba(15, 23, 42, 0.16);
}

/* Attivo colorato dal CSS dinamico (primary) */
.app-web-slide-dot.is-active {
    width: 16px;
}

/* HOME ARTICLE */
.app-web-home-article {
    color: inherit;
}

/* Ricerca */
.app-web-search-box {
    margin-bottom: 12px;
}

.app-web-search-form {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.app-web-search-input {
    flex: 1;
    padding: 9px 11px;
    border-radius: 6px;
    border: 1px solid rgba(15, 23, 42, 0.25);
    font-size: 0.9rem;
    background: #ffffff;
    height: 40px;
    box-sizing: border-box;
}

.app-web-search-input::placeholder {
    color: rgba(15, 23, 42, 0.45);
}

.app-web-search-button {
    padding: 0 14px;
    border-radius: 6px;
    border: 1px solid #2563eb;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: #2563eb;
    color: #ffffff;
    height: 40px;
    box-sizing: border-box;
}

.app-web-search-button::before {
    content: '\1F50D';
    font-size: 0.9rem;
}

.app-web-search-results-container {
    margin-top: 8px;
}

.app-web-search-count {
    font-size: 0.86rem;
    margin: 4px 0 6px;
    opacity: 0.8;
}

/* Titoli sezioni */
.app-web-section-title {
    font-size: 1.02rem;
    margin: 8px 0 8px;
}

/* Griglia 2 colonne per "Ultimi articoli" */
.app-web-grid-2cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.app-web-grid-item a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.app-web-grid-thumb {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 6px;
}

.app-web-grid-thumb img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    display: block;
}

.app-web-grid-thumb-placeholder {
    width: 100%;
    height: 90px;
    border-radius: 12px;
    background: linear-gradient(135deg, #e1f5fe, #b3e5fc);
}

.app-web-grid-title {
    font-size: 0.86rem;
    line-height: 1.3;
    margin: 0;
}

/* Pulsante Carica Altro dentro la griglia ultimi articoli: span 2 colonne e centrato */
.app-web-grid-2cols > .app-web-load-more {
    grid-column: 1 / -1;
    justify-self: center;
}

/* Lista articoli a card (categorie e ricerca) */
.app-web-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-web-article-card {
    border-radius: 14px;
    padding: 8px;
    background-color: #f9fafb;
}

.app-web-article-card-inner {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.app-web-article-thumb {
    flex: 0 0 92px;
    max-width: 92px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.app-web-article-thumb img {
    width: 100%;
    height: 72px;
    object-fit: cover;
    display: block;
}

.app-web-article-thumb-placeholder {
    width: 100%;
    height: 72px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ede7f6, #d1c4e9);
}

.app-web-article-info {
    flex: 1;
    min-width: 0;
}

.app-web-article-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.app-web-article-cat-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    background: rgba(15, 23, 42, 0.06);
    margin-bottom: 4px;
}

.app-web-article-title {
    margin: 0 0 4px;
    font-size: 0.94rem;
    line-height: 1.35;
}

.app-web-article-meta {
    font-size: 0.78rem;
    opacity: 0.7;
}

/* Pulsanti Carica Altro */
.app-web-load-more,
.app-web-load-more-search {
    margin: 10px 0 0;
    padding: 7px 14px;
    border-radius: 999px;
    border-width: 1px;
    border-style: solid;
    background: #ffffff !important;
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
}

/* GRIGLIA ICONE (link grid) */
.app-web-link-grid {
    display: grid;
    gap: 12px 10px;
    color: inherit;
}

.app-web-link-grid.app-web-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}
.app-web-link-grid.app-web-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}
.app-web-link-grid.app-web-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}
.app-web-link-grid.app-web-cols-5 {
    grid-template-columns: repeat(5, 1fr);
}
.app-web-link-grid.app-web-cols-6 {
    grid-template-columns: repeat(6, 1fr);
}

.app-web-link-item {
    display: flex;
    justify-content: center;
}

.app-web-link-item a,
.app-web-link-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    padding: 6px 4px;
    border-radius: 20px;
    background: linear-gradient(145deg, #ffffff, #f3f4f6);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
    width: 100%;
    max-width: 86px;
}

.app-web-link-item a:hover,
.app-web-link-card:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
}

.app-web-link-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 0% 0%, #ffffff, #e0f2f1);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
}

.app-web-link-title-wrapper {
    max-width: 80px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.app-web-link-title {
    font-size: 0.8rem;
    text-align: center;
    max-height: 2.4em;
    line-height: 1.2;
    overflow: hidden;
}

/* AVVISI */
.app-web-alert-inner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    position: relative;
}

.app-web-alert-icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.9);
    color: #1f2937;
}

.app-web-alert-content {
    flex: 1;
}

.app-web-alert-title {
    font-weight: 600;
    margin-bottom: 3px;
    font-size: 0.94rem;
}

.app-web-alert-text {
    margin-bottom: 4px;
    font-size: 0.88rem;
}

.app-web-alert-link a {
    font-weight: 600;
    text-decoration: underline;
    font-size: 0.88rem;
}

/* Colori predefiniti per tipo (se non sovrascritti dal custom bg) */
.app-web-alert-info {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

.app-web-alert-success {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
}

.app-web-alert-warning {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
}

.app-web-alert-error {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
}

.app-web-alert-close {
    border: none;
    background: transparent;
    position: absolute;
    top: 4px;
    right: 2px;
    font-size: 1.1rem;
    cursor: pointer;
    color: #111827;
}

/* EVENTI */
.app-web-events {
    border-radius: 18px;
    padding: 10px 12px;
}

.app-web-events-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.app-web-event-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.app-web-event-date-badge {
    padding: 4px 8px;
    border-radius: 12px;
    background: #e3f2fd;
    text-align: center;
    font-size: 0.78rem;
}

.app-web-event-date-day {
    display: block;
}

.app-web-event-date-time {
    display: block;
    opacity: 0.8;
}

.app-web-event-info {
    font-size: 0.86rem;
}

.app-web-event-title {
    font-weight: 600;
}

.app-web-event-location {
    font-size: 0.8rem;
    opacity: 0.7;
}

.app-web-event-link a {
    font-size: 0.8rem;
    text-decoration: underline;
}

/* LAYOUT SINGLE "CANVAS" */
#app-web-single {
    max-width: 840px;
    margin: 0 auto;
    padding: 12px 10px 30px;
    box-sizing: border-box;
}

.app-web-single-shell {
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

/* Header app */
.app-web-single-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(248, 250, 252, 0.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.app-web-single-back {
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 999px;
    background: #ffffff;
}

.app-web-single-app-label {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Hero immagine */
.app-web-single-hero {
    width: 100%;
    overflow: hidden;
    background: #e5e7eb;
}

.app-web-single-hero-img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    display: block;
}

.app-web-single-hero-placeholder {
    width: 100%;
    height: 230px;
    background: radial-gradient(circle at 0% 0%, #90caf9, #42a5f5);
}

/* Meta + titolo sotto immagine */
.app-web-single-content {
    padding: 14px 16px 20px;
}

.app-web-single-meta {
    margin-bottom: 10px;
}

.app-web-single-cat-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.app-web-single-title {
    font-size: 1.4rem;
    line-height: 1.3;
    margin: 0 0 6px;
}

.app-web-single-meta-row {
    font-size: 0.86rem;
    color: #111111;
    display: flex;
    align-items: center;
    gap: 4px;
}

.app-web-single-meta-item {
    color: #111111;
}

.app-web-single-meta-sep {
    opacity: 0.7;
}

/* Contenuto articolo */
.app-web-single-body {
    font-size: 1rem;
    line-height: 1.7;
}

/* Tipografia interno body */
.app-web-single-body p {
    margin-bottom: 1em;
}

.app-web-single-body h2,
.app-web-single-body h3,
.app-web-single-body h4 {
    margin-top: 1.2em;
    margin-bottom: 0.4em;
}

.app-web-single-body a {
    text-decoration: underline;
}

/* Mobile first */
@media (min-width: 768px) {
    .app-web-slide-card {
        min-width: 100%;
        max-width: 100%;
    }
}


/* ===============================
   Hom2-APP2 – Refining App-web look
   =============================== */

/* Contenitore generale widget articoli */
.app-web-home-article {
    border-radius: 20px;
    padding: 18px;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 45%, #eef2ff 100%);
    border: 1px solid rgba(15, 23, 42, 0.04);
}

/* Titoli sezione */
.app-web-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #111827;
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    padding-left: 12px;
}

.app-web-section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, #4f46e5, #6366f1);
}

/* Box di ricerca */
.app-web-search-box {
    margin-bottom: 18px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.35);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-web-search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.app-web-search-input {
    flex: 1;
    padding: 9px 11px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    font-size: 0.9rem;
    background: #ffffff;
    height: 40px;
    box-sizing: border-box;
}

.app-web-search-button {
    border-radius: 999px;
    padding: 0 14px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    cursor: pointer;
    height: 40px;
}

.app-web-search-button:hover {
    filter: brightness(1.05);
}

/* Card articolo (sia ricerca che categorie) */
.app-web-article-card {
    border-radius: 14px;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.25);
    transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.app-web-article-card-inner {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.app-web-article-card:hover {
    background-color: #ffffff;
    border-color: rgba(79, 70, 229, 0.35);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

/* Badge categoria + meta */
.app-web-article-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 0.7rem;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.06);
    color: #4f46e5;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.app-web-article-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    margin: 4px 0 2px;
}

.app-web-article-meta {
    font-size: 0.78rem;
    color: #6b7280;
}

/* Pulsante "Carica altri articoli" */
.app-web-load-more {
    margin-top: 10px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(79, 70, 229, 0.45);
    background: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
}

.app-web-load-more:hover {
    background: linear-gradient(135deg, #eef2ff, #ffffff);
}

/* Liste per categoria a due colonne su schermi medi + */
.app-web-category-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 640px) {
    .app-web-category-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mantieni la lista verticale per gli altri contesti */
.app-web-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-web-list.app-web-category-list {
    display: grid;
}

/* Fine refining Hom2-APP2 */
