/*
Theme Name: SmartCarDeals
Theme URI: https://smartcardeals.top
Author: SmartCarDeals
Author URI: https://smartcardeals.top
Description: News-style, no-sidebar theme for SmartCarDeals.top. Editable section titles, per-view content width, built-in SEO, No ads.
Version: 1.2.0
Requires at least: 6.0
Tested up to: 6.7
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: smartcardeals
Tags: blog, one-column, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, block-styles
*/

/* ============================================================
   CSS Variables
   ============================================================ */
:root {
  --scd-primary: #0e7a45;
  --scd-primary-dark: #0a5c34;
  --scd-accent: #1aa35a;
  --scd-dark: #0b3d28;
  --scd-darker: #072418;
  --scd-text: #2d2d2d;
  --scd-text-muted: #6c757d;
  --scd-bg: #f8f9fa;
  --scd-white: #ffffff;
  --scd-border: #e9ecef;
  --scd-radius: 10px;
  --scd-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --scd-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
  --scd-font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --scd-container: 1140px;
  --scd-header-h: 72px;
  --scd-topbar-h: 36px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

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

a {
  color: var(--scd-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--scd-primary-dark);
}

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

p {
  margin: 0 0 1.2em;
}

ul, ol {
  margin: 0 0 1.2em;
  padding-left: 1.4em;
}

/* ============================================================
   Layout helpers
   ============================================================ */
.scd-container {
  width: 100%;
  max-width: var(--scd-container);
  margin: 0 auto;
  padding: 0 20px;
}

.scd-site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.scd-main {
  flex: 1;
  padding: 32px 0 60px;
}

/* ============================================================
   Header & Navigation
   ============================================================ */
.scd-header {
  background: var(--scd-white);
  border-bottom: 3px solid var(--scd-primary);
  position: relative;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.scd-topbar {
  background: var(--scd-dark);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.75rem;
  letter-spacing: 0.01em;
}

.scd-topbar-inner {
  height: var(--scd-topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.scd-topbar-tag {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.8;
}

.scd-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--scd-header-h);
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 10px;
  padding-bottom: 0;
}

.scd-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.scd-logo img {
  height: 42px;
  width: auto;
}

.scd-logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--scd-dark);
  letter-spacing: -0.02em;
}

.scd-logo-text span {
  color: var(--scd-primary);
}

/* Primary Nav — dark news bar */
.scd-nav {
  flex: 1 1 100%;
  display: flex;
  align-items: stretch;
  background: var(--scd-dark);
  margin: 10px -20px 0;
  padding: 0 8px;
  overflow-x: auto;
}

.scd-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.scd-nav a {
  display: block;
  padding: 12px 16px;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  border-radius: 0;
  white-space: nowrap;
}

.scd-nav a:hover,
.scd-nav .current-menu-item > a,
.scd-nav .current-category-ancestor > a {
  background: var(--scd-primary);
  color: #fff;
}

/* Mobile toggle */
.scd-menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--scd-border);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--scd-dark);
  font-size: 1.25rem;
  line-height: 1;
}

.scd-menu-toggle:hover {
  background: var(--scd-bg);
}

/* ============================================================
   Featured Posts (Home)
   ============================================================ */
.scd-featured {
  margin-bottom: 48px;
}

.scd-section-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.scd-section-title::after {
  content: "";
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--scd-border), transparent);
}

.scd-featured-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
}

.scd-featured-main {
  position: relative;
  border-radius: var(--scd-radius);
  overflow: hidden;
  min-height: 380px;
  background: var(--scd-dark);
  box-shadow: var(--scd-shadow);
}

.scd-featured-main a {
  display: block;
  height: 100%;
  color: #fff;
}

.scd-featured-main .scd-thumb {
  position: absolute;
  inset: 0;
}

.scd-featured-main .scd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.scd-featured-main:hover .scd-thumb img {
  transform: scale(1.04);
}

.scd-featured-main .scd-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
}

.scd-featured-main .scd-cat {
  display: inline-block;
  background: var(--scd-accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
  width: fit-content;
}

.scd-featured-main h2 {
  color: #fff;
  font-size: 1.65rem;
  margin-bottom: 8px;
}

.scd-featured-main .scd-meta {
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
}

.scd-featured-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scd-featured-card {
  display: flex;
  gap: 16px;
  background: var(--scd-white);
  border-radius: var(--scd-radius);
  overflow: hidden;
  box-shadow: var(--scd-shadow);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  flex: 1;
}

.scd-featured-card:hover {
  box-shadow: var(--scd-shadow-hover);
  transform: translateY(-2px);
}

.scd-featured-card .scd-thumb {
  flex: 0 0 140px;
  overflow: hidden;
}

.scd-featured-card .scd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.scd-featured-card:hover .scd-thumb img {
  transform: scale(1.06);
}

.scd-featured-card .scd-body {
  padding: 14px 16px 14px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.scd-featured-card .scd-cat {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--scd-primary);
  margin-bottom: 4px;
}

.scd-featured-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.scd-featured-card .scd-meta {
  font-size: 0.8rem;
  color: var(--scd-text-muted);
}

/* ============================================================
   Post Grid (customizable)
   ============================================================ */
.scd-posts-grid {
  display: grid;
  grid-template-columns: repeat(var(--scd-grid-cols, 3), 1fr);
  gap: 28px;
}

.scd-post-card {
  background: var(--scd-white);
  border-radius: var(--scd-radius);
  overflow: hidden;
  box-shadow: var(--scd-shadow);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.scd-post-card:hover {
  box-shadow: var(--scd-shadow-hover);
  transform: translateY(-3px);
}

.scd-post-card .scd-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--scd-border);
}

