:root {
    --bg: #f6f7f9;
    --card: #ffffff;
    --border: #e7e7e7;
    --text: #111;
    --muted: #666;
    --danger: #b00020;
    --ok: #0b6;
    --primary: #111;
    --primaryText: #fff;
    --soft: #efefef;
    --radius: 1rem;
}

@font-face {
    font-family: 'Museo500';
    src: url('https://raw.githubusercontent.com/PiquezEnriquez/Icone/refs/heads/main/Museo-500.ttf');
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: 'Museo500', Verdana, sans-serif;
    font-size: 18px;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

form#aspnetForm {
    min-height: 100vh;
    height: auto;
    display: block;
}

/* ===== Layout generale ===== */

.page-shell {
    width: min(100%, 40rem);
    margin: 4.2rem auto auto auto;
    box-sizing: border-box;
}

.container {
    background-color: antiquewhite;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    border-radius: 2rem;
    box-sizing: border-box;
}

.card {
    width: min(100%, 40rem);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.8rem;
    margin: 0 auto 0.7rem auto;
    box-sizing: border-box;
}

.articolo {
    width: 100%;
    box-sizing: border-box;
}

/* ===== Menu superiore ===== */

#menuContainer,
#menuAdmContainer {
    position: fixed;
    top: 0;
    height: 3.8rem;
    z-index: 1000;
}

.menu {
    display: flex;
    width: min(100%, 40rem);
    height: 2.8rem;
    justify-content: space-between;
    align-items: flex-start;
    margin: auto;
    background-color: gray;
    color: white;
    border-radius: 0.6rem;
    padding: 0.6px;
    box-sizing: border-box;
}

.bread {
    font-size: 1rem;
    color: white;
    padding-left: 10px;
    padding-top: 0.7rem;
}

.bread button,
.menu button,
.sideMenu button {
    background: blueviolet;
    border: none;
    border-radius: 0.6rem;
    color: white;
    cursor: pointer;
    font-size: 1rem;
}

.menu button {
    margin: 4px 0;
    padding: 8px;
    text-align: left;
}

.menu button:hover,
.sideMenu button:hover {
    background: gainsboro;
}

.right-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 0;
}

#hamburger,
#admHamburger {
    background-color: gray;
    padding-right: 1rem;
    font-size: 2rem;
    text-align: right;
    cursor: pointer;
    border-radius: 2rem;
    z-index: 1001;
}

.hambIcon {
    margin-top: 0.25rem;
    height: 0;
}

/* ===== Menu laterale ===== */

.sideMenu {
    position: relative;
    width: 12rem;
    height: 0;
    background-color: cadetblue;
    color: white;
    padding-left: 0.6rem;
    border-radius: 0.6rem;
    z-index: 1002;
    display: none;
    box-sizing: border-box;
}

.sideMenu.open {
    display: flex;
    flex-direction: column;
}

.sideMenu button,
.bread button {
    height: 2.3rem;
    width: 95%;
    padding: 0.425rem;
    margin-right: 0.25rem;
    text-align: left;
}

.menuItem {
    display: block;
    width: 100%;
    padding: 0.8rem 1rem;
    text-align: left;
    border: none;
    background: none;
    font-size: 1rem;
    cursor: pointer;
}

.menuItem:hover {
    background-color: #f0f0f0;
}

.hrMenu {
    width: 90%;
    height: 1px;
    margin: 0.2rem 0;
    background-color: antiquewhite;
    border-style: solid;
}

.overHamb {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

/* ===== Spinner / attesa ===== */

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.6);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.waitDiv {
    margin: 1rem 0;
    border-color: gray;
    width: 50%;
}

.waitText {
    font-size: 2rem;
}

.waitImg {
    width: 60%;
    margin-top: 5%;
    margin-left: 20%;
    margin-right: 20%;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid #ddd;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-text {
    font-size: 1.2rem;
    text-align: center;
    color: #2f68ec;
    transition: opacity 0.5s;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.filterBox {
    padding-top:1rem;
    padding-bottom:1rem;
    border-style: solid;
    border-width: 1px;
    border-color: lightgrey;
    border-radius: 0.6rem;
    display: grid;
    grid-template-columns: auto auto;
    gap: 0.5rem;
}

.fillRow {
    font-size: 1.2rem;
}

.leftCol{
    text-align: right;
    padding-right: 2rem;
    font-size: 1.2rem;
}

.leftBtn {
    margin-left: auto;
    margin-right: 2rem;
}

.rightBtn {
    margin-left: 2rem;
    margin-right: auto;
}

/* ===== Box amministrazione ===== */

.box-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto;
    gap: 15px;
}

.box-sopra {
    grid-column: 1;
    grid-row: 1;
}

.tagBox {
    margin: 0.3rem 0 0.8rem 0;
}

.tagLink {
    display: inline-block;
    margin: 0.15rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: cadetblue;
    color: white !important;
    text-decoration: none;
    font-size: 0.85rem;
}

.tagLink:hover {
    background: blueviolet;
}

