:root {
  --bg: #0f131a;
  --bg-soft: #1d1916;
  --card: #231f1b;
  --ink: #cfd6df;
  --muted: #9aa6b4;
  --line: rgba(255, 255, 255, 0.22);
  --accent: #ffe08a;
  --accent-ink: #1a140c;
  --radius: 14px;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

body.gallery-page {
  margin: 0;
  padding-top: 0;
  background: #0f131a;
  color: var(--ink);
  min-height: 100vh;
  color-scheme: dark;
}

body.gallery-page #contenitore {
  background: #0f131a;
}

body.gallery-page #section__center {
  width: min(1120px, calc(100% - 16px));
  max-width: 100%;
  margin-top: 110px;
  text-align: left;
  box-sizing: border-box;
}

body.gallery-page .album-hero {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 32px;
  padding: 0;
  background: transparent;
  border: 0;
  z-index: 1;
}

body.gallery-page .album-hero-cover {
  position: relative;
  isolation: isolate;
  min-height: 280px;
  height: min(52vh, 520px);
  overflow: hidden;
  border-radius: 22px;
  background-color: #121820;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  box-shadow:
    0 0 0 1px rgba(220, 200, 154, 0.18),
    0 24px 48px rgba(0, 0, 0, 0.45);
}

body.gallery-page .album-hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(8, 10, 14, 0.08) 0%,
      rgba(8, 10, 14, 0.18) 38%,
      rgba(8, 10, 14, 0.78) 78%,
      rgba(8, 10, 14, 0.94) 100%
    );
  pointer-events: none;
}

body.gallery-page .album-hero-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 28px 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 820px;
}

body.gallery-page .album-hero-title {
  margin: 0;
  font-family: Georgia, "Playfair Display", "Times New Roman", serif;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #f6f1e6;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

body.gallery-page .album-hero-lede {
  margin: 0;
  max-width: 42rem;
  font-size: 0.98rem;
  line-height: 1.55;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: rgba(232, 224, 208, 0.88);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

body.gallery-page .album-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin-top: 6px;
}

body.gallery-page .album-hero-meta .gallery-author {
  font-size: 1.05rem;
}

body.gallery-page .album-hero-date {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(167, 180, 196, 0.92);
}

body.gallery-page .album-hero-meta .gallery-author + .album-hero-date::before {
  content: "·";
  margin-right: 14px;
  color: rgba(220, 200, 154, 0.7);
}

body.gallery-page .album-hero-actions {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  margin: 0;
}

body.gallery-page .album-del-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 0;
  border-radius: 10px;
  background: #d32f2f;
  color: #fff !important;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none !important;
  text-transform: uppercase;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

body.gallery-page .album-del-btn i {
  font-size: 1.15rem;
  color: #fff;
}

body.gallery-page .album-del-btn:hover,
body.gallery-page .album-del-btn:focus {
  background: #ff3b3b;
  color: #fff !important;
}

body.gallery-page .album-del-btn--admin {
  background: #8b1e1e;
}

body.gallery-page .album-del-btn--admin:hover,
body.gallery-page .album-del-btn--admin:focus {
  background: #c62828;
}

body.gallery-page .album-edit-btn,
body.gallery-page .album-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 0;
  border-radius: 10px;
  color: #fff !important;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none !important;
  text-transform: uppercase;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

body.gallery-page .album-edit-btn i,
body.gallery-page .album-add-btn i {
  font-size: 1.15rem;
  color: #fff;
}

body.gallery-page .album-edit-btn {
  background: #1f66ae;
}

body.gallery-page .album-edit-btn:hover,
body.gallery-page .album-edit-btn:focus {
  background: #4792de;
}

body.gallery-page .album-add-btn {
  background: #2ea05a;
}

body.gallery-page .album-add-btn:hover,
body.gallery-page .album-add-btn:focus {
  background: #3bc46f;
}

@media (max-width: 640px) {
  body.gallery-page .album-hero-cover {
    min-height: 240px;
    height: min(46vh, 380px);
    border-radius: 16px;
  }

  body.gallery-page .album-hero-copy {
    padding: 20px 16px 18px;
  }
}

body.gallery-page #containo {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding-top: 8px;
  text-align: left;
  clear: both;
}

