:root {
  --bg: #f7efe8;
  --bg-accent: #ead9cf;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --line: #e6d9d1;
  --line-dark: #d6c2b7;
  --text: #2a2230;
  --muted: #756877;
  --primary: #6a4352;
  --primary-strong: #553240;
  --secondary: #f7efe9;
  --gold: #b98b5a;
  --success: #dcefe2;
  --danger: #f6dddc;
  --warning: #f4ebd4;
  --shadow: 0 22px 60px rgba(18, 37, 46, 0.08);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Instrument Sans", sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(250, 242, 236, 0.58), rgba(250, 242, 236, 0.72)),
    url("https://www.manuelinaricevimenti.it/wp/wp-content/uploads/1-Castello-dal-mare.jpg") center center / cover fixed no-repeat;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 248, 243, 0.18), rgba(255, 248, 243, 0.18)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.34), transparent 24%),
    radial-gradient(circle at bottom right, rgba(106, 67, 82, 0.12), transparent 24%);
  pointer-events: none;
}

.layout {
  position: relative;
  z-index: 1;
}

.feedback,
.soft-card a {
  display: block;
}

.layout {
  width: min(1200px, calc(100% - 32px));
  margin: 24px auto 48px;
  display: grid;
  gap: 18px;
}

.layout--narrow {
  width: min(760px, calc(100% - 32px));
}

.page-actions {
  display: flex;
  justify-content: center;
}

.admin-layout {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100% - 32px));
  margin: 36px auto 48px;
  display: grid;
  gap: 18px;
}

.card {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero {
  padding: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 28px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Playfair Display", serif;
  line-height: 1.02;
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
}

h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
}

h3 {
  font-size: 1.1rem;
}

.lead,
.section-copy,
.soft-card p,
.timeline p,
.entry-main small {
  color: var(--muted);
  line-height: 1.75;
}

.lead strong,
.section-copy strong {
  color: var(--text);
}

.lead--soft {
  margin-top: 12px;
}

.hero__actions,
.hero__facts,
.grid-two,
.form-grid,
.toolbar,
.stats {
  display: grid;
  gap: 14px;
}

.hero__actions {
  margin-top: 28px;
  grid-template-columns: repeat(2, max-content);
}

.button {
  min-height: 48px;
  border-radius: 999px;
  padding: 0 18px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  background: #b98b5a;
  color: #fff;
}

