/* Pagine interne: eventi, mesi, temi */

html {
    scroll-padding-top: calc(var(--header-h) + 20px);
}

html.js .page-sub .ev,
html.js .page-sub .month-head {
    opacity: 1;
    transform: none;
}

.page-sub .ev {
    scroll-margin-top: calc(var(--header-h) + 20px);
}

.page-sub .month-sticky {
    top: calc(var(--header-h) + 28px);
}

/* Percorso */

.crumbs {
    padding-top: clamp(20px, 3vw, 32px);
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 500;
}

.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 0;
}

.crumbs li {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.crumbs a {
    color: var(--muted);
    text-decoration: none;
    transition: color .2s;
}

.crumbs a:hover {
    color: var(--accent-text);
}

.crumbs [aria-current] {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ink);
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.crumbs-sep {
    flex: none;
    width: 12px;
    height: 12px;
    margin: 0 8px;
    opacity: .6;
}

/* Scheda evento */

.pe {
    padding-bottom: clamp(48px, 6vw, 80px);
}

.pe-head {
    max-width: 880px;
    padding-top: clamp(28px, 4vw, 52px);
}

.pe-meta {
    font-size: 14px;
}

.pe-meta .cat,
.ev-meta a.cat {
    text-decoration: none;
    transition: color .2s;
}

.ev-meta a.cat:hover {
    color: var(--accent-text);
}

.pe-title {
    margin-top: 18px;
    font-size: clamp(34px, 4.6vw, 58px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -.03em;
    text-wrap: balance;
}

.pe-lede {
    max-width: 62ch;
    margin-top: 22px;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(19px, 1.9vw, 23px);
    line-height: 1.55;
    text-wrap: pretty;
}

/* Barra dell'anno */

.yb {
    margin-top: clamp(32px, 4vw, 48px);
}

.yb-track {
    position: relative;
    height: 34px;
    border-radius: 999px;
    background: var(--surface-2);
}

.yb-track::before {
    content: '';
    position: absolute;
    inset: 16px 16px auto;
    height: 2px;
    border-radius: 2px;
    background: var(--line);
}

.yb-tick {
    position: absolute;
    top: 13px;
    width: 2px;
    height: 8px;
    margin-left: -1px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--muted) 35%, transparent);
}

.yb-tick.is-same {
    top: 10px;
    height: 14px;
    background: color-mix(in srgb, var(--c) 70%, transparent);
}

.yb-span {
    position: absolute;
    top: 12px;
    height: 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--c) 45%, transparent);
}

.yb-dot {
    position: absolute;
    top: 50%;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--c);
    box-shadow: 0 0 0 4px var(--surface-2), 0 0 0 5px color-mix(in srgb, var(--c) 45%, transparent);
    transform: translate(-50%, -50%);
}

.yb-months {
    display: flex;
    margin-top: 10px;
}

.yb-month {
    min-width: 0;
    padding-top: 6px;
    border-left: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: color .2s;
}

.yb-month:last-child {
    border-right: 1px solid var(--line);
}

.yb-month:hover {
    color: var(--ink);
}

.yb-month.is-current {
    color: var(--ink);
    font-weight: 600;
}

.yb-short {
    display: none;
}

/* Corpo della scheda */

.pe-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
    gap: clamp(32px, 6vw, 80px);
    margin-top: clamp(40px, 5vw, 64px);
}

.pe-h {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.pe-body {
    max-width: 66ch;
    margin-top: 12px;
    color: var(--text);
    font-family: var(--serif);
    font-size: 18.5px;
    line-height: 1.75;
    text-wrap: pretty;
}

.pe-main .ev-article {
    max-width: 66ch;
    margin-top: 28px;
}

.pe-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.pe-side {
    align-self: start;
    padding: 24px 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.pe-facts {
    display: grid;
    gap: 18px;
}

.pe-facts > div + div {
    padding-top: 18px;
    border-top: 1px solid var(--line-soft);
}

.pe-facts dt {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
}

.pe-facts dd {
    margin-top: 4px;
    color: var(--ink);
    font-size: 14.5px;
    line-height: 1.5;
}

.pe-facts dd.ev-terms {
    margin-top: 8px;
}

.pe-theme {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-weight: 500;
    text-decoration: none;
}

.pe-theme i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--c);
}

.pe-theme:hover {
    color: var(--accent-text);
}

.pe-sources {
    display: grid;
    gap: 8px;
    margin-top: 2px;
}

.pe-sources li {
    line-height: 1.45;
}

.pe-sources a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--line);
    text-underline-offset: 3px;
    transition: text-decoration-color .2s;
}

