/*
Theme Name: Evolt News
Theme URI: https://evoltnews.com
Author: Evolt News
Description: Fast, clean tech and EV news theme with "Our Take" block, ad-ready widget areas, reading progress bar and dark mode.
Version: 1.5.0
Requires at least: 6.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: evolt
*/

/* ---------- Tokens ---------- */
:root {
  --bg: #ffffff;
  --surface: #f4f6f8;
  --ink: #16202a;
  --ink-soft: #4d5b68;
  --line: #e1e6eb;
  --link: #1747c9;
  --charge: #f2b705;      /* the one bold colour: "charge" amber */
  --charge-ink: #3a2c00;
  --head: "Barlow Semi Condensed", "Arial Narrow", Arial, sans-serif;
  --body: "Barlow", "Segoe UI", Roboto, Arial, sans-serif;
  --wrap: 1200px;
  --radius: 6px;
}
[data-theme="dark"] {
  --bg: #121a22;
  --surface: #1a2430;
  --ink: #e8edf2;
  --ink-soft: #a3b0bc;
  --line: #2a3643;
  --link: #7ea3ff;
  --charge-ink: #f2b705;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
}
img, video, iframe { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }
:focus-visible { outline: 3px solid var(--charge); outline-offset: 2px; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); white-space: nowrap;
}
.skip-link:focus {
  clip: auto; width: auto; height: auto; z-index: 1000;
  top: 8px; left: 8px; padding: 8px 14px; background: var(--charge); color: #000;
}
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.header-bar { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 22px; height: 30px; }
.brand-name { font: 700 30px/1 var(--head); letter-spacing: -.5px; }
.brand-sub { font: 500 15px/1 var(--head); color: var(--ink-soft); margin-left: 2px; }
.custom-logo { max-height: 40px; width: auto; }

.main-nav { flex: 1; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav a {
  display: block; padding: 8px 12px; color: var(--ink);
  font: 600 17px/1 var(--head); border-radius: var(--radius);
}
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current-cat > a {
  background: var(--surface); text-decoration: none;
}
.header-actions { display: flex; gap: 4px; margin-left: auto; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: none; border: 0; border-radius: var(--radius); color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: var(--surface); }
.icon-btn svg { width: 20px; height: 20px; }
.menu-btn { display: none; }

/* Reading progress bar = charge level */
.charge-bar { position: absolute; left: 0; bottom: -1px; height: 3px; width: 0; background: var(--charge); }

.search-panel { display: none; border-top: 1px solid var(--line); padding: 14px 0; }
.search-panel.is-open { display: block; }
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
  flex: 1; padding: 11px 14px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.btn {
  display: inline-block; padding: 11px 18px; border: 0; border-radius: var(--radius);
  background: var(--ink); color: var(--bg); font: 600 16px/1 var(--head); cursor: pointer;
}
.btn:hover { text-decoration: none; opacity: .9; }

@media (max-width: 900px) {
  .menu-btn { display: grid; }
  .main-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; padding: 8px 20px 16px; }
  .main-nav a { padding: 12px 8px; font-size: 19px; }
}

/* ---------- Ad slots ---------- */
.ad-slot { text-align: center; margin: 24px auto; min-height: 90px; }
.ad-slot .ad-label {
  display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 4px;
}
.ad-header { max-width: 970px; }
.ad-sticky { position: sticky; top: 84px; }

/* ---------- Layout ---------- */
.site-main { padding: 28px 0 56px; }
.with-sidebar { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 48px; }
@media (max-width: 980px) { .with-sidebar { grid-template-columns: 1fr; } }

/* ---------- Home: lead + stack ---------- */
.top-stories { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; padding-bottom: 32px; margin-bottom: 32px; border-bottom: 1px solid var(--line); }
@media (max-width: 860px) { .top-stories { grid-template-columns: 1fr; } }
.lead-card .thumb { border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; background: var(--surface); aspect-ratio: 16/9; }
.lead-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.lead-card h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; letter-spacing: -.3px; }
.lead-card h2 a, .stack-card h3 a, .row-card h3 a { color: var(--ink); }
.lead-card p { color: var(--ink-soft); margin: 0 0 10px; font-size: 18px; }

