/* TYT Event — family event platform */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Outfit:wght@300;400;500;600&display=swap');

:root {
  --bg0: #0f1412;
  --bg1: #1a2420;
  --bg2: #24302b;
  --ink: #f3efe6;
  --muted: #b7c0b8;
  --accent: #c6a35a;
  --accent-soft: rgba(198, 163, 90, 0.18);
  --line: rgba(243, 239, 230, 0.12);
  --danger: #e07a6a;
  --ok: #7cb89a;
  --radius: 14px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Outfit', system-ui, sans-serif;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(198, 163, 90, 0.16), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(90, 140, 120, 0.18), transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 45%, #121916);
  line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(15, 20, 18, 0.72);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.65rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
  animation: fadeUp 0.55s ease both;
}
.brand span {
  color: var(--accent);
  text-shadow: 0 0 24px rgba(198, 163, 90, 0.35);
}

.nav a.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.35rem 0.2rem;
  position: relative;
}
.nav a.nav-link:hover,
.nav a.nav-link.active { color: var(--ink); }
.nav a.nav-link.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -0.35rem;
  height: 2px;
  background: var(--accent);
  animation: growIn 0.35s ease;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.5rem;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.btn-primary {
  background: linear-gradient(135deg, #d4b46a, #a8843c);
  color: #1a1408;
  border-color: transparent;
  font-weight: 600;
}
.btn-ghost { background: transparent; }
.btn-danger { border-color: var(--danger); color: #ffc9c0; }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.hero {
  min-height: min(72vh, 640px);
  display: grid;
  align-content: end;
  gap: 1rem;
  padding: 3rem 0 2.5rem;
  animation: fadeUp 0.7s ease both;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 10% -5% auto auto;
  width: min(420px, 55vw);
  height: min(420px, 55vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(198,163,90,0.14), transparent 68%);
  pointer-events: none;
  animation: fadeIn 1.2s ease both;
}
.hero h1,
.hero p { position: relative; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 600;
  line-height: 1.05;
  margin: 0;
  letter-spacing: 0.02em;
}
.hero p {
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
}

.section {
  margin-top: 2.5rem;
  animation: fadeUp 0.6s ease both;
  animation-delay: 0.08s;
}
.section h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}
.section .lede {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
}

.item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  background: linear-gradient(160deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.item:hover { border-color: rgba(198,163,90,0.45); transform: translateY(-2px); }
.item h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  margin: 0 0 0.4rem;
}
.item .meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.55rem; }
.item p { margin: 0; color: var(--muted); }

.cover {
  aspect-ratio: 16/10;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.85rem;
  background:
    linear-gradient(135deg, rgba(198,163,90,0.25), transparent),
    var(--bg2);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }

.stack { display: grid; gap: 1rem; }

.article {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0;
}
.article h3 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  margin: 0 0 0.4rem;
}
.article .body { white-space: pre-wrap; color: var(--ink); }

.comments { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.comment {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.comment .who { font-weight: 600; color: var(--accent); font-size: 0.9rem; }
.comment .when { color: var(--muted); font-size: 0.8rem; margin-left: 0.5rem; }
.comment-media {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
}
.comment-media img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: pointer;
}

.form-row {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}
.form-row label { font-size: 0.85rem; color: var(--muted); }
input, textarea, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}
textarea { min-height: 100px; resize: vertical; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; animation: fadeIn 0.2s ease; }
.modal {
  width: min(420px, 100%);
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.modal h3 {
  font-family: var(--font-display);
  margin: 0 0 1rem;
  font-size: 1.6rem;
}

.edit-panel {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: min(380px, calc(100% - 2rem));
  background: var(--bg1);
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow);
  z-index: 50;
  display: none;
}
.edit-panel.open { display: block; animation: fadeUp 0.25s ease; }
body.edit-mode [data-entity] {
  outline: 1px dashed transparent;
  cursor: pointer;
}
body.edit-mode [data-entity]:hover {
  outline-color: var(--accent);
  background: var(--accent-soft);
}

.gallery-stage {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  min-height: 320px;
  display: grid;
  place-items: center;
}
.gallery-stage img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  animation: fadeIn 0.4s ease;
}
.gallery-nav {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.9rem;
}
.thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.75rem 0;
}
.thumbs img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  opacity: 0.65;
  cursor: pointer;
  border: 2px solid transparent;
}
.thumbs img.active { opacity: 1; border-color: var(--accent); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.empty {
  color: var(--muted);
  padding: 1.5rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-right: 0.35rem;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes growIn {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (max-width: 640px) {
  .nav { gap: 0.55rem; }
  .brand { width: 100%; margin-right: 0; }
  .toolbar { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
}