.pe-sources a:hover {
    text-decoration-color: var(--accent);
}

.pe-sources .ev-source-note {
    display: inline-block;
    margin: 4px 0 0;
    white-space: normal;
}

.pe-verify {
    color: var(--text) !important;
    font-size: 13.5px !important;
}

/* Precedente e successivo */

.pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: clamp(48px, 6vw, 72px);
}

.pager-link {
    display: grid;
    align-content: start;
    gap: 6px;
    min-width: 0;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
    transition: border-color .25s, box-shadow .3s var(--ease), transform .3s var(--ease);
}

.pager-link.is-empty {
    visibility: hidden;
}

.pager-next {
    text-align: right;
}

a.pager-link:hover {
    border-color: color-mix(in srgb, var(--c, var(--accent)) 45%, var(--line));
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.pager-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.pager-next .pager-label {
    justify-content: flex-end;
}

.pager-label svg {
    width: 15px;
    height: 15px;
}

.pager-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    text-wrap: balance;
}

.pager-meta {
    color: var(--muted);
    font-size: 13px;
}

/* Eventi correlati */

.pe-more-wrap {
    padding: clamp(48px, 6vw, 80px) 0;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.pe-related {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 40px clamp(32px, 5vw, 64px);
}

.pe-related-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.015em;
}

.pe-related-title a {
    color: inherit;
    text-decoration: none;
    background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat;
    transition: background-size .3s var(--ease);
}

.pe-related-title a:hover {
    background-size: 100% 2px;
}

.pe-rows {
    margin-top: 14px;
    border-top: 1px solid var(--line);
}

.pe-row a {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 14px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
    transition: background-color .2s, padding .3s var(--ease);
}

.pe-row a:hover {
    padding-left: 10px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--c) 9%, transparent), transparent 70%);
}

.pe-row-when {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.pe-row-title {
    font-size: 15.5px;
    font-weight: 500;
    line-height: 1.4;
}

.pe-row.is-key .pe-row-title {
    font-weight: 600;
}

.pe-row-cat {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 12.5px;
    white-space: nowrap;
}

.pe-row-cat i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c);
}

/* Schede compatte nelle pagine di mese e tema */

.pe-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    color: var(--accent-text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.pe-more svg {
    width: 16px;
    height: 16px;
    transition: transform .25s var(--ease);
}

.pe-more:hover svg {
    transform: translateX(3px);
}

/* Copertina di mesi e temi */

.pg-hero {
    padding-bottom: clamp(24px, 3vw, 36px);
}

.pg-title {
    display: flex;
    flex-direction: column;
    margin-top: clamp(24px, 4vw, 48px);
}

.pg-title-big {
    display: flex;
    align-items: center;
    gap: .22em;
    margin-left: -.04em;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(64px, 10vw, 132px);
    font-weight: 500;
    line-height: .95;
    letter-spacing: -.035em;
}

.pg-title-theme .pg-title-big i {
    flex: none;
    width: .26em;
    height: .26em;
    border-radius: 50%;
    background: var(--c);
}

.pg-title-sub {
    margin-top: 18px;
    font-size: clamp(20px, 2.2vw, 26px);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.015em;
}

.pg-lede {
    max-width: 62ch;
    margin-top: 18px;
    color: var(--text);
    font-family: var(--serif);
    font-size: clamp(17.5px, 1.6vw, 20px);
    line-height: 1.6;
    text-wrap: pretty;
}

.pg-stats {
    margin-top: 28px;
}

.pg-hero-row {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 28px 48px;
}

.pg-timeline {
    min-height: 0;
    padding-top: 0;
}

.pg-timeline .month:first-child {
    padding-top: clamp(32px, 4vw, 48px);
    border-top: 1px solid var(--line);
}

.month-name a {
    color: inherit;
    text-decoration: none;
    transition: color .2s;
}

.month-name a:hover {
    color: var(--accent-text);
}

.pg-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: color .2s;
}

.pg-back svg {
    width: 15px;
    height: 15px;
}

.pg-back:hover {
    color: var(--accent-text);
}

/* Pillole di navigazione */

.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color .2s, background-color .2s, color .2s;
}

a.pill:hover {
    border-color: var(--accent);
    color: var(--accent-text);
}

.pill.is-current {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--bg);
    font-weight: 600;
}

.pill.is-empty {
    opacity: .4;
}

.pill-theme i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c);
}

