/* Drawlings Padova — six palettes, no external fonts or services. */
:root {
  color-scheme: dark;
  --paper: #101d35;
  --surface: #192943;
  --ink: #f6f5ee;
  --muted: #bcc8dc;
  --line: #465774;
  --accent: #ffe54f;
  --radius: 14px;
  --page-width: 1480px;
}
:root[data-theme="inchiostro"] { --paper: #171717; --surface: #242424; --ink: #f8f5ef; --muted: #c4c1ba; --line: #55534e; --accent: #f4d789; }
:root[data-theme="bosco"] { --paper: #152d27; --surface: #203d34; --ink: #f2f5e9; --muted: #b8cebe; --line: #4e7160; --accent: #d9ef9d; }
:root[data-theme="carta"] { color-scheme: light; --paper: #faf8f1; --surface: #eeebe2; --ink: #20201c; --muted: #646359; --line: #bbb7aa; --accent: #71560a; }
:root[data-theme="rosa"] { color-scheme: light; --paper: #f8e8ed; --surface: #efdae2; --ink: #402333; --muted: #795368; --line: #be94a8; --accent: #8b3059; }
:root[data-theme="cielo"] { color-scheme: light; --paper: #e6f1fa; --surface: #d5e6f4; --ink: #17334a; --muted: #4c687d; --line: #96b3c9; --accent: #185d87; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 150px; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); font-family: "Trebuchet MS", Verdana, sans-serif; font-size: 16px; line-height: 1.65; }
body.dialog-open { overflow: hidden; }
main { flex: 1; }
button, input, select, summary { font: inherit; }
button, a, select, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { color: inherit; cursor: pointer; }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.04em; }
h1 { font-size: clamp(2.6rem, 5vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 3vw, 3rem); }
h3 { font-size: 1.4rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
::selection { color: var(--paper); background: var(--ink); }
.container { width: calc(100% - 80px); max-width: var(--page-width); margin-inline: auto; }
.muted { color: var(--muted); }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; line-height: 1.6; }
.lead { font-size: 1.15rem; line-height: 1.7; color: var(--muted); max-width: 660px; }
.skip-link { position: fixed; top: 12px; left: 12px; padding: 12px 20px; z-index: 20; background: var(--paper); border: 2px solid var(--ink); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; gap: 28px; min-height: 92px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; flex-shrink: 0; }
.brand img { width: 44px; height: 44px; border-radius: 50%; }
.brand-name { font-size: 1.4rem; font-weight: 700; letter-spacing: -.05em; line-height: 1; }
.brand-place { display: block; font-size: .6rem; letter-spacing: .3em; line-height: 2; margin-top: 2px; }
.nav { display: flex; gap: 24px; align-items: center; }
.nav a { text-decoration: none; font-size: .9rem; padding-block: 12px; position: relative; }
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); }
.nav a[aria-current="page"] { font-weight: 700; }
.header-controls { display: flex; align-items: center; gap: 20px; }
.theme-switch { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); }
.theme-switch select { max-width: 145px; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--paper); cursor: pointer; }
.language-switch { display: flex; border: 1px solid var(--line); border-radius: 100px; overflow: hidden; flex-shrink: 0; padding: 3px; }
.language-switch button { background: transparent; border: 0; border-radius: 100px; min-width: 40px; min-height: 36px; font-size: .74rem; font-weight: 700; }
.language-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.language-switch button:focus-visible { outline-offset: -3px; }
.text-link { color: var(--accent); font-size: .98rem; font-weight: 700; display: inline-block; }
.home-hero { text-align: center; padding-block: 42px 68px; }
.home-logo { width: min(390px, 100%); margin: 0 auto 30px; }
.home-logo img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.home-intro { font-size: clamp(1.1rem, 2vw, 1.4rem); max-width: 640px; margin: 0 auto 22px; line-height: 1.6; }
.page-intro { padding-block: 58px 34px; text-align: center; }
.page-intro h1 { margin-bottom: 16px; }
.page-intro .lead { margin-inline: auto; }
.gallery-section, .events-list { padding-bottom: 76px; }
.notice { font-size: .9rem; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; padding: 14px 20px; margin-bottom: 28px; }
.notice p:last-child { margin-bottom: 0; }
.error-notice, .grid-message { grid-column: 1 / -1; }
.error-notice .button { margin-top: 12px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 8px 18px; font-size: .9rem; font-weight: 700; background: var(--surface); border: 1px solid var(--line); border-radius: 100px; text-decoration: none; }
.button:hover { border-color: var(--ink); }
.drawings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px 24px; }
.drawing-card { min-width: 0; }
.drawing-open { position: relative; width: 100%; display: block; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; transition: transform .18s; }
.drawing-open img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; padding: 18px; }
.drawing-open:hover { transform: translateY(-3px); }
.drawing-zoom { position: absolute; right: 14px; bottom: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 50%; width: 36px; height: 36px; display: grid; place-items: center; font-size: 1.2rem; }
.drawing-caption { display: flex; align-items: start; justify-content: space-between; gap: 14px; padding: 16px 2px 0; }
.drawing-caption h3 { font-size: 1.08rem; letter-spacing: -.025em; margin: 0; overflow-wrap: anywhere; }
.drawing-author { font-size: .83rem; margin: 5px 0 0; color: var(--muted); }
.badge { display: inline-block; flex-shrink: 0; font-size: .64rem; font-weight: 700; letter-spacing: .055em; line-height: 1.6; text-transform: uppercase; border: 1px solid var(--line); border-radius: 100px; padding: 2px 9px; color: var(--muted); }
.event-section { margin-top: 40px; }
.section-title { font-size: 1.6rem; margin-bottom: 24px; }
.event-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; margin-bottom: 24px; scroll-margin-top: 150px; }
.event-summary { display: flex; align-items: center; gap: 30px; padding: 22px; cursor: pointer; list-style: none; }
.event-summary::-webkit-details-marker { display: none; }
.event-summary::marker { content: ""; }
.event-summary > img { width: 190px; height: 145px; flex-shrink: 0; object-fit: cover; border: 1px solid var(--line); border-radius: 10px; }
.event-overview { flex: 1; min-width: 0; }
.event-overview h3 { font-size: 1.6rem; margin-bottom: 12px; overflow-wrap: anywhere; }
.event-overview p { margin-bottom: 0; }
.event-overview .badge { margin-bottom: 12px; white-space: normal; }
.event-overview .event-date { margin-bottom: 8px; font-size: .68rem; }
.event-action { display: flex; align-items: center; gap: 16px; font-size: .83rem; font-weight: 700; }
.event-plus { border: 1px solid var(--line); border-radius: 50%; width: 42px; height: 42px; display: grid; place-items: center; font-size: 1.5rem; flex-shrink: 0; transition: transform .15s; }
.event-card[open] .event-plus { transform: rotate(45deg); }
.event-card[open] .event-summary { border-bottom: 1px solid var(--line); }
.event-summary:hover { background: var(--paper); }
.event-body { padding: 32px; }
.event-metadata { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 0 0 28px; }
.event-metadata dt { font-weight: 700; font-size: .85rem; }
.event-metadata dd { margin: 4px 0 0; color: var(--muted); }
.event-description, .drawing-description { white-space: pre-line; overflow-wrap: anywhere; }
.event-description { max-width: 840px; margin-bottom: 30px; }
.event-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-bottom: 20px; }
.event-images img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--paper); border-radius: 10px; }
.event-images img:only-child { grid-column: 1 / -1; max-height: 620px; }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; padding-block: 28px; align-items: center; }
.footer-inner p { margin: 0; }
.footer-name { font-size: .95rem; font-weight: 700; letter-spacing: -.03em; }
.footer-meta { text-align: right; font-size: .83rem; color: var(--muted); }
.drawing-dialog { width: min(900px, calc(100% - 48px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); }
.drawing-dialog::backdrop { background: rgb(0 0 0 / .78); }
.dialog-shell { position: relative; }
.dialog-close { position: absolute; z-index: 1; top: 14px; right: 14px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); font-size: 1.8rem; line-height: 1; }
.dialog-image { width: 100%; height: min(56dvh, 620px); padding: 24px; object-fit: contain; background: var(--surface); }
.dialog-caption { padding: 22px 28px; }
.dialog-caption h2 { font-size: 1.65rem; margin-bottom: 8px; }
.dialog-caption p { font-size: .9rem; margin-bottom: 10px; }
.dialog-controls { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 16px; }
.icon-button { border: 1px solid var(--line); background: var(--paper); border-radius: 50%; width: 44px; height: 44px; font-size: 1.25rem; }
.icon-button:disabled { opacity: .4; cursor: default; }
.dialog-counter { font-size: .8rem; color: var(--muted); }
.noscript-notice { margin: 20px auto; padding: 16px; border: 1px solid var(--line); }
@media (max-width: 1100px) {
  .container { width: calc(100% - 48px); }
  .header-inner { flex-wrap: wrap; gap: 8px 20px; padding-block: 16px 8px; }
  .header-controls { order: 1; }
  .nav { order: 2; width: 100%; justify-content: center; gap: 30px; }
  .drawings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event-action { font-size: 0; gap: 0; }
  .event-plus { font-size: 1.5rem; }
}
@media (max-width: 700px) {
  .container { width: calc(100% - 36px); }
  .header-inner { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding-block: 12px; }
  .brand { gap: 8px; }
  .brand img { width: 34px; height: 34px; }
  .brand-name { font-size: 1.2rem; }
  .brand-place { font-size: .5rem; }
  .header-controls { display: contents; }
  .language-switch { grid-column: 2; grid-row: 1; }
  .language-switch button { min-width: 34px; min-height: 36px; }
  .nav { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; gap: 8px; }
  .nav a { font-size: .82rem; padding-block: 8px; }
  .theme-switch { grid-column: 1 / -1; grid-row: 3; justify-content: end; }
  .theme-switch select { min-height: 40px; padding-block: 6px; }
  .home-hero { padding-block: 28px 46px; }
  .home-logo { width: min(310px, 100%); margin-bottom: 26px; }
  .home-intro { font-size: 1.1rem; }
  .notice { padding: 13px 16px; font-size: .83rem; }
  .drawings-grid { gap: 30px 18px; }
  .drawing-open img { padding: 12px; }
  .drawing-caption { flex-wrap: wrap; gap: 8px; }
  .drawing-zoom { width: 30px; height: 30px; right: 10px; bottom: 10px; }
  .page-intro { padding-block: 36px 24px; }
  .page-intro h1 { font-size: clamp(2.3rem, 9vw, 3.5rem); }
  .gallery-section, .events-list { padding-bottom: 48px; }
  .event-summary { gap: 16px; padding: 18px; align-items: start; flex-wrap: wrap; }
  .event-summary > img { width: 100%; height: 190px; }
  .event-overview h3 { font-size: 1.3rem; }
  .event-overview .event-date { font-size: .62rem; }
  .event-body { padding: 22px; }
  .event-metadata, .event-images { grid-template-columns: 1fr; gap: 18px; }
  .event-plus { width: 36px; height: 36px; }
  .footer-inner { flex-direction: column; gap: 8px; align-items: start; padding-block: 24px; }
  .footer-meta { text-align: left; }
  .drawing-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
  .dialog-image { height: 43dvh; padding: 14px; }
  .dialog-caption { padding: 18px; }
}
@media (max-width: 520px) { .drawings-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
