/*
Theme Name: SearchPulse
Author: Samad
Description: A fast, clean news-blog theme for search marketing and tech news sites. Chronological headline feed with timestamps, category badges, comment counts, right sidebar, and a pulsing "live" masthead dot. Inspired by classic search-news layouts.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: searchpulse
Tags: news, blog, two-columns, right-sidebar, custom-logo, custom-menu, threaded-comments, translation-ready
*/

/* ---------- Tokens ---------- */
:root {
  --ink: #10315b;        /* navy: nav, footer, strong text */
  --link: #1157b8;       /* headline blue */
  --link-dark: #0c3f87;
  --pulse: #e02b2b;      /* live-dot red */
  --paper: #ffffff;
  --mist: #f3f6fa;
  --border: #dfe6ee;
  --text: #1f2937;
  --muted: #64748b;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-dark); text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden;
  padding: 0; position: absolute; word-wrap: normal !important;
}
.skip-link:focus {
  clip: auto; clip-path: none; height: auto; width: auto;
  position: fixed; top: 8px; left: 8px; z-index: 1000;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 3px;
}

/* ---------- Header ---------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--border); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding-top: 22px; padding-bottom: 22px;
}
.site-title { margin: 0; font-size: 27px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.1; }
.site-title a { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; }
.site-title a:hover { color: var(--link); }
.site-description { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.custom-logo { max-height: 64px; width: auto; display: block; }

/* Signature: pulsing live dot */
.pulse-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--pulse); display: inline-block; margin-right: 11px;
  animation: sp-pulse 2s infinite;
}
@keyframes sp-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(224,43,43,.45); }
  70%  { box-shadow: 0 0 0 11px rgba(224,43,43,0); }
  100% { box-shadow: 0 0 0 0 rgba(224,43,43,0); }
}
@media (prefers-reduced-motion: reduce) {
  .pulse-dot { animation: none; }
}

.header-search { width: 300px; }

/* ---------- Nav ---------- */
.main-nav { background: var(--ink); }
.main-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.main-nav .menu li { margin: 0; }
.main-nav .menu a {
  display: block; padding: 12px 15px; color: #fff; text-decoration: none;
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
}
.main-nav .menu a:hover { background: rgba(255,255,255,.1); color: #fff; }
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a { box-shadow: inset 0 -3px 0 var(--pulse); }
.main-nav .sub-menu { display: none; } /* keep top level only; use flat menus */

/* ---------- Layout ---------- */
.layout {
  display: grid; grid-template-columns: minmax(0,1fr) 320px;
  gap: 48px; padding-top: 34px; padding-bottom: 64px;
}
.section-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted); margin: 0 0 6px; font-weight: 700;
}
.section-label::before { content: ""; display: inline-block; width: 18px; height: 3px; background: var(--pulse); margin-right: 9px; vertical-align: middle; }