@media (min-width: 640px) {
  body.gallery-page #containo {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }
}

body.gallery-page .sort-bar {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 0 18px;
}

body.gallery-page .pager-btn.is-active {
  background: #dcc89a;
  border-color: #dcc89a;
  color: #0f131a;
}

body.gallery-page .pager,
body.gallery-page .slide-pager {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  clear: both;
  width: 100%;
  padding: 28px 0 40px;
}

body.gallery-page .slide-pager {
  padding: 14px 0 4px;
}

body.gallery-page .pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  padding: 10px 18px;
  border: 1px solid rgba(220, 200, 154, 0.35);
  border-radius: 999px;
  background: #161d27;
  color: #f3f6fa;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

body.gallery-page .pager-btn:hover {
  background: #1e2836;
  border-color: #dcc89a;
  color: #ffe08a;
}

@media (max-width: 520px) {
  body.gallery-page .pager,
  body.gallery-page .slide-pager {
    gap: 8px;
  }

  body.gallery-page .pager-btn {
    min-width: 0;
    flex: 1;
    padding: 10px 12px;
    font-size: 0.82rem;
  }
}

body.gallery-page .zuadrodef {
  float: none;
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background: #161d27;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

body.gallery-page .thumb {
  position: relative;
  display: block;
  width: 100%;
  height: 180px;
  padding: 0;
  border: 0;
  overflow: hidden;
  cursor: pointer;
  border-radius: 0;
}

body.gallery-page .zuadrodef #numero {
  z-index: 12;
  border-radius: 0 0 12px 0;
}

body.gallery-page .zuadrodef.is-owner {
  height: auto;
  overflow: hidden;
  padding-bottom: 0;
}

body.gallery-page .thumb-actions {
  display: flex;
  gap: 8px;
  padding: 8px 10px 12px;
  background: #161d27;
}

body.gallery-page .thumb-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1;
}

body.gallery-page .thumb-action i {
  font-size: 0.95rem;
}

body.gallery-page .thumb-action--edit {
  background: rgba(46, 160, 90, 0.16);
  border: 1px solid rgba(142, 224, 164, 0.28);
  color: #b7ecc6;
}

body.gallery-page .thumb-action--edit:hover,
body.gallery-page .thumb-action--edit:focus {
  background: #2ea05a;
  border-color: #2ea05a;
  color: #fff;
}

body.gallery-page .thumb-action--delete {
  background: rgba(187, 55, 57, 0.16);
  border: 1px solid rgba(240, 160, 160, 0.28);
  color: #f0b4b4;
}

body.gallery-page .thumb-action--delete:hover,
body.gallery-page .thumb-action--delete:focus {
  background: #bb3739;
  border-color: #bb3739;
  color: #fff;
}

body.gallery-page .zuadrodef .button-81 {
  position: absolute;
  top: 140px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 16;
  display: inline-block;
  margin: 0;
  white-space: nowrap;
  background-color: #1f66ae;
  border: 0;
  border-radius: 1.5rem;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 8px 14px;
  text-align: center;
  text-decoration: none;
}

body.gallery-page .zuadrodef .button-81:hover {
  background-color: #4792de;
  color: #fff;
}

body.gallery-page .zuadrodef #ant {
  width: 100%;
  height: 180px;
  border-radius: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

@media (max-width: 480px) {
  body.gallery-page .thumb,
  body.gallery-page .zuadrodef #ant {
    height: 150px;
  }

  body.gallery-page .zuadrodef .button-81 {
    top: 110px;
  }

  body.gallery-page #section__center {
    margin-top: 90px;
  }

  .hero {
    padding: 20px 8px 12px;
  }

  h1 {
    font-size: 1.4rem;
  }
}

body.gallery-page #sottone {
  height: auto;
  background: #161d27;
  color: #e8eef4;
  padding: 10px 10px 12px;
}

body.gallery-page #sottone:hover {
  background: #1c2633;
}

body.gallery-page #sottone .descri {
  color: #dcc89a;
}

body.gallery-page #sottone .nomes,
body.gallery-page #sottone [itemprop="author"] {
  color: #f3f6fa;
}

body.gallery-page #sottone .commes,
body.gallery-page #sottone .times,
body.gallery-page #sottone .cates {
  color: #a7b4c4;
}

