/* Tema "Academic" — ispirato ad Academic Pages (MIT, © 2016 Michael Rose; vedi academic-LICENSE.txt). */
:root {
  --acad-base: #2f7f93; --acad-bg: #fff; --acad-footer-bg: #f2f3f3; --acad-border: #e4e6e7; --acad-text: #494e52;
  --acad-text-light: #7a8288; --acad-link: #2f7f93; --acad-link-hover: #1f5a69; --acad-masthead-h: 64px;
  --acad-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
html[data-theme="dark"] {
  --acad-base: #2f7f93; --acad-bg: #252a34; --acad-footer-bg: #1d2129; --acad-border: #3b4350; --acad-text: #eaeaea;
  --acad-text-light: #a9b0ba; --acad-link: #08d9d6; --acad-link-hover: #7af3f0;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--acad-bg); color: var(--acad-text); font-family: var(--acad-font); line-height: 1.5; padding-top: var(--acad-masthead-h); }
a { color: var(--acad-link); text-decoration: none; }
a:hover { color: var(--acad-link-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; margin: 1.6em 0 .5em; font-weight: 700; }
h1 { font-size: 2rem; margin-top: 0; } h2 { font-size: 1.5rem; } h3 { font-size: 1.15rem; }
.muted { color: var(--acad-text-light); }

/* Barra in alto: testo, filetto in basso, voce selezionata sottolineata */
.masthead { position: fixed; top: 0; left: 0; right: 0; z-index: 20; background: var(--acad-bg); border-bottom: 1px solid var(--acad-border); }
.masthead__inner-wrap { max-width: 1280px; margin: 0 auto; padding: .5em 1em; display: flex; align-items: center; min-height: var(--acad-masthead-h); }
/* Barra: titolo fisso a sinistra, voci che entrano nello spazio, le altre nel menu (JS "greedy nav" come nel tema originale) */
.masthead__title { font-weight: 700; color: var(--acad-text) !important; padding: 0 1.6em 2px 0; white-space: nowrap; }
.masthead__title.selected { border-bottom: 2px solid var(--acad-text); margin-right: 1.6em; padding-right: 0; }
.masthead__menu { flex: 1; min-width: 0; }
.masthead__menu ul { display: flex; flex-wrap: nowrap; align-items: center; list-style: none; margin: 0; padding: 0; overflow: hidden; }
.masthead__menu-item { padding-right: 1.4em; white-space: nowrap; flex: none; }
.masthead__menu-item a { color: var(--acad-text-light); font-weight: 500; padding-bottom: 2px; }
.masthead__menu-item a:hover { color: var(--acad-text); text-decoration: none; border-bottom: 2px solid var(--acad-border); }
.masthead__menu-item.selected a { color: var(--acad-text); font-weight: 700; }
.acad-btn-icon, .acad-burger { background: none; border: 0; color: var(--acad-text); font-size: 1.05rem; cursor: pointer; padding: .2em .5em; flex: none; }
.acad-burger { font-size: 1.3rem; }
.acad-burger[hidden] { display: none; }
.hidden-links { position: absolute; top: var(--acad-masthead-h); right: 1em; flex-direction: column; align-items: flex-start !important; background: var(--acad-bg); border: 1px solid var(--acad-border); border-radius: 4px; padding: .6em 1em; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 30; }
.hidden-links[hidden] { display: none !important; }
.hidden-links .masthead__menu-item { padding: .3em 0; }

/* Pagina: profilo dell'autore a sinistra, contenuto a destra */
#main { max-width: 1280px; margin: 0 auto; padding: 2em 1em; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 2.5em; align-items: start; }
.sidebar { position: sticky; top: calc(var(--acad-masthead-h) + 1.5em); }
.author__avatar img { width: 100%; max-width: 175px; aspect-ratio: 1; object-fit: cover; border-radius: 50%; display: block; margin-bottom: .6em; }
.author__name { margin: 0 0 .1em; font-size: 1.25rem; }
.author__bio { margin: 0 0 .8em; font-size: .9rem; color: var(--acad-text-light); }
.author__urls { list-style: none; margin: 0 0 1em; padding: 0; font-size: .9rem; }
.author__urls li { margin: .35em 0; overflow-wrap: anywhere; } .author__urls i { width: 1.2em; text-align: center; color: var(--acad-text-light); }
.btn { display: inline-block; padding: .5em 1em; border-radius: 4px; border: 0; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.btn--primary { background: var(--acad-base); color: #fff !important; } .btn--primary:hover { background: var(--acad-link-hover); text-decoration: none; }
.page__title { margin-bottom: .2em; }
.page__content h2 { padding-bottom: .4em; border-bottom: 1px solid var(--acad-border); }
.page__content p { margin: 0 0 1.2em; }
.page__meta { margin: .1em 0 0; font-size: .85rem; color: var(--acad-text-light); }
.notice { padding: .8em 1em; border-radius: 4px; background: var(--acad-footer-bg); border-left: 4px solid var(--acad-base); margin-bottom: 1em; }
.notice--danger { border-left-color: #ee5f5b; }

/* Voci dell'elenco */
.archive__item { display: flex; gap: 1em; align-items: flex-start; margin: 0 0 1.4em; }
.archive__item-teaser { flex: 0 0 120px; } .archive__item-teaser img { width: 120px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; display: block; }
.archive__item-teaser--ph { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; border-radius: 4px; background: var(--acad-footer-bg); color: var(--acad-text-light); font-size: 1.6rem; }
.archive__item-teaser--ph:hover { text-decoration: none; }
.archive__item-body { min-width: 0; }
.archive__item-title { margin: 0; font-size: 1.1rem; } .archive__item-title a { color: var(--acad-text); } .archive__item-title a:hover { color: var(--acad-link); }

/* Piè di pagina */
.page__footer { background: var(--acad-footer-bg); padding: 1.6em 1em; margin-top: 2em; font-size: .85rem; color: var(--acad-text-light); text-align: center; }
.page__footer ul { list-style: none; margin: 0 0 .8em; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .4em 1.2em; }
.page__footer a { color: var(--acad-text-light); text-decoration: underline; }

/* Profilo a sinistra: da schermo piccolo riga compatta (foto, nome, bio breve) con il tasto Info che apre il resto */
.btn--inverse { background: var(--acad-bg); color: var(--acad-text-light); border: 1px solid var(--acad-border); padding: .3em .9em; }
.author__urls-wrapper { position: relative; }
.author__urls-wrapper > .btn--inverse { display: none; }
@media (max-width: 1023px) {
  #main { grid-template-columns: 1fr; gap: 1em; }
  .sidebar { position: static; display: flex; flex-wrap: wrap; align-items: center; gap: .6em .9em; }
  html .sidebar .author__avatar { flex: none; width: 56px; }
  html .sidebar .author__avatar img { width: 56px; max-width: 56px; margin: 0; }
  .sidebar .author__content { flex: 1; min-width: 0; }
  .sidebar .author__name { font-size: 1.05rem; margin: 0; }
  .sidebar .author__bio { margin: .15em 0 0; font-size: .85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .author__urls-wrapper > .btn--inverse { display: inline-block; }
  .author__panel { display: none; position: absolute; right: 0; top: 100%; margin-top: .7em; min-width: 230px; max-width: 80vw; padding: .8em 1em; background: var(--acad-bg); border: 1px solid var(--acad-border); border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 10; }
  .author__panel.open { display: block; }
  .author__panel .author__urls { margin-bottom: .6em; }
  .sidebar .author__slot, .sidebar .author__extra { flex-basis: 100%; }
}
@media (max-width: 599px) { .archive__item-teaser { flex-basis: 88px; } .archive__item-teaser img { width: 88px; } h1 { font-size: 1.6rem; } }

/* ==========================================================================
   Veste Academic sulle pagine interne (stessa struttura del tema AdminLTE)
   Attiva con html.acad-skin (aggiunto da academicHeadAssets()).
   ========================================================================== */
html.acad-skin { background: var(--acad-bg); }
html.acad-skin body { background: var(--acad-bg) !important; color: var(--acad-text); font-family: var(--acad-font); padding-top: var(--acad-masthead-h); }
/* AdminLTE dispone la pagina con una griglia pensata per la sua barra (.app-header): con la barra Academic basta una colonna normale. */
html.acad-skin .app-wrapper { display: block !important; min-height: 0; }
html.acad-skin .app-main { display: block !important; width: auto !important; max-width: 100% !important; min-height: 0; }
html.acad-skin .app-content { width: 100%; }
html.acad-skin .app-wrapper, html.acad-skin .app-main, html.acad-skin .app-content { background: transparent; }
html.acad-skin .app-content-header { display: none; } /* solo briciole di pane: nel tema Academic c'è già la barra in alto */
html.acad-skin .app-content { padding-top: 1.5rem; }
html.acad-skin .app-content > .container-fluid { max-width: 1280px; margin: 0 auto; padding-left: 1em; padding-right: 1em; }
html.acad-skin a:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item) { color: var(--acad-link); }
html.acad-skin a:not(.btn):hover { color: var(--acad-link-hover); }
html.acad-skin .masthead a, html.acad-skin .page__footer a { text-decoration: none; }
html.acad-skin .page__footer a { text-decoration: underline; color: var(--acad-text-light) !important; }
html.acad-skin .masthead__menu-item a { color: var(--acad-text-light) !important; } html.acad-skin .masthead__menu-item.selected a, html.acad-skin a.masthead__title { color: var(--acad-text) !important; }
html.acad-skin .author__name a { color: var(--acad-text) !important; }
html.acad-skin .btn.btn--primary, html.acad-skin .btn--primary { color: #fff !important; }

/* Due colonne: profilo a sinistra (fisso), contenuto a destra; le eventuali schede specifiche della pagina stanno sotto il contenuto */
@media (min-width: 992px) {
  html.acad-skin .app-content > .container-fluid > .row { display: grid; grid-template-columns: 250px minmax(0, 820px); gap: 1.5rem 2.5rem; align-items: start; justify-content: start; margin: 0; --bs-gutter-x: 0; }
  html.acad-skin .app-content > .container-fluid > .row > * { padding-left: 0; padding-right: 0; margin-top: 0; width: auto; max-width: none; flex: none; }
  html.acad-skin .app-content > .container-fluid > .row > .adminlte-sidebar-col { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: calc(var(--acad-masthead-h) + 1.5rem); align-self: start; }
  html.acad-skin .app-content > .container-fluid > .row > .adminlte-main-col { grid-column: 2; grid-row: 1; min-width: 0; }
  html.acad-skin .app-content > .container-fluid > .row > .adminlte-extras-col { grid-column: 2; grid-row: 2; position: static; min-width: 0; }
}
html.acad-skin .adminlte-sidebar-col .sidebar { position: static; display: block; }
html.acad-skin .author__extra { margin-top: 1.4em; }
html.acad-skin .adminlte-sidebar-col .author__avatar img { max-width: 175px; margin-bottom: .6em; }

/* Riquadri: piatti, titoli a filetto come i titoli di sezione di Academic Pages */
html.acad-skin .card { background: transparent; border: 0; border-radius: 0; box-shadow: none; color: inherit; }
html.acad-skin .card-header { background: transparent; border: 0; border-bottom: 1px solid var(--acad-border); padding: 0 0 .4em; }
html.acad-skin .card-header .card-title, html.acad-skin .card-title { float: none; font-size: 1.3rem; font-weight: 700; margin: 0; color: var(--acad-text); }
html.acad-skin .card-body { padding-left: 0; padding-right: 0; }
html.acad-skin .card-footer { background: transparent; border-top: 1px solid var(--acad-border); padding-left: 0; padding-right: 0; }
html.acad-skin .adminlte-main-col > .card { border-bottom: 1px solid var(--acad-border); }
html.acad-skin .adminlte-extras-col .card { border: 1px solid var(--acad-border); border-radius: 4px; padding: 0 1em; margin-bottom: 1rem; }
html.acad-skin .list-group-item { background: transparent; border-color: var(--acad-border); color: inherit; }
html.acad-skin .text-muted, html.acad-skin .text-secondary { color: var(--acad-text-light) !important; }
html.acad-skin .text-body, html.acad-skin .text-dark { color: var(--acad-text) !important; }
html.acad-skin .bg-body, html.acad-skin .bg-white, html.acad-skin .bg-body-tertiary, html.acad-skin .bg-light { background: transparent !important; }
html.acad-skin h1, html.acad-skin h2, html.acad-skin h3, html.acad-skin h4, html.acad-skin h5 { color: var(--acad-text); }
html.acad-skin .btn-primary { background: var(--acad-base); border-color: var(--acad-base); color: #fff; }
html.acad-skin .btn-primary:hover { background: var(--acad-link-hover); border-color: var(--acad-link-hover); }
html.acad-skin .btn-outline-primary { color: var(--acad-link); border-color: var(--acad-link); } html.acad-skin .btn-outline-primary:hover { background: var(--acad-base); color: #fff; }
html.acad-skin .badge.bg-primary, html.acad-skin .text-bg-primary { background-color: var(--acad-base) !important; }
html.acad-skin .form-control, html.acad-skin .form-select { background-color: var(--acad-bg); color: var(--acad-text); border-color: var(--acad-border); }
html.acad-skin .table { --bs-table-color: var(--acad-text); --bs-table-bg: transparent; --bs-table-border-color: var(--acad-border); }
html.acad-skin .page-link { background: var(--acad-bg); border-color: var(--acad-border); color: var(--acad-link); }
html.acad-skin .alert { border-radius: 4px; }
html.acad-skin .app-footer { display: none; }

.acad-more { text-align: center; margin: 1.5em 0; }
.acad-more .btn[disabled] { opacity: .6; cursor: default; }

/* Schede nella colonna sinistra (es. categorie del blog), sotto il profilo */
html.acad-skin .author__slot .card { border: 1px solid var(--acad-border); border-radius: 4px; padding: 0 1em; margin-top: 1.2em; }
html.acad-skin .author__slot:empty { display: none; }

/* Blog in veste Academic: elenco di testo e schede laterali senza immagini */
html.acad-skin .acad-bloglist{list-style:none;margin:0;padding:0}
html.acad-skin .acad-bloglist li{padding:.9em 0;border-bottom:1px solid var(--acad-border)}
html.acad-skin .acad-bloglist li:last-child{border-bottom:0}
html.acad-skin .acad-bloglist__t{font-size:1.05em;font-weight:600;text-decoration:none}
html.acad-skin .acad-bloglist small{display:block;font-size:.8em;opacity:.7;margin-top:.15em}
html.acad-skin .acad-bloglist p{margin:.35em 0 0;font-size:.9em;opacity:.85}
html.acad-skin .author__list{margin-top:1.2em;font-size:.85em}
html.acad-skin .author__list-title{font-size:1em;font-weight:700;margin:0 0 .4em}
html.acad-skin .author__list ul{list-style:none;margin:0;padding:0}
html.acad-skin .author__list li{padding:.45em 0;border-bottom:1px solid var(--acad-border)}
html.acad-skin .author__list li:last-child{border-bottom:0}
html.acad-skin .author__list li small{display:block;opacity:.7}
html.acad-skin .author__list-more{display:block;margin-top:.5em}
html.acad-skin .author__list a.is-active{font-weight:700;text-decoration:underline}
/* Filtro del blog: senza riquadri, come le altre voci della colonna */
html.acad-skin .adminlte-sidebar-col .card{border:0;background:transparent;box-shadow:none}
html.acad-skin .adminlte-sidebar-col .card .card-body{padding-left:0;padding-right:0}
html.acad-skin .adminlte-sidebar-col fieldset>.border{border:0!important;padding-left:0!important}
html.acad-skin .adminlte-sidebar-col fieldset{border:0;padding:0;margin-left:0}
html.acad-skin .adminlte-sidebar-col fieldset legend{padding:0;float:none;width:auto}
html.acad-skin .acad-bloglist + .acad-bloglist li:first-child{border-top:1px solid var(--acad-border)}
html.acad-skin .acad-bloglist:has(+ .acad-bloglist) li:last-child{border-bottom:0}

/* Pagina articolo (struttura del template: posts/…/blog-post) */
html.acad-skin .acad-post .page__title{margin-bottom:.2em}
html.acad-skin .acad-post__cover{max-width:100%;height:auto;display:block;margin:1em 0}
html.acad-skin .acad-post .page__content{margin:1.2em 0}
html.acad-skin .page__taxonomy-item{display:inline-block;margin-right:.4em;padding:.1em .6em;border:1px solid var(--acad-border);border-radius:4px;font-size:.85rem;color:var(--acad-text-light)}
html.acad-skin .page__share{margin:1.5em 0}
html.acad-skin .page__share-title{margin:0 0 .5em;padding-bottom:.3em;border-bottom:1px solid var(--acad-border);font-size:1rem}
html.acad-skin .page__share .btn{margin:0 .3em .4em 0}
html.acad-skin .pagination{display:flex;gap:.6em;margin:1.5em 0}
html.acad-skin .pagination--pager{flex:1;text-align:center;padding:.6em 1em;border:1px solid var(--acad-border);border-radius:4px;font-weight:600;color:var(--acad-link)}
html.acad-skin .pagination--pager.disabled{color:var(--acad-text-light);opacity:.5}
html.acad-skin .pagination--pager:hover{text-decoration:none;background:var(--acad-footer-bg)}
html.acad-skin .page__related-title{padding-bottom:.3em;border-bottom:1px solid var(--acad-border);font-size:1.15rem}
html.acad-skin .grid__wrapper{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:1.2em}
html.acad-skin .acad-card{display:block;margin:0}
html.acad-skin .acad-card .page__meta{margin:.2em 0}
html.acad-skin .archive__item-excerpt{font-size:.85rem;color:var(--acad-text-light);margin:.4em 0 0}

/* Video: elenco con anteprima 16:9 piccola a sinistra */
html.acad-skin .acad-video{display:flex;gap:1em;align-items:flex-start;padding:1em 0;margin:0;border-bottom:1px solid var(--acad-border)}
html.acad-skin .acad-video__thumb{position:relative;flex:0 0 220px;aspect-ratio:16/9;background:#111;border-radius:4px;overflow:hidden;display:block}
html.acad-skin .acad-video__thumb img{width:100%;height:100%;object-fit:cover;display:block}
html.acad-skin .acad-video__thumb i{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;font-size:2rem;text-shadow:0 2px 8px rgba(0,0,0,.6)}
html.acad-skin .acad-video .archive__item-title{font-size:1.1rem}
@media(max-width:599px){html.acad-skin .acad-video{flex-direction:column}html.acad-skin .acad-video__thumb{flex-basis:auto;width:100%}}
/* Link nella colonna sinistra: separatori di sezione come titoletti */
.author__urls .author__divider{margin-top:.9em;padding-top:.5em;border-top:1px solid var(--acad-border);font-weight:700;font-size:.8rem;text-transform:uppercase;letter-spacing:.04em;color:var(--acad-text-light)}
