/* PawFlame — dusk theme: night sky melting into a golden horizon */

:root {
  --night-deep: #0b1026;
  --night: #141a38;
  --night-soft: #1e2547;
  --dusk-purple: #4a3766;
  --dusk-rose: #8a4f63;
  --gold: #ffb85c;
  --gold-soft: #ffd9a3;
  --gold-glow: rgba(255, 184, 92, 0.35);
  --cream: #f6efe3;
  --cream-dim: rgba(246, 239, 227, 0.72);
  --cream-faint: rgba(246, 239, 227, 0.45);
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.12);
  --danger: #ff8b7a;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Nunito Sans', 'Helvetica Neue', Arial, sans-serif;
  --radius: 16px;
  --maxw: 1080px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--cream);
  background: var(--night-deep);
  background-image: linear-gradient(180deg, var(--night-deep) 0%, var(--night) 45%, var(--night-soft) 100%);
  min-height: 100vh;
}

h1, h2, h3 { font-family: var(--font-serif); font-weight: 500; line-height: 1.2; color: var(--gold-soft); }
h1 { font-size: clamp(2rem, 5.5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin-bottom: .6em; }
h3 { font-size: 1.25rem; margin-bottom: .35em; }
p  { margin-bottom: 1em; }
a  { color: var(--gold-soft); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
img { max-width: 100%; height: auto; display: block; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--gold); color: var(--night-deep);
  padding: 8px 16px; z-index: 100; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 16, 38, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  font-family: var(--font-serif); font-size: 1.45rem; font-weight: 600;
  color: var(--cream); text-decoration: none; display: flex; align-items: center; gap: 9px;
}
.brand-flame {
  width: 11px; height: 17px; display: inline-block;
  background: radial-gradient(ellipse at 50% 80%, #ffd27a 0%, #ff9d3c 55%, transparent 78%);
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  animation: flicker 2.4s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 6px var(--gold-glow));
}
.brand-flame.small { width: 9px; height: 14px; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--cream-dim); text-decoration: none; font-size: .95rem; font-weight: 400; }
.nav-links a:hover { color: var(--cream); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--cream); margin: 5px 0; border-radius: 2px; transition: .25s; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block; padding: 13px 30px; border-radius: 40px;
  font-family: var(--font-sans); font-weight: 600; font-size: .98rem;
  text-decoration: none; cursor: pointer; border: none; transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, #ff9d3c 100%);
  color: #241503; box-shadow: 0 0 26px var(--gold-glow);
}
.btn-primary:hover { color: #241503; box-shadow: 0 0 40px var(--gold-glow); }
.btn-ghost {
  background: transparent; color: var(--cream); border: 1px solid var(--card-border);
}
.btn-ghost:hover { color: var(--gold-soft); border-color: var(--gold-soft); }
.btn-nav { padding: 10px 22px; font-size: .9rem; }
.btn-sm { padding: 9px 20px; font-size: .88rem; }
.btn-lg { padding: 16px 40px; font-size: 1.05rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Hero (starfield + golden horizon) ---------- */

.hero {
  position: relative; overflow: hidden; text-align: center;
  padding: clamp(70px, 12vw, 130px) 20px clamp(90px, 14vw, 150px);
  background: linear-gradient(180deg, var(--night-deep) 0%, var(--night) 40%, var(--dusk-purple) 78%, var(--dusk-rose) 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255,255,255,.55), transparent 50%),
    radial-gradient(1px 1px at 32% 12%, rgba(255,255,255,.4), transparent 50%),
    radial-gradient(2px 2px at 55% 28%, rgba(255,255,255,.6), transparent 50%),
    radial-gradient(1px 1px at 72% 15%, rgba(255,255,255,.45), transparent 50%),
    radial-gradient(1.5px 1.5px at 88% 30%, rgba(255,255,255,.5), transparent 50%),
    radial-gradient(1px 1px at 45% 8%, rgba(255,255,255,.35), transparent 50%),
    radial-gradient(1.5px 1.5px at 65% 42%, rgba(255,255,255,.4), transparent 50%),
    radial-gradient(1px 1px at 20% 45%, rgba(255,255,255,.3), transparent 50%),
    radial-gradient(1px 1px at 80% 55%, rgba(255,255,255,.25), transparent 50%);
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 110px; pointer-events: none;
  background: radial-gradient(ellipse 65% 100% at 50% 100%, rgba(255,217,163,.5), transparent 72%);
}
.hero-inner { position: relative; z-index: 2; max-width: 660px; margin: 0 auto; }
.hero h1 { color: var(--gold-soft); text-shadow: 0 0 40px var(--gold-glow); margin-bottom: 16px; }
.hero p.lead { font-size: 1.12rem; color: var(--cream-dim); max-width: 540px; margin: 0 auto 30px; }

/* ---------- Sections ---------- */

.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(50px, 8vw, 80px) 20px; }
.section-narrow { max-width: 720px; }
.section-title { text-align: center; margin-bottom: 34px; }
.section-title p { color: var(--cream-faint); max-width: 520px; margin: 8px auto 0; }

