/* Cantiamo – stile del sito Piccolo Coro TAB (colori, caratteri e forme di albertozak.it) */
@font-face {
  font-family: "PCTK Baloo";
  src: url("pctk/fonts/baloo-2-latin-wght-normal.woff2") format("woff2-variations"), url("pctk/fonts/baloo-2-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 800; font-display: swap;
}
@font-face {
  font-family: "PCTK Nunito";
  src: url("pctk/fonts/nunito-latin-wght-normal.woff2") format("woff2-variations"), url("pctk/fonts/nunito-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 1000; font-display: swap;
}

:root {
  --blue: #2563EB; --pink: #EC4899; --pink-d: #DB2777; --yellow: #F59E0B; --sun: #FDE047;
  --green: #10B981; --violet: #8B5CF6; --ink: #0F172A; --ink-2: #475569;
  --night-1: #1E1B4B; --night-2: #312E81; --night-3: #4C1D95;
  --bg: #F8FAFC; --soft: #EFF6FF; --card: #FFFFFF; --line: #DBEAFE;
  --ok: #047857; --err: #B91C1C;
  --display: "PCTK Baloo", "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --body: "PCTK Nunito", Nunito, "Segoe UI", system-ui, sans-serif;
  --rainbow: linear-gradient(90deg, #10B981, #2563EB 25%, #8B5CF6 45%, #EC4899 65%, #F59E0B 85%, #FDE047);
  --clay: 0 10px 0 -2px rgba(15, 23, 42, .10), 0 18px 30px -10px rgba(37, 99, 235, .28), inset 0 -6px 0 rgba(15, 23, 42, .06), inset 0 4px 0 rgba(255, 255, 255, .7);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 16px/1.5 var(--body); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
main.site-main { flex: 1; width: min(1180px, calc(100% - 32px)); margin: 28px auto 0; }
a { color: var(--blue); }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; }
[hidden] { display: none !important; }
:focus-visible { outline: 4px solid var(--yellow); outline-offset: 3px; border-radius: 12px; }

/* ---------------- intestazione ---------------- */
.site-header { position: relative; z-index: 30; background: rgba(255,255,255,.96); box-shadow: 0 10px 30px -18px rgba(30,27,75,.45); }
.site-header::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--rainbow); }
.header-inner { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 20px 0 14px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--night-3); }
.brand img { width: 72px; height: 72px; border-radius: 50%; background: #fff; object-fit: contain;
  box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--sun), 0 10px 22px -10px rgba(30,27,75,.55); transition: transform .3s var(--ease-back); }
