/* Default stylesheet shipped by site-generate.
 *
 * Produces a working, responsive site out of the box: header / nav /
 * main / footer chrome, a hero + card landing layout for the default
 * home page, and a login card. Override colors, typography, and the
 * hero / card blocks to brand the site.
 */

* { box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    color: #1e293b;
    background: #f8fafc;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 1rem; }

/* ---- Sidebar navigation ---- */
:root { --sidebar-w: 220px; --sidebar-speed: 0.2s; }

.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 20;
    width: var(--sidebar-w);
    display: flex; flex-direction: column;
    background: #1e293b; color: white;
    overflow-y: auto;
    transition: transform var(--sidebar-speed) ease, visibility var(--sidebar-speed);
}
.sidebar-head { padding: 1rem 3.25rem 1rem 1rem; min-height: 3.5rem; }
.sidebar .site-name { color: white; text-decoration: none; font-weight: 600; font-size: 1.15rem; line-height: 1.3; }
.sidebar-nav, .sidebar-auth { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.5rem; }
.sidebar-nav { flex: 1; }
.sidebar-auth { border-top: 1px solid rgba(255,255,255,0.1); padding-bottom: 1rem; }
.sidebar-nav a, .sidebar-auth a { color: white; text-decoration: none; padding: 0.55rem 0.75rem; border-radius: 4px; }
.sidebar-nav a:hover, .sidebar-auth a:hover { background: rgba(255,255,255,0.08); }
.sidebar a.active { background: rgba(255,255,255,0.15); }
.sidebar-auth .logout-form { display: block; padding: 0.25rem 0.75rem 0; }

.sidebar-toggle {
    position: fixed; top: 0.6rem; z-index: 30;
    left: calc(var(--sidebar-w) - 2.75rem);
    width: 2.25rem; height: 2.25rem;
    display: flex; align-items: center; justify-content: center;
    background: #334155; border: none; border-radius: 4px; cursor: pointer;
    transition: left var(--sidebar-speed) ease;
}
.sidebar-toggle:hover { background: #475569; }
.hamburger, .hamburger::before, .hamburger::after {
    display: block; width: 18px; height: 2px; background: white; border-radius: 1px;
}
.hamburger { position: relative; }
.hamburger::before, .hamburger::after { content: ""; position: absolute; left: 0; }
.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }

.page { margin-left: var(--sidebar-w); transition: margin-left var(--sidebar-speed) ease; }

.nav-collapsed .sidebar { transform: translateX(-100%); visibility: hidden; }
.nav-collapsed .sidebar-toggle { left: 0.75rem; }
.nav-collapsed .page { margin-left: 0; padding-left: 3rem; }

.site-main { padding: 2rem 0; min-height: 60vh; }

.btn {
    display: inline-block; padding: 0.5rem 1rem;
    background: #334155; color: white;
    border: none; border-radius: 4px;
    text-decoration: none; cursor: pointer;
}