.pill-theme b {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.pill-theme.is-current {
    border-color: var(--c);
    background: color-mix(in srgb, var(--c) 14%, var(--surface));
    color: var(--ink);
}

.pill-theme.is-current b {
    color: var(--ink);
}

/* Temi del mese */

.mix {
    margin-top: 12px;
}

.mix-bar {
    display: flex;
    gap: 2px;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
}

.mix-bar i {
    background: var(--c);
}

.mix-list {
    display: grid;
    gap: 2px;
    margin-top: 14px;
}

.mix-list a,
.mix-list span {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 0;
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color .2s;
}

.mix-list a:hover {
    color: var(--accent-text);
}

.mix-list i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c);
}

.mix-list b {
    margin-left: auto;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
}

.page-month .month-blog {
    margin-top: 24px;
}

/* Istogramma dei temi */

.hist {
    display: grid;
    grid-template-columns: repeat(12, 34px);
    gap: 6px;
    align-items: end;
}

.hist-col {
    display: grid;
    justify-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
}

.hist-bar {
    position: relative;
    display: block;
    width: 100%;
    height: 72px;
    border-radius: 8px;
    background: var(--surface-2);
}

.hist-bar::before {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: max(calc(var(--h) * 100%), 0px);
    border-radius: 8px;
    background: var(--c);
    transition: filter .2s;
}

.hist-bar b {
    position: absolute;
    right: 0;
    bottom: 6px;
    left: 0;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

a.hist-col:hover .hist-bar::before {
    filter: brightness(1.08) saturate(1.1);
}

.hist-label {
    font-size: 11.5px;
    font-weight: 600;
}

.hist-col.is-empty {
    opacity: .5;
}

/* Indice dei temi */

.theme-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
    gap: 18px;
    padding: clamp(16px, 2vw, 24px) 0 clamp(56px, 7vw, 96px);
}

.theme-card a {
    position: relative;
    display: grid;
    gap: 14px;
    height: 100%;
    padding: 24px 24px 22px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        radial-gradient(110% 80% at 100% 0%, color-mix(in srgb, var(--c) 12%, transparent), transparent 60%),
        var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: border-color .25s, box-shadow .3s var(--ease), transform .3s var(--ease);
}

.theme-card a::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: var(--c);
}

.theme-card a:hover {
    border-color: color-mix(in srgb, var(--c) 45%, var(--line));
    box-shadow: var(--shadow-lift);
    transform: translateY(-3px);
}

.theme-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-card-head i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--c);
}

.theme-card-name {
    color: var(--ink);
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -.015em;
}

.theme-card-head b {
    margin-left: auto;
    color: var(--ink);
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -.02em;
}

.theme-card-text {
    font-size: 14.5px;
    line-height: 1.6;
}

.theme-card-share {
    display: block;
    height: 4px;
    border-radius: 999px;
    background: var(--surface-2);
}

.theme-card-share i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--c);
}

.theme-card-key {
    display: grid;
    gap: 2px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.theme-card-key span {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
}

/* 404 */

.pg-404 {
    padding-top: clamp(48px, 8vw, 112px);
    padding-bottom: clamp(56px, 8vw, 112px);
}

.pg-404 .pg-lede {
    margin-top: 22px;
}

.pg-404-title {
    margin-top: clamp(48px, 6vw, 72px);
}

.pg-404 .pe-rows {
    max-width: 820px;
}

/* Adattamenti */

@media (max-width: 960px) {
    .pe-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .pe-side {
        max-width: 640px;
    }

    .page-sub .month-head .mix,
    .page-sub .month-head .month-blog-title:first-child {
        order: 0;
    }

    .page-month .month-sticky > .month-blog-title,
    .page-month .month-sticky > .mix {
        display: none;
    }

    .page-sub .pg-back {
        order: 3;
    }
}

@media (max-width: 720px) {
    .yb-long {
        display: none;
    }

    .yb-short {
        display: inline;
    }

    .yb-month {
        font-size: 10.5px;
    }

    .pager {
        grid-template-columns: minmax(0, 1fr);
    }

    .pager-link.is-empty {
        display: none;
    }

    .pager-next {
        text-align: left;
    }

    .pager-next .pager-label {
        justify-content: flex-start;
    }

    .pe-row a {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .pe-row-cat {
        grid-column: 2;
        margin-top: -8px;
    }

    .pe-side {
        padding: 20px;
    }

    .pe-body {
        font-size: 17.5px;
    }

    .hist {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        width: 100%;
        gap: 4px;
    }

    .hist-bar b {
        font-size: 10.5px;
    }

    .pills:not(.pills-themes) {
        flex-wrap: nowrap;
        margin-inline: calc(var(--gutter) * -1);
        padding-inline: var(--gutter);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .pills:not(.pills-themes)::-webkit-scrollbar {
        display: none;
    }

    .pill {
        flex: none;
    }
}