.brand:hover img, .brand:focus-visible img { transform: rotate(-6deg) scale(1.05); }
.brand span { font: 700 1.05rem/1.25 var(--display); letter-spacing: .02em; max-width: 12em; }
.nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.nav > a, .nav summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 16px; border-radius: 999px; font: 800 1.15rem/1.2 var(--display); color: var(--ink); text-decoration: none;
  transition: background .2s ease, transform .2s ease;
}
.nav summary::-webkit-details-marker { display: none; }
.nav > a:hover, .nav summary:hover { background: #FEF9C3; transform: translateY(-1px); }
.nav > a.is-current, .nav details.is-current > summary { background: var(--pink-d); color: #fff; box-shadow: 0 4px 0 -1px #BE185D, 0 10px 18px -10px rgba(236,72,153,.9); }
.nav details { position: relative; }
.nav details summary::after { content: ""; width: 8px; height: 8px; border: solid currentColor; border-width: 0 3px 3px 0; transform: rotate(45deg) translateY(-3px); }
.nav details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.nav .menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 260px; padding: 10px; border-radius: 22px; background: #fff;
  box-shadow: 0 0 0 2px rgba(139,92,246,.18), 0 24px 40px -16px rgba(30,27,75,.45); display: grid; gap: 2px; z-index: 40; }
.nav .menu a { padding: 10px 16px; border-radius: 14px; font: 700 1.05rem/1.25 var(--display); color: var(--ink); text-decoration: none; }
.nav .menu a:hover { background: #FEF9C3; }
.nav .menu a.is-current { background: #FCE7F3; color: #9D174D; }
.nav .menu form { margin: 0; }
.nav .menu button { width: 100%; text-align: left; border: 0; background: none; cursor: pointer; padding: 10px 16px; border-radius: 14px; font: 700 1.05rem/1.25 var(--display); color: var(--ink); }
.nav .menu button:hover { background: #FEF9C3; }
@media (max-width: 760px) {
  .header-inner { padding: 16px 0 10px; gap: 10px; }
  .brand img { width: 56px; height: 56px; }
  .nav { margin-left: 0; width: 100%; }
  .nav > a, .nav summary { font-size: 1.05rem; padding: 6px 12px; }
  .nav .menu { left: 0; right: auto; }
}

/* ---------------- piè di pagina ---------------- */
.site-footer { position: relative; margin-top: 90px; color: #E9D5FF; background: linear-gradient(160deg, var(--night-1) 0%, var(--night-2) 55%, var(--night-3) 100%); }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: -38px; height: 40px; background: var(--night-1);
  -webkit-mask: radial-gradient(28px 22px at 28px 0, transparent 98%, #000) 0 0 / 56px 40px repeat-x;
  mask: radial-gradient(28px 22px at 28px 0, transparent 98%, #000) 0 0 / 56px 40px repeat-x; }
.site-footer::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--rainbow); opacity: .9; }
.footer-inner { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 30px; display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; font-weight: 600; }
.footer-claim { width: 100%; text-align: center; font: 800 2rem/1.15 var(--display); color: var(--sun); margin: 0 0 12px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--sun); text-decoration: underline; text-underline-offset: 3px; }
.site-footer .brandname { font-family: var(--display); font-weight: 800; }
.to-top { padding: 10px 18px; border-radius: 999px; color: var(--ink) !important; background: var(--sun); font: 800 1rem/1 var(--display); box-shadow: 0 5px 0 -1px #CA8A04; }

/* ---------------- home ---------------- */
.pctk-homepage a.pctk-book-link { display: block; text-decoration: none; color: inherit; }
.pctk-book-cover { display: block; width: 100%; max-width: 200px; aspect-ratio: 3 / 4; object-fit: cover; margin: 0 auto; border-radius: 12px; background: var(--soft); box-shadow: 0 12px 22px -12px rgba(15,23,42,.5); }

/* ---------------- pagine di testo ---------------- */
.prose { max-width: 780px; margin: 0 auto; background: var(--card); border-radius: 28px; padding: clamp(20px, 4vw, 44px); box-shadow: var(--clay); }
.prose h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 16px; }
.prose h1::after { content: ""; display: block; width: 96px; height: 10px; border-radius: 10px; margin-top: 8px; background: linear-gradient(90deg, var(--blue), var(--pink), var(--yellow)); }
.prose h2 { font-size: 1.6rem; margin: 32px 0 8px; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }

/* ---------------- libretto ---------------- */
.book-view { display: grid; gap: 16px; }
.book-view object, .book-view iframe { width: 100%; height: min(85vh, 1100px); border: 0; border-radius: 20px; background: #fff; box-shadow: var(--clay); }

/* ---------------- moduli, admin, accesso ---------------- */
.wrap { width: min(980px, calc(100% - 32px)); margin: 0 auto; }
.page-title { font: 800 clamp(2rem, 5vw, 3rem)/1.05 var(--display); margin: 0 0 18px; }
.page-title::after { content: ""; display: block; width: 96px; height: 10px; border-radius: 10px; margin-top: 8px; background: linear-gradient(90deg, var(--blue), var(--pink), var(--yellow)); }
.card { background: var(--card); border-radius: 28px; padding: clamp(18px, 3vw, 28px); margin-bottom: 22px; box-shadow: var(--clay); }
.card h2 { margin: 0 0 12px; font-size: 1.6rem; }
.grid { display: grid; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border: 3px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); cursor: pointer; text-decoration: none;
  font: 800 1rem/1 var(--display); transition: transform .18s var(--ease-back), box-shadow .18s ease;
  box-shadow: 0 5px 0 -1px #BFDBFE;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 -1px #BFDBFE; }
.btn.primary { background: var(--pink); color: #fff; border-color: rgba(255,255,255,.5); box-shadow: 0 6px 0 -1px #9D174D, 0 14px 22px -12px rgba(236,72,153,.6), inset 0 3px 0 rgba(255,255,255,.35); }
.btn.alt { background: var(--blue); color: #fff; border-color: rgba(255,255,255,.5); box-shadow: 0 6px 0 -1px #1E3A8A, inset 0 3px 0 rgba(255,255,255,.35); }
.btn.danger { color: var(--err); border-color: #FECACA; box-shadow: 0 5px 0 -1px #FECACA; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: .92rem; }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs .btn[aria-selected="true"] { background: var(--violet); color: #fff; border-color: rgba(255,255,255,.5); box-shadow: 0 6px 0 -1px #5B21B6; }
input[type=text], input[type=search], input[type=number], input[type=password], input[type=email], textarea, select {
  width: 100%; font: 600 1rem/1.3 var(--body); color: var(--ink); background: #fff;
  border: 3px solid var(--line); border-radius: 16px; padding: 10px 14px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); }
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92rem; min-height: 200px; }
input[type=file] { font: 600 .9rem var(--body); max-width: 100%; }
label.f { display: grid; gap: 6px; font: 700 .95rem/1.2 var(--body); color: var(--ink-2); }
.tracks { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.tracks input[type=file] { max-width: 100%; }
.tracks input { min-width: 0; width: 100%; box-sizing: border-box; }
.tracks fieldset { border: 3px dashed var(--line); border-radius: 20px; padding: 12px 14px; margin: 0; min-width: 0; background: var(--soft); }
.tracks legend { font: 800 1.1rem var(--display); padding: 0 6px; color: var(--night-3); }
.msg { padding: 12px 14px; border-radius: 16px; font-weight: 700; white-space: pre-wrap; }
.msg.ok { background: #D1FAE5; color: var(--ok); }
.msg.err { background: #FEE2E2; color: var(--err); }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
table.list { width: 100%; border-collapse: collapse; }
table.list td { padding: 12px 6px; border-top: 2px solid var(--soft); vertical-align: middle; }
.chip { display: inline-block; font: 800 .75rem/1 var(--display); padding: 5px 10px; border-radius: 999px; background: var(--soft); color: var(--blue); vertical-align: middle; }
.chip.pink { background: #FCE7F3; color: #9D174D; }
.chip.grey { background: #F1F5F9; color: #475569; }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88em; background: var(--soft); padding: 1px 5px; border-radius: 6px; }
.login-box { max-width: 460px; margin: 20px auto 0; text-align: center; }
.login-box .card { text-align: left; }
.login-logo { width: 110px; height: 110px; border-radius: 50%; background: #fff; object-fit: contain; box-shadow: 0 0 0 4px #fff, 0 0 0 8px var(--sun), var(--clay); margin-bottom: 14px; }
.notice { text-align: center; padding: 40px 20px; }
@media (max-width: 560px) { .card { border-radius: 22px; } }

/* ---- messaggi dei maestri in home ---- */
.notices { display: grid; gap: 16px; margin: 8px 0 28px; }
.notice-card { position: relative; padding: 18px 22px; border-radius: 24px; background: var(--nc-bg); border: 3px solid var(--nc-bd); box-shadow: 0 6px 0 var(--nc-bd); color: #1E1B4B; }
.notice-card.c-giallo, .sw.c-giallo { --nc-bg: #FEF9C3; --nc-bd: #FACC15; }
.notice-card.c-rosa, .sw.c-rosa { --nc-bg: #FCE7F3; --nc-bd: #F472B6; }
.notice-card.c-azzurro, .sw.c-azzurro { --nc-bg: #DBEAFE; --nc-bd: #60A5FA; }
.notice-card.c-verde, .sw.c-verde { --nc-bg: #D1FAE5; --nc-bd: #34D399; }
.notice-card.c-viola, .sw.c-viola { --nc-bg: #EDE9FE; --nc-bd: #A78BFA; }
.notice-title { margin: 0 0 6px; font: 800 clamp(1.3rem, 3vw, 1.7rem)/1.15 var(--display); padding-right: 44px; }
.notice-text { margin: 0; font-size: 1.08rem; line-height: 1.5; padding-right: 30px; overflow-wrap: anywhere; }
.notice-text a { color: inherit; font-weight: 700; }
.notice-edit { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--nc-bd); background: #fff; color: #1E1B4B; display: grid; place-items: center; cursor: pointer; }
.notice-edit:hover, .notice-edit:focus-visible { transform: rotate(-12deg) scale(1.08); }
.notice-add { justify-self: start; display: inline-flex; gap: 8px; align-items: center; }
.notice-form { display: grid; gap: 12px; }
.notice-form textarea { min-height: 110px; font: 1.05rem/1.5 var(--body); }
.notice-colors { display: flex; gap: 10px; }
.notice-colors .sw { width: 34px; height: 34px; border-radius: 50%; background: var(--nc-bg); border: 3px solid var(--nc-bd); cursor: pointer; display: grid; place-items: center; }
.notice-colors .sw:has(input:checked) { outline: 3px solid #1E1B4B; outline-offset: 2px; }
.notice-colors input { position: absolute; opacity: 0; pointer-events: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