.stack { display: flex; flex-direction: column; }
.stack-card { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.stack-card:first-child { border-top: 0; padding-top: 0; }
.stack-card .thumb { border-radius: 4px; overflow: hidden; aspect-ratio: 16/10; background: var(--surface); }
.stack-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.stack-card h3 { font-size: 20px; font-weight: 600; margin-bottom: 6px; }

/* ---------- Rows (latest list) ---------- */
.section-title { font: 700 24px/1.2 var(--head); margin: 0 0 8px; padding-bottom: 10px; border-bottom: 3px solid var(--ink); display: inline-block; }
.row-card { display: grid; grid-template-columns: 240px 1fr; gap: 22px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.row-card .thumb { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; background: var(--surface); }
.row-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-card h3 { font-size: 24px; font-weight: 600; margin-bottom: 6px; }
.row-card p { margin: 0 0 8px; color: var(--ink-soft); }
@media (max-width: 600px) {
  .row-card { grid-template-columns: 110px 1fr; gap: 14px; }
  .row-card h3 { font-size: 19px; }
  .row-card p { display: none; }
}

.cat-link { display: inline-block; font: 600 15px/1 var(--head); color: var(--link); margin-bottom: 6px; }
.meta { font-size: 14px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.meta a { color: var(--ink-soft); }

/* ---------- Pagination ---------- */
.pagination { margin-top: 32px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers {
  min-width: 42px; padding: 10px 14px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); font-weight: 600;
}
.pagination .current { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Archive header ---------- */
.archive-head { margin-bottom: 8px; }
.archive-head h1 { font-size: 40px; }
.archive-head p { color: var(--ink-soft); max-width: 70ch; }

/* ---------- Single article ---------- */
.breadcrumbs { font-size: 14px; color: var(--ink-soft); margin-bottom: 14px; }
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs span[aria-hidden] { margin: 0 6px; }
.entry-header h1 { font-size: clamp(32px, 4.4vw, 50px); font-weight: 700; letter-spacing: -.5px; margin-bottom: 14px; }
.entry-deck { font-size: 21px; line-height: 1.45; color: var(--ink-soft); margin: 0 0 18px; }
.byline { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.byline img { border-radius: 50%; width: 40px; height: 40px; }
.byline .who { font-weight: 600; color: var(--ink); }
.featured { margin: 0 0 28px; }
.featured img { width: 100%; border-radius: var(--radius); }
.featured figcaption { font-size: 14px; color: var(--ink-soft); margin-top: 6px; }

.entry-content { font-size: 19px; line-height: 1.7; max-width: 720px; }
.entry-content > * { margin: 0 0 1.2em; }
.entry-content h2 { font-size: 30px; margin-top: 1.6em; }
.entry-content h3 { font-size: 24px; margin-top: 1.4em; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content blockquote { margin-left: 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--line); color: var(--ink-soft); font-style: italic; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content img { border-radius: var(--radius); }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.entry-content th { background: var(--surface); }

/* Our Take: the signature block */
.our-take {
  max-width: 720px; margin: 36px 0; padding: 22px 24px 20px;
  background: var(--surface); border-radius: var(--radius);
  border-left: 6px solid var(--charge);
}
.our-take-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.our-take-head svg { width: 18px; height: 26px; flex-shrink: 0; }
.our-take-head h2 { font-size: 26px; margin: 0; }
.our-take-body { font-size: 18px; line-height: 1.65; }
.our-take-body > *:last-child { margin-bottom: 0; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0; }
.tags a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 20px; font-size: 14px; color: var(--ink); }

.author-box { display: grid; grid-template-columns: 72px 1fr; gap: 18px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); max-width: 720px; }
.author-box img { border-radius: 50%; }
.author-box h2 { font-size: 20px; margin-bottom: 4px; }
.author-box p { margin: 0; color: var(--ink-soft); font-size: 16px; }

.related { margin-top: 40px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 14px; }
.related-grid .thumb { aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: var(--surface); margin-bottom: 8px; }
.related-grid .thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-grid h3 { font-size: 18px; font-weight: 600; }
.related-grid h3 a { color: var(--ink); }
@media (max-width: 700px) { .related-grid { grid-template-columns: 1fr; } }

/* ---------- Sidebar ---------- */
.sidebar .widget { margin-bottom: 36px; }
.sidebar .widget-title, .sidebar h2 { font: 700 20px/1.2 var(--head); padding-bottom: 8px; border-bottom: 3px solid var(--ink); display: inline-block; margin-bottom: 10px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.sidebar li a { color: var(--ink); font-weight: 500; }
.popular li { display: grid; grid-template-columns: 30px 1fr; gap: 8px; }
.popular .rank { font: 700 22px/1.1 var(--head); color: var(--charge-ink); }

/* ---------- Pages ---------- */
.page-content { max-width: 760px; }
.page-content h1 { font-size: 44px; }

/* ---------- Comments ---------- */
.comments-area { max-width: 720px; margin-top: 40px; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment-meta { font-size: 14px; color: var(--ink-soft); }
.comment-author { font-weight: 600; color: var(--ink); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.comment-form .submit { padding: 12px 20px; border: 0; border-radius: var(--radius); background: var(--ink); color: var(--bg); font: 600 16px var(--head); cursor: pointer; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 44px 0 24px; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 24px; } }
.site-footer h2 { font-size: 18px; margin-bottom: 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--ink); }
.site-footer p { color: var(--ink-soft); margin: 0 0 10px; }
.footer-bottom { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }

/* ---------- 404 / empty ---------- */
.empty-state { max-width: 560px; padding: 40px 0; }
.empty-state h1 { font-size: 44px; }

/* ---------- WP core alignment ---------- */
.alignleft { float: left; margin: 0 1.2em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.2em; }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption-text, .wp-element-caption { font-size: 14px; color: var(--ink-soft); }
.sticky, .bypostauthor, .gallery-caption {}

/* ---------- v1.3 mobile fixes ---------- */
.thumb { display: block; position: relative; }
.lead-card .thumb, .stack-card .thumb, .row-card .thumb, .related-grid .thumb { display: block; }
.lead-card, .stack-card, .row-card { min-width: 0; }
.lead-card h2, .stack-card h3, .row-card h3 { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .header-bar { gap: 10px; height: 58px; }
  .main-nav { top: 58px; }
  .brand-name { font-size: 26px; }
  .brand-sub { font-size: 14px; }
  .icon-btn { width: 38px; height: 38px; }
  .site-main { padding: 18px 0 40px; }
  .top-stories { gap: 18px; padding-bottom: 22px; margin-bottom: 22px; }
  .lead-card h2 { font-size: 27px; }
  .lead-card p { font-size: 16px; }
  .stack-card { grid-template-columns: 104px 1fr; gap: 12px; padding: 14px 0; }
  .stack-card h3 { font-size: 17px; }
  .row-card { grid-template-columns: 108px 1fr; gap: 12px; padding: 16px 0; }
  .row-card h3 { font-size: 18px; }
  .meta { font-size: 13px; gap: 2px 10px; }
  .entry-header h1 { font-size: 30px; }
  .entry-deck { font-size: 18px; }
  .entry-content { font-size: 18px; }
  .entry-content h2 { font-size: 25px; }
  .entry-content h3 { font-size: 21px; }
  .our-take { padding: 18px 16px; }
  .author-box { grid-template-columns: 56px 1fr; }
  .author-box img { width: 56px; height: 56px; }
}

/* ---------- v1.4 mobile home page ---------- */
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
  /* one clean column */
  .home .with-sidebar, .blog .with-sidebar { display: block; }
  .home .sidebar .widget, .blog .sidebar .widget { display: none; }

  .top-stories { display: block; }
  .lead-card { margin-bottom: 18px; }
  .lead-card .thumb { aspect-ratio: 16 / 9; border-radius: 10px; margin-bottom: 12px; }
  .lead-card h2 { font-size: 26px; line-height: 1.15; margin-bottom: 8px; }
  .lead-card p {
    font-size: 16px; line-height: 1.45; margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }

  /* compact news list: thumbnail left, title right */
  .stack-card, .row-card {
    display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px;
    padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 0; align-items: start;
  }
  .stack-card:first-child { border-top: 1px solid var(--line); padding-top: 14px; }
  .stack-card .thumb, .row-card .thumb { aspect-ratio: 4 / 3; border-radius: 8px; }
  .stack-card h3, .row-card h3 {
    font-size: 17px; line-height: 1.25; margin: 0 0 4px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  }
  .row-card p { display: none; }
  .cat-link { font-size: 13px; margin-bottom: 3px; }
  .stack-card .meta, .row-card .meta { font-size: 12px; }
  .row-card .meta span:first-child { display: none; } /* hide "By author" in list */
  .row-card .meta span:last-child { display: none; }  /* hide reading time in list */

  .section-title { font-size: 20px; margin-top: 8px; }
  .pagination .page-numbers { min-width: 38px; padding: 8px 10px; }
}

/* ---------- v1.5 smaller lead story on phones ---------- */
@media (max-width: 760px) {
  .lead-card .thumb { aspect-ratio: 2 / 1; max-height: 190px; border-radius: 10px; margin-bottom: 10px; }
  .lead-card h2 { font-size: 21px; line-height: 1.2; margin-bottom: 6px; }
  .lead-card p { display: none; }
  .lead-card .meta { font-size: 12px; }
  .lead-card .meta span:first-child, .lead-card .meta span:last-child { display: none; }
}
