:root {
  --brand: #2D79EB; --brand-deep: #1A56BF; --brand-night: #123F8C; --aqua: #6CE5E8;
  --ink: #0F2744; --slate: #4F5F73; --mist: #F3F7FE; --line: #DCE5F2; --danger: #D92D20; --ok: #17663A;
  --font-display: 'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); font-size: 1.05rem; line-height: 1.65; background: #fff; }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 0.6rem; color: var(--brand-night); }
a { color: var(--brand-deep); }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.wrap { width: min(1140px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(760px, 100% - 2rem); margin-inline: auto; }
.muted { color: var(--slate); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header and footer */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--brand-deep); color: #fff; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; flex-wrap: wrap; padding-block: 0.4rem; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: #fff; text-decoration: none; letter-spacing: -0.02em; }
.brand span { color: var(--aqua); }
.site-nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.site-nav a { color: #D6E4FB; text-decoration: none; font-weight: 500; font-size: 0.97rem; }
.site-nav a:hover { color: #fff; }
.site-footer { background: var(--brand-night); color: #BFD4F7; padding: 2.5rem 0 1.5rem; margin-top: 4rem; font-size: 0.95rem; }
.site-footer a { color: #E4EEFF; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; }
.site-footer strong { display: block; color: #fff; font-family: var(--font-display); margin-bottom: 0.4rem; }
.footer-bottom { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.18); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; font-size: 0.9rem; }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; border: 0; border-radius: 6px; padding: 0.65rem 1.2rem; font: 700 1rem var(--font-body); background: var(--brand-deep); color: #fff; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--brand-night); color: #fff; }
.btn-aqua { background: var(--aqua); color: var(--ink); }
.btn-aqua:hover { background: #8CEEF0; color: var(--ink); }
.btn-outline { background: #fff; color: var(--brand-deep); border: 1.5px solid var(--brand-deep); }
.btn-outline:hover { background: var(--brand-deep); color: #fff; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b42318; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.9rem; }
.btn[disabled], .btn.disabled { opacity: 0.5; cursor: not-allowed; }
label { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 0.3rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=tel], input[type=datetime-local], select, textarea {
  width: 100%; border: 1px solid #B9C9E0; border-radius: 6px; padding: 0.6rem 0.8rem; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(45,121,235,.2); }
textarea { min-height: 7rem; resize: vertical; }
.field { margin-bottom: 1rem; }
.field small { color: var(--slate); display: block; margin-top: 0.25rem; }
.row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.check input { width: auto; }
.hp { position: absolute; left: -9999px; }
.flash { padding: 0.8rem 1rem; border-radius: 6px; margin: 1rem 0; font-weight: 500; }
.flash-success { background: #DFF5E6; color: #0F4D2B; }
.flash-error { background: #FDE7E4; color: #8A1C12; }
.flash-info { background: #E4EEFF; color: var(--brand-night); }

/* Pagination and chips */
.pager { display: flex; justify-content: center; gap: 0.4rem; margin: 2.5rem 0 0; flex-wrap: wrap; }
.pager a, .pager span { padding: 0.45rem 0.85rem; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; font-weight: 700; }
.pager .on { background: var(--brand-deep); color: #fff; border-color: var(--brand-deep); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.5rem; }
.chip { padding: 0.35rem 0.9rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 0.9rem; color: var(--brand-deep); background: #fff; }
.chip:hover, .chip.on { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }

/* Admin */
.admin-bar { background: var(--ink); color: #fff; }
.admin-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 54px; flex-wrap: wrap; }
.admin-bar a, .admin-bar button { color: #D6E4FB; text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.admin-bar a:hover, .admin-bar button:hover { color: #fff; }
.admin-nav { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center; }
.admin-main { padding: 2rem 0 3rem; }
.admin-main h1 { font-size: 1.7rem; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; margin-bottom: 1.25rem; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.data th, table.data td { text-align: left; padding: 0.65rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--slate); }
.pill { display: inline-block; padding: 0.1rem 0.65rem; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: var(--mist); color: var(--slate); }
.pill-published, .pill-active, .pill-delivered, .pill-paid { background: #DFF5E6; color: var(--ok); }
.pill-draft, .pill-hidden { background: #EEF0F3; color: #55606D; }
.pill-new { background: #FFE9D6; color: #9A4300; }
.pill-confirmed, .pill-shipped { background: #E4EEFF; color: var(--brand-deep); }
.pill-cancelled { background: #FDE7E4; color: #8A1C12; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: var(--mist); }
.login-card { background: #fff; padding: 2rem; border-radius: 12px; width: 100%; max-width: 400px; box-shadow: 0 16px 40px rgba(18,63,140,.15); }
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 1.5rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; }
.stat b { display: block; font: 700 1.8rem var(--font-display); color: var(--brand-deep); }
.notfound { text-align: center; padding: 5rem 0; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
/* Blog */
.section { padding: 2.5rem 0; }
.hero-sm { background: var(--brand-deep); color: #fff; padding: 3.5rem 0 3rem; }
.hero-sm h1 { color: #fff; font-size: clamp(2rem, 4.5vw, 3.2rem); max-width: 18ch; }
.hero-sm p { color: #E4EEFF; max-width: 38rem; font-size: 1.15rem; }
.search { display: flex; gap: 0.6rem; max-width: 30rem; margin-top: 1.4rem; }
.grid { display: grid; gap: 1.75rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: 0 14px 34px rgba(18,63,140,.13); transform: translateY(-2px); }
.card-img { aspect-ratio: 16 / 9; background: var(--mist); display: block; overflow: hidden; }
.card-img img, .featured-img img { width: 100%; height: 100%; object-fit: cover; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-deep), var(--brand)); }
.ph span { font: 700 3rem var(--font-display); color: rgba(255,255,255,.85); }
.card-body { padding: 1.1rem 1.25rem 1.3rem; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: 1.15rem; }
.card-body h3 a, .featured h2 a { color: var(--brand-night); text-decoration: none; }
.card-body h3 a:hover, .featured h2 a:hover { color: var(--brand); }
.card-body p { color: var(--slate); font-size: 0.97rem; margin: 0 0 0.9rem; }
.more { margin-top: auto; font-weight: 700; text-decoration: none; }
.more::after { content: " \2192"; }
.meta { font-size: 0.85rem; color: var(--slate); margin-bottom: 0.5rem; }
.tag { display: inline-block; background: #E4EEFF; color: var(--brand-deep); font-weight: 700; padding: 0.05rem 0.6rem; border-radius: 999px; margin-right: 0.4rem; }
.featured { display: grid; grid-template-columns: 1.15fr 1fr; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 2rem; background: #fff; }
.featured-img { min-height: 280px; background: var(--mist); display: block; }
.featured-body { padding: 2rem; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.featured-body h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.featured-body p { color: var(--slate); }
.empty { text-align: center; padding: 3rem 0; }
.crumbs { font-size: 0.9rem; color: var(--slate); margin-bottom: 1rem; }
.post-title { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 0.6rem; }
.post-cover { width: 100%; border-radius: 12px; margin: 1.2rem 0 2rem; aspect-ratio: 16 / 9; object-fit: cover; }
.prose { font-size: 1.12rem; line-height: 1.8; }
.prose h2 { font-size: 1.6rem; margin-top: 2.2rem; }
.prose h3 { font-size: 1.3rem; margin-top: 1.8rem; }
.prose p, .prose li { color: #26374D; }
.prose img { border-radius: 10px; margin: 1.5rem auto; }
.prose blockquote { margin: 1.5rem 0; padding: 0.4rem 1.2rem; border-left: 4px solid var(--aqua); background: var(--mist); border-radius: 0 8px 8px 0; }
.prose blockquote p { margin: 0.5rem 0; }
.prose pre { background: var(--ink); color: #E4EEFF; padding: 1rem 1.2rem; border-radius: 8px; overflow-x: auto; font-size: 0.95rem; }
.prose code { background: var(--mist); padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.92em; }
.prose pre code { background: none; padding: 0; }
.share { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin: 2.5rem 0; padding: 1rem 0; border-block: 1px solid var(--line); }
.share a { font-weight: 700; text-decoration: none; }
.cta { background: var(--brand-night); color: #fff; border-radius: 14px; padding: 2rem; margin-top: 1rem; }
.cta h2 { color: #fff; font-size: 1.5rem; }
.cta p { color: #D6E4FB; }
.draft-banner { background: #FFE9D6; color: #7A3500; text-align: center; padding: 0.6rem; font-weight: 700; }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; }
.toolbar button, .upload-btn { border: 1px solid #B9C9E0; background: #fff; border-radius: 6px; padding: 0.3rem 0.75rem; cursor: pointer; font: 600 0.9rem var(--font-body); margin: 0; }
.toolbar button:hover, .upload-btn:hover { background: var(--mist); }
.preview { border: 1px dashed #B9C9E0; border-radius: 8px; padding: 1rem 1.2rem; min-height: 12rem; background: #fff; }
@media (max-width: 760px) { .featured { grid-template-columns: 1fr; } .featured-img { min-height: 200px; } .site-nav { gap: .7rem; } }

.card-img, .card-img:hover { text-decoration: none; }