/* ---------- Stats ---------- */

.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px; max-width: 760px; margin: -55px auto 0; position: relative; z-index: 3; padding: 0 20px;
}
.stat {
  background: rgba(20, 26, 56, 0.9); border: 1px solid var(--card-border);
  border-radius: var(--radius); padding: 18px 12px; text-align: center;
  backdrop-filter: blur(8px);
}
.stat .num { font-family: var(--font-serif); font-size: 1.9rem; color: var(--gold); font-weight: 600; }
.stat .lbl { font-size: .78rem; letter-spacing: 1.2px; text-transform: uppercase; color: var(--cream-faint); }

/* ---------- Memorial cards ---------- */

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 16px;
}
.mem-card {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 20px 14px 16px; text-align: center; text-decoration: none; color: var(--cream);
  transition: transform .18s, border-color .18s, box-shadow .18s; display: block;
}
.mem-card:hover { transform: translateY(-3px); border-color: var(--gold-glow); box-shadow: 0 8px 30px rgba(0,0,0,.35); color: var(--cream); }
.mem-card .photo {
  width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 12px;
  object-fit: cover; box-shadow: 0 0 0 3px rgba(255, 184, 92, 0.3);
}
.mem-card .name { font-family: var(--font-serif); font-size: 1.15rem; color: var(--gold-soft); }
.mem-card .years { font-size: .78rem; color: var(--cream-faint); }
.mem-card .flame { margin: 10px auto 0; }
.mem-card .flame.out { opacity: .18; animation: none; filter: none; }

.flame {
  width: 13px; height: 20px;
  background: radial-gradient(ellipse at 50% 80%, #ffd27a 0%, #ff9d3c 55%, transparent 78%);
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  animation: flicker 2.2s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px var(--gold-glow));
}
.flame.big { width: 22px; height: 34px; }

@keyframes flicker {
  0%   { transform: scale(1) rotate(-1.5deg); opacity: .95; }
  40%  { transform: scale(1.07) rotate(1deg); }
  100% { transform: scale(.93) rotate(-2deg); opacity: .85; }
}
@media (prefers-reduced-motion: reduce) {
  .flame, .brand-flame { animation: none; }
}

/* ---------- How it works ---------- */

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.step {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 26px 22px;
}
.step .n {
  font-family: var(--font-serif); font-size: 1.1rem; color: var(--night-deep);
  width: 34px; height: 34px; border-radius: 50%; background: var(--gold);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px; font-weight: 600;
}
.step p { color: var(--cream-dim); font-size: .95rem; margin: 0; }

/* ---------- Forms ---------- */

.form-card {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: clamp(22px, 4vw, 36px);
}
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; color: var(--cream); }
.form-row .hint { font-size: .8rem; color: var(--cream-faint); margin-top: 4px; }
input[type="text"], input[type="email"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--card-border); background: rgba(11, 16, 38, 0.6);
  color: var(--cream); font-family: var(--font-sans); font-size: 1rem;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 130px; resize: vertical; }
select option { background: var(--night); }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hp-wrap { position: absolute; left: -9999px; top: -9999px; }

.photo-drop {
  border: 2px dashed var(--card-border); border-radius: var(--radius); padding: 26px;
  text-align: center; cursor: pointer; transition: border-color .2s;
}
.photo-drop:hover, .photo-drop.dragover { border-color: var(--gold); }
.photo-drop img { max-height: 180px; margin: 0 auto 10px; border-radius: 12px; }
.photo-drop input[type="file"] { display: none; }

/* Candle choice */
.candle-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.candle-opt {
  position: relative; border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 20px 18px; cursor: pointer; background: rgba(11, 16, 38, 0.4); transition: border-color .15s, background .15s;
}
.candle-opt input { position: absolute; opacity: 0; }
.candle-opt.selected { border-color: var(--gold); background: rgba(255, 184, 92, 0.08); box-shadow: 0 0 24px rgba(255,184,92,.12); }
.candle-opt .price { font-family: var(--font-serif); font-size: 1.5rem; color: var(--gold); }
.candle-opt .desc { font-size: .85rem; color: var(--cream-dim); }
.candle-opt .badge {
  position: absolute; top: -10px; right: 14px; background: var(--gold); color: var(--night-deep);
  font-size: .68rem; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  padding: 3px 10px; border-radius: 20px;
}

