/**
 * File: app/app.css
 * Description: the web app of the Kraški pust (app/index.html): made for the phone, with the colours and the
 *              fonts of the site; on a wide screen it stays in a column in the middle
 */

:root {
  /* The blue of the site (css/kp-v4.css); the red of the site is no longer used in the app */
  --brand: #196891;
  --brand-dark: #0d4868;
  --brand-light: #3d9bd0;
  --yellow: #ffcd47;
  --gold: #f0b400;
  --blue: #0d4868;
  --sky: #115d84;
  --ink: #1d2730;
  --muted: #5d6b76;
  --line: #e2e8ee;
  --bg: #f4f6f8;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(13, 72, 104, .08);
  --bar: 56px;
  --tabs: 62px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body.has-viewer { overflow: hidden; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: var(--sky); }
[hidden] { display: none !important; }
.icon { flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 20;
  /* Two sides of the same width, so that the name stays really in the middle */
  display: grid; grid-template-columns: 76px minmax(0, 1fr) 76px; align-items: center; gap: 4px;
  height: calc(var(--bar) + var(--safe-top));
  padding: var(--safe-top) 8px 0 10px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.bar-back, .bar-lang, .bar-login {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 35px; height: 35px; padding: 0 7px;
  background: rgba(255, 255, 255, .14); border: 0; border-radius: 12px; color: #fff; cursor: pointer;
}
.bar-back, .bar-login { padding: 0; }
.bar-side { display: flex; align-items: center; gap: 4px; min-width: 0; }
.bar-side.is-right { justify-content: flex-end; gap: 6px; }
.bar-login { position: relative; text-decoration: none; }
/* Logged in: a yellow dot on the icon */
.bar-login.is-in::after { content: ""; position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; background: var(--yellow); border: 2px solid var(--brand); border-radius: 50%; }
.bar-logo { display: flex; flex: none; }
.bar-back svg, .bar-login svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.bar-lang { font: 700 13px/1 "Montserrat", sans-serif; letter-spacing: .06em; }
.bar-brand { display: flex; justify-content: center; min-width: 0; color: #fff; text-decoration: none; }
/* The logo of the site without background, a light shadow keeps it readable on the blue */
.bar-logo img { width: auto; height: 38px; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .35)); }
.bar-brand > span { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; max-width: 100%; overflow: hidden; font: 400 18px/1.1 "Paytone One", sans-serif; white-space: nowrap; text-overflow: ellipsis; }
.bar-brand > span > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* The name of the edition: the name and, below it, the year in yellow */
/* On one line, as big as the room allows: app.js (fitBarName) makes it smaller only when it does not fit */
.bar-name { display: block; overflow: hidden; line-height: 1.1; font-size: 21px; white-space: nowrap; }
.bar-name strong { color: var(--yellow); font-weight: 400; }
/* On the main screens, after the logo, the badge with the number of the edition, as on the site */
.bar-badge {
  display: grid; place-items: center; flex: none;
  width: 32px; height: 32px;
  background: var(--yellow); border: 2px solid #fff; border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .28);
  color: var(--brand-dark); font: 400 13px/1 "Paytone One", sans-serif;
  transform: rotate(-8deg);
}

/* Screen */
.view {
  max-width: 960px; margin: 0 auto;
  padding: 16px 16px calc(var(--tabs) + var(--safe-bottom) + 24px);
  outline: none;
}
.page-title { margin: 4px 0 14px; color: var(--brand); font: 400 28px/1.15 "Paytone One", sans-serif; }
.page-title small { display: block; margin-top: 6px; color: var(--brand-dark); font: 400 21px/1.2 "Paytone One", sans-serif; }
.section-title { margin: 22px 0 10px; color: var(--blue); font: 700 15px/1.2 "Montserrat", sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.meta { margin: 0 0 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 60px 0; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { padding: 40px 12px; color: var(--muted); text-align: center; }
.offline-note { margin: 0 0 12px; padding: 10px 14px; background: #fff7dc; border: 1px solid #f0d98a; border-radius: 12px; color: #6b5300; font-size: 14px; }

/* Buttons and cards */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px;
  background: var(--brand); border: 0; border-radius: 999px; color: #fff;
  font: 700 15px/1.2 "Montserrat", sans-serif; text-decoration: none; cursor: pointer;
}
.btn:active { background: var(--brand-dark); }
.btn:disabled { opacity: .6; }
.btn.is-quiet { background: #fff; border: 1.5px solid var(--line); color: var(--blue); }
.btn.is-wide { width: 100%; margin-top: 14px; }
.card {
  display: block; margin: 0 0 14px; padding: 16px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  color: inherit; text-decoration: none;
}
.card h2 { margin: 0; color: var(--ink); font: 700 17px/1.3 "Montserrat", sans-serif; }
.card p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.kicker { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; color: var(--brand); font: 700 12px/1.2 "Montserrat", sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.link { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; color: var(--brand); font-weight: 700; text-decoration: none; }

/* Home: the countdown as on the site (css/kp-v4.css .kp4-countdown), with its confetti still and falling */
:root {
  --rhombus-red: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath transform='rotate(20 12 12)' d='M12 1l7 11-7 11-7-11z' fill='%23e63946'/%3E%3C/svg%3E");
  --rhombus-yellow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath transform='rotate(-30 12 12)' d='M12 1l7 11-7 11-7-11z' fill='%23ffcd47'/%3E%3C/svg%3E");
  --rhombus-white: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath transform='rotate(-50 12 12)' d='M12 1l7 11-7 11-7-11z' fill='%23ffffff'/%3E%3C/svg%3E");
  --rhombus-sky: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath transform='rotate(35 12 12)' d='M12 1l7 11-7 11-7-11z' fill='%234fb3e8'/%3E%3C/svg%3E");
  --rhombus-pink: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath transform='rotate(60 12 12)' d='M12 1l7 11-7 11-7-11z' fill='%23e738c1'/%3E%3C/svg%3E");
}
.hero {
  position: relative; overflow: hidden;
  margin: 0 0 14px; padding: 24px 16px 20px;
  background: linear-gradient(160deg, #1a78a6, #0d4868);
  border-radius: 16px; color: #fff; text-align: center;
  box-shadow: 0 6px 18px rgba(17, 93, 132, .30);
}
.hero-title { position: relative; z-index: 1; margin: 0; font: 400 30px/1.15 "Oswald", sans-serif; }
.hero-title strong { color: #ffcd47; font-weight: 400; }
.hero-date { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 7px; margin: 10px 0 0; color: #d6ecf7; font: 600 13px/1.3 "Montserrat", sans-serif; }
.countdown { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; max-width: 360px; margin: 18px auto 0; }
.countdown div { display: flex; flex-direction: column; align-items: center; padding: 12px 2px 10px; background: rgba(255, 255, 255, .12); border-top: 4px solid var(--cell, #fff); border-radius: 10px; }
.countdown .is-red { --cell: #e63946; }
.countdown .is-white { --cell: #ffffff; }
.countdown .is-sky { --cell: #4fb3e8; }
.countdown .is-yellow { --cell: #ffcd47; }
.countdown b { font: 400 34px/1 "Oswald", sans-serif; font-variant-numeric: tabular-nums; }
.countdown span { margin-top: 6px; color: #d6ecf7; font: 600 10px "Montserrat", sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.countdown-live { position: relative; z-index: 1; margin: 16px 0 0; color: #ffcd47; font: 400 30px/1.2 "Oswald", sans-serif; }
/* Confetti falling slowly behind the numbers */
.confetti { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 9px; opacity: .85; animation: confetti-fall linear infinite; }
.confetti i.is-rhombus { width: var(--size, 12px); height: var(--size, 12px); background-size: contain; background-repeat: no-repeat; }
.confetti i.is-dot { border-radius: 50%; }
@keyframes confetti-fall {
  0% { transform: translate3d(0, -20px, 0) rotate(0deg); }
  50% { transform: translate3d(14px, 130px, 0) rotate(200deg); }
  100% { transform: translate3d(-6px, 300px, 0) rotate(420deg); }
}
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }

.signup { display: flex; align-items: center; gap: 14px; background: #fff8e1; border: 1px solid #f0d98a; }
.signup > .icon:first-child { color: var(--brand); }
.signup > div { flex: 1; }
.signup > .icon:last-child { color: var(--muted); }

.notify-head, .install { display: flex; align-items: flex-start; gap: 14px; }
.notify-head > .icon, .install > .icon { margin-top: 2px; color: var(--brand); }
.notify .btn { width: 100%; margin-top: 14px; }
.notify-state { min-height: 0; margin: 8px 0 0 !important; }
.notify-state:empty { display: none; }
.install { flex-wrap: wrap; }
.install > div { flex: 1 1 200px; }
.install .btn { flex: 1 1 100%; }

.winners-after { margin-top: 14px; }
.winners { background: linear-gradient(180deg, #fff8e1, #fff 46%); border-top: 5px solid var(--yellow); }
.winners h2 { color: var(--brand); font: 400 22px/1.15 "Paytone One", sans-serif; }
.winners h3 { margin: 16px 0 8px; color: var(--blue); font: 700 13px/1.2 "Montserrat", sans-serif; letter-spacing: .08em; text-transform: uppercase; }

.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 6px; padding: 0; list-style: none; }
.podium li { position: relative; display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.podium li.is-place-1 { border-color: var(--gold); box-shadow: 0 4px 14px rgba(240, 180, 0, .3); }
.podium-photo { display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; overflow: hidden; background: #eef3f6; border: 0; cursor: zoom-in; }
.podium-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.podium-photo.is-plain { display: flex; align-items: center; justify-content: center; color: #9fb4c2; cursor: default; }
.podium-place {
  position: absolute; top: 6px; left: 6px;
  display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  background: #fff; border-radius: 50%; color: var(--blue); font: 400 15px/1 "Paytone One", sans-serif; box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.is-place-1 .podium-place { background: var(--gold); color: #fff; }
.is-place-2 .podium-place { background: #a9b4bd; color: #fff; }
.is-place-3 .podium-place { background: #c98a52; color: #fff; }
.podium strong, .podium span:not(.podium-place):not(.podium-photo), .podium b { padding: 0 8px; }
.podium strong { margin-top: 6px; font-size: 13px; line-height: 1.25; }
.podium span:not(.podium-place):not(.podium-photo) { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.podium b { margin: auto 0 8px; padding-top: 4px; color: var(--brand); font: 400 16px/1 "Paytone One", sans-serif; }
.podium b small { color: var(--muted); font: 600 11px/1 "Montserrat", sans-serif; }

.news-list { display: grid; gap: 12px; }
.news-card { display: flex; flex-direction: column; overflow: hidden; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.news-card img { width: 100%; max-height: 220px; object-fit: cover; }
.news-card div { padding: 12px 16px 16px; }
.news-card h3 { margin: 0; font: 700 17px/1.3 "Montserrat", sans-serif; }
.news-card p:not(.meta) { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.article { padding: 0 0 10px; }
.article-image { display: block; width: calc(100% + 32px); margin: -16px -16px 14px; padding: 0; background: none; border: 0; cursor: zoom-in; }
.article-image img { display: block; width: 100%; max-height: 60vh; object-fit: cover; }
.article-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.article-top .meta { margin: 0; }
.share { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 6px 12px; background: #e3eff6; border: 0; border-radius: 999px; color: var(--brand); font-size: 13px; font-weight: 700; cursor: pointer; }
.share:active { background: #cfe3ef; }
.article h1 { margin: 6px 0 8px; color: var(--brand); font: 400 26px/1.2 "Paytone One", sans-serif; }
.article .lead { margin: 0 0 12px; font-weight: 600; }
.rich { overflow-wrap: anywhere; }
.rich img { height: auto; border-radius: 10px; cursor: zoom-in; }
.rich p { margin: 0 0 12px; }

/* Segments (tabs inside a screen) */
.segments {
  position: sticky; top: calc(var(--bar) + var(--safe-top)); z-index: 10;
  display: flex; gap: 6px; overflow-x: auto;
  margin: 0 -16px 14px; padding: 8px 16px;
  background: var(--bg); scrollbar-width: none;
}
.segments::-webkit-scrollbar { display: none; }
.segments a {
  flex: none; padding: 8px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  color: var(--blue); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.segments a b { margin-left: 2px; color: var(--muted); font-weight: 600; }
.segments a.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }
.segments a.is-active b { color: rgba(255, 255, 255, .75); }
/* The years of the gallery page: a row above the kinds, smaller */
.segments.is-years { position: static; margin-bottom: 0; padding-bottom: 4px; }
.segments.is-years a { padding: 6px 12px; font-size: 13px; }
.segments.is-years a.is-active { background: var(--brand); border-color: var(--brand); }
.segments.is-years + .press, .segments.is-years + .empty { margin-top: 10px; }

.search { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 0 14px; background: #fff; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 44px; background: none; border: 0; outline: none; font: inherit; font-size: 16px; color: var(--ink); }

/* Start list, order of the parade, ranking */
.entries { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.entry { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); }
.entry-photo {
  position: relative; flex: none; display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; padding: 0; overflow: hidden;
  background: #eef3f6; border: 0; border-radius: 10px; color: #8aa3b4; cursor: zoom-in;
}
.entry-photo.is-plain { cursor: default; }
.entry.is-float .entry-photo.is-plain { background: #dcebf4; color: var(--brand-dark); }
.entry.is-group .entry-photo.is-plain { background: #e6f3fb; color: var(--brand-light); }
.entry.is-guest .entry-photo.is-plain { background: #fff3cf; color: #a67c00; }
.entry-photo img { width: 100%; height: 100%; object-fit: cover; }
.entry-number {
  position: absolute; left: 4px; bottom: 4px;
  min-width: 26px; height: 22px; padding: 0 6px;
  background: var(--brand); border-radius: 7px; color: #fff; font: 400 14px/22px "Paytone One", sans-serif; text-align: center;
}
.entry.is-float .entry-number { background: var(--brand-dark); }
.entry.is-group .entry-number { background: var(--brand-light); }
.entry.is-guest .entry-number { background: #a67c00; }
.entry-photo.is-plain .entry-number { position: static; min-width: 0; height: auto; padding: 0; background: none; color: inherit; font-size: 26px; line-height: 1; }
.entry-text { flex: 1; min-width: 0; }
.entry-text strong { display: block; font-size: 15px; line-height: 1.25; }
.entry-text > span { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.3; }
.entry-text details { margin-top: 4px; font-size: 13px; }
.entry-text summary { color: var(--sky); font-weight: 600; cursor: pointer; }
.entry-text details p { margin: 4px 0 0; color: var(--ink); white-space: pre-line; }
.entry-kind { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.entry-kind b { color: var(--brand); font: 400 18px/1 "Paytone One", sans-serif; letter-spacing: 0; }
.entry.is-off { opacity: .55; }
.entry.is-off .entry-text strong { text-decoration: line-through; }
.entries.is-ranking { margin-top: 10px; }

.map { display: block; width: 100%; padding: 0; overflow: hidden; background: #fff; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); cursor: zoom-in; }
.map img { display: block; width: 100%; }

/* Programme (the HTML of includes/kp_program.php) */
.program .kp4-prog-day { margin: 0 0 16px; overflow: hidden; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.program .kp4-prog-date { display: flex; align-items: baseline; gap: 8px; padding: 12px 16px; background: var(--blue); color: #fff; }
.program .kp4-prog-date strong { font: 400 26px/1 "Paytone One", sans-serif; }
.program .kp4-prog-weekday { font-weight: 700; text-transform: capitalize; }
.program .kp4-prog-items { margin: 0; padding: 4px 0; list-style: none; }
.program .kp4-prog-items li { display: flex; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.program .kp4-prog-items li:first-child { border-top: 0; }
.program .kp4-prog-items li.is-main { background: #fff8e1; }
.program .kp4-prog-time { flex: none; width: 52px; color: var(--brand); font: 400 17px/1.3 "Paytone One", sans-serif; }
.program .kp4-prog-time.is-label { font: 700 12px/1.6 "Montserrat", sans-serif; text-transform: uppercase; }
.program .kp4-prog-text { flex: 1; min-width: 0; }
/* "Po sprevodu", "Po nagrajevanju" ...: a moment without the hour goes above its text, not in the narrow column */
.program .kp4-prog-items li:has(.kp4-prog-time.is-label) { flex-direction: column; gap: 2px; }
.program .kp4-prog-time.is-label { width: auto; }
.program .kp4-prog-text h3 { margin: 0; font-size: 15px; line-height: 1.35; }
.program .kp4-prog-html { margin-top: 4px; color: var(--muted); font-size: 14px; }
.program dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0 0; font-size: 13px; }
.program dt { color: var(--muted); font-weight: 600; }
.program dd { margin: 0; }
.program img { display: block; margin-top: 8px; border-radius: 10px; cursor: zoom-in; }
.program .kp4-prog-link { display: inline-block; margin-top: 6px; font-weight: 600; }

/* Archive */
.years { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.years a { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.years b { flex: none; color: var(--brand); font: 400 24px/1 "Paytone One", sans-serif; }
.years span { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; }
.years small { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.years small .icon { margin-right: 3px; vertical-align: -2px; }
.years a > .icon { color: var(--muted); }

.galleries { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.galleries a { display: flex; flex-direction: column; height: 100%; overflow: hidden; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.galleries img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #eef3f6; }
.galleries span { padding: 8px 10px 10px; }
.galleries strong { display: block; font-size: 13px; line-height: 1.3; }
.galleries small { display: flex; align-items: center; gap: 4px; margin-top: 4px; color: var(--muted); font-size: 12px; }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0 -12px; }
.photos button { display: block; aspect-ratio: 1; padding: 0; overflow: hidden; background: #e6ecf0; border: 0; cursor: zoom-in; }
.photos img { width: 100%; height: 100%; object-fit: cover; }

.videos, .press { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.videos button, .press button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px;
  background: var(--card); border: 0; border-radius: 14px; box-shadow: var(--shadow); text-align: left; cursor: pointer;
}
.video-poster { position: relative; flex: none; width: 120px; aspect-ratio: 16 / 9; overflow: hidden; background: #1d2730; border-radius: 10px; }
.video-poster img { width: 100%; height: 100%; object-fit: cover; }
.video-poster i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; }
.video-poster i .icon { fill: #fff; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .5)); }
.press img { flex: none; width: 72px; height: 72px; object-fit: cover; background: #eef3f6; border-radius: 10px; }
.videos strong, .press strong { display: block; font-size: 14px; line-height: 1.3; }
.videos small, .press small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }

/* Login */
.login { display: grid; gap: 14px; }
.login p:first-child { margin: 0; }
.login label { display: grid; gap: 6px; color: var(--ink); font-size: 14px; font-weight: 600; }
.login input { width: 100%; height: 48px; padding: 0 14px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; font: inherit; font-size: 16px; font-weight: 400; color: var(--ink); }
.login input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(25, 104, 145, .15); }
.password { position: relative; display: block; }
.password input { padding-right: 52px; }
.password button { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; background: none; border: 0; color: var(--muted); cursor: pointer; }
.login-error { margin: 0 !important; padding: 10px 12px; background: #fdecea; border-radius: 10px; color: #a1260d !important; font-weight: 600; }
.login .btn { margin-top: 0; }
.login small { color: var(--muted); font-size: 12px; font-weight: 400; }
.login .accept { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; }
.login .accept input { flex: none; width: 22px; height: 22px; margin: 0; }
.profile { display: flex; align-items: flex-start; gap: 14px; }
.profile > .icon { color: var(--brand); }

/* My entries to the parade */
.entry-card { display: grid; gap: 8px; }
.entry-card h2 { font-size: 17px; }
.entry-card .meta { margin: 0; }
.state { justify-self: start; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.state.is-0 { background: #fff3cf; color: #7a5a00; }
.state.is-1 { background: #ddf3e3; color: #1e6b34; }
.state.is-2 { background: #fdecea; color: #a1260d; }
.entry-note { margin: 0 !important; padding: 8px 10px; background: var(--bg); border-radius: 10px; color: var(--ink) !important; }
.entry-files { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.entry-files li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg); border-radius: 10px; font-size: 14px; }
.entry-files li a { flex: 1; min-width: 0; overflow: hidden; color: var(--brand); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.entry-files li small { color: var(--muted); }
.entry-files li button { width: 32px; height: 32px; padding: 0; background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.entry-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.entry-actions .btn { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.notice { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; font-weight: 600; }
.notice.is-ok { background: #ddf3e3; color: #1e6b34; }
.notice.is-error { background: #fdecea; color: #a1260d; }
.notice div + div { margin-top: 4px; }
.kind-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 14px; }
.kind-choice button { min-height: 46px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; font-weight: 700; cursor: pointer; }
.kind-choice button.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.entry-form fieldset { margin: 0 0 14px; padding: 16px; background: var(--card); border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.entry-form legend { float: left; width: 100%; margin: 0 0 10px; padding: 0; color: var(--brand-dark); font: 400 18px/1.2 "Paytone One", sans-serif; }
.entry-form label { display: grid; gap: 6px; margin: 0 0 12px; font-size: 14px; font-weight: 600; clear: both; }
.entry-form label b { color: #c0392b; }
.entry-form input:not([type="checkbox"]):not([type="file"]), .entry-form textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  font: inherit; font-size: 16px; font-weight: 400; color: var(--ink);
}
.entry-form textarea { min-height: 110px; resize: vertical; }
.entry-form input:focus, .entry-form textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(25, 104, 145, .15); }
.entry-form small { color: var(--muted); font-weight: 400; }
.accept { display: flex !important; grid-template-columns: none; align-items: flex-start; gap: 10px !important; font-weight: 500 !important; }
.accept input { flex: none; width: 22px; height: 22px; margin: 0; }

/* Rules and privacy (the HTML of includes/kp_rules.php) */
.rules-index, .kp4-rules-index { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.kp4-rules-index a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; background: #fff; border: 1px solid var(--line); border-radius: 999px; color: var(--brand-dark); font-size: 13px; font-weight: 600; text-decoration: none; }
.kp4-rules-index a b { display: grid; place-items: center; width: 22px; height: 22px; background: var(--brand); border-radius: 50%; color: #fff; font-size: 12px; }
.kp4-rule { margin: 0 0 12px; padding: 16px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); scroll-margin-top: calc(var(--bar) + var(--safe-top) + 12px); }
.kp4-rule h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; color: var(--brand-dark); font: 400 19px/1.2 "Paytone One", sans-serif; }
.kp4-rule h2 span { display: grid; place-items: center; flex: none; width: 30px; height: 30px; background: var(--yellow); border-radius: 50%; color: var(--brand-dark); font-size: 15px; }
.kp4-rule ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.kp4-rule li { display: flex; gap: 10px; }
.kp4-rule-mark { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; background: #e3eff6; border-radius: 6px; color: var(--brand-dark); font-size: 12px; font-weight: 700; }
.kp4-rule li p { margin: 0; font-size: 15px; line-height: 1.55; }
.kp4-rule img { display: block; width: 100%; height: auto; margin-top: 8px; border-radius: 10px; }
.kp4-rules-closing { margin: 16px 0 0; color: var(--muted); font-size: 14px; text-align: center; }
.kp4-rules-closing p { margin: 0 0 6px; }

/* The rules over the form of a new entry */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--bg); }
.sheet-top { display: flex; justify-content: flex-end; padding: calc(var(--safe-top) + 8px) 10px 4px; background: var(--brand); }
.sheet-top button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; background: rgba(255, 255, 255, .14); border: 0; border-radius: 12px; color: #fff; cursor: pointer; }
.sheet-top svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.sheet-body { flex: 1; overflow-y: auto; padding: 16px 16px calc(var(--safe-bottom) + 24px); }

/* PDF */
/* The red PDF icon, at the right above the list */
.pdf-row { display: flex; justify-content: flex-end; margin: -4px 0 10px; }
.pdf-icon { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px; background: none; border: 0; border-radius: 10px; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.pdf-icon svg { width: 30px; height: 36px; filter: drop-shadow(0 2px 3px rgba(217, 48, 37, .3)); transition: transform .15s; }
.pdf-icon:active svg { transform: scale(.92); }
.pdf-icon.is-busy svg { animation: pdf-busy 1s ease-in-out infinite; }
@keyframes pdf-busy { 50% { transform: translateY(-4px); } }
.pdf-holder { position: fixed; top: 0; left: -12000px; z-index: -1; background: #fff; }

/* Marks of the jury */
.scores-legend { margin: 0 0 4px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.scores { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.score { margin: 0; padding: 12px 14px; }
.score-head { display: flex; align-items: center; gap: 12px; }
.score-place { display: grid; place-items: center; flex: none; width: 32px; height: 32px; background: #e3eff6; border-radius: 50%; color: var(--brand-dark); font: 400 16px/1 "Paytone One", sans-serif; }
.score.is-place-1 .score-place { background: var(--gold); color: #fff; }
.score.is-place-2 .score-place { background: #a9b4bd; color: #fff; }
.score.is-place-3 .score-place { background: #c98a52; color: #fff; }
.score-name { flex: 1; min-width: 0; }
.score-name strong { display: block; font-size: 15px; line-height: 1.25; }
.score-name span { display: block; color: var(--muted); font-size: 13px; }
.score-points { display: flex; flex-direction: column; align-items: flex-end; color: var(--brand); font: 400 22px/1 "Paytone One", sans-serif; }
.score-points small { color: var(--muted); font: 600 10px/1.4 "Montserrat", sans-serif; text-transform: uppercase; }
.score details { margin-top: 8px; }
.score summary { color: var(--brand); font-size: 13px; font-weight: 700; cursor: pointer; }
.score-table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 14px; text-align: center; }
.score-table th, .score-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.score-table thead th { color: var(--muted); font-size: 12px; }
.score-table tbody th { color: var(--ink); font-weight: 600; text-align: left; }
.score-table .is-total th, .score-table .is-total td { border-bottom: 0; color: var(--brand); font-size: 15px; }

/* Winners of every year */
.winners-years { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.winners-years > li { margin: 0; padding: 12px 14px; }
.winners-year { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; color: inherit; text-decoration: none; }
.winners-year b { color: var(--brand); font: 400 22px/1 "Paytone One", sans-serif; }
.winners-year span { flex: 1; color: var(--muted); font-size: 13px; font-weight: 600; }
.winners-places { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.winners-places li { position: relative; display: flex; align-items: center; gap: 10px; }
.winners-places .podium-place { position: static; flex: none; width: 26px; height: 26px; font-size: 13px; box-shadow: none; }
.winner-photo { flex: none; width: 46px; height: 46px; padding: 0; overflow: hidden; background: #eef3f6; border: 0; border-radius: 8px; cursor: zoom-in; }
.winner-photo img { width: 100%; height: 100%; object-fit: cover; }
.winners-places div { flex: 1; min-width: 0; }
.winners-places strong { display: block; font-size: 14px; line-height: 1.25; }
.winners-places div span { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
.winners-places b { color: var(--brand); font: 400 16px/1 "Paytone One", sans-serif; }

/* Search in the rankings: the chart and the rows */
.top { padding: 14px 16px; }
.top h2 { margin: 0 0 10px; color: var(--brand-dark); font: 400 18px/1.2 "Paytone One", sans-serif; }
.top ol { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.top a { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; grid-template-areas: "place name count" "place bar count"; align-items: center; gap: 2px 10px; padding: 6px 4px; border-radius: 10px; color: inherit; text-decoration: none; }
.top a:active { background: var(--bg); }
.top-place { grid-area: place; color: var(--muted); font: 400 15px/1 "Paytone One", sans-serif; text-align: center; }
.top-name { grid-area: name; overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.top-bar { grid-area: bar; height: 8px; background: #e3eff6; border-radius: 999px; overflow: hidden; }
.top-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #4fb3e8); border-radius: 999px; }
.top li:first-child .top-bar span { background: linear-gradient(90deg, var(--gold), var(--yellow)); }
.top-count { grid-area: count; display: flex; flex-direction: column; align-items: flex-end; min-width: 44px; }
.top-count strong { color: var(--brand-dark); font: 400 18px/1 "Paytone One", sans-serif; }
/* How many times first: in the red of the site */
.top-count small { color: #d93025; font-size: 11px; font-weight: 700; }
.rank-row summary { color: inherit; font-size: inherit; font-weight: inherit; list-style: none; cursor: pointer; }
.rank-row summary::-webkit-details-marker { display: none; }
.rank-year { flex: none; color: var(--muted); font-size: 13px; font-weight: 700; }
.rank-photo { display: block; width: 100%; margin-top: 10px; padding: 0; overflow: hidden; background: none; border: 0; border-radius: 10px; cursor: zoom-in; }
.rank-photo img { display: block; width: 100%; height: auto; }
.rank-text { margin: 8px 0 0; font-size: 14px; line-height: 1.5; white-space: pre-line; }
.press-line { margin-top: 4px !important; color: var(--ink) !important; font-style: italic; }
.search-cancel { flex: none; color: var(--brand); font-size: 14px; font-weight: 700; text-decoration: none; }

/* A PDF or a video to open: brochure, book, documentary */
.doc-card { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; color: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.doc-icon { display: grid; place-items: center; flex: none; width: 64px; height: 76px; background: linear-gradient(160deg, #1a78a6, #0d4868); border-radius: 10px; color: #fff; box-shadow: inset -6px 0 0 rgba(0, 0, 0, .15); }
.doc-card > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.doc-card strong { font-size: 16px; line-height: 1.3; }
.doc-card small { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.doc-card .link { margin-top: 8px; }
.doc-card.is-video .video-poster { width: 120px; }

/* Articles */
.articles { display: grid; gap: 12px; }
.article-card { display: flex; gap: 14px; margin: 0; color: inherit; text-decoration: none; }
.article-card img { flex: none; width: 76px; height: 76px; object-fit: cover; border-radius: 50%; background: #eef3f6; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--yellow); }
.article-card > div { min-width: 0; }
.article-card h2 { margin: 2px 0 2px; font-size: 16px; line-height: 1.3; }
.article-edition { display: inline-block; margin-right: 6px; padding: 1px 7px; background: var(--yellow); border-radius: 999px; color: var(--brand-dark); font-weight: 700; }
.article-author { margin: 0 0 6px !important; color: var(--brand) !important; font-weight: 600; }
.article-preview { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 14px; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.article-preview p { margin: 0; }
.article-card .link { margin-top: 6px; }
.article-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.article-head img { flex: none; width: 90px; height: 90px; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--yellow); }
.article-head h1 { margin: 2px 0 4px; font-size: 24px; }

/* Search */
.home-search { margin: 0 0 14px; box-shadow: var(--shadow); }
.results { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.results a, .results button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; background: var(--card); border: 0; border-radius: 12px; box-shadow: var(--shadow); color: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.results b { flex: none; min-width: 42px; color: var(--brand); font: 400 15px/1 "Paytone One", sans-serif; }
.results span { flex: 1; min-width: 0; }
.results strong { display: block; font-size: 14px; line-height: 1.3; }
.results small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.results em { flex: none; color: var(--muted); font-size: 12px; font-style: normal; font-weight: 700; }
.results .icon { flex: none; color: var(--brand); }
.section-title small { color: var(--muted); font-weight: 600; }

/* The data of the footer of the site */
.contact p { margin: 8px 0 0; color: var(--ink); font-size: 14px; line-height: 1.6; }
.contact h3 { margin: 14px 0 0; color: var(--brand-dark); font-size: 14px; }
.contact-list { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 14px; }
.contact-list li { display: flex; align-items: center; gap: 10px; }
.contact-list .icon { color: var(--brand); }
.contact-list a { color: var(--brand); font-weight: 600; text-decoration: none; }
.footer-social { display: flex; gap: 10px; margin: 10px 0 0 !important; }
.footer-social a { display: grid; place-items: center; width: 42px; height: 42px; background: var(--brand); border-radius: 50%; color: #fff; }
.app-footer { margin: 28px -16px 0; padding: 20px 16px 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.5; text-align: center; }
.app-footer p { margin: 0 0 8px; }
.app-footer b { color: var(--brand-dark); }
.app-footer .footer-social { justify-content: center; margin: 4px 0 10px !important; }
.app-footer .footer-social a { width: 38px; height: 38px; }
.app-copyright { margin: 4px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

/* More */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.choice button { min-height: 44px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; font-weight: 600; cursor: pointer; }
.choice button.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }
.links { margin: 0 0 14px; padding: 0; overflow: hidden; list-style: none; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.links li + li { border-top: 1px solid var(--line); }
.links a { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 16px; color: var(--ink); font-weight: 600; text-decoration: none; }
.links a > .icon:first-child { color: var(--brand); }
.links a span { flex: 1; }
.links a > .icon:last-child { color: var(--muted); }

/* A new version of the app has arrived */
.update-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabs) + var(--safe-bottom) + 12px); z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 560px; margin: 0 auto; padding: 10px 10px 10px 16px;
  background: var(--brand-dark); border-radius: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  color: #fff; font-size: 14px; font-weight: 600;
}
.update-bar button { flex: none; padding: 8px 14px; background: var(--yellow); border: 0; border-radius: 999px; color: var(--brand-dark); font-weight: 700; cursor: pointer; }

/* Tabs at the bottom */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(7, 1fr);
  height: calc(var(--tabs) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(13, 72, 104, .06);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; overflow: hidden; color: #7a8a96; font-size: 10px; letter-spacing: -.02em; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; text-decoration: none; }
.tabs a.is-active { color: var(--brand); }
/* "Programma", "Archivio": the Italian names are longer */
html[lang="it"] .tabs a { font-size: 9.5px; letter-spacing: -.03em; }
.tabs a.is-active .icon { stroke-width: 2.4; }

/* Photo and video viewer */
.viewer { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: rgba(8, 12, 16, .96); color: #fff; }
.viewer-top { display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-top) + 8px) 10px 8px 16px; font-weight: 600; }
.viewer-top button, .viewer-nav { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; background: rgba(255, 255, 255, .12); border: 0; border-radius: 50%; color: #fff; cursor: pointer; }
.viewer svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.viewer-stage { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 8px; touch-action: pan-y pinch-zoom; }
.viewer-stage img, .viewer-stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-stage video { width: 100%; background: #000; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.viewer-nav.is-prev { left: 10px; }
.viewer-nav.is-next { right: 10px; }
.viewer-caption { margin: 0; padding: 10px 16px calc(var(--safe-bottom) + 14px); font-size: 14px; text-align: center; }
.viewer-caption:empty { padding-bottom: calc(var(--safe-bottom) + 8px); }
@media (hover: none) { .viewer-nav { display: none; } }

@media (min-width: 720px) {
  .view { padding-left: 24px; padding-right: 24px; }
  .photos { grid-template-columns: repeat(4, 1fr); margin: 0; }
  /* On a tablet every news is as wide as the screen: the photo on the left, the text next to it */
  .news-card { flex-direction: row; align-items: stretch; }
  .news-card img { flex: none; width: 42%; max-height: none; min-height: 190px; }
  .news-card div { flex: 1; padding: 18px 20px; }
  .news-card h3 { font-size: 20px; }
  .news-card p:not(.meta) { font-size: 15px; }
  .podium strong { font-size: 14px; }
}
@media (min-width: 900px) {
  /* On a computer the tabs are a bar in the middle, like the screen */
  .tabs { left: 50%; right: auto; width: 960px; max-width: 100%; transform: translateX(-50%); border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; }
}
/* The screen reached with a swipe slides in from that side */
.view.is-from-right { animation: from-right .28s ease-out; }
.view.is-from-left { animation: from-left .28s ease-out; }
@keyframes from-right { from { opacity: .4; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes from-left { from { opacity: .4; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } .view.is-from-right, .view.is-from-left { animation: none; } }
