:root {
    --color-accent: hsl(356 62% 39%);
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-accent: hsl(6 88% 67%);
    }
}

:root[data-theme="dark"] {
    --color-accent: hsl(6 88% 67%);
}

:root[data-theme="light"] {
    --color-accent: hsl(356 62% 39%);
}

.content-list {
    list-style: none;
    padding-left: 0;
}

.content-list li {
    border-top: 1px solid var(--bg-dark);
    padding: 0.85rem 0;
}

.content-list a {
    font: var(--h3);
}

.content-list .article-meta {
    display: block;
    margin-top: 0.25rem;
}

.navbar-title {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    max-width: 34ch;
}

.navbar-title-main {
    font: var(--h2);
}

.navbar-subtitle {
    color: var(--color-text-muted);
    font: var(--p2);
}

.top {
    z-index: 1000;
    grid-template-columns: minmax(1rem, 1fr) minmax(0, 1120px) minmax(1rem, 1fr);
}

.navbar {
    min-width: 0;
}

.navbar-brand {
    min-width: 0;
}

.navbar-panel {
    min-width: 0;
}

.navbar-title {
    min-width: 0;
}

.navbar-title-main,
.navbar-subtitle {
    overflow-wrap: anywhere;
}

.nav-toggle {
    align-items: center;
    gap: 0.5rem;
}

.nav-toggle::before {
    content: "";
    width: 1rem;
    height: 0.125rem;
    background: currentColor;
    box-shadow: 0 -0.32rem 0 currentColor, 0 0.32rem 0 currentColor;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 45%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0));
    pointer-events: none;
}

.hero-copy {
    position: absolute;
    right: clamp(1.25rem, 6vw, 5rem);
    bottom: clamp(1.5rem, 7vw, 5.5rem);
    z-index: 1;
    width: min(34rem, calc(100% - 2.5rem));
    color: #fff;
    text-align: right;
    text-shadow: 0 0.1rem 0.8rem rgba(0, 0, 0, 0.72);
}

.hero-copy h1 {
    margin: 0;
    font-family: var(--ff);
    font-size: clamp(2.25rem, 7vw, 5.5rem);
    line-height: 0.95;
}

.hero-copy blockquote {
    margin: 1rem 0 0 auto;
    padding: 0;
    border: 0;
    max-width: 30rem;
    color: inherit;
}

.hero-copy blockquote p {
    margin: 0;
    font: 1.15rem/1.45 var(--ff);
}

.credits {
    margin: 1.5rem 0 2rem;
    padding: 1rem 0;
    border-top: 1px solid var(--bg-dark);
    border-bottom: 1px solid var(--bg-dark);
}

.credits-title {
    margin: 0 0 0.85rem;
    color: var(--color-text-muted);
    font: var(--p2);
    text-transform: uppercase;
}

.credits-list {
    display: grid;
    gap: 0.45rem 1rem;
    margin: 0;
}

.credits-item {
    display: grid;
    grid-template-columns: minmax(8rem, 0.36fr) minmax(0, 1fr);
    gap: 1rem;
}

.credits dt {
    color: var(--color-text-muted);
    font: var(--p2);
}

.credits dd {
    margin: 0;
    font: var(--p2);
}

.credits p {
    margin: 0;
    font: inherit;
}

.credits-item--full {
    grid-template-columns: 1fr;
}

.gallery {
    display: block;
    margin: 1.5rem 0;
}

.gallery figure {
    margin: 0 auto 1.5rem;
}

.gallery img {
    display: block;
    width: auto;
    max-width: 92%;
    height: auto;
    margin: 0 auto;
    aspect-ratio: auto;
    object-fit: contain;
}

.spettacoli-feed-header {
    margin-bottom: 1.5rem;
}

.spettacoli-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0 2rem;
}

.spettacolo-card {
    min-width: 0;
    border-top: 1px solid var(--bg-dark);
}

.spettacolo-card-link {
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100%;
    color: var(--color-text);
    text-decoration: none;
}

.spettacolo-card-link:hover h2 {
    color: var(--color-accent);
}

.spettacolo-card-media {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--bg-dark);
}

.spettacolo-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spettacolo-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--color-text-muted);
    font: 600 4rem/1 var(--ff);
    text-transform: uppercase;
}

.spettacolo-card-body {
    padding: 0.85rem 0 0;
}

.spettacolo-card h2 {
    margin: 0;
    font: var(--h3);
}