.scd-post-card .scd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.scd-post-card:hover .scd-thumb img {
  transform: scale(1.05);
}

.scd-post-card .scd-cat-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--scd-primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 9px;
  border-radius: 4px;
}

.scd-post-card .scd-body {
  padding: 18px 20px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.scd-post-card h2,
.scd-post-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  flex: 1;
}

.scd-post-card h2 a,
.scd-post-card h3 a {
  color: var(--scd-dark);
}

.scd-post-card h2 a:hover,
.scd-post-card h3 a:hover {
  color: var(--scd-primary);
}

.scd-post-card .scd-excerpt {
  font-size: 0.9rem;
  color: var(--scd-text-muted);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.scd-post-card .scd-meta {
  font-size: 0.8rem;
  color: var(--scd-text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}

.scd-read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--scd-primary);
  margin-top: 8px;
}

.scd-read-more:hover {
  gap: 10px;
}

/* ============================================================
   Single Post
   ============================================================ */
.scd-single {
  max-width: 100%;
  margin: 0 auto;
}

.scd-single-header {
  margin-bottom: 28px;
}

.scd-single-header .scd-cat {
  display: inline-block;
  background: rgba(14, 122, 69, 0.1);
  color: var(--scd-primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.scd-single-header h1 {
  font-size: 2.1rem;
  margin-bottom: 12px;
}

.scd-single-meta {
  font-size: 0.9rem;
  color: var(--scd-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.scd-single-thumb {
  border-radius: var(--scd-radius);
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: var(--scd-shadow);
}

.scd-single-thumb img {
  width: 100%;
}

.scd-content {
  font-size: 1.05rem;
  line-height: 1.8;
}

.scd-content h2 {
  font-size: 1.45rem;
  margin-top: 1.8em;
}

.scd-content h3 {
  font-size: 1.2rem;
  margin-top: 1.5em;
}

.scd-content img {
  border-radius: 8px;
  margin: 1.5em 0;
}

.scd-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.scd-content blockquote {
  border-left: 4px solid var(--scd-primary);
  margin: 1.5em 0;
  padding: 12px 20px;
  background: rgba(14, 122, 69, 0.06);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--scd-text-muted);
}

.scd-tags {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--scd-border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.scd-tags a {
  background: var(--scd-bg);
  color: var(--scd-text);
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--scd-border);
}

.scd-tags a:hover {
  background: var(--scd-primary);
  color: #fff;
  border-color: var(--scd-primary);
}

/* ============================================================
   Archive / Category / Search
   ============================================================ */
.scd-archive-header {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--scd-border);
}

.scd-archive-header h1 {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.scd-archive-header .scd-desc {
  color: var(--scd-text-muted);
  font-size: 1rem;
}

/* ============================================================
   Pagination
   ============================================================ */
.scd-pagination {
  margin-top: 48px;
  display: flex;
  justify-content: center;
}

.scd-pagination .nav-links,
.scd-pagination ul.page-numbers {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.scd-pagination .nav-links > ul.page-numbers {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.scd-pagination li {
  margin: 0;
  padding: 0;
}

.scd-pagination a,
.scd-pagination .page-numbers,
.scd-pagination .current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--scd-white);
  color: var(--scd-dark);
  border: 1px solid var(--scd-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  text-decoration: none;
}

.scd-pagination a:hover,
.scd-pagination a.page-numbers:hover {
  background: var(--scd-primary);
  color: #fff;
  border-color: var(--scd-primary);
}

.scd-pagination .current,
.scd-pagination span.current {
  background: var(--scd-primary);
  color: #fff;
  border-color: var(--scd-primary);
}

/* ============================================================
   Footer
   ============================================================ */
.scd-footer {
  background: var(--scd-darker);
  color: rgba(255, 255, 255, 0.75);
  padding: 40px 0 28px;
  margin-top: auto;
}

.scd-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin-bottom: 24px;
  list-style: none;
  padding: 0;
}

.scd-footer-nav a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  font-weight: 500;
}

.scd-footer-nav a:hover {
  color: #fff;
}

.scd-footer-copy {
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
}

.scd-footer-copy a {
  color: rgba(255, 255, 255, 0.7);
}

.scd-footer-copy a:hover {
  color: #fff;
}

/* ============================================================
   Comments
   ============================================================ */
.scd-comments {
  max-width: 100%;
  margin: 48px auto 0;
  padding-top: 32px;
  border-top: 1px solid var(--scd-border);
}

.scd-comments h3 {
  font-size: 1.3rem;
  margin-bottom: 24px;
}

/* ============================================================
   404
   ============================================================ */
.scd-404 {
  text-align: center;
  padding: 80px 20px;
}

.scd-404 h1 {
  font-size: 4rem;
  color: var(--scd-primary);
  margin-bottom: 8px;
}

.scd-404 p {
  font-size: 1.15rem;
  color: var(--scd-text-muted);
  margin-bottom: 28px;
}

.scd-btn {
  display: inline-block;
  background: var(--scd-primary);
  color: #fff !important;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.scd-btn:hover {
  background: var(--scd-primary-dark);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .scd-featured-grid {
    grid-template-columns: 1fr;
  }

  .scd-featured-main {
    min-height: 300px;
  }

  .scd-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .scd-menu-toggle {
    display: block;
  }

  .scd-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    background: var(--scd-white);
    border-bottom: 1px solid var(--scd-border);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    padding: 12px 20px 20px;
    flex: none;
  }

  .scd-nav a {
    color: var(--scd-dark);
    text-transform: none;
  }

  .scd-nav.is-open {
    display: block;
  }

  .scd-nav ul {
    flex-direction: column;
    gap: 2px;
  }

  .scd-nav a {
    padding: 12px 14px;
  }

  .scd-posts-grid {
    grid-template-columns: 1fr;
  }

  .scd-featured-card .scd-thumb {
    flex: 0 0 110px;
  }

  .scd-single-header h1 {
    font-size: 1.6rem;
  }

  .scd-footer-nav {
    gap: 6px 14px;
  }
}

@media (max-width: 480px) {
  .scd-featured-main {
    min-height: 260px;
  }

  .scd-featured-main h2 {
    font-size: 1.3rem;
  }

  .scd-featured-card {
    flex-direction: column;
  }

  .scd-featured-card .scd-thumb {
    flex: none;
    height: 140px;
  }

  .scd-featured-card .scd-body {
    padding: 14px 16px;
  }
}

/* WordPress core alignment */
.alignwide,
.alignfull {
  margin-left: auto;
  margin-right: auto;
}

.wp-caption {
  max-width: 100%;
}

.wp-caption-text {
  font-size: 0.85rem;
  color: var(--scd-text-muted);
  text-align: center;
  margin-top: 6px;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* ============================================================
   News rails
   ============================================================ */
.scd-news-rails {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 32px;
  margin-bottom: 48px;
}

.scd-rail {
  background: var(--scd-white);
  border-radius: var(--scd-radius);
  box-shadow: var(--scd-shadow);
  padding: 18px 18px 8px;
  border-top: 3px solid var(--scd-primary);
}

.scd-rail .scd-section-title {
  font-size: 1.05rem;
  margin-bottom: 14px;
}

.scd-rail .scd-section-title a {
  color: var(--scd-dark);
}

.scd-rail .scd-section-title a:hover {
  color: var(--scd-primary);
}

.scd-rail-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--scd-border);
}