/* ---------- News list ---------- */
.news-item { padding: 22px 0; border-bottom: 1px solid var(--border); }
.news-item:first-of-type { padding-top: 12px; }
.cat-badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--link-dark); background: #e9f1fc;
  padding: 3px 9px; border-radius: 3px; margin-bottom: 7px;
}
.cat-badge:hover { background: #d9e8fa; text-decoration: none; }
.news-title { margin: 0; font-size: 21px; line-height: 1.32; font-weight: 700; }
.news-title a { color: var(--link); }
.news-title a:hover { color: var(--link-dark); text-decoration: underline; }
.news-meta {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  margin: 7px 0 9px;
}
.news-meta a { color: var(--muted); }
.news-meta a:hover { color: var(--link); }
.meta-sep { padding: 0 7px; color: #b8c3d0; }
.meta-comments a { color: var(--pulse); font-weight: 600; }
.news-excerpt { color: #3c4652; font-size: 15px; }
.news-excerpt p { margin: 0; }
.news-thumb { margin: 10px 0 4px; }
.news-thumb img { border-radius: 3px; display: block; }
.sticky { background: var(--mist); border: 1px solid var(--border); border-radius: 4px; padding: 18px; }

/* ---------- Pagination ---------- */
.navigation.pagination { margin-top: 30px; }
.nav-links .page-numbers {
  display: inline-block; padding: 8px 13px; margin: 0 6px 6px 0;
  border: 1px solid var(--border); border-radius: 3px;
  color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none;
}
.nav-links .page-numbers.current { background: var(--ink); color: #fff; border-color: var(--ink); }
.nav-links a.page-numbers:hover { border-color: var(--link); color: var(--link); text-decoration: none; }

/* ---------- Single post / page ---------- */
.entry-title { margin: 4px 0 0; font-size: 31px; line-height: 1.22; color: var(--ink); font-weight: 800; letter-spacing: -0.3px; }
.entry-thumb { margin: 20px 0 4px; }
.entry-thumb img { border-radius: 4px; display: block; }
.entry-content { font-size: 17px; line-height: 1.75; }
.entry-content a { text-decoration: underline; }
.entry-content h2 { font-size: 24px; margin: 34px 0 12px; color: var(--ink); }
.entry-content h3 { font-size: 20px; margin: 28px 0 10px; color: var(--ink); }
.entry-content ul, .entry-content ol { padding-left: 1.5em; }
.entry-content li { margin-bottom: 6px; }
.entry-content blockquote {
  margin: 22px 0; padding: 14px 20px; border-left: 4px solid var(--link);
  background: var(--mist); color: #33404e; font-style: italic;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content pre {
  background: #0f1720; color: #e6edf3; padding: 16px 18px;
  border-radius: 5px; overflow: auto; font-size: 14px; line-height: 1.6;
}
.entry-content code { background: #eef2f6; padding: 2px 6px; border-radius: 3px; font-size: .9em; }
.entry-content pre code { background: none; padding: 0; }
.entry-content table { border-collapse: collapse; width: 100%; margin: 20px 0; font-size: 15px; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
.entry-content th { background: var(--mist); color: var(--ink); }

.tag-list { margin-top: 22px; }
.tag-list a {
  display: inline-block; font-size: 12px; color: var(--muted);
  background: var(--mist); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 20px; margin: 0 6px 6px 0;
}
.tag-list a:hover { color: var(--link); border-color: var(--link); text-decoration: none; }

.post-nav {
  display: flex; justify-content: space-between; gap: 20px;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 16px 0; margin: 30px 0; font-size: 14px; font-weight: 600;
}
.post-nav .nav-next { text-align: right; }

/* ---------- Sidebar ---------- */
.widget-area .widget { margin-bottom: 36px; }
.widget-title {
  font-size: 13px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink); border-bottom: 2px solid var(--ink);
  padding-bottom: 8px; margin: 0 0 14px; font-weight: 800;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px dashed #e4eaf1; font-size: 14px; }
.widget li:last-child { border-bottom: 0; }
.widget a { color: var(--text); }
.widget a:hover { color: var(--link); }
.widget .post-date { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* ---------- Search form ---------- */
.search-form { display: flex; }
.search-form .search-field {
  flex: 1; min-width: 0; padding: 9px 12px; font-size: 14px;
  border: 1px solid #c7d1dd; border-right: 0; border-radius: 3px 0 0 3px;
}
.search-form .search-field:focus { outline: 2px solid var(--link); outline-offset: -1px; }
.search-form .search-submit {
  background: var(--ink); color: #fff; border: 0;
  padding: 9px 15px; font-size: 13px; font-weight: 700; border-radius: 0 3px 3px 0;
}
.search-form .search-submit:hover { background: #0a2444; }

/* ---------- Comments ---------- */
.comments-area { margin-top: 34px; }
.comments-title, .comment-reply-title { font-size: 19px; color: var(--ink); margin: 0 0 16px; }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { padding-left: 26px; }
.comment-list .comment { padding: 15px 0; border-bottom: 1px solid var(--border); }
.comment-author { font-weight: 700; color: var(--ink); }
.comment-author .avatar { border-radius: 50%; vertical-align: middle; margin-right: 9px; }
.comment-metadata { font-family: var(--mono); font-size: 11px; margin: 3px 0 8px; }
.comment-metadata a { color: var(--muted); }
.comment-content { font-size: 15px; }
.comment-content p:last-child { margin-bottom: 0; }
.reply { font-size: 13px; margin-top: 6px; }
.bypostauthor .comment-author::after {
  content: "Author"; font-size: 10px; font-weight: 700; text-transform: uppercase;
  background: var(--ink); color: #fff; border-radius: 3px; padding: 2px 6px; margin-left: 8px;
}
.comment-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #c7d1dd;
  border-radius: 3px; margin-bottom: 14px;
}
.comment-form .submit {
  background: var(--pulse); color: #fff; border: 0;
  padding: 11px 22px; border-radius: 3px; font-weight: 700;
}
.comment-form .submit:hover { background: #c02020; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #c9d6e6; margin-top: 40px; }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 18px; padding-top: 30px; padding-bottom: 30px; font-size: 13px;
}
.site-footer a { color: #e6eef8; }
.site-footer a:hover { color: #fff; }
.footer-menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 18px; }

/* ---------- WP core classes ---------- */
.alignleft { float: left; margin: 6px 22px 12px 0; }
.alignright { float: right; margin: 6px 0 12px 22px; }
.aligncenter { display: block; margin: 12px auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 13px; color: var(--muted); text-align: center; margin-top: 6px; }
.gallery-caption { font-size: 13px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .widget-area { margin-top: 46px; border-top: 3px solid var(--ink); padding-top: 26px; }
  .header-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .header-search { width: 100%; }
  .entry-title { font-size: 26px; }
  .news-title { font-size: 19px; }
}
