/*
Theme Name: Digital Lamar
Theme URI: https://digitallamar.com
Author: Digital Lamar
Author URI: https://digitallamar.com
Description: Custom blog theme matching the Digital Lamar static site — dark, futuristic, Space Grotesk + Inter, gradient accents.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: Proprietary
Text Domain: digitallamar
*/

/* The main site stylesheet (/assets/css/main.css) is enqueued first and
   provides the design system: variables, header, footer, buttons, page-hero.
   Everything below is blog-specific. */

/* ---------- Blog listing ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 1024px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .blog-grid { grid-template-columns: 1fr; } }

.post-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.35s;
}
.post-card:hover { transform: translateY(-6px); border-color: rgba(79, 125, 243, 0.45); }

.post-card__thumb { aspect-ratio: 16 / 9; overflow: hidden; background: linear-gradient(135deg, rgba(79,125,243,0.18), rgba(139,92,246,0.18), rgba(56,232,255,0.12)); }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.post-card:hover .post-card__thumb img { transform: scale(1.05); }

.post-card__body { display: flex; flex-direction: column; gap: 14px; padding: 26px; flex: 1; }
.post-card__meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); }
.post-card__meta .cat { color: var(--cyan); }
.post-card__title { font-family: var(--font-d); font-weight: 600; font-size: 21px; line-height: 1.3; letter-spacing: -0.01em; }
.post-card__title a { color: var(--text); transition: color 0.25s; }
.post-card__title a:hover { color: var(--cyan); }
.post-card__excerpt { font-size: 14.5px; line-height: 1.7; color: var(--muted); }
.post-card__more { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.post-card__more svg { transition: transform 0.3s; }
.post-card:hover .post-card__more svg { transform: translateX(4px); }

/* ---------- Pagination ---------- */
.blog-pagination { margin-top: clamp(40px, 6vw, 70px); }
.blog-pagination .nav-links { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.blog-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--muted);
  transition: color 0.25s, border-color 0.25s;
}
.blog-pagination .page-numbers:hover { color: var(--text); border-color: rgba(79, 125, 243, 0.5); }
.blog-pagination .page-numbers.current { color: #fff; background: var(--grad); border-color: transparent; }
.blog-pagination .page-numbers.dots { border: none; }

/* ---------- Single post ---------- */
.post-hero { padding: calc(var(--nav-h) + clamp(60px, 8vw, 110px)) 0 clamp(36px, 5vw, 60px); position: relative; overflow: hidden; }
.post-hero .wrap { position: relative; z-index: 1; max-width: 880px; }
.post-hero__title { font-family: var(--font-d); font-weight: 700; line-height: 1.08; letter-spacing: -0.025em; font-size: clamp(32px, 4.6vw, 58px); margin-top: 18px; }
.post-hero__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 26px; font-size: 14px; color: var(--muted); }
.post-hero__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }
.post-hero__meta .cat a { color: var(--cyan); }

.post-feature { max-width: 880px; margin: 0 auto; padding: 0 var(--pad); }
.post-feature img { width: 100%; border-radius: 20px; border: 1px solid var(--line); }