.cloudTag {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

    .cloudTag input {
        display: none;
    }

    .cloudTag label {
        display: inline-block;
        padding: 0.25rem 0.65rem;
        border-radius: 999px;
        background: cadetblue;
        color: white;
        cursor: pointer;
        font-size: 0.9rem;
    }

    .cloudTag input:checked + label {
        background: blueviolet;
        color: white;
        font-weight: bold;
    }

.box-sotto {
    grid-column: 1;
    grid-row: 2;
}

.box-laterale {
    grid-column: 2;
    grid-row: 1 / 3;
    width:24rem;
}

.box {
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #f7f7f7;
}

.rowBox {
    display: flex;
    flex-direction: row;
    border-radius: 0.6rem;
    border: 2px solid gray;
}

.columnBox {
    flex: 44%;
    padding-left: 1%;
    padding-right: 2%;
}

.oneColumn {
    width: 94%;
}

.marginLeft_1 {
    margin-left: 1%;
}

.fu{
    margin-top: 0.75rem;
    font-size:1.15rem;
}

.boxRadioButton,
.boxSceltaArticolo,
.boxUploadHtml {
    border-radius: 0.6rem;
    border: 2px solid gray;
}

/* ===== Navigazione articoli ===== */

.nav-articoli {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
}

.prev,
.next {
    width: 45%;
}

.prev {
    text-align: left;
}

.next {
    text-align: right;
}

.aPrev,
.aNext {
    text-decoration: none;
    font-size: 2rem;
    background: cadetblue;
    border: 2px solid blue;
    padding: 0 1rem 0.7rem 1rem;
    color: white;
}

.aPrev {
    border-top-left-radius: 2rem;
    border-bottom-left-radius: 2rem;
}

.aNext {
    border-top-right-radius: 2rem;
    border-bottom-right-radius: 2rem;
}

/* ===== Messaggistica ===== */

.msgInfo {
    display: flex;
    flex-direction: row;
}

.infoLeft,
.infoRight {
    border-radius: 0.5rem;
}

.infoLeft {
    flex: 22%;
    padding-left: 3%;
    padding-right: 2%;
}

.infoRight {
    flex: 72%;
    padding-left: 2%;
    padding-right: 3%;
}

.msgInfoText {
    display: block;
    min-height: 3rem;
    width: auto;
    padding: 0.5rem 0.8rem;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    color: white;
    background: blueviolet;
}

/* ===== Pulsanti ===== */

.bigButton {
    display: block;
    width: 100%;
    padding: 0.8rem 1rem;
    text-align: center;
    background: palegreen;
    font-size: 1rem;
    cursor: pointer;
    color: darkblue;
    border-radius: 0.6rem;
    border: 2px solid gray;
}
.normButton {
    width:7rem;
    padding: 0.5rem 1rem;
    text-align: center;
    background: palegreen;
    font-size: 1rem;
    cursor: pointer;
    color: darkblue;
    border-radius: 0.6rem;
    border: 2px solid gray;
}

.toggleRow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 3.5rem;
    height: 1.8rem;
    background: #ccc;
    border-radius: 999px;
    vertical-align: middle;
    transition: background 0.3s;
}

.toggle::after {
    content: "";
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 1.5rem;
    height: 1.5rem;
    background: white;
    border-radius: 50%;
    transition: all 0.3s;
}


.toggleRow:has(input:checked) .toggle {
    background: cadetblue;
}

.toggleRow:has(input:checked) .toggle::after {
    left: 1.85rem;
}

.toggle input {
    appearance: none;
}

.toggle label {
    display: block;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    background: #ccc;
    cursor: pointer;
}

.toggle input:checked + label {
    background: cadetblue;
    color: white;
}

/*====== Login =======*/

.loginCard {
    width: 100%;
    zoom: 1.25;
    max-width: 400px;
    margin-left: 1rem;
    padding: 2rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-sizing: border-box;
}

/* ===== Mobile ===== */

@media screen and (max-width: 700px), (pointer: coarse) {

    html,
    body,
    form#aspnetForm {
        width: 100%;
        min-height: 100vh;
        height: auto;
        margin: 0;
        padding: 0;
        transform: none;
        overflow-x: hidden;
        overflow-y: auto;
    }

    #menuContainer,
    #menuAdmContainer {
        width: 100%;
        min-height: 4.4rem;
        height: auto;
        overflow: visible;
        border-radius: 0.5rem;
    }

    .menu {
        width: 100%;
        height: 4.4rem;
        margin: 0;
        border-radius: 0;
        display: grid;
        grid-template-columns: auto auto 1fr;
        align-items: center;
        gap: 0.5rem;
    }

    .bread {
        padding: 0.4rem;
    }

    #hamburger,
    #admHamburger {
        font-size: 2rem;
        text-align: center;
        padding-right: 0.5rem;
    }

    .right-item {
        min-width: 0;
    }

    .hambIcon{
        padding-bottom: 1.25rem;
    }

    .sideMenu {
        position: absolute;
        top: 4.4rem;
        left: 0.5rem;
        width: 80vw;
        max-width: 18rem;
        z-index: 2000;
    }

    .page-shell,
    .container,
    .card,
    .articolo {
        display: block;
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }

    .page-shell {
        min-height: 100vh;
        padding: 0;
    }

    .card {
        margin-top: 1rem;
        border-radius: 0.6rem;
    }

    .loginCard {
        zoom: 1.5;
    }

    .box-wrapper {
        grid-template-columns: 1fr;
    }


    .rowBox,
    .msgInfo,
    .nav-articoli {
        flex-direction: column;
    }

    .columnBox,
    .infoLeft,
    .infoRight,
    .prev,
    .next {
        width: 100%;
        flex: none;
        box-sizing: border-box;
    }

    .next {
        text-align: left;
        margin-top: 1rem;
    }

    .articolo img,
    .typora-export-content img {
        max-width: 100%;
        height: auto;
    }

    table,
    pre,
    canvas {
        max-width: 100%;
        overflow-x: auto;
    }
}
