/* ============================================================================
   DigiCreAI — l'hub degli strumenti
   ----------------------------------------------------------------------------
   Un posto solo, con quattro strumenti: immagini, grafica, loghi, sito.
   Prima erano quattro pagine sparse, ognuna con il suo indirizzo e il suo menu:
   chi voleva fare una copertina non sapeva da dove cominciare.
   Qui si sceglie la scheda, e ogni strumento vive nella sua stanza.
   ========================================================================== */

.str-wrap { padding: 6px 0 40px; }

/* Sul telefono il margine si stringe: 20 px per lato sono un lusso che
   l'anteprima dello strumento non può permettersi (misurato: il testo
   arrivava a 390 su 390, senza un pixel di respiro a destra). */
@media (max-width: 640px) {
  .str-wrap { padding: 4px 12px 32px; }
}

/* ── l'intestazione: cosa si fa qui ───────────────────────────────────── */
.str-testa { padding: 22px 0 6px; }
.str-testa h1 { margin: 8px 0 8px; font-size: clamp(26px, 3.4vw, 38px); line-height: 1.1; letter-spacing: -.02em; }
.str-testa p { margin: 0; color: var(--muted, #5f7190); font-size: 16px; max-width: 60ch; }

/* ── le quattro linguette ─────────────────────────────────────────────── */
.str-tabs {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  margin: 20px 0 18px;
}
.str-tab {
  display: flex; align-items: center; gap: 11px; text-align: left;
  border: 1px solid var(--line, #e0e9f6); background: var(--surface, #fff);
  border-radius: 14px; padding: 13px 14px; cursor: pointer; min-height: 64px;
  font-family: inherit; color: var(--text, #0b1f4b);
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.str-tab:hover { border-color: var(--primary, #2f6bff); transform: translateY(-1px); }
.str-tab.attiva {
  border-color: transparent; color: #fff;
  background: var(--grad, linear-gradient(120deg, #2ad6f2, #2f6bff 55%, #a52ff0));
  box-shadow: 0 8px 22px rgba(47, 107, 255, .3);
}
.str-tab .ic {
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-2, #eef4fd); color: var(--primary, #2f6bff);
}
.str-tab.attiva .ic { background: #ffffff26; color: #fff; }
.str-tab .ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.str-tab .tx { display: block; min-width: 0; }
.str-tab b { display: block; font-size: 14.5px; font-weight: 750; letter-spacing: -.01em; line-height: 1.2; }
.str-tab .d { display: block; font-size: 12px; opacity: .72; margin-top: 2px; }

/* ── la stanza: dove vive lo strumento ────────────────────────────────── */
.str-stanza { position: relative; }
.str-stanza[hidden] { display: none !important; }
.str-stanza > iframe {
  display: block; width: 100%; height: 78vh; min-height: 620px;
  border: 1px solid var(--line, #e0e9f6); border-radius: 16px;
  background: var(--surface, #fff);
}
/* mentre lo strumento si carica: una riga onesta, non un cerchio che gira */
.str-attesa {
  display: flex; align-items: center; justify-content: center;
  height: 78vh; min-height: 620px; border-radius: 16px;
  border: 1px dashed var(--line, #e0e9f6); background: var(--surface-2, #eef4fd);
  color: var(--muted, #5f7190); font-size: 14px;
}

/* ── ogni strumento ha un piede con le cose utili ────────────────────── */
.str-piede {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--muted, #5f7190);
}
.str-piede a { color: inherit; }
.str-azione {
  border: 1px solid var(--line, #e0e9f6); background: var(--surface, #fff);
  color: var(--text, #0b1f4b); border-radius: 9px; padding: 7px 11px;
  font: 600 12.5px/1 inherit; font-family: inherit; cursor: pointer;
}
.str-azione:hover { border-color: var(--primary, #2f6bff); }

/* ── il telefono: le linguette diventano una fila che scorre ─────────── */
@media (max-width: 860px) {
  .str-tabs { display: flex; overflow-x: auto; scrollbar-width: none; gap: 6px; }
  .str-tabs::-webkit-scrollbar { display: none; }
  .str-tab { flex: 0 0 auto; min-width: 0; padding: 10px 12px; min-height: 56px; }
  .str-tab b { font-size: 13.5px; white-space: nowrap; }
  .str-tab .d { display: none; }   /* sul telefono conta il nome, non la descrizione */
  .str-tab .ic { width: 30px; height: 30px; border-radius: 8px; }
  .str-tab .ic svg { width: 17px; height: 17px; }
  .str-stanza > iframe, .str-attesa { height: 74vh; min-height: 520px; }
}

/* nel tema notturno i bordi devono vedersi, non sparire */
html[data-theme="dark"] .str-stanza > iframe { background: #0d1626; }
html[data-theme="dark"] .str-attesa { background: #101c30; }

/* ── dentro la stanza: niente doppio menu, niente doppio margine ─────── */
body.dentro-hub main { padding-top: 8px; }
body.dentro-hub { background: var(--surface, #fff); }


/* Intestazione compatta: priorità allo spazio di lavoro. */
.str-testa { padding: 8px 0 4px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 20px; }
.str-testa h1 { margin: 0; font-size: 20px; line-height: 1.3; }
.str-guida { font-size: 13px; color: var(--muted, #5f7190); }
.str-guida summary { cursor: pointer; }
.str-guida p { font-size: 14px; line-height: 1.5; margin: 8px 0; max-width: 65ch; }

/* Spazio di lavoro espandibile, senza dipendenza dalla Fullscreen API. */
.str-workbar { display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 0 0;font-size:13px;color:var(--muted,#5f7190); }
.str-workbar button { font:inherit;min-height:40px;padding:8px 14px;background:var(--surface,#fff);color:var(--ink,#0b1f4b);border:1px solid var(--line,#d6dfef);border-radius:9px;cursor:pointer; }
.str-workbar button:focus-visible,.str-tab:focus-visible { outline:3px solid #2f6bff;outline-offset:3px; }
.str-tabs { gap:6px;margin:10px 0; }
.str-tab { padding:10px 14px;min-height:44px;border-radius:10px; }
.str-tab .d { display:none; }
body.str-focus { overflow:hidden; }
body.str-focus #dc-strumenti { position:fixed;inset:0;z-index:10000;background:var(--surface-2,#f3f7fd);padding:8px 12px;display:flex;flex-direction:column; }
body.str-focus .str-workbar { margin:0;flex-shrink:0; }
body.str-focus .str-tabs { flex-shrink:0; }
body.str-focus .str-stanza:not([hidden]) { display:flex;flex-direction:column;flex:1;min-height:0; }
body.str-focus .str-stanza > iframe,body.str-focus .str-attesa { flex:1;min-height:0;height:auto;border-radius:10px; }
body.str-focus .str-piede { flex-shrink:0;padding:6px 0;font-size:12px; }
@media(max-width:640px) { body.str-focus #dc-strumenti { padding:6px; } .str-tab { padding:8px 12px; } }

/* Le regole globali per section non devono aggiungere fasce vuote all’hub. */
#dc-strumenti .str-stanza { padding:0;margin:0; }
body.str-focus #dc-strumenti .str-stanza { padding:0;margin:0; }
body.str-focus .str-piede { display:none; }

/* Su desktop una sola riga di navigazione nell'area espansa. */
@media(min-width:761px) {
 body.str-focus .str-workbar { position:absolute;right:12px;top:8px;z-index:2; }
 body.str-focus .str-workbar > span { display:none; }
 body.str-focus .str-tabs { margin:0 0 8px;padding-right:140px; }
 body.str-focus .str-tab { min-height:40px; }
}