/* ---------- Post content typography ---------- */
.post-content { max-width: 760px; margin: 0 auto; padding: clamp(36px, 5vw, 60px) var(--pad) clamp(50px, 7vw, 90px); }
.post-content > * + * { margin-top: 1.4em; }
.post-content p { font-size: 17px; line-height: 1.85; color: var(--muted); }
.post-content h2, .post-content h3, .post-content h4 {
  font-family: var(--font-d); color: var(--text); font-weight: 600; line-height: 1.25; letter-spacing: -0.015em;
}
.post-content h2 { font-size: clamp(24px, 2.6vw, 32px); margin-top: 1.9em; }
.post-content h3 { font-size: clamp(20px, 2.1vw, 24px); margin-top: 1.7em; }
.post-content h4 { font-size: 18px; }
.post-content a { color: var(--cyan); text-decoration: underline; text-decoration-color: rgba(56, 232, 255, 0.35); text-underline-offset: 3px; }
.post-content a:hover { text-decoration-color: var(--cyan); }
.post-content strong { color: var(--text); }
.post-content ul, .post-content ol { padding-left: 1.3em; display: grid; gap: 0.6em; }
.post-content li { font-size: 16.5px; line-height: 1.75; color: var(--muted); }
.post-content li::marker { color: var(--cyan); }
.post-content blockquote {
  border-left: 3px solid transparent;
  border-image: linear-gradient(180deg, var(--blue), var(--violet)) 1;
  padding: 6px 0 6px 24px; font-style: italic;
}
.post-content blockquote p { color: var(--text); font-size: 18px; }
.post-content img { max-width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line); }
.post-content figcaption { font-size: 13px; color: var(--muted-2); text-align: center; margin-top: 10px; }
.post-content code { font-size: 0.9em; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; color: var(--cyan); }
.post-content pre { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 14px; padding: 20px 24px; overflow-x: auto; }
.post-content pre code { background: none; border: none; padding: 0; color: var(--muted); }
.post-content hr { border: none; height: 1px; background: var(--line); margin: 2.5em 0; }
.post-content table { width: 100%; border-collapse: collapse; font-size: 15px; }
.post-content th, .post-content td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; color: var(--muted); }
.post-content th { color: var(--text); font-family: var(--font-d); font-weight: 600; }
.post-content iframe { max-width: 100%; border-radius: 16px; }

/* ---------- Prev / next post ---------- */
.post-nav { border-top: 1px solid var(--line); }
.post-nav .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-top: clamp(36px, 5vw, 60px); padding-bottom: clamp(36px, 5vw, 60px); }
.post-nav a { display: flex; flex-direction: column; gap: 8px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; transition: border-color 0.3s, transform 0.3s; }
.post-nav a:hover { border-color: rgba(79, 125, 243, 0.45); transform: translateY(-3px); }
.post-nav .label { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.post-nav .title { font-family: var(--font-d); font-weight: 600; font-size: 16.5px; color: var(--text); line-height: 1.35; }
.post-nav .next { text-align: right; align-items: flex-end; }
@media (max-width: 640px) { .post-nav .wrap { grid-template-columns: 1fr; } }

/* ---------- Misc ---------- */
.blog-empty { text-align: center; padding: 60px 0; color: var(--muted); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ============================================================
   LIGHT / DARK MODE (blog only)
   Default = dark (inherits main.css). html.dl-light flips the
   colour tokens for the whole blog page. The static site never
   sets this class, so it stays dark.
   ============================================================ */
html.dl-light {
  --bg: #ffffff;
  --bg-2: #f5f7fa;
  --bg-3: #eceff4;
  --surface: #ffffff;
  --line: rgba(12, 18, 30, 0.12);
  --line-soft: rgba(12, 18, 30, 0.07);
  --text: #0d1117;
  --muted: #4a5263;
  --muted-2: #6b7385;
  --cyan: #0b8fb0;            /* deeper cyan for contrast on white */
}
/* Surfaces that were hardcoded for dark — fix them for light */
html.dl-light .site-header.is-scrolled { background: rgba(255, 255, 255, 0.82); }
html.dl-light .post-content code { background: rgba(12, 18, 30, 0.05); }
html.dl-light .post-content pre  { background: rgba(12, 18, 30, 0.04); }

/* Particle/grain noise looks dirty on white — remove it in light mode (blog only) */
html.dl-light .grain { display: none; }

/* Big "DIGITAL LAMAR" footer watermark uses a white gradient (invisible on white).
   Flip it to a faint dark gradient so it shows in light mode. */
html.dl-light .footer-mega {
  background: linear-gradient(180deg, rgba(13, 17, 23, 0.12), rgba(13, 17, 23, 0.02));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* ---------- Theme toggle button ---------- */
.dl-theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); color: var(--text); margin-right: 12px;
  transition: border-color 0.25s, color 0.25s; background: none; cursor: pointer;
}
.dl-theme-toggle:hover { border-color: var(--cyan); color: var(--cyan); }
.dl-theme-toggle svg { width: 18px; height: 18px; }
.dl-theme-toggle .ico-sun { display: none; }
.dl-theme-toggle .ico-moon { display: block; }
html.dl-light .dl-theme-toggle .ico-sun { display: block; }
html.dl-light .dl-theme-toggle .ico-moon { display: none; }

/* ============================================================
   BLOG POST CUSTOM COMPONENTS (theme-aware, no inline styles)
   Prefixed with .post-content for specificity over base rules.
   ============================================================ */
/* Table of contents */
.post-content .dl-toc { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 24px 28px; margin: 0 0 40px; }
.post-content .dl-toc__label { font-family: var(--font-d); font-weight: 600; font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); margin: 0 0 14px; }
.post-content .dl-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 36px; font-size: 15.5px; line-height: 2; }
.post-content .dl-toc li { font-size: 15.5px; }
.post-content .dl-toc a { color: var(--muted); text-decoration: none; }
.post-content .dl-toc a:hover { color: var(--cyan); }
@media (max-width: 600px) { .post-content .dl-toc ol { columns: 1; } }