.spettacolo-card p {
    margin: 0.45rem 0 0;
    color: var(--color-text-muted);
    font: var(--p2);
}

.spettacolo-card .spettacolo-card-year {
    margin-top: 0.25rem;
}

.event-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
}

.home-events {
    margin-top: 2.5rem;
}

.event-period {
    margin-top: 2rem;
}

.event-period--past {
    margin-top: 3rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--bg-dark);
}

.event-period-title {
    margin-bottom: 0.5rem;
}

.event-year {
    margin-top: 2rem;
}

.event-year-title {
    color: var(--color-text-muted);
}

.event-item {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: 1.25rem;
    padding: 1rem 0;
    border-top: 1px solid var(--bg-dark);
}

.event-date {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: var(--color-text-muted);
}

.event-day {
    color: var(--color-text);
    font: 600 1.55rem/1 var(--ff);
}

.event-month {
    margin-top: 0.2rem;
    font: var(--p2);
    text-transform: uppercase;
}

.event-title {
    margin: 0;
    font: var(--h3);
}

.event-title a {
    color: var(--color-text);
    text-decoration: none;
}

.event-title a:hover {
    color: var(--color-accent);
}

.event-meta {
    color: var(--color-text-muted);
    font: var(--p2);
    margin: 0.4rem 0 0;
}

.event-meta span::before {
    content: "\00b7";
    margin: 0 0.45rem;
}

.history {
    margin-top: 2.5rem;
}

.history-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
}

.history-item {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: 1.25rem;
    padding: 1.2rem 0;
    border-top: 1px solid var(--bg-dark);
}

.history-date {
    color: var(--color-text);
    font: 600 1.25rem/1.1 var(--ff);
}

.history-card {
    display: block;
}

.history-media {
    margin: 0 0 0.85rem;
}

.history-media img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    background: var(--bg-dark);
}

.history-media figcaption {
    margin-top: 0.45rem;
    color: var(--color-text-muted);
    font: var(--p2);
}

.history-summary h3 {
    margin: 0 0 0.45rem;
    font: var(--h3);
}

.history-text p {
    margin-bottom: 0.65rem;
    font: var(--p2);
}

@media (max-width: 768px) {
    .hero-copy {
        right: auto;
        left: 1.25rem;
        bottom: 1.5rem;
        width: min(28rem, calc(100% - 2.5rem));
        text-align: left;
    }

    .hero-copy h1 {
        font-size: clamp(2rem, 12vw, 3.5rem);
    }

    .hero-copy blockquote p {
        font-size: 1rem;
    }

    .spettacoli-grid {
        grid-template-columns: 1fr;
    }

    .history-item,
    .event-item {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .event-date {
        flex-direction: row;
        align-items: baseline;
        gap: 0.45rem;
    }

    .event-month {
        margin-top: 0;
    }

    .credits-item {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }
}

@media (min-width: 769px) and (max-width: 1040px) {
    .spettacoli-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .top {
        grid-template-columns: 1fr;
    }

    .navbar {
        margin: 0.75rem 1rem;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .nav-toggle {
        display: inline-flex;
        justify-content: center;
    }

    .navbar-panel {
        display: none;
        width: 100%;
        grid-column: 1 / -1;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding-top: 0.5rem;
        overflow-x: clip;
    }

    .navbar-panel.is-open {
        display: flex;
    }

    .navbar-tools {
        margin-left: 0;
        width: 100%;
    }

    .navbar-buttons {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-left: 0;
    }

    .navbar-buttons li {
        width: 100%;
    }

    .navbar-buttons a,
    .navbar-buttons button {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.8rem 0;
        white-space: normal;
        border-bottom: 1px solid var(--bg-dark);
    }

    .submenu {
        position: static;
        min-width: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        border: none;
        border-radius: 0;
        padding: 0 0 0.35rem 1rem;
        background: transparent;
        margin: 0;
    }

    .submenu li a,
    .submenu li button {
        padding: 0.55rem 0;
        font-size: 0.95rem;
        border-bottom: none;
    }

    .theme-menu {
        width: 100%;
    }

    .theme-menu .has-submenu {
        width: 100%;
    }

    .theme-toggle {
        width: 100%;
        justify-content: flex-start;
        gap: 0.65rem;
    }

    .theme-menu .submenu {
        padding-left: 0;
    }

    .theme-menu .submenu li button {
        padding-left: 0;
    }

    .theme-toggle::after {
        content: "Tema";
        color: var(--color-text-muted);
    }
}
