/* =================================================================
   hub.css — VorticeBlu home
   Menu «Risorse» a cartelle, menu mobile, striscia Blog, servizi.
   Usa le variabili colore definite in index.html (:root).
   ================================================================= */

/* ---------- NAV: link Blog in evidenza ---------- */
.nav-links a.nav-blog {
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.nav-blog-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 0 3px rgba(79,142,255,0.18);
}

/* ---------- MENU A TENDINA «RISORSE» A CARTELLE ---------- */
/* il menu si centra sulla barra di navigazione, non sulla voce */
.nav-dropdown.hub-mega { position: static; }
.nav-dropdown.hub-mega .dd-menu {
  top: 100%;
  left: 50%;
  width: min(820px, calc(100vw - 2rem));
  min-width: 0;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  padding: 0.9rem;
  border-radius: 18px;
}
.dd-blog {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.8rem 0.9rem; margin-bottom: 0.8rem;
  border-radius: 12px; text-decoration: none;
  background: linear-gradient(135deg, rgba(79,142,255,0.14), rgba(124,92,252,0.14));
  border: 1px solid rgba(79,142,255,0.25);
  transition: border-color .15s, transform .15s;
}
.dd-blog:hover { border-color: rgba(79,142,255,0.55); transform: translateY(-1px); }
.dd-blog-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient); font-size: 1.1rem;
}
.dd-blog-text { display: flex; flex-direction: column; min-width: 0; }
.dd-blog-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.9rem; color: var(--text); }
.dd-blog-sub { font-size: 0.76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-blog-arrow { margin-left: auto; color: var(--accent); font-size: 1.1rem; }

.dd-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.4rem 0.8rem;
}
.dd-col { min-width: 0; }
.dd-cat {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.6rem; margin-bottom: 0.15rem;
  text-decoration: none; border-radius: 8px;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}
.dd-cat:hover { color: var(--text); background: var(--surface); }
.dd-cat-count {
  margin-left: auto; font-size: 0.68rem; letter-spacing: 0;
  background: var(--surface); border: 1px solid var(--border);
  padding: 0.05rem 0.45rem; border-radius: 100px;
}
.dd-col .dd-item { padding: 0.55rem 0.6rem; }
.dd-col .dd-item-icon { width: 30px; height: 30px; font-size: 0.9rem; border-radius: 8px; }
.dd-more {
  display: block; padding: 0.35rem 0.6rem 0.6rem 3rem;
  font-size: 0.76rem; color: var(--accent); text-decoration: none;
}
.dd-more:hover { text-decoration: underline; }
.dd-all {
  display: flex; justify-content: center; align-items: center; gap: 0.4rem;
  margin-top: 0.7rem; padding: 0.7rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem; font-weight: 500; color: var(--accent); text-decoration: none;
}
.dd-all:hover { color: var(--text); }

/* ---------- MENU MOBILE ---------- */
.nav-right { display: flex; align-items: center; gap: 0.6rem; }
.nav-burger {
  display: none;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-burger svg { width: 20px; height: 20px; }

.mnav {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(7,8,15,0.97);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none; transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease;
}
.mnav.open { opacity: 1; pointer-events: auto; transform: none; }
body.mnav-lock { overflow: hidden; }
.mnav-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(1rem, env(safe-area-inset-top)) 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}
.mnav-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 1rem 1.25rem calc(2rem + env(safe-area-inset-bottom));
}
.mnav .dd-blog { margin-bottom: 1.2rem; }
.mnav-label {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin: 0.4rem 0 0.6rem;
}
.mnav-cat {
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--card); margin-bottom: 0.6rem; overflow: hidden;
}
.mnav-cat summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 0.7rem; padding: 0.8rem 0.9rem;
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.95rem;
}
.mnav-cat summary::-webkit-details-marker { display: none; }
.mnav-cat summary .hub-ico { width: 34px; height: 34px; font-size: 1rem; border-radius: 9px; }
.mnav-cat summary .mnav-count { margin-left: auto; font-family: 'DM Sans', sans-serif; font-weight: 500; font-size: 0.75rem; color: var(--muted); }
.mnav-cat summary .mnav-chev { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.mnav-cat[open] summary .mnav-chev { transform: rotate(180deg); }
.mnav-cat .dd-item { margin: 0 0.4rem; }
.mnav-cat .mnav-items { padding-bottom: 0.4rem; }
.mnav-links { display: flex; flex-direction: column; margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 0.6rem; }
.mnav-links a {
  color: var(--text); text-decoration: none; font-size: 1.05rem;
  padding: 0.8rem 0.2rem; border-bottom: 1px solid var(--border);
}

/* ---------- ICONA RIUTILIZZABILE ---------- */
.hub-ico {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  border-radius: 12px; color: #fff;
}

/* ---------- BLOG: quadrati sopra il titolo ---------- */
#hero .hero-content { width: 100%; min-width: 0; }
.hero-blog {
  display: flex; flex-direction: column; align-items: stretch;
  margin: 0 auto 2.4rem; max-width: 100%;
  animation: hubIn .7s ease both;
}
.hb-head {
  display: flex; align-items: center; justify-content: center; gap: 0.9rem; margin-bottom: 0.9rem;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
}
.hb-label { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text); }
.hb-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(79,142,255,0.6);
  animation: hbPulse 2.4s ease-out infinite;
}
.hb-sep { width: 1px; height: 12px; background: var(--border); }
.hb-all { color: var(--muted); text-decoration: none; transition: color .2s; }
.hb-all:hover { color: var(--accent); }

