@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Italiana&display=swap');

:root {
  --cream: #f7f1e7;
  --paper: #fffaf2;
  --brown: #5a3a2c;
  --brown-soft: #8a6c5d;
  --burgundy: #581c2b;
  --burgundy-dark: #3f101d;
  --rose: #b98787;
  --line: rgba(90, 58, 44, 0.18);
  --shadow: 0 20px 55px rgba(63, 16, 29, 0.11);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--brown);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.32;
  background-image: radial-gradient(rgba(88, 28, 43, 0.2) 0.55px, transparent 0.55px);
  background-size: 6px 6px;
}

.salma-registry-page {
  --cream: #f3efe6;
  --paper: #fffaf1;
  --brown: #4a463c;
  --brown-soft: #746e60;
  --burgundy: #52634d;
  --burgundy-dark: #394937;
  --rose: #b8745c;
  --line: rgba(74, 70, 60, 0.18);
  --shadow: 0 20px 55px rgba(57, 73, 55, 0.13);
}

.salma-registry-page::before {
  background-image: radial-gradient(rgba(82, 99, 77, 0.2) 0.55px, transparent 0.55px);
}

.salma-registry-page footer { background: #303d2f; }
.salma-registry-page .reserve-dialog::backdrop { background: rgba(38, 52, 37, 0.74); }

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 88px;
  padding: 0 clamp(20px, 5vw, 76px);
  border-bottom: 1px solid var(--line);
}