.button--secondary {
  background: linear-gradient(180deg, #fffaf6 0%, #f8eee8 100%);
  color: var(--primary);
  border-color: var(--line);
}

.button--danger {
  background: #fff;
  color: #8d3432;
  border-color: #ebc2c0;
}

.button--small {
  min-height: 38px;
  padding-inline: 14px;
}

.hero__facts {
  margin-top: 28px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero__facts article,
.hero__countdown,
.hero__note,
.soft-card,
.stats article,
.section-block,
.admin-insert {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.hero__facts article {
  padding: 18px;
}

.hero__facts span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.hero__facts small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero__panel {
  display: grid;
  gap: 14px;
}

.hero__countdown,
.hero__note {
  padding: 22px;
}

.hero__countdown-label {
  display: block;
  margin-bottom: 16px;
  color: var(--muted);
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.countdown-grid div {
  padding: 18px 10px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fffaf6 0%, #f9f0e9 100%);
  text-align: center;
}

.countdown-grid strong {
  display: block;
  font-size: 2rem;
}

.countdown-grid span {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero__note ul {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rsvp-public {
  max-width: 100%;
}

.section-block {
  padding: 28px;
}

.section-heading {
  margin-bottom: 18px;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline article {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.timeline article:first-child {
  border-top: 0;
  padding-top: 0;
}

.timeline span {
  color: var(--primary);
  font-weight: 700;
}

.info-stack {
  display: grid;
  gap: 14px;
}

.soft-card {
  padding: 20px;
}

.soft-card a {
  margin-top: 10px;
  color: var(--primary);
}

.rice-note {
  border-left: 4px solid var(--gold);
  background: linear-gradient(135deg, #fff6f0 0%, #fbebe4 100%);
}

.rice-note h3 {
  margin-bottom: 10px;
  color: var(--primary-strong);
}

.rice-note p + p {
  margin-top: 10px;
}

.iban-box {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px dashed var(--line-dark);
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 14px;
}

.iban-box code {
  overflow-wrap: anywhere;
}

.form,
.admin-insert {
  display: grid;
  gap: 16px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}

.form-grid__wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 15px;
  color: var(--text);
}

textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.form-actions--center {
  justify-content: center;
}

.upload-panel {
  display: grid;
  gap: 8px;
  padding: 22px 20px;
  border: 2px dashed var(--line-dark);
  border-radius: 22px;
  background: linear-gradient(180deg, #fffaf6 0%, #f8eee8 100%);
  text-align: center;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.upload-panel:hover,
.upload-panel:focus-within {
  transform: translateY(-1px);
  border-color: var(--gold);
  box-shadow: 0 12px 28px rgba(106, 67, 82, 0.08);
}

.upload-panel__copy {
  display: grid;
  gap: 8px;
  text-align: center;
}

.upload-native-input {
  position: relative;
  z-index: 1;
  width: 100%;
  background: #fff;
  border: 1px solid var(--line-dark);
  border-radius: 16px;
  padding: 12px 14px;
  cursor: pointer;
}

.upload-native-input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.upload-dropzone__eyebrow {
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.upload-panel strong {
  font-size: 1.1rem;
}

.upload-panel span {
  color: var(--muted);
  line-height: 1.5;
}

.upload-dropzone__meta {
  display: inline-flex;
  justify-self: center;
  align-items: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  color: var(--primary-strong);
  font-weight: 700;
}

.upload-panel.is-active {
  border-color: var(--gold);
  background: linear-gradient(180deg, #fff9f2 0%, #f4e4d7 100%);
}

.feedback {
  margin: 0;
  min-height: 20px;
  color: var(--muted);
}

.stats {
  /*grid-template-columns: repeat(4, minmax(0, 1fr));*/
  margin-bottom: 18px;
}

.stats article {
  padding: 18px;
}

.stats span {
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.stats strong {
  font-size: 1.8rem;
}

.toolbar {
  grid-template-columns: 1fr 220px;
  margin-bottom: 14px;
}

.table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
}

.entries-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.entries-table th,
.entries-table td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.entries-table thead th {
  background: #f7f9fa;
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.entry-main strong,
.entry-main small,
.entry-status span,
.entry-actions {
  display: block;
}

.entry-main small {
  margin-top: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 700;
}

.badge--yes {
  background: var(--success);
  color: #215d36;
}

.badge--no {
  background: var(--danger);
  color: #7c2e2b;
}

.badge--pending {
  background: var(--warning);
  color: #7f631f;
}

.entry-actions {
  min-width: 190px;
}

.entry-actions .button,
.entry-actions select {
  width: 100%;
  margin-bottom: 8px;
}

.admin-insert {
  margin-top: 18px;
  padding: 20px;
}

.admin-insert summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--primary);
}

.is-success {
  color: #215d36;
}

.is-error {
  color: #8d3432;
}

.is-hidden {
  display: none;
}

.form--narrow {
  max-width: 440px;
}

.form--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}

.form--inline .form-grid__wide {
  flex: 1 1 240px;
}

.photos-manage {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.photos-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.photo-thumb {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 1 / 1;
  background: var(--secondary);
}

.photo-thumb a {
  display: block;
  width: 100%;
  height: 100%;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.photo-thumb__remove {
  position: absolute;
  top: 6px;
  right: 6px;
  border: none;
  background: rgba(42, 34, 48, 0.72);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-thumb__remove:hover {
  background: var(--primary-strong);
}

.photo-card {
  display: grid;
  gap: 6px;
}

.photo-card__meta {
  display: grid;
  gap: 2px;
}

.photo-card__meta small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.photo-card__meta small:first-child {
  color: var(--text);
  font-weight: 600;
}

.admin-dashboard__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-dashboard__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.section-heading--compact {
  margin-bottom: 12px;
}

.site-footer {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto 28px;
  padding: 0 4px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.site-footer a {
  color: var(--primary);
}

@media (max-width: 980px) {
  .hero,
  .grid-two,
  .stats,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .hero__actions,
  .hero__facts,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .layout,
  .admin-layout,
  .site-footer {
    width: min(100% - 18px, 1200px);
  }

  .hero,
  .section-block {
    padding: 22px;
  }

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

  .iban-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer,
  .admin-dashboard__header {
    flex-direction: column;
  }
}
