/*
Theme Name: Pavetally Blacktop
Theme URI: https://pavetally.com/
Author: Farah J.
Author URI: https://pavetally.com/about/
Description: Blog theme for Pavetally, matching the Blacktop Precision design system used by the static calculator pages. Dark/light theme with a shared preference key, calculator-ready, schema built in. Designed to run in a /blog/ subdirectory alongside a static site at the root.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pavetally-blacktop
Tags: blog, one-column, custom-colors, custom-menu, dark-mode-support, editor-style, featured-images, threaded-comments, translation-ready
*/

/* =========================================================================
   TOKENS — identical to the static site's global.css.

   Two layers: BRAND tokens never change; SEMANTIC tokens flip under
   [data-theme='dark']. Only ever use semantic tokens in rules below, or dark
   mode breaks.
   ========================================================================= */

:root {
  --ink: #14161a;
  --ink2: #1e2127;
  --cream: #f5f1e8;
  --paper: #fffdf8;
  --amber: #ff8f1f;
  --amber-dark: #c96a10;
  --steel: #8891a0;
  --line: rgba(255, 255, 255, 0.09);

  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;

  --wrap: 1120px;
  --wrap-narrow: 760px;
  --radius: 14px;
  --radius-sm: 8px;

  --bg: var(--paper);
  --bg-alt: var(--cream);
  --surface: #ffffff;
  --panel: var(--ink);
  --text: var(--ink);
  --text-soft: #3b4149;
  --text-muted: #5d6470;
  --border: rgba(20, 22, 26, 0.12);
  --border-strong: rgba(20, 22, 26, 0.28);
  --link: var(--amber-dark);
  --shadow: rgba(20, 22, 26, 0.13);
  --toggle-bg: var(--ink);
  --toggle-fg: var(--paper);
  color-scheme: light;
}

[data-theme='dark'] {
  --bg: #101216;
  --bg-alt: #171a20;
  --surface: #191c22;
  --panel: #232830;
  --text: #ecebe7;
  --text-soft: #c6ccd5;
  --text-muted: #99a1ae;
  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.3);
  --link: #ffa445;
  --shadow: rgba(0, 0, 0, 0.55);
  --toggle-bg: #ecebe7;
  --toggle-fg: #14161a;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--text);
}

h1 {
  font-size: 46px;
  line-height: 1.08;
}
h2 {
  font-size: 30px;
}
h3 {
  font-size: 21px;
}

p {
  margin: 0 0 1.1em;
}

a {
  color: var(--link);
  text-underline-offset: 2px;
}
a:hover {
  color: var(--text);
}

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

code,
pre {
  font-family: var(--font-mono);
  font-size: 14.5px;
}

pre {
  background: var(--panel);
  color: var(--amber);
  padding: 18px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 22px;
}

.wrap-narrow {
  width: 100%;
  max-width: var(--wrap-narrow);
  margin: 0 auto;
  padding: 0 22px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--amber);
  color: #14161a;
  padding: 10px 16px;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip:focus {
  left: 0;
}

.site-main {
  padding: 26px 0 72px;
}

/* ---------- header (always dark — brand identity) ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(20, 22, 26, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 66px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.logo:hover {
  color: var(--paper);
}

.logo-mark {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--amber);
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--steel);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
}

.site-nav a:hover,
.site-nav .current-menu-item > a {
  color: var(--paper);
}

.site-nav a.nav-cta,
.site-nav a.nav-cta:hover {
  background: var(--amber);
  color: #14161a;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
}

/* ---------- theme toggle ---------- */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--paper);
  cursor: pointer;
  padding: 0;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.32);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .icon-sun {
  display: none;
}
[data-theme='dark'] .theme-toggle .icon-sun {
  display: block;
}
[data-theme='dark'] .theme-toggle .icon-moon {
  display: none;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- stripe divider (signature element) ---------- */

.stripes {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
}

.stripes span {
  display: block;
  width: 26px;
  height: 5px;
  border-radius: 2px;
  background: var(--amber);
}
.stripes span:nth-child(2) {
  opacity: 0.7;
}
.stripes span:nth-child(3) {
  opacity: 0.45;
}
.stripes span:nth-child(4) {
  opacity: 0.25;
}

/* ---------- breadcrumbs & meta ---------- */

.crumbs {
  font-size: 13.5px;
  color: var(--text-muted);
  padding: 18px 0 0;
}

.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.crumbs li::after {
  content: '/';
  margin-left: 8px;
  opacity: 0.55;
}

.crumbs li:last-child::after {
  content: '';
}

.crumbs a {
  color: var(--text-muted);
}

.meta {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 1.6em;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
}

.meta a {
  color: var(--text-muted);
}

/* ---------- post content ---------- */

.entry-content h2 {
  margin-top: 2.2em;
  scroll-margin-top: 90px;
}

.entry-content h3 {
  margin-top: 1.6em;
}

.entry-content ul,
.entry-content ol {
  margin: 0 0 1.2em;
  padding-left: 1.3em;
}

.entry-content li {
  margin-bottom: 0.45em;
}

.entry-content blockquote {
  margin: 1.5em 0;
  padding: 14px 20px;
  background: var(--bg-alt);
  border-left: 3px solid var(--amber);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.entry-content blockquote p:last-child {
  margin-bottom: 0;
}

.entry-content figure {
  margin: 1.8em 0;
}

.entry-content figcaption {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 8px;
}

.answer-box {
  background: var(--bg-alt);
  border-left: 3px solid var(--amber);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 18px 22px;
  margin: 0 0 1.8em;
  font-size: 18px;
  line-height: 1.6;
}

.answer-box p:last-child {
  margin-bottom: 0;
}

.note {
  font-size: 13.5px;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--amber);
}

/* ---------- tables ---------- */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.6em;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
}