/* TL;DR / answer box */
.post-content .dl-tldr { border-left: 3px solid var(--cyan); background: rgba(56, 232, 255, 0.06); border-radius: 0 14px 14px 0; padding: 20px 24px; margin: 0 0 34px; }
.post-content .dl-tldr__label { font-family: var(--font-d); font-weight: 600; font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); margin: 0 0 9px; }
.post-content .dl-tldr p { margin: 0; color: var(--text); font-size: 17px; line-height: 1.7; }

/* CTA blocks */
.post-content .dl-cta { text-align: center; border: 1px solid var(--line); border-radius: 18px; padding: 36px 28px; margin: 44px 0; background: var(--bg-2); }
.post-content .dl-cta h3 { font-family: var(--font-d); font-weight: 700; font-size: 22px; line-height: 1.3; color: var(--text); margin: 0 0 10px; }
.post-content .dl-cta p { max-width: 520px; margin: 0 auto 22px; font-size: 16px; line-height: 1.6; color: var(--muted); }

/* ---------- Share bar + author box (theme-rendered, below content) ---------- */
.post-end { max-width: 760px; margin: 0 auto; padding: 0 var(--pad) clamp(40px, 6vw, 70px); }

.post-share { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 22px 0 26px; border-top: 1px solid var(--line); }
.post-share__label { font-family: var(--font-d); font-weight: 600; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); margin-right: 4px; }
.post-share a, .post-share button { width: 40px; height: 40px; border-radius: 10px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); color: var(--text); background: none; cursor: pointer; transition: border-color 0.2s, color 0.2s; }
.post-share a:hover, .post-share button:hover { border-color: var(--cyan); color: var(--cyan); }
.post-share svg { width: 18px; height: 18px; }
.post-share__copied { font-size: 13px; font-weight: 600; color: var(--cyan); opacity: 0; transition: opacity 0.2s; }
.post-share__copied.show { opacity: 1; }

.dl-author { display: flex; gap: 20px; align-items: flex-start; background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 26px 28px; }
.dl-author__avatar { flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--grad); display: flex; align-items: center; justify-content: center; font-family: var(--font-d); font-weight: 700; font-size: 24px; color: #fff; overflow: hidden; }
.dl-author__avatar img { width: 100%; height: 100%; object-fit: cover; }
.dl-author__name { font-family: var(--font-d); font-weight: 600; font-size: 17px; color: var(--text); margin: 0 0 2px; }
.dl-author__name span { color: var(--muted-2); font-weight: 400; font-size: 14px; }
.dl-author p { font-size: 15px; line-height: 1.7; color: var(--muted); margin: 8px 0 12px; }
.dl-author a { font-family: var(--font-d); font-weight: 600; font-size: 14px; color: var(--cyan); text-decoration: none; }
@media (max-width: 520px) { .dl-author { flex-direction: column; gap: 14px; } }