.hb-row {
  display: flex; gap: 12px;
  max-width: 100%; min-width: 0;
  padding: 6px 6px 8px;
  overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x proximity;
  scroll-padding: 0 6px;
}
.hb-row::-webkit-scrollbar { display: none; }
.hb-row > :first-child { margin-left: auto; }
.hb-row > :last-child { margin-right: auto; }

.hb-tile {
  position: relative; flex: 0 0 100px; width: 100px; height: 100px;
  border-radius: 18px; overflow: hidden; display: block;
  background: linear-gradient(145deg, #1a2550, #2a1a58);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  text-decoration: none; color: #fff;
  scroll-snap-align: start;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s, border-color .3s;
  animation: hbIn .55s cubic-bezier(.2,.8,.2,1) both;
}
.hb-tile:hover, .hb-tile:focus-visible {
  transform: translateY(-5px) scale(1.04);
  border-color: rgba(79,142,255,0.55);
  box-shadow: 0 14px 34px rgba(79,142,255,0.22), 0 0 0 1px rgba(79,142,255,0.35);
  outline: none;
}
.hb-tile img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.hb-tile:hover img { transform: scale(1.08); }
.hb-ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; opacity: 0.55;
}
.hb-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,8,15,0) 30%, rgba(7,8,15,0.88) 100%);
}
.hb-t {
  position: absolute; left: 8px; right: 8px; bottom: 7px;
  font-size: 0.66rem; line-height: 1.25; font-weight: 500; text-align: left;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.hb-new {
  position: absolute; top: 7px; left: 7px;
  font-size: 0.52rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--gradient); padding: 0.12rem 0.4rem; border-radius: 100px;
}
.hb-more {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
  background: rgba(79,142,255,0.06);
  border: 1px dashed rgba(79,142,255,0.4);
  box-shadow: none;
}
.hb-more-arrow {
  width: 32px; height: 32px; border-radius: 50%; background: var(--gradient);
  display: flex; align-items: center; justify-content: center; font-size: 0.95rem;
  transition: transform .3s;
}
.hb-more:hover .hb-more-arrow { transform: translateX(3px); }
.hb-more-txt { font-size: 0.68rem; color: var(--muted); }
.hb-skel {
  background: linear-gradient(90deg, var(--surface) 0%, #171b2b 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: hubShimmer 1.3s linear infinite;
  box-shadow: none;
}

.hb-caption {
  margin: 0.7rem auto 0; min-height: 1.4em; max-width: 560px;
  font-size: 0.82rem; color: var(--muted);
  display: flex; align-items: baseline; justify-content: center; gap: 0.55rem;
  white-space: nowrap; overflow: hidden;
}
.hb-cap-date { color: var(--accent); font-size: 0.72rem; letter-spacing: 0.04em; flex-shrink: 0; }
.hb-cap-title { overflow: hidden; text-overflow: ellipsis; color: var(--text); opacity: 0.85; }

@keyframes hbIn { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes hbPulse {
  0% { box-shadow: 0 0 0 0 rgba(79,142,255,0.55); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(79,142,255,0); }
}

/* ---------- SEZIONE SERVIZI (cartelle) ---------- */
#risorse.hub-services { padding-top: 5rem; }
.hub-folders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}
.hub-folder {
  position: relative; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 1.3rem; color: inherit; font: inherit;
  display: flex; flex-direction: column; gap: 0.7rem;
  overflow: hidden;
  transition: transform .25s, border-color .25s, box-shadow .25s;
  animation: hubIn .5s ease both;
}
.hub-folder::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--c1), var(--c2)); opacity: 0.8;
}
.hub-folder:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.16); }
.hub-folder.active {
  border-color: var(--c1);
  box-shadow: 0 0 0 1px var(--c1), 0 14px 40px rgba(0,0,0,0.35);
}
.hub-folder-top { display: flex; align-items: center; gap: 0.8rem; }
.hub-folder .hub-ico { width: 46px; height: 46px; font-size: 1.35rem; }
.hub-folder-name { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.05rem; }
.hub-folder-count { font-size: 0.75rem; color: var(--muted); }
.hub-folder-desc {
  font-size: 0.82rem; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hub-folder-peek { display: flex; align-items: center; margin-top: auto; }
.hub-folder-peek .hub-ico {
  width: 30px; height: 30px; font-size: 0.85rem; border-radius: 50%;
  border: 2px solid var(--card); margin-right: -8px;
}
.hub-folder-peek .peek-more {
  margin-left: 16px; font-size: 0.74rem; color: var(--muted);
}

.hub-filter-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin: 2.5rem 0 1.2rem;
}
.hub-filter-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.15rem; display: flex; align-items: center; gap: 0.6rem; }
.hub-filter-title .hub-ico { width: 32px; height: 32px; font-size: 0.95rem; border-radius: 9px; }
.hub-reset {
  background: none; border: 1px solid var(--border); color: var(--muted);
  padding: 0.45rem 0.9rem; border-radius: 100px; cursor: pointer; font: inherit; font-size: 0.8rem;
}
.hub-reset:hover { color: var(--text); border-color: rgba(255,255,255,0.25); }

