:root {
  --bg: #f6f1ea;
  --card: #ffffff;
  --text: #2a2522;
  --muted: #776d66;
  --green: #1f4d3a;
  --green-2: #2c6b52;
  --red: #b3262e;
  --gold: #c9a24a;
  --line: #e4dcd2;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--green-2); }

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--green);
  border-bottom: 4px solid var(--red);
}
.top a, .top button.link { color: #fff; text-decoration: none; font-weight: 500; }
.top .brand { font-size: 1.2rem; font-weight: 700; }
.top nav { display: flex; gap: 20px; align-items: center; }
.top nav a:hover, .top button.link:hover { color: var(--gold); }

main { max-width: 1000px; margin: 0 auto; padding: 24px 16px 64px; }

h1 { margin: 8px 0 20px; font-size: 1.7rem; }
h2 { margin-top: 0; font-size: 1.25rem; }
h3 { margin: 0 0 6px; font-size: 1.1rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 24px 0;
}
.card.narrow { max-width: 380px; margin: 48px auto; }

form label { display: block; margin-bottom: 14px; font-weight: 500; font-size: .95rem; }
input[type=text], input:not([type]), input[type=url], input[type=password], textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 11px;
  border: 1px solid #cfc5b9;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
input[type=file] { display: block; margin-top: 6px; }
input:focus, textarea:focus { outline: 2px solid var(--green-2); outline-offset: 1px; border-color: transparent; }

button {
  font: inherit;
  font-weight: 600;
  padding: 9px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button.secondary { background: var(--green-2); }
button.danger { background: transparent; color: var(--red); border: 1px solid var(--red); }
button.link { background: none; border: 0; padding: 0; font-weight: 500; color: var(--green-2); text-decoration: underline; }
button.link.danger { color: var(--red); border: 0; }

form.inline { display: inline; margin: 0; }
form.row { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; }
form.row input { margin: 0; flex: 1; }

.flash { padding: 10px 14px; border-radius: 8px; margin: 0 0 16px; }
.flash.ok { background: #e3f1e8; color: var(--green); border: 1px solid #b9dcc6; }
.flash.error { background: #fbe8e8; color: #8c1d23; border: 1px solid #f0bcbc; }

.empty, .hint { color: var(--muted); }
.crumb { margin: 0; }
.crumb a { text-decoration: none; }

/* Főoldali fejléc */
.hero {
  margin: 0 0 28px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--green);
  border-bottom: 4px solid var(--red);
  box-shadow: 0 8px 24px rgba(31, 77, 58, .18);
}
.hero img {
  display: block;
  width: 100%;
  aspect-ratio: 2400 / 512;
  min-height: 140px;          /* keskeny kijelzőn középre vágva */
  object-fit: cover;
  object-position: center 35%;
}
/* Telefonon a külön mobil kivágás (16:9) jelenik meg, vágás nélkül */
@media (max-width: 640px) {
  .hero img.has-mobile { aspect-ratio: 900 / 506; min-height: 0; object-position: center; }
}
.hero h1 {
  margin: 0;
  padding: 14px 20px 12px;
  color: #fff;
  text-align: center;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: .14em;
}
.hero h1::before, .hero h1::after { content: "✦"; color: var(--gold); font-size: .55em; vertical-align: middle; margin: 0 .7em; }

/* Személyek */
.person-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.person-grid a {
  display: block;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: transform .1s, box-shadow .1s;
}
.person-grid a:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.person-grid .name { display: block; font-size: 1.2rem; font-weight: 700; }
.person-grid .count { color: var(--muted); font-size: .9rem; }

/* Kívánságok */
.wish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.wish {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.wish-img img { display: block; width: 100%; height: 200px; object-fit: cover; background: #eee; }
.wish-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.wish-body h3 a { color: var(--text); }
.wish .desc { white-space: pre-line; margin: 4px 0 8px; color: #4a423d; overflow-wrap: anywhere; }
.wish .shop { font-weight: 600; }
.wish .actions { margin-top: auto; padding-top: 10px; display: flex; gap: 16px; font-size: .9rem; border-top: 1px solid var(--line); }

.current-image { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.current-image img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; }
label.check { display: flex; gap: 6px; align-items: center; margin: 0; font-weight: 400; }

/* Admin */
table.persons { width: 100%; border-collapse: collapse; margin-top: 12px; }
table.persons th, table.persons td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: middle; }
table.persons td form.row { margin: 0; }
table.persons td:nth-child(2), table.persons td:nth-child(3) { white-space: nowrap; width: 1%; }

.pw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }

@media (max-width: 560px) {
  .top { padding: 12px 16px; }
  table.persons thead { display: none; }
  table.persons tr { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 8px 0; border-top: 1px solid var(--line); }
  table.persons td { border: 0; padding: 0; width: auto !important; }
  table.persons td:first-child { grid-column: 1 / -1; }
}
