/*
 * Enzisoft site theme. The store (/store, /account, served by the EnzisoftUpm app) uses the same tokens and
 * components; keep the :root blocks below in sync with EnzisoftUpm/src/EnzisoftUpm/Account/Pages.cs.
 * Bootstrap 4 stays for the grid and the CMS blocks (columns, carousel, forms, pagination); this file restyles it.
 */
:root {
  --bg: #f6f7f9; --panel: #ffffff; --text: #1d2330; --muted: #667085; --border: #e3e6ec;
  --accent: #4f6bed; --accent-text: #ffffff; --accent-soft: #eef1fd; --danger: #c4372f; --ok: #1f8a4c; --warn: #a86400;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161b; --panel: #1c1f26; --text: #e6e8ee; --muted: #9aa2b1; --border: #2c313b;
    --accent: #7b91ff; --accent-text: #0f1220; --accent-soft: #232a45; --danger: #ff7a70; --ok: #5fd08f; --warn: #f0b35a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, h3, h4, h5, h6 { color: var(--text); font-family: inherit; font-weight: 700; letter-spacing: -.01em; }
p { color: inherit; }
a { color: var(--accent); }
a:hover { color: var(--accent); }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); background: var(--panel);
       border: 1px solid var(--border); border-radius: 5px; padding: .05rem .3rem; }
pre code { border: 0; padding: 0; background: none; }
.muted { color: var(--muted); }
.container { max-width: 1120px; padding-left: 1.5rem; padding-right: 1.5rem; }

/* ---------------------------------------------------------------- top bar and footer (same as the store) */
.topbar { background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1020; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 60px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-weight: 650; font-size: 1.05rem; }
.brand:hover { color: var(--text); text-decoration: none; }
.brand svg { width: 28px; height: 28px; flex: none; }
.topnav { display: flex; align-items: center; gap: 1.25rem; }
.topnav > a { color: var(--text); text-decoration: none; font-weight: 500; flex: none; }
.topnav > a:hover { color: var(--accent); text-decoration: none; }
.topnav > a.active { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); padding: 1.15rem 0; }
.footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .88rem; margin-top: 3rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 1.5rem; padding-top: 1.5rem; padding-bottom: 1.5rem; }
.footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); }

/* ---------------------------------------------------------------- buttons, cards, forms (Bootstrap overrides) */
.btn { border-radius: 8px; font-weight: 600; padding: .5rem 1rem; transition: border-color .15s, background .15s; }
.btn-primary, .btn-success { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover, .btn-primary:focus, .btn-success:hover, .btn-success:focus {
  background: color-mix(in srgb, var(--accent) 88%, #000); border-color: color-mix(in srgb, var(--accent) 88%, #000); color: var(--accent-text); }
.btn-outline { background: var(--panel); border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--muted); color: var(--text); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: var(--text); }
.card .card-img-top { border-radius: 0; }
.card-body h5 { font-weight: 650; }
.form-control { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; }
.form-control:focus { background: var(--bg); color: var(--text); border-color: var(--accent);
                      box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.form-control::placeholder { color: var(--muted); }
.pagination { gap: .35rem; }
.page-link { background: var(--panel); border: 1px solid var(--border); border-radius: 8px !important; color: var(--text); }
.page-link:hover { background: var(--accent-soft); border-color: var(--border); color: var(--accent); }
.page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

/* ---------------------------------------------------------------- page headers */
main { padding: 2.5rem 0 1rem; }
.page-head { padding-top: 2.5rem; padding-bottom: 1.5rem; }
.page-head h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .75rem; }
.page-head .lead { font-size: 1.1rem; color: var(--muted); max-width: 720px; }
.hero-image { position: relative; overflow: hidden; border-radius: 18px; margin-top: 2rem; min-height: 260px; display: flex; align-items: flex-end;
              background: #0b0d12 center / cover no-repeat; border: 1px solid var(--border); }
.hero-image::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 10, 14, .05) 20%, rgba(8, 10, 14, .75)); }
.hero-image .hero-text { position: relative; padding: 2.5rem; color: #fff; max-width: 760px; }
.hero-image h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.12; letter-spacing: -.025em; margin: 0 0 .6rem; }
.hero-image .lead { color: rgba(255, 255, 255, .85); font-size: 1.1rem; margin: 0; }
.hero-image .post-meta, .hero-image .post-meta a { color: rgba(255, 255, 255, .85); }
.page-head + main, .hero-image + main { padding-top: 1.5rem; }