.alert-error { background: #f8d7da; color: #842029; padding: 0.75rem; border-radius: 4px; margin: 1rem 0; }

.login-card { max-width: 420px; margin: 2rem auto; padding: 2rem; background: white; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.logout-btn { background: transparent; color: white; border: 1px solid rgba(255,255,255,0.3); padding: 0.4rem 0.8rem; border-radius: 4px; cursor: pointer; }
.logout-form { display: inline; }

.hero { padding: 3rem 0 2rem; text-align: center; }
.hero h1 { font-size: 2.25rem; margin: 0 0 0.75rem; color: #1e293b; }
.hero-logo img { display: block; width: 100%; max-width: 50vw; height: auto; margin: 0 auto; }
.home .container { max-width: none; padding: 0; }
.hero-image { display: block; width: 90%; max-width: 90vw; height: auto; margin: 50px auto; }
.hero-lead { max-width: 640px; margin: 0 auto 1.5rem; font-size: 1.1rem; line-height: 1.55; color: #475569; }
.hero-cta { margin: 1.5rem 0 0; }
.hero-cta .btn { padding: 0.65rem 1.25rem; font-size: 1rem; }

.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 2rem 0; }
.card { background: white; padding: 1.5rem; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.card h2 { margin: 0 0 0.5rem; font-size: 1.15rem; color: #1e293b; }
.card p { margin: 0; line-height: 1.5; color: #475569; }
.card code { background: #e2e8f0; padding: 0.1rem 0.35rem; border-radius: 3px; font-size: 0.9em; }

@media (max-width: 720px) {
    /* Sidebar overlays the content on small screens */
    .page, .nav-collapsed .page { margin-left: 0; padding-left: 0; padding-top: 3rem; }
    .sidebar { box-shadow: 2px 0 12px rgba(0,0,0,0.25); }
}

/* Home page: logo sits in the top row alongside the fixed menu button
 * (button: top 0.6rem, height 2.25rem). */
.home .page, .nav-collapsed .home .page { padding-top: 0; }
.home .site-main { padding-top: 0; }
.home .hero { padding-top: 0; }
.hero .hero-logo {
    display: flex; align-items: center; justify-content: center;
    min-height: 3.45rem; padding: 0.6rem 0; margin: 0;
}

.account-welcome {
    margin: 0 0 1.5rem;
    padding: 0.75rem 1rem;
    border-left: 4px solid #2ecc71;
    background: rgba(46, 204, 113, 0.08);
    border-radius: 4px;
}

.settings-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}
.settings-nav {
    flex: 0 0 200px;
}
.settings-nav ul {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}
.settings-nav h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    opacity: 0.6;
    margin: 1rem 0 0.5rem;
}
.settings-nav a {
    display: block;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    text-decoration: none;
}
.settings-nav a.active {
    background: rgba(46, 204, 113, 0.15);
    font-weight: 600;
}
.settings-content {
    flex: 1;
    min-width: 0;
}
@media (max-width: 700px) {
    .settings-layout { flex-direction: column; }
    .settings-nav { flex: none; width: 100%; }
}

/* plant database viewer (/admin/plantdb) */
.plantdb { max-width: 100%; }
.plantdb-meta { color: #475569; font-size: 0.9rem; }
.plantdb-meta code { background: #e2e8f0; padding: 0.1rem 0.35rem; border-radius: 3px; }
.plantdb-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; border-bottom: 1px solid #cbd5e1; margin: 1rem 0; }
.plantdb-tabs a { padding: 0.5rem 0.9rem; text-decoration: none; color: #334155; border-radius: 4px 4px 0 0; }
.plantdb-tabs a.active { background: #334155; color: white; }
.plantdb-count { font-size: 0.8rem; opacity: 0.75; }
.plantdb-filter { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 0.5rem; }
.plantdb-filter input[type=search] { padding: 0.45rem 0.6rem; border: 1px solid #cbd5e1; border-radius: 4px; min-width: 240px; }
.plantdb-summary { color: #64748b; font-size: 0.85rem; }
.plantdb-scroll { overflow-x: auto; }
.plantdb-table { border-collapse: collapse; width: 100%; font-size: 0.85rem; background: white; }
.plantdb-table th, .plantdb-table td { padding: 0.4rem 0.6rem; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: top; }
.plantdb-table th { background: #f1f5f9; white-space: nowrap; }
.plantdb-table tr.row-deleted td { color: #94a3b8; background: #f8fafc; }
.badge-deleted { display: inline-block; font-size: 0.7rem; padding: 0.05rem 0.4rem; border-radius: 3px; background: #fde2e2; color: #842029; }
.plantdb-pager { display: flex; gap: 0.5rem; margin: 1rem 0; }

/* shop admin (/admin/shop) */
.alert-success { padding: 0.6rem 0.9rem; border-radius: 4px; background: #dcfce7; color: #14532d; margin: 0.75rem 0; }
.shop-admin h1 small { font-weight: normal; color: #64748b; font-size: 0.6em; }
.shop-todo { background: #fef9c3; border: 1px solid #fde047; border-radius: 6px; padding: 0.5rem 1rem; margin: 1rem 0; }
.shop-todo h2 { font-size: 1rem; margin: 0.25rem 0; }
.shop-thumb { width: 56px; }
.shop-thumb img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; display: block; }
.shop-nophoto { font-size: 0.7rem; color: #94a3b8; }
.shop-status { display: inline-block; font-size: 0.75rem; padding: 0.05rem 0.45rem; border-radius: 3px; background: #e2e8f0; color: #334155; }
.shop-status-in_stock { background: #dcfce7; color: #14532d; }
.shop-status-reserved { background: #fef3c7; color: #78350f; }
.shop-status-sold { background: #dbeafe; color: #1e3a8a; }
.shop-status-withdrawn { background: #fde2e2; color: #842029; }
.shop-form { max-width: 560px; margin: 1rem 0; }
.shop-form .form-group { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.75rem; }
.shop-form input[type=text], .shop-form input[type=number], .shop-form select, .shop-form textarea { padding: 0.45rem 0.6rem; border: 1px solid #cbd5e1; border-radius: 4px; font: inherit; }
.shop-inline { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; max-width: none; }
.shop-inline h2 { width: 100%; margin: 0; }
.shop-inline label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; }
.shop-inline input[type=number] { width: 8rem; padding: 0.45rem 0.6rem; border: 1px solid #cbd5e1; border-radius: 4px; }
.shop-camera { position: relative; overflow: hidden; cursor: pointer; }
.shop-camera input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.shop-photos { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.shop-photos figure { margin: 0; width: 160px; }
.shop-photos img { width: 160px; height: 160px; object-fit: cover; border-radius: 6px; display: block; }
.shop-photos figcaption { display: flex; gap: 0.4rem; align-items: center; margin-top: 0.3rem; font-size: 0.8rem; }
.btn-small { padding: 0.2rem 0.5rem; font-size: 0.75rem; }
.shop-admin .btn-cancel { background: #e2e8f0; color: #334155; }
.shop-visibility { padding: 0.5rem 0.8rem; border-radius: 4px; background: #f1f5f9; }
.shop-visibility.is-visible { background: #dcfce7; }