.scd-rail-item.is-lead {
  grid-template-columns: 1fr;
  border-top: 0;
  padding-top: 0;
}

.scd-rail-item .scd-thumb {
  display: block;
  overflow: hidden;
  border-radius: 6px;
  background: var(--scd-border);
  aspect-ratio: 16 / 10;
}

.scd-rail-item .scd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scd-rail-item h3 {
  font-size: 0.95rem;
  margin: 0 0 4px;
}

.scd-rail-item h3 a {
  color: var(--scd-dark);
}

.scd-rail-item h3 a:hover {
  color: var(--scd-primary);
}

.scd-rail-item.is-lead h3 {
  font-size: 1.15rem;
  margin-top: 10px;
}

.scd-rail-item .scd-meta {
  font-size: 0.75rem;
  color: var(--scd-text-muted);
}

.scd-section-title a {
  color: inherit;
}

/* Ads — reserved height reduces layout shift */
.scd-ad {
  margin: 28px 0 8px;
  min-height: 280px;
  background: #f3f4f6;
  border: 1px dashed var(--scd-border);
  border-radius: 8px;
  overflow: hidden;
}

.scd-ad-after {
  clear: both;
}

@media (max-width: 768px) {
  .scd-news-rails {
    grid-template-columns: 1fr;
  }

  .scd-topbar-tag {
    display: none;
  }
}

