/* ============================================================
   proudpets.no — "Best in Show" design system
   Signature: the pet ID tag (marigold dog-tag chip with a punched hole)
   Display: Baloo 2 · Body: Nunito · warm, rounded, photo-forward
   ============================================================ */

:root {
  --paper:      #FFF6EC;   /* warm milk */
  --paper-2:    #FFFDFA;   /* cards */
  --paper-3:    #FBEFDD;   /* raised / chips */
  --ink:        #2B2018;   /* espresso */
  --ink-soft:   #6B5849;
  --muted:      #9C8975;
  --line:       #EBDCC6;   /* warm hairline */
  --marigold:   #F5A524;
  --marigold-deep: #DD8B0E;
  --raspberry:  #E84A5F;
  --raspberry-deep: #D13550;
  --teal:       #1F968E;
  --ring:       rgba(245,165,36,.45);
  --shadow:     0 1px 2px rgba(74,48,20,.05), 0 10px 24px rgba(74,48,20,.07);
  --shadow-lift:0 4px 10px rgba(74,48,20,.08), 0 22px 48px rgba(74,48,20,.14);
  --r-sm: 10px; --r: 16px; --r-lg: 22px;
  --display: "Baloo 2", system-ui, sans-serif;
  --body: "Nunito", system-ui, sans-serif;
  --wrap: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:   #1E1712;
    --paper-2: #271E18;
    --paper-3: #322620;
    --ink:     #F6ECDF;
    --ink-soft:#D4C3B2;
    --muted:   #A9947E;
    --line:    #3A2D24;
    --teal:    #54C7BE;
    --shadow:     0 1px 2px rgba(0,0,0,.4), 0 10px 24px rgba(0,0,0,.45);
    --shadow-lift:0 4px 10px rgba(0,0,0,.45), 0 22px 48px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.1; color: var(--ink); margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
.muted { color: var(--muted); }
::selection { background: rgba(245,165,36,.28); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  -webkit-backdrop-filter: saturate(1.3) blur(10px); backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 1rem; padding: .7rem clamp(1rem, 4vw, 2rem);
}
.brand {
  font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em;
  color: var(--ink) !important; margin-right: auto; display: inline-flex; align-items: center; gap: .5rem;
}
.brand:hover { text-decoration: none; }
.brand::before {  /* the pet ID tag mark */
  content: ""; width: 26px; height: 26px; border-radius: 9px 9px 11px 11px;
  background: var(--marigold);
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 5px var(--marigold);
  flex: none;
}
nav { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
nav a { color: var(--ink-soft); font-weight: 700; padding: .45rem .7rem; border-radius: 999px; }
nav a:hover { background: var(--paper-3); color: var(--ink); text-decoration: none; }
.bell { position: relative; }
.bell-count:not(:empty) {
  position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--raspberry); color: #fff; border-radius: 999px; font-size: .72rem; font-weight: 800;
  display: grid; place-items: center; font-family: var(--body);
}
.inline { display: inline; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: clamp(1.5rem, 4vw, 2.75rem) clamp(1rem, 4vw, 2rem) 4rem; }

/* ---------- buttons ---------- */
.btn, button, input[type="submit"] {
  font-family: var(--display); font-weight: 700; font-size: 1rem; cursor: pointer;
  border: none; border-radius: 999px; padding: .7rem 1.4rem;
  background: var(--marigold); color: #3a2710;
  box-shadow: 0 2px 0 var(--marigold-deep); transition: transform .12s ease, box-shadow .12s ease, background .15s;
  display: inline-flex; align-items: center; gap: .45rem;
}
.btn:hover, button:hover { text-decoration: none; transform: translateY(-1px); background: #ffb53a; }
.btn:active, button:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--marigold-deep); }
a.btn { color: #3a2710 !important; }
.link-btn { background: none; box-shadow: none; color: var(--muted); padding: .3rem .2rem; font-family: var(--body); font-weight: 700; }
.link-btn:hover { background: none; color: var(--raspberry); transform: none; }

/* ---------- gallery hero + grid ---------- */
.gallery-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.gallery-head h1 { margin: 0; margin-right: auto; }

.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.post-card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.post-card > a:first-child { position: relative; display: block; aspect-ratio: 4/3; background: var(--paper-3); }
.post-card > a:first-child:hover { text-decoration: none; }
.post-card img { width: 100%; height: 100%; object-fit: cover; }
.post-card > a:first-child:not(:has(img))::after {
  content: "🐾"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.4rem; opacity: .35;
}
/* the pet ID tag — species chip */
.tag {
  font-family: var(--display); font-weight: 700; font-size: .8rem; color: #3a2710;
  background: var(--marigold); padding: .2rem .7rem .2rem .95rem; border-radius: 999px;
  display: inline-flex; align-items: center; position: relative; text-transform: capitalize;
}
.tag::before { content: ""; position: absolute; left: .42rem; width: 6px; height: 6px; border-radius: 50%; background: rgba(58,39,16,.55); }
.post-card .tag { position: absolute; left: .7rem; bottom: .7rem; box-shadow: 0 2px 8px rgba(74,48,20,.25); }
.post-card h3 { margin: .85rem 1rem .15rem; }
.post-card h3 a { color: var(--ink); font-weight: 800; }
.post-card h3 a:hover { color: var(--raspberry); text-decoration: none; }
.post-card .card-body { padding-bottom: 1rem; }
.post-card .card-body .muted { margin: 0 1rem; font-size: .92rem; }

.pager { display: flex; gap: 1rem; justify-content: center; margin-top: 2.5rem; }
.pager a { padding: .55rem 1.1rem; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); color: var(--ink); }
.pager a:hover { background: var(--paper-3); text-decoration: none; }

