/* ==========================================================
   Shiba Stuff — playful doge theme
   Palette: warm sand + ember orange + ink for legibility.
   ========================================================== */

@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;800&family=Comic+Neue:wght@400;700&display=swap");

:root {
    --bg:        #fdf8f1;
    --bg-card:   #ffffff;
    --bg-soft:   #f5ebda;
    --ink:       #2a1f17;
    --ink-soft:  #6b5a4b;
    --rust:      #d8702c;     /* shiba coat */
    --rust-deep: #b85820;
    --cream:     #f4d9b3;     /* belly cream */
    --leaf:      #5b8b4f;     /* accent for "much wow" */
    --border:    #e6d8c1;
    --shadow:    0 1px 2px rgba(42,31,23,0.06), 0 8px 24px rgba(42,31,23,0.08);
    --radius:    14px;
    --maxw:      1100px;
    --font-sans: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --font-display: "Comic Neue", "Comic Sans MS", "Nunito", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

.skip {
    position: absolute; left: -9999px; top: 0;
    background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 1000;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Header / Nav ---------- */

.site-header {
    background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(8px);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1.25rem; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .55rem; }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.9rem; transform: translateY(-1px); }
.brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--rust-deep);
    letter-spacing: .5px;
}

.site-nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.site-nav a {
    color: var(--ink-soft);
    padding: .5rem .85rem;
    border-radius: 999px;
    font-weight: 600;
}
.site-nav a:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.site-nav a.active { background: var(--rust); color: #fff; }

/* ---------- Hero (home page) ---------- */

.hero {
    text-align: center;
    padding: 4rem 1.25rem 3rem;
    background:
        radial-gradient(ellipse at top, var(--cream) 0%, transparent 60%),
        var(--bg);
}
.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4.2rem);
    color: var(--rust-deep);
    margin: 0 0 .5rem;
    letter-spacing: -.5px;
}
.hero .tagline {
    font-size: 1.2rem;
    color: var(--ink-soft);
    margin: 0 auto 1.75rem;
    max-width: 540px;
}
.hero-emoji {
    display: block;
    font-size: 4rem;
    margin-bottom: .25rem;
    animation: bob 3.2s ease-in-out infinite;
}
@keyframes bob {
    0%,100% { transform: translateY(0) rotate(-3deg); }
    50%     { transform: translateY(-6px) rotate(3deg); }
}

.btn {
    display: inline-block;
    background: var(--rust);
    color: #fff;
    padding: .7rem 1.4rem;
    border-radius: 999px;
    font-weight: 700;
    border: 0;
    cursor: pointer;
    transition: transform .12s ease, background .12s ease;
}
.btn:hover { background: var(--rust-deep); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--rust-deep); border: 2px solid var(--rust); }
.btn-ghost:hover { background: var(--rust); color: #fff; }
.btn-row { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

.doge-tags {
    display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center;
    margin-top: 2rem;
}
.doge-tag {
    background: var(--bg-card);
    border: 1px dashed var(--rust);
    color: var(--rust-deep);
    padding: .25rem .75rem;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: .95rem;
    transform: rotate(var(--r, 0deg));
}

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

section { padding: 3rem 0; }

.section-title {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--rust-deep);
    margin: 0 0 .25rem;
}
.section-sub { color: var(--ink-soft); margin: 0 0 1.75rem; }

/* ---------- Card grids ---------- */

.grid {
    display: grid;
    gap: 1.25rem;
}
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .15s ease, border-color .15s ease;
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-2px); border-color: var(--rust); }
.card-body { padding: 1.1rem 1.2rem 1.25rem; }
.card h3 { margin: 0 0 .35rem; font-size: 1.15rem; color: var(--ink); }
.card p { margin: 0; color: var(--ink-soft); font-size: .97rem; }
.card .meta { font-size: .85rem; color: var(--ink-soft); margin-top: .75rem; }

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

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.gallery-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.gallery-item img,
.gallery-item iframe {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 0;
    display: block;
}
.gallery-item .caption {
    padding: .65rem .9rem;
    font-size: .9rem;
    color: var(--ink-soft);
}
.video-wrap { position: relative; aspect-ratio: 16/9; }
.video-wrap iframe { width: 100%; height: 100%; }

/* ---------- Shop ---------- */