.hub-group { margin-bottom: 2.2rem; }
.hub-group-head {
  display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.9rem;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.hub-group-head::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.hub-group-head .hub-ico { width: 24px; height: 24px; font-size: 0.75rem; border-radius: 7px; }

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.9rem;
}
.hub-card {
  display: flex; align-items: flex-start; gap: 0.9rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 1rem; text-decoration: none; color: inherit;
  transition: transform .2s, border-color .2s, background .2s;
  animation: hubIn .45s ease both;
}
.hub-card:hover { transform: translateY(-2px); border-color: rgba(79,142,255,0.35); background: #141828; }
.hub-card .hub-ico { width: 44px; height: 44px; font-size: 1.25rem; }
.hub-card-text { min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.hub-card-name { font-family: 'Syne', sans-serif; font-weight: 600; font-size: 0.93rem; display: flex; align-items: center; gap: 0.35rem; }
.hub-card-name svg { width: 12px; height: 12px; color: var(--muted); flex-shrink: 0; }
.hub-card-desc {
  font-size: 0.79rem; color: var(--muted); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hub-empty { color: var(--muted); font-size: 0.9rem; padding: 1rem 0; }

@keyframes hubIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes hubShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- TELEFONO ---------- */
@media (max-width: 768px) {
  .nav-burger { display: inline-flex; }
  #risorse.hub-services { padding-top: 3.5rem; }
  .hero-blog { margin-bottom: 1.8rem; }
  .hb-row { margin: 0 -1.5rem; padding: 6px 1.5rem 8px; max-width: none; scroll-padding: 0 1.5rem; }
  .hb-caption { max-width: 100%; }
  .hub-folders {
    display: grid; grid-auto-flow: column; grid-template-columns: none;
    grid-auto-columns: 72%;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-left: -1.5rem; margin-right: -1.5rem; padding: 0.2rem 1.5rem 0.6rem;
    scroll-padding: 0 1.5rem;
  }
  .hub-folders::-webkit-scrollbar { display: none; }
  .hub-folder { scroll-snap-align: start; }
  .hub-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .hb-tile, .hub-folder, .hub-card, .hero-blog { animation: none; }
  .hb-dot, .hb-skel { animation: none; }
}

/* ---------- ICONE VERE DELLE APP (sezione Download) ---------- */
#download .app-icon.app-icon-img {
  background: none; padding: 0; overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
#download .app-icon.app-icon-img img {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 12px;
}
#download .app-badge svg { width: 13px; height: 13px; }
@media (max-width: 768px) {
  #download .apps-grid { grid-template-columns: 1fr 1fr; gap: 0.7rem; margin-top: 2rem; }
  #download .app-card { padding: 1rem; gap: 0.55rem; border-radius: 14px; }
  #download .app-icon.app-icon-img { width: 48px; height: 48px; }
  #download .app-name { font-size: 0.88rem; }
  #download .app-desc {
    font-size: 0.74rem;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  }
}
