/* Aurora — main stylesheet (loaded non-blocking; critical.css handles first paint). */

/* ---------- dark mode ---------- */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tez-bg: #0b1120;
    --tez-surface: #111827;
    --tez-text: #d1d5db;
    --tez-heading: #f3f4f6;
    --tez-muted: #9ca3af;
    --tez-border: #1f2937;
    --tez-header-bg: #0f172a;
    --tez-header-text: #f3f4f6;
  }
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}

:root[data-theme="dark"] {
  --tez-bg: #0b1120;
  --tez-surface: #111827;
  --tez-text: #d1d5db;
  --tez-heading: #f3f4f6;
  --tez-muted: #9ca3af;
  --tez-border: #1f2937;
  --tez-header-bg: #0f172a;
  --tez-header-text: #f3f4f6;
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

/* ---------- article content ---------- */

.entry-content { max-width: var(--tez-content, 760px); }
.entry-content > * { margin-left: auto; margin-right: auto; }

.entry-content h2 { margin: 1.7em 0 .55em; scroll-margin-top: 84px; }
.entry-content h3 { margin: 1.5em 0 .45em; scroll-margin-top: 84px; }
.entry-content h4 { margin: 1.3em 0 .4em; font-size: 1.1em; }

.entry-content ul, .entry-content ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.entry-content li { margin-bottom: .5em; }
.entry-content li::marker { color: var(--tez-primary); }

.entry-content img,
.entry-content figure img { border-radius: var(--tez-radius, 10px); margin: 0 auto; }
.entry-content figure { margin: 1.8em 0; }
.entry-content figcaption {
  text-align: center; font-size: 14px; color: var(--tez-muted);
  margin-top: 8px; font-style: italic;
}

.entry-content blockquote {
  border-left: 4px solid var(--tez-primary);
  margin: 1.6em 0; padding: .2em 0 .2em 1.2em;
  color: var(--tez-muted); font-size: 1.06em;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

.entry-content pre {
  background: #0f172a; color: #e2e8f0; padding: 16px 18px;
  border-radius: var(--tez-radius, 10px); overflow-x: auto;
  font-size: 14px; line-height: 1.6; margin: 1.5em 0;
}
.entry-content code {
  background: var(--tez-surface); padding: 2px 6px; border-radius: 4px;
  font-size: .9em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.entry-content pre code { background: none; padding: 0; color: inherit; }

.tez-table-wrap { overflow-x: auto; margin: 1.5em 0; -webkit-overflow-scrolling: touch; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 480px; }
.entry-content th, .entry-content td { border: 1px solid var(--tez-border); padding: 10px 13px; text-align: left; }
.entry-content th { background: var(--tez-surface); font-weight: 650; }
.entry-content tbody tr:nth-child(even) { background: color-mix(in srgb, var(--tez-surface) 55%, transparent); }

.entry-content hr, .tez-divider {
  border: 0; border-top: 1px solid var(--tez-border); margin: 2.2em 0;
}

.tez-anchor {
  opacity: 0; margin-left: 8px; font-weight: 400; color: var(--tez-muted);
  text-decoration: none; font-size: .75em;
}
h2:hover .tez-anchor, h3:hover .tez-anchor { opacity: 1; }

.tez-auto-link { border-bottom: 1px dotted currentColor; }

.tez-note {
  background: var(--tez-surface); border-left: 4px solid var(--tez-primary);
  padding: 14px 18px; border-radius: 0 var(--tez-radius) var(--tez-radius) 0; margin: 1.5em 0;
}
.tez-note-warning { border-left-color: #d97706; }
.tez-note-success { border-left-color: #059669; }
.tez-note p:last-child { margin-bottom: 0; }

.tez-button {
  display: inline-block; background: var(--tez-primary); color: #fff;
  padding: 11px 22px; border-radius: var(--tez-radius); font-weight: 600;
}
.tez-button:hover { background: var(--tez-primary-hover); text-decoration: none; }

.tez-inline-related {
  background: var(--tez-surface); border-radius: var(--tez-radius);
  padding: 16px 20px; margin: 1.8em 0;
}
.tez-inline-related-title { font-weight: 650; margin: 0 0 8px; font-size: 15px; color: var(--tez-heading); }
.tez-inline-related ul { margin: 0; padding-left: 1.2em; }

/* ---------- table of contents ---------- */

.tez-toc {
  background: var(--tez-surface); border: 1px solid var(--tez-border);
  border-radius: var(--tez-radius); padding: 14px 18px; margin: 0 0 1.8em;
}
.tez-toc summary {
  font-weight: 650; cursor: pointer; color: var(--tez-heading);
  font-size: 15.5px; list-style: none; display: flex; align-items: center; gap: 8px;
}
.tez-toc summary::-webkit-details-marker { display: none; }
.tez-toc summary::before { content: "☰"; opacity: .5; }
.tez-toc nav { margin-top: 10px; }
.tez-toc ol { margin: 0; padding-left: 1.3em; font-size: 15px; }
.tez-toc li { margin: 5px 0; }
.tez-toc a { color: var(--tez-text); }
.tez-toc a:hover { color: var(--tez-primary); }
.tez-toc-sub { padding-left: 1.1em; font-size: .95em; opacity: .9; }

/* ---------- post cards ---------- */

.post-grid { display: grid; grid-template-columns: 1fr; gap: 26px; }

.post-card {
  background: var(--tez-bg); border: 1px solid var(--tez-border);
  border-radius: var(--tez-radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .16s ease, box-shadow .16s ease;
}
.post-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 23, 42, .1); }
.post-card .card-image { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.post-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.post-card h2, .post-card h3 { font-size: 19px; margin: 0 0 8px; line-height: 1.35; }
.post-card h2 a, .post-card h3 a { color: var(--tez-heading); }
.post-card h2 a:hover, .post-card h3 a:hover { color: var(--tez-primary); text-decoration: none; }
.post-card p { font-size: 15px; color: var(--tez-muted); margin: 0 0 12px; }
.post-card .card-meta {
  margin-top: auto; font-size: 13px; color: var(--tez-muted);
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.card-category {
  display: inline-block; background: var(--tez-surface); color: var(--tez-primary);
  font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 20px;
  margin-bottom: 9px; text-transform: uppercase; letter-spacing: .04em;
}

/* list layout */
.layout-list .post-grid { grid-template-columns: 1fr !important; }
.layout-list .post-card { flex-direction: row; }
.layout-list .post-card .card-image { width: 280px; aspect-ratio: 4/3; flex: none; }
@media (max-width: 700px) {
  .layout-list .post-card { flex-direction: column; }
  .layout-list .post-card .card-image { width: 100%; aspect-ratio: 16/9; }
}

/* minimal layout */
.layout-minimal .post-grid { grid-template-columns: 1fr !important; gap: 0; }
.layout-minimal .post-card {
  border: 0; border-bottom: 1px solid var(--tez-border); border-radius: 0;
  flex-direction: row; gap: 18px; padding: 22px 0;
}
.layout-minimal .post-card:hover { transform: none; box-shadow: none; }
.layout-minimal .post-card .card-image { width: 130px; aspect-ratio: 1; border-radius: 8px; }
.layout-minimal .post-card-body { padding: 0; }

/* ---------- archive header ---------- */

.archive-header { margin-bottom: 32px; }
.archive-header h1 { margin-bottom: 8px; }
.archive-description { color: var(--tez-muted); max-width: 680px; font-size: 16px; }
.archive-count { font-size: 14px; color: var(--tez-muted); }

/* ---------- sidebar ---------- */

.site-sidebar { position: sticky; top: 84px; display: grid; gap: 24px; }
.widget {
  background: var(--tez-surface); border-radius: var(--tez-radius); padding: 18px 20px;
}
.widget-title {
  font-size: 15px; font-weight: 700; margin: 0 0 12px;
  color: var(--tez-heading); letter-spacing: -.01em;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px solid var(--tez-border); font-size: 14.5px; }
.widget li:last-child { border-bottom: 0; }
.widget li a { color: var(--tez-text); }
.widget li a:hover { color: var(--tez-primary); }
.widget .count { color: var(--tez-muted); font-size: 12.5px; }

.widget-post { display: flex; gap: 11px; align-items: flex-start; }
.widget-post img { width: 62px; height: 46px; object-fit: cover; border-radius: 6px; flex: none; }
.widget-post .title { font-size: 14px; line-height: 1.4; }

.search-form { display: flex; gap: 6px; }
.search-form input[type=search] {
  flex: 1; padding: 9px 12px; border: 1px solid var(--tez-border);
  border-radius: var(--tez-radius); font: inherit; font-size: 15px;
  background: var(--tez-bg); color: var(--tez-text); min-width: 0;
}
.search-form button {
  padding: 9px 16px; border: 0; border-radius: var(--tez-radius);
  background: var(--tez-primary); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}

/* ---------- single post extras ---------- */

.entry-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 28px 0; }
.entry-tags a {
  background: var(--tez-surface); color: var(--tez-muted);
  padding: 5px 13px; border-radius: 20px; font-size: 13.5px;
}
.entry-tags a:hover { background: var(--tez-primary); color: #fff; text-decoration: none; }

.share-box { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 26px 0; }
.share-box .label { font-size: 14px; font-weight: 600; color: var(--tez-muted); }
.share-box a {
  padding: 7px 15px; border: 1px solid var(--tez-border); border-radius: 20px;
  font-size: 13.5px; color: var(--tez-text);
}
.share-box a:hover { background: var(--tez-primary); color: #fff; border-color: var(--tez-primary); text-decoration: none; }

.author-box {
  display: flex; gap: 18px; background: var(--tez-surface);
  border-radius: var(--tez-radius); padding: 22px; margin: 34px 0;
}
.author-box img { width: 72px; height: 72px; border-radius: 50%; flex: none; }
.author-box h3 { margin: 0 0 5px; font-size: 17px; }
.author-box p { margin: 0 0 8px; font-size: 15px; color: var(--tez-muted); }
.author-box .author-social { display: flex; gap: 12px; font-size: 13.5px; }
@media (max-width: 600px) { .author-box { flex-direction: column; text-align: center; align-items: center; } }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 34px 0; }
.post-nav a {
  border: 1px solid var(--tez-border); border-radius: var(--tez-radius);
  padding: 15px 18px; color: var(--tez-heading);
}
.post-nav a:hover { border-color: var(--tez-primary); text-decoration: none; }
.post-nav .dir { font-size: 12.5px; color: var(--tez-muted); display: block; margin-bottom: 4px; }
.post-nav .next-post { text-align: right; }
@media (max-width: 600px) { .post-nav { grid-template-columns: 1fr; } }

.related-posts { margin: 44px 0; }
.related-posts > h2 { font-size: 22px; margin-bottom: 20px; }

/* ---------- comments ---------- */

.comments-section { margin: 44px 0; max-width: var(--tez-content, 760px); }
.comments-section > h2 { font-size: 22px; margin-bottom: 20px; }
.comment-list { list-style: none; margin: 0 0 32px; padding: 0; }
.comment-item { border-bottom: 1px solid var(--tez-border); padding: 18px 0; }
.comment-item:last-child { border-bottom: 0; }
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.comment-head img { width: 38px; height: 38px; border-radius: 50%; }
.comment-author { font-weight: 650; font-size: 15px; color: var(--tez-heading); }
.comment-date { font-size: 12.5px; color: var(--tez-muted); }
.comment-body { font-size: 15.5px; }
.comment-children { list-style: none; margin: 14px 0 0 26px; padding-left: 16px; border-left: 2px solid var(--tez-border); }

.comment-form { background: var(--tez-surface); padding: 22px; border-radius: var(--tez-radius); }
.comment-form h3 { margin: 0 0 14px; font-size: 18px; }
.comment-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.comment-form input, .comment-form textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--tez-border);
  border-radius: 8px; font: inherit; font-size: 15px; margin-bottom: 12px;
  background: var(--tez-bg); color: var(--tez-text);
}
.comment-form textarea { min-height: 120px; resize: vertical; }
.comment-form button {
  background: var(--tez-primary); color: #fff; border: 0; padding: 11px 24px;
  border-radius: var(--tez-radius); font: inherit; font-weight: 600; cursor: pointer;
}
.comment-form .honeypot { position: absolute; left: -9999px; }
@media (max-width: 600px) { .comment-form .row { grid-template-columns: 1fr; } }

/* ---------- pagination ---------- */

.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 44px 0 0; }
.page-link {
  padding: 9px 15px; border: 1px solid var(--tez-border);
  border-radius: 8px; color: var(--tez-text); font-size: 15px;
}
.page-link:hover { border-color: var(--tez-primary); color: var(--tez-primary); text-decoration: none; }
.page-link.current { background: var(--tez-primary); color: #fff; border-color: var(--tez-primary); }
.page-gap { padding: 9px 6px; color: var(--tez-muted); }

/* ---------- footer ---------- */

.site-footer {
  background: var(--tez-footer-bg, #0f172a);
  color: var(--tez-footer-text, #94a3b8);
  padding: 48px 0 24px; margin-top: var(--tez-gap, 48px);
}
.footer-grid { display: grid; gap: 32px; margin-bottom: 32px; }
@media (min-width: 760px) {
  .footer-cols-2 .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-cols-3 .footer-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-cols-4 .footer-grid { grid-template-columns: repeat(4, 1fr); }
}
.site-footer h3 { color: #fff; font-size: 15px; margin: 0 0 12px; }
.site-footer a { color: inherit; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 5px 0; font-size: 14.5px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 20px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  font-size: 13.5px;
}
.footer-bottom .menu { gap: 16px; }
.footer-bottom .menu a { padding: 0; font-size: 13.5px; }

.back-to-top {
  position: fixed; right: 20px; bottom: 20px; width: 42px; height: 42px;
  border-radius: 50%; background: var(--tez-primary); color: #fff;
  border: 0; cursor: pointer; display: none; place-items: center; z-index: 40;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .25);
}
.back-to-top.show { display: grid; }

/* ---------- search overlay ---------- */

.search-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .75);
  z-index: 100; display: none; align-items: flex-start; justify-content: center; padding: 80px 20px;
}
.search-overlay.open { display: flex; }
.search-overlay .box {
  background: var(--tez-bg); border-radius: var(--tez-radius);
  padding: 22px; width: 100%; max-width: 560px;
}

/* ---------- 404 / empty ---------- */

.page-404 { text-align: center; padding: 60px 20px; }
.page-404 .code { font-size: 82px; font-weight: 800; color: var(--tez-primary); line-height: 1; margin: 0; }
.page-404 p { color: var(--tez-muted); max-width: 460px; margin: 12px auto 24px; }

.no-results { text-align: center; padding: 48px 20px; color: var(--tez-muted); }

/* ---------- print ---------- */

@media print {
  .site-header, .site-footer, .site-sidebar, .tez-ad, .share-box,
  .related-posts, .comments-section, .back-to-top, .post-nav { display: none !important; }
  .entry-content { max-width: none; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 11px; color: #666; }
}