th,
td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-alt);
}

/* ---------- author box ---------- */

.author-box {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 2.4em 0 0;
}

.author-box .avatar,
.author-box img {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
}

.author-box .avatar {
  background: var(--panel);
  color: var(--amber);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.author-box .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  margin: 0 0 6px;
}

.author-box .bio {
  font-size: 15px;
  color: var(--text-soft);
  margin: 0;
}

/* ---------- post list ---------- */

.post-list .post-item {
  border-top: 1px solid var(--border);
  padding: 26px 0;
}

.post-list h2 {
  font-size: 26px;
  margin-bottom: 6px;
}

.post-list h2 a {
  color: var(--text);
  text-decoration: none;
}

.post-list h2 a:hover {
  color: var(--link);
}

.post-list .post-meta {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.more-link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

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

.pagination {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 15px;
}

.pagination .page-numbers {
  display: inline-block;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-right: 6px;
  text-decoration: none;
}

.pagination .page-numbers.current {
  background: var(--amber);
  color: #14161a;
  border-color: var(--amber);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--amber);
  color: #14161a;
}

.btn-primary:hover {
  background: #ffa040;
  color: #14161a;
}

.btn-ghost {
  background: transparent;
  color: var(--paper);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--paper);
}

/* ---------- cookie consent banner ---------- */

.consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: var(--panel);
  border-top: 1px solid var(--border-strong);
  padding: 16px 20px;
}

.consent-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.consent-inner p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  max-width: 640px;
  color: var(--paper);
}

.consent-inner a {
  color: var(--amber);
}

.consent-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.consent-actions .btn {
  padding: 9px 16px;
  font-size: 13.5px;
}

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

.comments-area {
  margin-top: 3em;
  padding-top: 2em;
  border-top: 1px solid var(--border);
}

.comment-list {
  list-style: none;
  padding: 0;
}

.comment-list li {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}

.comment-form input[type='text'],
.comment-form input[type='email'],
.comment-form input[type='url'],
.comment-form textarea {
  width: 100%;
  max-width: 520px;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

/* ---------- footer (always dark) ---------- */

.site-footer {
  background: var(--ink);
  color: var(--steel);
  padding: 62px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 34px;
}

.site-footer h4 {
  color: var(--paper);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin-bottom: 9px;
}

.site-footer a {
  color: var(--steel);
  text-decoration: none;
  font-size: 14.5px;
}

.site-footer a:hover {
  color: var(--amber);
}

.site-footer .tag {
  font-size: 14.5px;
  max-width: 30ch;
}

.footer-bar {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 13px;
}

.footer-bar p {
  margin: 0;
  max-width: 52ch;
}

/* ---------- WordPress core classes ---------- */

.alignleft {
  float: left;
  margin: 0 1.5em 1em 0;
}
.alignright {
  float: right;
  margin: 0 0 1em 1.5em;
}
.aligncenter {
  display: block;
  margin: 1.5em auto;
}
.alignwide {
  max-width: var(--wrap);
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0 22px;
}
.alignfull {
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.wp-caption {
  max-width: 100%;
}
.sticky,
.gallery-caption,
.bypostauthor {
  /* required by the theme review guidelines */
}

/* ---------- responsive: single breakpoint, same as the static site ---------- */

@media (max-width: 820px) {
  h1 {
    font-size: 34px;
  }
  h2 {
    font-size: 25px;
  }
  .header-inner {
    flex-wrap: wrap;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .site-nav ul {
    flex-wrap: wrap;
    gap: 14px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
  .footer-bar {
    flex-direction: column;
    gap: 10px;
  }
  .alignwide,
  .alignfull {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