.alert { border-radius: 12px; padding: 14px 18px; margin-bottom: 20px; font-size: .95rem; }
.alert-error { background: rgba(255, 139, 122, .12); border: 1px solid rgba(255, 139, 122, .4); color: var(--danger); }
.alert-ok { background: rgba(255, 184, 92, .1); border: 1px solid rgba(255, 184, 92, .35); color: var(--gold-soft); }

/* ---------- Memorial page ---------- */

.memorial-hero { text-align: center; padding: clamp(40px, 7vw, 70px) 20px 30px; position: relative; }
.memorial-hero .photo {
  width: clamp(140px, 24vw, 190px); height: clamp(140px, 24vw, 190px);
  border-radius: 50%; object-fit: cover; margin: 0 auto 6px;
  box-shadow: 0 0 0 5px rgba(255, 184, 92, 0.35), 0 0 60px rgba(255, 184, 92, 0.18);
}
.memorial-hero .flame-holder { display: flex; justify-content: center; margin: 14px 0 6px; }
.memorial-hero h1 { margin-bottom: 2px; }
.memorial-hero .years { color: var(--cream-faint); font-size: .95rem; letter-spacing: 1px; }
.memorial-hero .species-tag { display: inline-block; margin-top: 8px; font-size: .78rem; color: var(--cream-faint); border: 1px solid var(--card-border); padding: 3px 12px; border-radius: 20px; }
.tribute {
  max-width: 640px; margin: 24px auto; font-family: var(--font-serif);
  font-size: 1.25rem; font-style: italic; color: var(--cream); line-height: 1.7; white-space: pre-line;
}
.memorial-meta { color: var(--cream-faint); font-size: .88rem; }
.memorial-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }

.candle-note { text-align: center; font-size: .9rem; color: var(--cream-faint); max-width: 480px; margin: 8px auto 0; }
.candle-note a { color: var(--gold); }

/* Guestbook */
.guestbook { max-width: 680px; margin: 0 auto; }
.gb-message {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 14px;
}
.gb-message .who { font-weight: 700; font-size: .9rem; color: var(--gold-soft); }
.gb-message .when { font-size: .75rem; color: var(--cream-faint); margin-left: 8px; font-weight: 400; }
.gb-message p { margin: 6px 0 0; font-size: .95rem; color: var(--cream-dim); }

.visitor-candles { text-align: center; margin: 18px auto; color: var(--cream-dim); font-size: .95rem; }
.visitor-candles .row { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.visitor-candles .flame { width: 10px; height: 15px; }

/* ---------- Sanctuary ---------- */

#map {
  height: clamp(320px, 50vw, 460px); border-radius: var(--radius);
  border: 1px solid var(--card-border); z-index: 1;
  background: var(--night-soft); /* dark placeholder while tiles load */
}
#map .leaflet-tile-pane { filter: saturate(.9); }
.map-note { font-size: .8rem; color: var(--cream-faint); margin-top: 8px; text-align: right; }
#pick-map { height: 240px; border-radius: 12px; border: 1px solid var(--card-border); }

/* ---------- Pricing ---------- */

.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; align-items: stretch; }
.price-card {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 30px 26px; text-align: center; position: relative; display: flex; flex-direction: column;
}
.price-card.featured { border-color: var(--gold); box-shadow: 0 0 40px rgba(255,184,92,.12); }
.price-card .amount { font-family: var(--font-serif); font-size: 2.6rem; color: var(--gold); margin: 8px 0 2px; }
.price-card .period { color: var(--cream-faint); font-size: .82rem; margin-bottom: 18px; }
.price-card ul { list-style: none; text-align: left; margin: 0 0 22px; flex: 1; }
.price-card li { padding: 7px 0 7px 26px; position: relative; font-size: .93rem; color: var(--cream-dim); }
.price-card li::before { content: "✦"; position: absolute; left: 2px; color: var(--gold); font-size: .8rem; }
.donation-strip {
  text-align: center; background: linear-gradient(135deg, rgba(255,184,92,.12), rgba(138,79,99,.18));
  border: 1px solid rgba(255,184,92,.25); border-radius: var(--radius); padding: 26px; margin-top: 34px;
}

/* ---------- FAQ ---------- */

