/* ============================================================
   loved.pet — stylesheet
   A warm, quiet, literary look: ivory paper, ink text,
   terracotta & candle-gold accents.
   ============================================================ */

:root {
  --paper:      #FAF6F0;
  --paper-deep: #F3ECE1;
  --card:       #FFFFFF;
  --ink:        #26221C;
  --ink-soft:   #5C544A;
  --ink-faint:  #8B8177;
  --line:       #E5DCCE;
  --accent:     #A8542F;   /* terracotta */
  --accent-deep:#8A4224;
  --gold:       #C2A163;
  --gold-soft:  #EFE4CB;
  --sage:       #7C8B6F;
  --danger:     #A03A2E;
  --ok:         #4F7A50;
  --radius:     14px;
  --shadow:     0 1px 2px rgba(38,34,28,.05), 0 8px 28px rgba(38,34,28,.08);
  --shadow-lg:  0 2px 6px rgba(38,34,28,.08), 0 18px 48px rgba(38,34,28,.14);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 820px; margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,246,240,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
header.site .bar {
  display: flex; align-items: center; gap: 28px;
  padding: 14px 0;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 600; font-size: 1.5rem; letter-spacing: -.01em;
  color: var(--ink); display: flex; align-items: center; gap: 9px;
}
.wordmark:hover { color: var(--ink); }
.wordmark .paw { width: 26px; height: 26px; flex: none; }
.wordmark em { font-style: normal; color: var(--accent); }
nav.main { display: flex; gap: 22px; margin-left: auto; align-items: center; }
nav.main a { color: var(--ink-soft); font-weight: 600; font-size: .95rem; }
nav.main a:hover, nav.main a.active { color: var(--accent-deep); }
nav.main .btn { margin-left: 6px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff !important;
  font-weight: 600; font-size: .95rem;
  padding: 10px 20px; border-radius: 999px;
  border: none; cursor: pointer; font-family: var(--font-body);
  transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: var(--accent-deep); transform: translateY(-1px); }
.btn.ghost {
  background: transparent; color: var(--ink) !important;
  border: 1.5px solid var(--line);
}
.btn.ghost:hover { border-color: var(--gold); background: var(--gold-soft); }
.btn.small { padding: 7px 14px; font-size: .85rem; }
.btn.danger { background: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- hero (home) ---------- */
.hero {
  position: relative;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero-inner {
  display: grid; grid-template-columns: 1.15fr .85fr;
  gap: 48px; align-items: center;
  padding: 72px 0 64px;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.9rem);
  font-weight: 550; line-height: 1.08; letter-spacing: -.015em;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p.lede {
  margin-top: 22px; font-size: 1.18rem; color: var(--ink-soft);
  max-width: 34em;
}
.hero .cta-row { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero-art { position: relative; }
.hero-art .frame {
  border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lg);
  transform: rotate(1.2deg);
}
.hero-art .frame img { width: 100%; height: 460px; object-fit: cover; }
.hero-art .caption {
  margin-top: 14px; text-align: center; font-size: .88rem;
  color: var(--ink-faint); font-style: italic;
}

/* ---------- section headings ---------- */
.section { padding: 64px 0; }
.section-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 28px; }
.section-head h2 {
  font-family: var(--font-display); font-weight: 550;
  font-size: 1.9rem; letter-spacing: -.01em;
}
.section-head .more { margin-left: auto; font-weight: 600; font-size: .92rem; }
.kicker {
  text-transform: uppercase; letter-spacing: .14em; font-size: .74rem;
  font-weight: 700; color: var(--gold); margin-bottom: 10px; display: block;
}

/* ---------- collage ---------- */
.collage {
  columns: 5 200px; column-gap: 12px;
}
.collage a {
  display: block; margin-bottom: 12px; border-radius: 10px; overflow: hidden;
  position: relative; break-inside: avoid;
  box-shadow: 0 1px 3px rgba(38,34,28,.12);
}
.collage img {
  width: 100%; transition: transform .4s ease, filter .4s ease;
}
.collage a:hover img { transform: scale(1.04); }
.collage a::after {
  content: attr(data-label);
  position: absolute; inset: auto 0 0 0;
  padding: 26px 10px 8px;
  background: linear-gradient(transparent, rgba(20,16,12,.72));
  color: #fff; font-size: .82rem; font-weight: 600;
  opacity: 0; transition: opacity .3s ease;
}
.collage a:hover::after { opacity: 1; }

/* ---------- tribute cards ---------- */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 22px;
}
.t-card {
  background: var(--card); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
  color: var(--ink);
}
.t-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: var(--ink); }
.t-card .ph { height: 230px; overflow: hidden; background: var(--paper-deep); }
.t-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.t-card .body { padding: 16px 18px 18px; }
.t-card h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.t-card .meta { color: var(--ink-faint); font-size: .86rem; margin-top: 3px; }
.t-card .tag { color: var(--ink-soft); font-size: .95rem; margin-top: 9px; font-style: italic; }
.t-card .candles { margin-top: 10px; font-size: .85rem; color: var(--gold); font-weight: 600; }