.site-header > p, .date, .back-link {
  margin: 0;
  color: var(--brown-soft);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.date, .back-link { justify-self: end; }
.back-link { text-decoration: none; transition: color 160ms ease; }
.back-link:hover { color: var(--burgundy); }

.monogram {
  justify-self: start;
  color: var(--burgundy);
  font-family: "Italiana", Georgia, serif;
  font-size: 1.55rem;
  letter-spacing: -0.08em;
  text-decoration: none;
}

.monogram span { color: var(--rose); font-size: 0.72em; font-style: italic; }

.hero {
  position: relative;
  display: flex;
  min-height: 520px;
  padding: 95px 20px 90px;
  overflow: hidden;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero::before, .hero::after {
  position: absolute;
  width: min(32vw, 380px);
  aspect-ratio: 1;
  border: 1px solid rgba(88, 28, 43, 0.15);
  border-radius: 50%;
  content: "";
}

.hero::before { top: -170px; left: -100px; box-shadow: 0 0 0 42px rgba(88, 28, 43, 0.025); }
.hero::after { right: -120px; bottom: -210px; box-shadow: 0 0 0 75px rgba(90, 58, 44, 0.025); }

.eyebrow {
  margin: 0 0 16px;
  color: var(--rose);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  color: var(--burgundy);
  font-family: "Italiana", Georgia, serif;
  font-size: clamp(4.5rem, 11vw, 10rem);
  font-weight: 400;
  letter-spacing: -0.075em;
  line-height: 0.86;
}

.hero h1 em { color: var(--rose); font-size: 0.66em; font-weight: 400; }

.salma-registry-page .hero h1 em {
  display: inline-block;
  margin-left: 0.08em;
  font-size: 0.96em;
  letter-spacing: 0.12em;
}

.intro {
  max-width: 620px;
  margin: 34px auto 0;
  color: var(--brown-soft);
  font-family: Georgia, serif;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.75;
}

.flourish { display: flex; width: min(360px, 70vw); margin-top: 35px; align-items: center; gap: 15px; color: var(--rose); }
.flourish::before, .flourish::after { height: 1px; background: var(--line); content: ""; flex: 1; }
.flourish span { font-size: 1.2rem; }

.registry { padding: 80px clamp(20px, 5vw, 76px) 110px; background: var(--burgundy); color: var(--paper); }

.section-heading {
  display: flex;
  max-width: 1400px;
  margin: 0 auto 46px;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}

.section-heading h2, .admin-welcome h1 {
  margin: 0;
  font-family: "Italiana", Georgia, serif;
  font-size: clamp(3rem, 6vw, 5.8rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.availability { margin: 0 0 8px; color: rgba(255, 250, 242, 0.62); font-size: 0.77rem; letter-spacing: 0.12em; text-transform: uppercase; }

.gift-grid { display: grid; max-width: 1400px; margin: 0 auto; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }

.gift-card {
  position: relative;
  display: flex;
  min-height: 430px;
  padding: 24px;
  overflow: hidden;
  background: var(--paper);
  color: var(--brown);
  flex-direction: column;
  gap: 22px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.gift-card:hover { z-index: 1; box-shadow: var(--shadow); transform: translateY(-4px); }
.gift-card.is-reserved { background: var(--burgundy-dark); box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.1); }
.gift-card.is-reserved > * { opacity: 0.44; filter: grayscale(0.55) saturate(0.5); transition: opacity 160ms ease, filter 160ms ease; }
.gift-card.is-reserved:hover > * { opacity: 0.6; filter: grayscale(0.35) saturate(0.65); }
.gift-card.is-reserved .gift-copy h3,
.gift-card.is-reserved .gift-note,
.gift-card.is-reserved .gift-link { color: var(--paper); }
.gift-card.is-reserved .gift-status { color: var(--rose); }
.gift-card.is-reserved .secondary-button { border-color: rgba(255, 250, 242, 0.72); color: var(--paper); }
.gift-card.is-reserved::after { position: absolute; top: 48px; right: -58px; width: 240px; padding: 11px 0; background: var(--rose); box-shadow: 0 5px 18px rgba(20, 8, 12, 0.32); color: var(--burgundy-dark); content: "Reserved"; font-size: 0.9rem; font-weight: 800; letter-spacing: 0.17em; text-align: center; text-transform: uppercase; transform: rotate(42deg); }

.gift-image { width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: #eadfd5; }
.gift-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gift-copy { display: flex; padding: 4px; flex: 1; flex-direction: column; justify-content: center; }
.gift-card.has-image .gift-copy { padding-top: 0; justify-content: flex-start; }
.gift-status { margin: 0 0 13px; color: var(--rose); font-size: 0.65rem; font-weight: 600; letter-spacing: 0.17em; text-transform: uppercase; }
.gift-copy h3 { margin: 0; color: var(--burgundy); font-family: "Italiana", Georgia, serif; font-size: clamp(2.1rem, 3.4vw, 3.7rem); font-weight: 400; letter-spacing: -0.04em; line-height: 0.98; overflow-wrap: anywhere; }
.gift-note { max-width: 36ch; margin: 15px 0 0; color: var(--brown-soft); line-height: 1.55; }
.gift-note.is-collapsed { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.gift-note.is-expanded { display: block; overflow: visible; }
.note-toggle { width: fit-content; margin-top: 9px; padding: 7px 10px; border: 0; background: var(--rose); color: var(--burgundy-dark); cursor: pointer; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.gift-link { display: inline-block; margin-top: 18px; color: var(--burgundy); font-size: 0.78rem; font-weight: 600; text-decoration: none; }
.gift-link span { display: inline-block; margin-left: 4px; transition: transform 160ms ease; }
.gift-link:hover span { transform: translate(2px, -2px); }

.reserve-button, .secondary-button, .primary-button {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--burgundy);
  border-radius: 0;
  background: var(--burgundy);
  color: var(--paper);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.reserve-button:hover, .primary-button:hover { background: var(--burgundy-dark); transform: translateY(-1px); }
.secondary-button { background: transparent; color: var(--burgundy); }
.secondary-button:hover { background: rgba(88, 28, 43, 0.06); }
button:disabled { cursor: wait; opacity: 0.58; }

.empty-state { max-width: 640px; margin: 30px auto; padding: 60px 20px; text-align: center; }
.empty-state span, .admin-empty span { color: var(--rose); font-size: 2rem; }
.empty-state h3 { margin: 18px 0 10px; font-family: "Italiana", Georgia, serif; font-size: 2.3rem; font-weight: 400; }
.empty-state p { color: rgba(255, 250, 242, 0.68); }

footer { padding: 80px 20px; background: #321620; color: var(--paper); text-align: center; }
footer p { margin: 0 0 9px; color: var(--rose); font-family: Georgia, serif; font-style: italic; }
footer strong { font-family: "Italiana", Georgia, serif; font-size: 2.6rem; font-weight: 400; }

.reserve-dialog { width: min(92vw, 480px); padding: 54px 46px 42px; border: 0; background: var(--paper); box-shadow: 0 28px 90px rgba(24, 5, 11, 0.38); color: var(--brown); text-align: center; }
.reserve-dialog::backdrop { background: rgba(45, 12, 22, 0.74); backdrop-filter: blur(4px); }
.reserve-dialog h2 { margin: 10px 0 16px; color: var(--burgundy); font-family: "Italiana", Georgia, serif; font-size: 2.8rem; font-weight: 400; line-height: 1.05; }
.reserve-dialog > p:not(.eyebrow) { margin: 0 0 28px; color: var(--brown-soft); line-height: 1.65; }
.dialog-heart { margin-bottom: 15px; color: var(--rose); font-size: 2.2rem; }
.dialog-close { position: absolute; top: 13px; right: 17px; border: 0; background: none; cursor: pointer; color: var(--brown-soft); font-family: Georgia, serif; font-size: 1.8rem; }
.dialog-done { max-width: 210px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; }
.confirm-dialog .dialog-heart { display: grid; width: 48px; height: 48px; margin: 0 auto 18px; border: 1px solid var(--rose); border-radius: 50%; place-items: center; font-family: Georgia, serif; font-size: 1.5rem; }

.toast { position: fixed; z-index: 20; right: 24px; bottom: 24px; max-width: min(390px, calc(100vw - 48px)); padding: 15px 20px; background: var(--burgundy-dark); box-shadow: var(--shadow); color: var(--paper); font-size: 0.88rem; opacity: 0; pointer-events: none; transform: translateY(16px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.show { opacity: 1; transform: translateY(0); }

.admin-main { min-height: calc(100vh - 88px); }
.login-panel { display: grid; min-height: calc(100vh - 88px); padding: 50px 20px; place-items: center; }
.login-card { width: min(100%, 460px); padding: clamp(34px, 5vw, 58px); background: var(--paper); box-shadow: var(--shadow); }
.login-card h1 { margin: 0 0 18px; color: var(--burgundy); font-family: "Italiana", Georgia, serif; font-size: 3.4rem; font-weight: 400; letter-spacing: -0.05em; }
.login-card > p:not(.eyebrow) { margin: 0 0 28px; color: var(--brown-soft); line-height: 1.6; }

form { display: grid; gap: 18px; }
label { display: grid; gap: 8px; color: var(--brown); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
label span { color: var(--brown-soft); font-size: 0.85em; font-weight: 400; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 0; outline: none; background: #fffdf8; color: var(--brown); font-size: 0.95rem; letter-spacing: 0; text-transform: none; transition: border 160ms ease, box-shadow 160ms ease; }
input { height: 50px; padding: 0 14px; }
input[type="file"] { height: auto; padding: 13px 12px; color: var(--brown-soft); font-size: 0.78rem; }
textarea { min-height: 100px; padding: 14px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--burgundy); box-shadow: 0 0 0 3px rgba(88, 28, 43, 0.08); }
.form-error { min-height: 1.2em; margin: -6px 0; color: #a11d37; font-size: 0.78rem; }

.dashboard { padding: 70px clamp(20px, 5vw, 76px) 100px; }
.admin-welcome { display: flex; max-width: 1400px; margin: 0 auto 50px; align-items: end; justify-content: space-between; gap: 30px; }
.admin-welcome h1 { color: var(--burgundy); }
.admin-welcome > div > p:last-child { margin: 18px 0 0; color: var(--brown-soft); }
.text-button { padding: 10px 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--burgundy); cursor: pointer; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }

.registry-switcher { display: grid; max-width: 1400px; margin: 0 auto 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.registry-tab { display: flex; min-height: 66px; padding: 0 22px; border: 1px solid var(--line); background: transparent; color: var(--brown-soft); cursor: pointer; align-items: center; gap: 14px; font-size: 0.76rem; font-weight: 600; letter-spacing: 0.1em; text-align: left; text-transform: uppercase; transition: background 160ms ease, border-color 160ms ease, color 160ms ease; }
.registry-tab span { color: var(--rose); font-family: Georgia, serif; font-size: 0.72rem; }
.registry-tab:hover { border-color: var(--burgundy); color: var(--burgundy); }
.registry-tab.active { border-color: var(--burgundy); background: var(--burgundy); color: var(--paper); }
.registry-tab.active span { color: var(--rose); }
.registry-tab[data-registry-tab="salma"].active { border-color: #52634d; background: #52634d; }

.admin-layout { display: grid; max-width: 1400px; margin: 0 auto; grid-template-columns: minmax(290px, 0.7fr) minmax(0, 1.5fr); gap: 24px; align-items: start; }
.add-card { position: sticky; top: 24px; padding: 34px; background: var(--burgundy); color: var(--paper); }
.add-card h2, .manage-heading h2 { margin: 0 0 26px; font-family: "Italiana", Georgia, serif; font-size: 2.5rem; font-weight: 400; }
.add-card label { color: var(--paper); }
.add-card input, .add-card textarea { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: var(--paper); }
.add-card input::placeholder, .add-card textarea::placeholder { color: rgba(255,255,255,.43); }
.add-card input:focus, .add-card textarea:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(255,255,255,.08); }
.add-card .primary-button { border-color: var(--paper); background: var(--paper); color: var(--burgundy); }
.add-card .primary-button:hover { background: #eadfd5; }
.add-card.salma-active { background: #52634d; }
.add-card.salma-active input:focus, .add-card.salma-active textarea:focus { border-color: #d58c70; }
.add-card.salma-active .primary-button { color: #52634d; }

.manage-list { min-width: 0; background: var(--paper); }
.manage-heading { display: flex; padding: 28px 30px 20px; border-bottom: 1px solid var(--line); align-items: baseline; justify-content: space-between; }
.manage-heading h2 { margin: 0; color: var(--burgundy); }
.manage-heading span { color: var(--brown-soft); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }
.manage-item { display: grid; padding: 26px 30px; border-bottom: 1px solid var(--line); grid-template-columns: 42px minmax(0, 1fr) auto; gap: 18px; align-items: start; }
.manage-thumb { width: 74px; height: 74px; grid-column: 2; margin: 0 0 2px; object-fit: cover; }
.manage-thumb + div { grid-column: 2; }
.manage-number { padding-top: 4px; color: var(--rose); font-family: Georgia, serif; font-size: 0.75rem; }
.manage-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.manage-item h3 { margin: 0; color: var(--burgundy); font-family: "Italiana", Georgia, serif; font-size: 1.65rem; font-weight: 400; }
.manage-item p { margin: 8px 0 0; color: var(--brown-soft); font-size: 0.88rem; line-height: 1.5; }
.manage-item a { display: inline-block; margin-top: 9px; color: var(--burgundy); font-size: 0.72rem; font-weight: 600; text-decoration: none; }
.status-pill { padding: 5px 8px; background: rgba(90,58,44,.08); color: var(--brown-soft); font-size: 0.58rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.status-pill.reserved { background: rgba(88,28,43,.1); color: var(--burgundy); }
.remove-button { margin-top: 3px; padding: 6px 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: #9b3b4e; cursor: pointer; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.admin-empty { padding: 80px 30px; color: var(--brown-soft); text-align: center; }
.list-loading { padding: 54px 30px; color: var(--brown-soft); text-align: center; }

button:focus-visible, a:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }

@media (max-width: 900px) {
  .gift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-layout { grid-template-columns: 1fr; }
  .add-card { position: static; }
}

@media (max-width: 620px) {
  .site-header { grid-template-columns: 1fr auto; min-height: 74px; padding: 0 18px; }
  .site-header > p { display: none; }
  .date, .back-link { font-size: 0.62rem; }
  .hero { min-height: 470px; padding-top: 75px; }
  .hero h1 { font-size: clamp(4rem, 22vw, 6.4rem); }
  .intro { font-size: 1rem; }
  .registry { padding: 65px 16px 80px; }
  .section-heading { display: block; margin-bottom: 30px; }
  .availability { margin-top: 20px; }
  .gift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gift-card { height: clamp(280px, 41svh, 330px); min-height: 0; padding: 12px; gap: 10px; }
  .gift-card.no-image { min-height: 0; }
  .gift-image { aspect-ratio: auto; height: 92px; flex: 0 0 auto; }
  .gift-copy { min-height: 0; padding: 0; overflow: hidden; justify-content: flex-start; }
  .gift-card.note-expanded { height: auto; min-height: clamp(280px, 41svh, 330px); }
  .gift-card.note-expanded .gift-copy { overflow: visible; }
  .gift-status { margin-bottom: 7px; font-size: 0.52rem; letter-spacing: 0.12em; }
  .gift-copy h3 { font-size: clamp(1.45rem, 7vw, 2rem); line-height: 0.96; }
  .gift-note { margin-top: 8px; font-size: 0.7rem; line-height: 1.3; }
  .gift-note.is-collapsed { -webkit-line-clamp: 2; }
  .note-toggle { margin-top: 6px; padding: 6px 8px; font-size: 0.62rem; letter-spacing: 0.04em; }
  .gift-link { margin-top: 8px; font-size: 0.62rem; }
  .gift-card > .reserve-button, .gift-card > .secondary-button { min-height: 40px; padding: 6px; font-size: 0.56rem; letter-spacing: 0.07em; }
  .gift-card.is-reserved::after { top: 30px; right: -43px; width: 170px; padding: 8px 0; font-size: 0.66rem; letter-spacing: 0.12em; }
  .reserve-dialog { padding: 48px 25px 30px; }
  .dialog-actions { grid-template-columns: 1fr; }
  .dashboard { padding: 50px 16px 70px; }
  .registry-switcher { grid-template-columns: 1fr; }
  .admin-welcome { display: block; }
  .text-button { margin-top: 26px; }
  .add-card { padding: 28px 22px; }
  .manage-heading { padding: 23px 20px 16px; }
  .manage-item { padding: 22px 20px; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
  .manage-thumb { grid-column: 2; grid-row: 1; width: 64px; height: 64px; }
  .manage-thumb + div { grid-column: 2; grid-row: 2; }
  .remove-button { grid-column: 2; width: fit-content; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