body.gallery-page .zuadrodef > a {
  color: inherit;
  text-decoration: none;
}

.hero,
.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  padding: 40px 0 20px;
}

.eyebrow {
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.76rem;
  color: var(--accent);
  margin: 0 0 10px;
}

h1,
h2,
h3,
p,
strong,
cite,
li {
  color: var(--ink);
}

h1 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  margin: 0 0 10px;
}

.gallery-author {
  color: #dcc89a;
  font-weight: 700;
  text-decoration: none;
  text-shadow:
    0 0 6px rgba(255, 224, 138, 0.55),
    0 0 14px rgba(220, 200, 154, 0.35);
}

.gallery-author:hover,
.gallery-author:focus,
.gallery-author:visited {
  color: #ffe08a;
  font-weight: 700;
  text-decoration: none;
  text-shadow:
    0 0 8px rgba(255, 224, 138, 0.85),
    0 0 18px rgba(255, 224, 138, 0.45);
}

.lede {
  margin: 0;
  max-width: 42rem;
  color: var(--muted);
  line-height: 1.5;
}

.notice {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.slideshow {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(1180px, calc(100vw - 32px));
  max-height: 92vh;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
}

.slideshow::backdrop {
  background: rgba(15, 19, 26, 0.82);
}

.slideshow-shell {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  background: #161d27;
  border: 1px solid rgba(232, 238, 244, 0.12);
  border-radius: 16px;
  padding: 16px 56px 16px 16px;
  max-height: 92vh;
  overflow: auto;
}

.slide-photo {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  touch-action: pan-y;
}

.slide-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  will-change: transform, opacity;
}

.slide-frame.is-sliding {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.slide-photo img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  background: #0f131a;
  border-radius: 10px;
  transform-origin: center center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}

.slide-protect {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 10px;
  background: transparent;
}

.slide-didascalia {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 12px 16px 14px;
  border-radius: 0 0 10px 10px;
  background: rgba(8, 6, 5, 0.48);
  color: #c8d0da;
  font-size: 0.95rem;
  line-height: 1.4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  z-index: 3;
  pointer-events: none;
}

.slide-photo figcaption {
  width: 100%;
  padding: 10px 4px 0;
  text-align: center;
}

.slide-photo h2 {
  margin: 0;
  font-size: 1.1rem;
}

#slide-counter {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.slide-comments {
  min-width: 0;
  overflow: auto;
  padding-right: 8px;
}

.slide-comments h3 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 1rem;
}

.slide-comments h3 span,
.comments h3 span {
  display: inline-flex;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 6px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: rgba(217, 164, 65, 0.18);
  color: var(--accent);
  font-size: 0.78rem;
}