/* ---------------------------------------------------------------- blocks */
.block { padding: 0 0 1.5rem; overflow-wrap: break-word; }   /* long URLs and tokens wrap instead of widening the page */
.block img { border-radius: var(--radius); }
.block h2 { font-size: 1.5rem; margin: 1.5rem 0 .75rem; }
.block h3 { font-size: 1.2rem; margin: 1.25rem 0 .5rem; }
.block ul, .block ol { padding-left: 1.4rem; }
.block.column-block .row { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem .5rem;
                           margin-left: 0; margin-right: 0; align-items: center; }
.block.column-block .col-md > :last-child { margin-bottom: 0; }
.block.column-block img { width: 100%; height: auto; object-fit: cover; }
.block.column-block .col-md:not(:last-child) { margin-bottom: 1.25rem; }
@media (min-width: 768px) { .block.column-block .col-md:not(:last-child) { margin-bottom: 0; } }
.block pre { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.block pre code.hljs { padding: 1rem 1.1rem; font-size: 13px; line-height: 1.55; }
.block iframe { max-width: 100%; border: 0; border-radius: var(--radius); }
.block iframe[src*="youtube"], .block iframe[src*="vimeo"] { width: 100%; max-width: 720px; height: auto; aspect-ratio: 16 / 9; }
blockquote, .blockquote { margin: 1.5rem 0; padding: .4rem 1.25rem; border-left: 3px solid var(--accent); color: var(--muted); font-size: 1.15rem; }
.blockquote-footer { color: var(--muted); }
.carousel { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.carousel img { border-radius: 0; }
.carousel-indicators li { width: 8px; height: 8px; border-radius: 50%; border: 0; }

/* ---------------------------------------------------------------- blog */
.post-meta { font-size: .88rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin-bottom: .75rem; }
.post-meta a { color: inherit; text-decoration: none; }
.post-meta a:hover { color: var(--accent); }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; }
.post-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
             overflow: hidden; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.post-card:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); text-decoration: none;
                   box-shadow: 0 8px 24px -12px color-mix(in srgb, var(--accent) 45%, transparent); }
.post-card.featured { grid-column: 1 / -1; }
.post-card img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; display: block; }
.post-card-body { padding: 1.25rem 1.4rem 1.4rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.post-card h3 { font-size: 1.2rem; margin: 0; line-height: 1.3; }
.post-card.featured h3 { font-size: 1.6rem; }
.post-card .excerpt { color: var(--muted); }
.post-card .more { margin-top: auto; padding-top: .5rem; color: var(--accent); font-weight: 600; font-size: .92rem; }
.post-body .container, .post-container { max-width: 820px; }
.comments { max-width: 820px; }
.comment-form { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; margin: 1rem 0 2.5rem; }
.comment img { border-radius: 50%; }
.comment h5 { font-size: 1rem; }

/* ---------------------------------------------------------------- cookie notice */
#cookieConsent { position: fixed; z-index: 1030; left: 50%; bottom: 1rem; transform: translateX(-50%); width: min(560px, calc(100% - 2rem));
                 display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; background: var(--panel); color: var(--text);
                 border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
#cookieConsent p { margin: 0; flex: 1; font-size: .92rem; }
#cookieConsent button { flex: none; border: 0; border-radius: 8px; padding: .5rem 1.1rem; font: inherit; font-weight: 600;
                        background: var(--accent); color: var(--accent-text); cursor: pointer; }

@media (max-width: 760px) {
  .container { padding-left: 1rem; padding-right: 1rem; }
  .topnav { gap: .85rem; min-width: 0; overflow-x: auto; scrollbar-width: none; font-size: .95rem; }
  .topnav > a.active { padding: 1.15rem 0; }
  .brand span { display: none; }
  main { padding-top: 1.5rem; }
  .page-head { padding-top: 1.5rem; padding-bottom: 1rem; }
  .hero-image { margin-top: 1rem; min-height: 200px; border-radius: 14px; }
  .hero-image .hero-text { padding: 1.5rem 1.25rem; }
  .post-grid { grid-template-columns: 1fr; }
  .post-card.featured h3 { font-size: 1.3rem; }
  #cookieConsent { flex-direction: column; align-items: stretch; text-align: center; }
}