/* ---------- single post ---------- */
.post { max-width: 720px; margin: 0 auto; }
.back { display: inline-block; margin-bottom: 1rem; color: var(--muted); font-weight: 700; }
.post > h1 { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.post > h1 .muted { font-size: 1.1rem; font-weight: 700; font-family: var(--display); }
.post-title { font-size: 1.2rem; color: var(--ink-soft); font-weight: 700; margin: 0 0 .4rem; }
.byline { color: var(--muted); margin: 0 0 1.25rem; font-weight: 700; }
.post-photo { width: 100%; border-radius: var(--r-lg); margin: 0 0 1rem; box-shadow: var(--shadow); }
.story { font-size: 1.12rem; line-height: 1.7; white-space: pre-wrap; margin: 1.25rem 0 1.75rem; }
.post-actions { display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0; }

/* like = warm heart that fills when liked */
.like-btn {
  background: var(--paper-2); color: var(--raspberry); border: 2px solid var(--raspberry);
  box-shadow: none; font-size: 1.05rem; padding: .5rem 1.1rem;
}
.like-btn:hover { background: #fff0f2; transform: translateY(-1px); }
.like-btn[data-liked="true"] { background: var(--raspberry); color: #fff; }
.post-actions .muted { font-weight: 800; color: var(--raspberry); }

/* ---------- comments ---------- */
.comments { margin-top: 2.5rem; border-top: 1px solid var(--line); padding-top: 1.5rem; }
.comment {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: .7rem 1rem; margin-bottom: .7rem; display: flex; gap: .5rem; flex-wrap: wrap;
}
.comment strong { font-family: var(--display); color: var(--ink); }
.comment span { color: var(--ink-soft); }

/* ---------- profile ---------- */
.profile-head { text-align: center; margin-bottom: 2rem; }
.profile-head h1 { margin-bottom: .25rem; }
.profile-head .bio { color: var(--ink-soft); max-width: 48ch; margin: .25rem auto .5rem; }
.profile-head .muted { font-weight: 700; }
.follow-btn { margin-top: .75rem; }
.follow-btn[data-following="true"] { background: var(--paper-2); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }

/* ---------- forms ---------- */
form { max-width: 480px; }
.post form, .comments form { max-width: 100%; }
form label { display: block; font-family: var(--display); font-weight: 700; color: var(--ink); margin: 0 0 1rem; }
input[type="text"], input[type="email"], input[type="password"], input:not([type]), select, textarea {
  display: block; width: 100%; margin-top: .35rem; font: inherit; color: var(--ink);
  background: var(--paper-2); border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: .6rem .8rem; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 5rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--marigold); box-shadow: 0 0 0 4px var(--ring); }
input[type="file"] { padding: .5rem; background: var(--paper-3); border-style: dashed; cursor: pointer; }
#msg { font-weight: 700; color: var(--teal); min-height: 1.2em; }

/* ---------- notifications ---------- */
.notif { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); padding: .8rem 1.1rem; margin-bottom: .6rem; }
.notif strong { font-family: var(--display); }

/* ---------- admin ---------- */
.mod-row {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: .7rem 1rem; margin-bottom: .6rem;
}
.mod-row img { border-radius: 10px; }
.mod-row strong { font-family: var(--display); }
.admin-act { font-size: .85rem; padding: .35rem .8rem; }
.admin-act[data-url*="reject"], .admin-act[data-url*="ban"] { background: var(--paper-3); color: var(--raspberry-deep); box-shadow: inset 0 0 0 1.5px var(--line); }
.admin-act[data-url*="reject"]:hover, .admin-act[data-url*="ban"]:hover { background: #fff0f2; }

/* ---------- footer ---------- */
.site-footer {
  text-align: center; color: var(--muted); font-family: var(--display); font-weight: 700;
  padding: 2.5rem 1rem; border-top: 1px solid var(--line); margin-top: 3rem;
}

/* ---------- a11y / motion ---------- */
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .post-card:hover { transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  .site-header { gap: .5rem; padding: .6rem .9rem; }
  .brand { font-size: 1.3rem; }
  nav { gap: .15rem; }
  nav a { padding: .4rem .5rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .85rem; }
  form { max-width: 100%; }
}