.slide-comments ul,
.comments ul {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.slide-comments li,
.comments li {
  background: #1a2230;
  border: 1px solid rgba(232, 238, 244, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
}

.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 0.86rem;
}

.author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.author:hover strong {
  text-decoration: underline;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #2a241f;
}

time,
.empty {
  color: var(--muted);
}

.slide-comments li p {
  margin: 0;
  color: #c5ced8;
  font-family: Georgia, "Palatino Linotype", Palatino, "Times New Roman", serif;
  font-size: clamp(1.05rem, 2.8vw, 1.4rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.slide-comments .dellike {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin: 10px 0 0;
}

.slide-comments .dellike a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.04em;
  font-family: "Roboto", "Segoe UI", sans-serif;
}

.slide-comments .mipiace {
  color: #5cb85c;
}

.slide-comments .mipiace:hover {
  color: #fff;
}

.slide-comments .elimina {
  color: #bf3b3d;
}

.slide-comments .elimina:hover {
  color: #fff;
}

.slide-comments .risposta {
  display: block;
  margin: 14px 0 0 auto;
  max-width: min(100%, 22rem);
  padding: 10px 12px 10px 14px;
  border-radius: 14px 4px 14px 14px;
  background: linear-gradient(165deg, rgba(48, 62, 82, 0.72), rgba(18, 24, 34, 0.92));
  border: 1px solid rgba(186, 198, 212, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: #b4bec9;
  font-size: 0.78em;
  font-style: italic;
  letter-spacing: 0.02em;
  line-height: 1.45;
  text-align: left;
}

.slide-comments .risposta::after {
  content: "";
  display: block;
  clear: both;
}

.slide-comments .avat_risposta {
  float: left;
  width: 28px;
  height: 28px;
  margin: 1px 8px 4px 0;
  border-radius: 50%;
  object-fit: cover;
  background: #161d27;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.slide-comments .risposta-meta {
  display: block;
  clear: both;
  margin-top: 6px;
  color: #8b96a3;
  font-size: 0.72em;
  font-style: italic;
  letter-spacing: 0.03em;
}

.slide-comments .reply-form {
  display: grid;
  gap: 8px;
  margin: 14px 0 0 auto;
  max-width: min(100%, 22rem);
  padding: 12px 14px 12px;
  border-radius: 14px 4px 14px 14px;
  background: linear-gradient(165deg, rgba(48, 62, 82, 0.42), rgba(18, 24, 34, 0.88));
  border: 1px solid rgba(186, 198, 212, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.slide-comments .reply-label {
  margin: 0;
  color: #9aa6b4;
  font-size: 0.68rem;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.slide-comments .reply-form textarea {
  min-height: 72px;
  margin: 0;
  padding: 8px 0 4px;
  border: 0;
  border-bottom: 1px solid rgba(186, 198, 212, 0.22);
  border-radius: 0;
  background: transparent;
  color: #c5ced8;
  font-family: Georgia, "Palatino Linotype", Palatino, "Times New Roman", serif;
  font-size: 0.95rem;
  font-style: italic;
  letter-spacing: 0.02em;
  line-height: 1.5;
  resize: vertical;
}

.slide-comments .reply-form textarea::placeholder {
  color: #7d8896;
  font-style: italic;
  opacity: 1;
}

.slide-comments .reply-form textarea:focus {
  outline: none;
  border-bottom-color: rgba(220, 200, 154, 0.55);
}

.slide-comments .reply-form .inviozzo {
  justify-self: end;
  margin-top: 2px;
  border: 1px solid rgba(220, 200, 154, 0.35);
  border-radius: 999px;
  background: transparent;
  color: #dcc89a;
  padding: 6px 14px;
  font-size: 0.72rem;
  font-weight: 650;
  font-style: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.slide-comments .reply-form .inviozzo:hover {
  background: rgba(220, 200, 154, 0.12);
  border-color: #dcc89a;
  color: #ffe08a;
}

.empty {
  margin: 0;
  line-height: 1.45;
  font-size: clamp(0.95rem, 2.4vw, 1.1rem);
}

.comment-form {
  display: grid;
  gap: 10px;
}

.comment-form .hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--muted);
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #161310;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px;
}

textarea {
  resize: vertical;
  min-height: 72px;
}

.comment-form button {
  justify-self: start;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 650;
  cursor: pointer;
}

.nav,
.close {
  position: absolute;
  border: 0;
  background: rgba(0, 0, 0, 0.45);
  color: var(--ink);
  cursor: pointer;
  border-radius: 999px;
}

.nav {
  top: 28%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  font-size: 1.8rem;
  line-height: 1;
}

.prev {
  left: 8px;
}

.next {
  right: 8px;
}

.close {
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  font-size: 1.4rem;
}

a {
  color: var(--accent);
}

@media (max-width: 860px) {
  .slideshow {
    width: 100vw;
    max-width: 100vw;
    left: 50%;
  }

  .slideshow-shell {
    padding: 48px 0 12px;
    max-height: 96vh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .slide-photo,
  .slide-frame {
    width: 100%;
    max-width: 100%;
  }

  .slide-photo img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 0;
  }

  .slide-didascalia {
    border-radius: 0;
  }

  .slide-photo figcaption,
  .slide-comments {
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
  }

  .nav {
    top: 22%;
  }

  .slide-comments li {
    padding: 12px;
  }

  .slide-comments li p {
    font-size: clamp(1.12rem, 4.2vw, 1.35rem);
  }
}

@media (max-width: 480px) {
  .slide-comments li p {
    font-size: clamp(1.18rem, 5vw, 1.32rem);
  }

  .meta {
    flex-wrap: wrap;
    font-size: 0.8rem;
  }
}
