/*
Theme Name: Sparkpro Blog
Theme URI: https://sparkprocreatives.com
Author: Sparkpro Creatives
Author URI: https://sparkprocreatives.com
Description: Magazine-style blog theme for Sparkpro Creatives — hero post, numbered latest list, category tiles, sidebar widgets, and footer columns, built in the Sparkpro brand system (blue accent, Space Grotesk/Inter typography, no dark backgrounds).
Version: 1.0
Requires at least: 5.9
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: sparkpro-blog
*/

:root {
  --sp-blue: #27A6DC;
  --sp-blue-dark: #1E86B4;
  --sp-text: #1B1F27;
  --sp-text-muted: #5B6472;
  --sp-bg: #FFFFFF;
  --sp-bg-alt: #F5F8FA;
  --sp-border: #E4E9ED;
  --sp-font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --sp-font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sp-font-body);
  color: var(--sp-text);
  background: var(--sp-bg);
  line-height: 1.65;
  font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--sp-font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--sp-text);
  margin: 0 0 0.6em;
}

a { color: var(--sp-blue); text-decoration: none; }
a:hover { color: var(--sp-blue-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul { padding-left: 0; }

.sp-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.sp-section-title {
  font-size: 1.4rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sp-section-title .sp-view-all { font-size: 0.85rem; font-weight: 600; }

/* ---------- Header ---------- */
.sp-site-header {
  border-bottom: 1px solid var(--sp-border);
  padding: 18px 0;
  background: var(--sp-bg);
  position: sticky;
  top: 0;
  z-index: 50;
}
.sp-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.sp-site-branding { display: flex; flex-direction: column; }
.sp-site-title { font-size: 1.5rem; margin: 0; }
.sp-site-title a { color: var(--sp-text); }
.sp-site-title a:hover { color: var(--sp-blue); text-decoration: none; }
.sp-site-description { font-size: 0.85rem; color: var(--sp-text-muted); margin-top: 2px; }

.sp-nav ul { list-style: none; display: flex; gap: 24px; margin: 0; padding: 0; flex-wrap: wrap; }
.sp-nav a { color: var(--sp-text); font-weight: 500; font-size: 0.92rem; }
.sp-nav a:hover { color: var(--sp-blue); text-decoration: none; }

.sp-header-actions { display: flex; align-items: center; gap: 14px; }
.sp-header-search-form { display: flex; align-items: center; }
.sp-header-search-form input[type="search"] {
  border: 1px solid var(--sp-border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-family: var(--sp-font-body);
  width: 160px;
}
.sp-header-search-form input[type="search"]:focus { outline: none; border-color: var(--sp-blue); }
.sp-header-search-form button { display: none; }

.sp-cta-button {
  display: inline-block;
  background: var(--sp-blue);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
}
.sp-cta-button:hover { background: var(--sp-blue-dark); color: #fff; text-decoration: none; }

/* ---------- Category badges ---------- */
.sp-cat-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.sp-cat-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sp-blue);
  background: rgba(39, 166, 220, 0.1);
  padding: 4px 10px;
  border-radius: 999px;
}
.sp-cat-badge:hover { text-decoration: none; background: rgba(39, 166, 220, 0.18); }

.sp-post-meta {
  font-size: 0.82rem;
  color: var(--sp-text-muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.sp-post-meta a { color: var(--sp-text-muted); }
.sp-post-meta a:hover { color: var(--sp-blue); }
.sp-post-meta .dot::before { content: "\2022"; margin-right: 10px; color: var(--sp-border); }

/* ---------- Hero ---------- */
.sp-hero { padding: 32px 0 8px; }
.sp-hero-post {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  background: var(--sp-bg-alt);
}
.sp-hero-post img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sp-hero-post::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 14, 20, 0.82) 0%, rgba(10, 14, 20, 0.25) 55%, transparent 100%);
}
.sp-hero-content { position: relative; z-index: 2; padding: 32px; max-width: 720px; }
.sp-hero-content .sp-cat-badge { background: rgba(255,255,255,0.16); color: #fff; }
.sp-hero-content h1, .sp-hero-content h2 { color: #fff; font-size: 2rem; margin-bottom: 12px; }
.sp-hero-content .sp-post-meta { color: rgba(255,255,255,0.85); }
.sp-hero-content .sp-post-meta a { color: rgba(255,255,255,0.85); }

/* ---------- Numbered latest list ---------- */
.sp-latest-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  padding: 28px 0 8px;
  list-style: none;
  margin: 0;
}
.sp-latest-item { display: flex; gap: 14px; align-items: flex-start; }
.sp-latest-num {
  font-family: var(--sp-font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--sp-border);
  line-height: 1;
  min-width: 28px;
}
.sp-latest-item h3 { font-size: 0.98rem; margin-bottom: 6px; }
.sp-latest-item h3 a { color: var(--sp-text); }
.sp-latest-item h3 a:hover { color: var(--sp-blue); text-decoration: none; }

/* ---------- Category tiles ---------- */
.sp-categories { padding: 40px 0 8px; }
.sp-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.sp-cat-tile {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  height: 140px;
  display: flex;
  align-items: flex-end;
  background: var(--sp-blue);
}
.sp-cat-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.55; }
.sp-cat-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,14,20,0.75), transparent 70%); }
.sp-cat-tile-content { position: relative; z-index: 2; padding: 16px; color: #fff; }
.sp-cat-tile-content a { color: #fff; }
.sp-cat-tile-content h3 { font-size: 1.05rem; margin-bottom: 2px; }
.sp-cat-tile-content span { font-size: 0.78rem; opacity: 0.85; }

/* ---------- Main layout: grid + sidebar ---------- */
.sp-content-layout {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 44px;
  padding: 44px 0 60px;
  align-items: start;
}

.sp-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}

.sp-post-card {
  border: 1px solid var(--sp-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--sp-bg);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.sp-post-card:hover { box-shadow: 0 8px 24px rgba(27, 31, 39, 0.08); transform: translateY(-2px); }
.sp-post-card-thumb { width: 100%; aspect-ratio: 4 / 3; background: var(--sp-bg-alt); overflow: hidden; }
.sp-post-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sp-post-card-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.sp-post-card-title { font-size: 1.08rem; margin: 8px 0; }
.sp-post-card-title a { color: var(--sp-text); }
.sp-post-card-title a:hover { color: var(--sp-blue); text-decoration: none; }
.sp-post-card-excerpt { color: var(--sp-text-muted); font-size: 0.9rem; flex: 1; margin-bottom: 12px; }

/* ---------- Sidebar ---------- */
.sp-sidebar { display: flex; flex-direction: column; gap: 36px; }
.sp-widget { border: 1px solid var(--sp-border); border-radius: 10px; padding: 20px; }
.sp-widget h2, .sp-widget h4 { font-size: 1rem; margin-bottom: 16px; }
.sp-widget ul { list-style: none; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.sp-widget-post { display: flex; gap: 10px; align-items: flex-start; }
.sp-widget-post-thumb { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: var(--sp-bg-alt); }
.sp-widget-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sp-widget-post h5 { font-size: 0.86rem; margin: 0 0 4px; line-height: 1.35; }
.sp-widget-post h5 a { color: var(--sp-text); }
.sp-widget-post h5 a:hover { color: var(--sp-blue); text-decoration: none; }
.sp-widget-post-date { font-size: 0.75rem; color: var(--sp-text-muted); }

.sp-social-list { display: flex; flex-wrap: wrap; gap: 10px; }
.sp-social-list a {
  border: 1px solid var(--sp-border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sp-text);
}
.sp-social-list a:hover { border-color: var(--sp-blue); color: var(--sp-blue); text-decoration: none; }

.sp-cat-list a { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--sp-text); }
.sp-cat-list a:hover { color: var(--sp-blue); text-decoration: none; }
.sp-cat-list span { color: var(--sp-text-muted); }

/* ---------- Pagination ---------- */
.sp-pagination { display: flex; gap: 10px; padding-top: 20px; flex-wrap: wrap; }
.sp-pagination a, .sp-pagination span {
  border: 1px solid var(--sp-border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.88rem;
  color: var(--sp-text);
}
.sp-pagination .current { background: var(--sp-blue); color: #fff; border-color: var(--sp-blue); }
.sp-pagination a:hover { border-color: var(--sp-blue); color: var(--sp-blue); text-decoration: none; }

/* ---------- Single post ---------- */
.sp-single-post { padding: 44px 0 20px; }
.sp-single-post h1 { font-size: 2.1rem; margin-bottom: 16px; }
.sp-single-thumb { border-radius: 12px; overflow: hidden; margin-bottom: 32px; aspect-ratio: 16/9; }
.sp-single-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sp-single-post .entry-content { max-width: 760px; }
.sp-single-post .entry-content p { margin-bottom: 1.3em; }
.sp-single-post .entry-content h2, .sp-single-post .entry-content h3 { margin-top: 1.6em; }
.sp-back-link { display: inline-block; margin-bottom: 20px; font-size: 0.88rem; font-weight: 600; }

/* ---------- Footer ---------- */
.sp-site-footer { background: var(--sp-bg-alt); border-top: 1px solid var(--sp-border); margin-top: 30px; }
.sp-footer-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  padding: 48px 0;
}
.sp-footer-columns h2, .sp-footer-columns h4 { font-size: 0.98rem; margin-bottom: 16px; }
.sp-footer-bar {
  border-top: 1px solid var(--sp-border);
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--sp-text-muted);
}
.sp-footer-bar a { color: var(--sp-text-muted); }
.sp-footer-bar a:hover { color: var(--sp-blue); }
.sp-footer-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sp-footer-gallery img { border-radius: 6px; aspect-ratio: 1/1; object-fit: cover; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sp-content-layout { grid-template-columns: 1fr; }
  .sp-hero-post { min-height: 320px; }
}
@media (max-width: 640px) {
  .sp-header-inner { flex-direction: column; align-items: flex-start; }
  .sp-header-search-form input[type="search"] { width: 130px; }
  .sp-hero-content h1, .sp-hero-content h2 { font-size: 1.5rem; }
  .sp-single-post h1 { font-size: 1.6rem; }
}