/* ---------- search ---------- */
.search-block {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.search-row { display: flex; gap: 12px; flex-wrap: wrap; }
.search-row input[type=search] { flex: 1 1 300px; }
input[type=text], input[type=search], input[type=email], input[type=password],
select, textarea {
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 11px 14px; width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(194,161,99,.18);
}
select { width: auto; min-width: 150px; }
textarea { resize: vertical; min-height: 130px; }
label.f {
  display: block; font-weight: 600; font-size: .9rem;
  margin: 18px 0 6px; color: var(--ink-soft);
}
label.f:first-child { margin-top: 0; }
.hint { font-size: .84rem; color: var(--ink-faint); margin-top: 5px; }

/* ---------- tribute page ---------- */
.trib-hero { border-bottom: 1px solid var(--line); background: var(--paper-deep); }
.trib-hero-inner {
  display: grid; grid-template-columns: 380px 1fr; gap: 48px;
  padding: 56px 0; align-items: center;
}
.trib-hero .portrait {
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg);
}
.trib-hero .portrait img { width: 100%; height: 440px; object-fit: cover; }
.trib-hero h1 {
  font-family: var(--font-display); font-weight: 550;
  font-size: clamp(2.2rem, 4.5vw, 3.4rem); letter-spacing: -.015em;
  line-height: 1.05;
}
.trib-hero .cn { color: var(--ink-faint); font-weight: 400; }
.trib-hero .sub { margin-top: 12px; color: var(--ink-soft); font-size: 1.05rem; }
.trib-hero .sub b { color: var(--ink); }
.trib-hero .tagline {
  margin-top: 22px; font-family: var(--font-display); font-style: italic;
  font-size: 1.35rem; color: var(--accent-deep); max-width: 26em; line-height: 1.4;
}
.candle-row { margin-top: 28px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.candle-count { color: var(--ink-soft); font-size: .95rem; }
.candle-count b { color: var(--gold); font-size: 1.05rem; }

/* share buttons */
.share-row {
  margin-top: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.share-label { font-size: .85rem; color: var(--ink-faint); margin-right: 4px; }
.share-pill {
  display: inline-flex; align-items: center;
  font-family: var(--font-body); font-size: .82rem; font-weight: 600;
  color: var(--ink-soft); background: #fff;
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 5px 13px; cursor: pointer; text-decoration: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.share-pill:hover { border-color: var(--gold); background: var(--gold-soft); color: var(--ink); }

.story {
  font-size: 1.13rem; line-height: 1.8;
}
.story p { margin: 0 0 1.35em; }
.story p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 3.4em; float: left; line-height: .85;
  padding: .04em .12em 0 0; color: var(--accent);
}
.story .sig { font-style: italic; color: var(--ink-soft); }

/* gallery */
.gallery { columns: 4 220px; column-gap: 12px; }
.gallery a, .gallery .vid {
  display: block; margin-bottom: 12px; border-radius: 10px;
  overflow: hidden; break-inside: avoid;
  box-shadow: 0 1px 3px rgba(38,34,28,.12); cursor: zoom-in;
}
.gallery img { width: 100%; transition: transform .35s ease; }
.gallery a:hover img { transform: scale(1.03); }
.gallery video { width: 100%; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(20,16,12,.93);
  align-items: center; justify-content: center; padding: 30px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 20px 80px rgba(0,0,0,.6); }
.lightbox .x, .lightbox .nav {
  position: absolute; color: #fff; background: rgba(255,255,255,.1);
  border: none; cursor: pointer; border-radius: 999px;
  width: 46px; height: 46px; font-size: 1.3rem; display: flex;
  align-items: center; justify-content: center;
}
.lightbox .x { top: 20px; right: 20px; }
.lightbox .nav.prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox .nav.next { right: 18px; top: 50%; transform: translateY(-50%); }
.lightbox .x:hover, .lightbox .nav:hover { background: rgba(255,255,255,.22); }

/* comments */
.comments { margin-top: 8px; }
.comment {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 18px; margin-bottom: 14px;
}
.comment .who { font-weight: 700; font-size: .92rem; }
.comment .when { color: var(--ink-faint); font-size: .8rem; margin-left: 8px; }
.comment .body { margin-top: 6px; color: var(--ink-soft); }

/* ---------- forms / auth ---------- */
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow);
}
.notice {
  border-radius: 10px; padding: 13px 16px; margin: 16px 0;
  font-size: .95rem; border: 1px solid;
}
.notice.info { background: var(--gold-soft); border-color: var(--gold); color: #6d5620; }
.notice.ok { background: #EAF2E8; border-color: var(--ok); color: var(--ok); }
.notice.err { background: #F7E8E5; border-color: var(--danger); color: var(--danger); }
.hidden { display: none !important; }

/* file input drop look */
.filebox {
  border: 2px dashed var(--line); border-radius: 12px; padding: 20px;
  text-align: center; color: var(--ink-faint); background: var(--paper);
}
.filebox input { margin-top: 8px; }
.thumbs-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.thumbs-preview img { width: 74px; height: 74px; object-fit: cover; border-radius: 8px; }

/* admin table */
.mod-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; margin-bottom: 16px; display: flex; gap: 18px; align-items: flex-start;
}
.mod-item img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; flex: none; }
.mod-item .grow { flex: 1; }
.mod-item .actions { display: flex; gap: 10px; margin-top: 12px; }

/* ---------- quote band ---------- */
.quote-band {
  background: var(--paper-deep); border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line); padding: 70px 0; text-align: center;
}
.quote-band blockquote {
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 500;
  max-width: 26em; margin: 0 auto; line-height: 1.45; color: var(--ink);
}
.quote-band cite {
  display: block; margin-top: 18px; font-style: normal;
  font-size: .9rem; color: var(--ink-faint); font-family: var(--font-body);
}

/* ---------- footer ---------- */
footer.site {
  border-top: 1px solid var(--line); padding: 44px 0 56px;
  color: var(--ink-faint); font-size: .92rem; background: var(--paper);
}
footer.site .cols { display: flex; gap: 40px; flex-wrap: wrap; align-items: flex-start; }
footer.site .brand { font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); font-weight: 600; }
footer.site nav { display: flex; gap: 18px; flex-wrap: wrap; margin-left: auto; }
footer.site a { color: var(--ink-soft); }
footer.site .dedication { margin-top: 16px; font-style: italic; max-width: 40em; }

/* ---------- misc ---------- */
.empty {
  text-align: center; color: var(--ink-faint); padding: 60px 0;
  font-style: italic;
}
.spinner { text-align: center; color: var(--ink-faint); padding: 40px 0; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding: 44px 0; }
  .hero-art .frame img { height: 340px; }
  .trib-hero-inner { grid-template-columns: 1fr; gap: 28px; }
  .trib-hero .portrait img { height: 380px; }
  nav.main { gap: 14px; }
  nav.main .hide-m { display: none; }
}