.product-card { padding: 1rem; text-align: center; }
.product-card img { aspect-ratio: 1/1; object-fit: contain; padding: .5rem; background: var(--bg-soft); border-radius: 10px; }
.product-card .price { font-family: var(--font-display); color: var(--rust-deep); font-size: 1.35rem; margin: .25rem 0; }
.affiliate-disclosure {
    background: var(--bg-soft);
    border-left: 4px solid var(--rust);
    padding: .9rem 1.1rem;
    border-radius: 4px;
    color: var(--ink-soft);
    margin-bottom: 2rem;
    font-size: .95rem;
}

/* ---------- Blog post page ---------- */

.post-hero { text-align: center; padding: 3rem 1.25rem 1rem; }
.post-hero h1 {
    font-family: var(--font-display);
    color: var(--rust-deep);
    font-size: clamp(2rem, 4vw, 3rem);
    margin: 0 0 .25rem;
}
.post-hero .meta { color: var(--ink-soft); }

.post-body {
    max-width: 720px; margin: 0 auto; padding: 1rem 1.25rem 3rem;
    font-size: 1.07rem; line-height: 1.8;
}
.post-body h2 { font-family: var(--font-display); color: var(--rust-deep); margin-top: 2rem; }
.post-body img { border-radius: var(--radius); margin: 1.25rem 0; }
.post-body code {
    background: var(--bg-soft); padding: .1rem .35rem; border-radius: 4px;
    font-size: .92em;
}

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

.site-footer {
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 4rem;
    color: var(--ink-soft);
    text-align: center;
}
.footer-bork {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--rust-deep);
    margin: 0 0 .35rem;
}
.footer-bork span { display: inline-block; transform: rotate(-2deg); margin: 0 .35rem; }
.footer-bork span:nth-child(2) { transform: rotate(2deg); }
.footer-meta { font-size: .85rem; margin: 0; }

/* ---------- Flash messages ---------- */

.flash {
    margin: 1rem 0;
    padding: .75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
}
.flash-info    { background: #e8f3ff; color: #1c4f80; border: 1px solid #b6d8f5; }
.flash-success { background: #e8f7e8; color: #2c6b2f; border: 1px solid #b6e0b9; }
.flash-error   { background: #fde7e7; color: #8a2222; border: 1px solid #f1b3b3; }

/* ---------- Forms (admin) ---------- */

.form-row { margin-bottom: 1.1rem; }
.form-row label { display: block; font-weight: 700; margin-bottom: .35rem; color: var(--ink); }
.form-row input[type=text],
.form-row input[type=password],
.form-row input[type=url],
.form-row input[type=number],
.form-row select,
.form-row textarea {
    width: 100%; padding: .65rem .8rem;
    border: 1px solid var(--border); border-radius: 8px;
    font: inherit; background: #fff; color: var(--ink);
}
.form-row textarea { min-height: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95rem; }
.form-row .help { font-size: .85rem; color: var(--ink-soft); margin-top: .25rem; display: block; }
.form-actions { display: flex; gap: .75rem; align-items: center; }

/* ---------- Admin layout ---------- */

.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-side {
    background: var(--ink); color: #f4ebde; padding: 1.5rem 1rem;
}
.admin-side .brand-name { color: #fff; }
.admin-side a {
    display: block; color: #f4ebde; padding: .5rem .75rem;
    border-radius: 8px; margin-bottom: .15rem;
}
.admin-side a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.admin-side a.active { background: var(--rust); color: #fff; }
.admin-side .who { font-size: .85rem; color: #c8b9a3; margin-top: 1.5rem; padding: 0 .75rem; }

.admin-main { padding: 2rem 2.5rem; background: var(--bg); }
.admin-h1 { font-family: var(--font-display); color: var(--rust-deep); margin-top: 0; }

table.data { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.data th, table.data td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--border); }
table.data th { background: var(--bg-soft); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
table.data tr:last-child td { border-bottom: 0; }
table.data .actions a { margin-right: .5rem; }
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.badge-published { background: #d6efd2; color: #2c6b2f; }
.badge-draft     { background: #f0e1c4; color: #7a5a18; }

/* ---------- Login page ---------- */

.login-card {
    max-width: 380px; margin: 4rem auto; padding: 2rem;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.login-card h1 { font-family: var(--font-display); color: var(--rust-deep); margin: 0 0 1.25rem; text-align: center; }

/* ---------- Mobile ---------- */

@media (max-width: 720px) {
    .header-inner { flex-direction: column; align-items: flex-start; gap: .5rem; }
    .site-nav { width: 100%; justify-content: flex-start; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side { padding: 1rem; }
    .admin-main { padding: 1.25rem; }
}