.faq-item { border-bottom: 1px solid var(--card-border); }
.faq-item summary {
  font-family: var(--font-serif); font-size: 1.15rem; color: var(--cream);
  padding: 18px 30px 18px 4px; cursor: pointer; list-style: none; position: relative;
}
.faq-item summary::after { content: "+"; position: absolute; right: 8px; color: var(--gold); font-size: 1.3rem; transition: transform .2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item div { padding: 0 4px 18px; color: var(--cream-dim); font-size: .96rem; }

/* ---------- CTA band ---------- */

.cta-band {
  text-align: center; padding: clamp(60px, 10vw, 100px) 20px;
  background: linear-gradient(180deg, transparent 0%, rgba(74, 55, 102, .35) 60%, rgba(138, 79, 99, .4) 100%);
}

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid rgba(255,255,255,.07); background: rgba(8, 12, 30, .7); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 40px 20px 28px; text-align: center; }
.footer-brand { max-width: 420px; margin: 0 auto 18px; }
.footer-brand p { color: var(--cream-faint); font-size: .88rem; margin: 8px 0 0; }
.footer-brand strong { font-family: var(--font-serif); font-size: 1.2rem; margin-left: 6px; }
.footer-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.footer-links a { color: var(--cream-faint); text-decoration: none; font-size: .88rem; }
.footer-links a:hover { color: var(--gold-soft); }
.footer-copy { color: rgba(246,239,227,.3); font-size: .78rem; margin: 0; }
.footer-copy a { color: rgba(246,239,227,.4); }

/* ---------- Cookie banner ---------- */

.cookie-banner {
  position: fixed; bottom: 16px; left: 16px; right: 16px; z-index: 90;
  max-width: 480px; margin: 0 auto; background: var(--night-soft);
  border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.cookie-banner p { font-size: .9rem; margin-bottom: 12px; }
.cookie-actions { display: flex; gap: 10px; }

/* ---------- Share buttons ---------- */

.share-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* ---------- 404 ---------- */

.page-404 { text-align: center; padding: 100px 20px; }

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(11, 16, 38, .98); flex-direction: column; padding: 20px;
    border-bottom: 1px solid var(--card-border);
  }
  .nav-links.open { display: flex; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .candle-choice { grid-template-columns: 1fr; }
  .stats { margin-top: -40px; }
}

/* ---------- Admin (backoffice) ---------- */

.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }
.admin-nav a {
  padding: 8px 18px; border-radius: 30px; border: 1px solid var(--card-border);
  color: var(--cream-dim); text-decoration: none; font-size: .9rem;
}
.admin-nav a.active, .admin-nav a:hover { color: var(--night-deep); background: var(--gold); border-color: var(--gold); }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--card-border); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--card-border); vertical-align: top; }
.admin-table th { background: rgba(255,255,255,.04); font-family: var(--font-sans); font-weight: 700; font-size: .78rem; letter-spacing: .8px; text-transform: uppercase; color: var(--cream-faint); }
.admin-table tr.row-hidden { opacity: .45; }
.admin-table .actions form { margin: 2px 2px 2px 0; }
.admin-table .actions .btn { padding: 5px 12px; font-size: .78rem; }
.admin-table small { color: var(--cream-faint); }

/* ---------- Gallery ---------- */

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; max-width: 680px; margin: 0 auto; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; border: 1px solid var(--card-border); }
.gallery figure { position: relative; margin: 0; }

/* ---------- Blog ---------- */

.blog-list { display: grid; gap: 18px; max-width: 720px; margin: 0 auto; }
.blog-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 26px 28px; text-decoration: none; display: block; transition: border-color .18s; }
.blog-card:hover { border-color: var(--gold-glow); }
.blog-card h3 { margin-bottom: 6px; }
.blog-card p { color: var(--cream-dim); font-size: .95rem; margin: 0; }
.blog-card .meta { font-size: .78rem; color: var(--cream-faint); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
.article { max-width: 680px; margin: 0 auto; }
.article h1 { margin-bottom: 10px; }
.article .meta { color: var(--cream-faint); font-size: .85rem; margin-bottom: 26px; }
.article h2 { margin-top: 1.4em; }
.article p { color: var(--cream-dim); }
.article blockquote { border-left: 3px solid var(--gold); padding-left: 18px; font-family: var(--font-serif); font-style: italic; font-size: 1.15rem; margin: 1.4em 0; color: var(--cream); }
.gb-message .gb-photo { margin-top: 12px; border-radius: 12px; max-height: 320px; width: auto; max-width: 100%; border: 1px solid var(--card-border); }
.admin-table .thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
