/*
Theme Name: SwiftBlog
Theme URI: https://example.com/swiftblog
Author: Your Name
Author URI: https://example.com
Description: SwiftBlog is a clean, fast-loading, SEO-friendly blogging theme with a classic-meets-modern design. Built-in ad spaces in the header and sidebar, a minimal widget set to keep pages light, and a modern social icons widget. Fully responsive and optimized for readability and speed.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: swiftblog
Tags: blog, one-column, two-columns, right-sidebar, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready, theme-options, sticky-post

SwiftBlog WordPress Theme is distributed under the terms of the GNU GPL.
*/

/* =========================================================
   0. CSS RESET / BASE
   ========================================================= */
:root {
  --sb-max-width: 1180px;
  --sb-accent: #2b6cb0;
  --sb-accent-dark: #1a4971;
  --sb-text: #222222;
  --sb-text-light: #5a5a5a;
  --sb-bg: #ffffff;
  --sb-bg-alt: #f7f7f8;
  --sb-border: #e6e6e6;
  --sb-radius: 6px;
  --sb-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sb-font-heading: Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

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

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

a { color: var(--sb-accent); text-decoration: none; }
a:hover, a:focus { color: var(--sb-accent-dark); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--sb-font-heading);
  line-height: 1.25;
  color: #111;
  margin: 1.2em 0 0.5em;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1.3em; }

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

blockquote {
  margin: 1.5em 0;
  padding: 0.6em 1.3em;
  border-left: 4px solid var(--sb-accent);
  background: var(--sb-bg-alt);
  font-style: italic;
  color: var(--sb-text-light);
}

code, pre {
  font-family: Consolas, Monaco, monospace;
  background: var(--sb-bg-alt);
  border-radius: 4px;
}
pre { padding: 1em; overflow-x: auto; }
code { padding: 0.15em 0.4em; }

table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
table th, table td { border: 1px solid var(--sb-border); padding: 0.6em 0.8em; text-align: left; }

hr { border: 0; border-top: 1px solid var(--sb-border); margin: 2em 0; }

.screen-reader-text {
  position: absolute !important;
  clip: rect(1px,1px,1px,1px);
  width: 1px; height: 1px; overflow: hidden;
}
.screen-reader-text:focus {
  position: static !important;
  width: auto; height: auto; clip: auto; display: block;
  background: #fff; padding: 10px; z-index: 999;
}

img.wp-smiley, img.emoji { display: inline-block !important; margin: 0 .07em !important; }

/* =========================================================
   1. LAYOUT
   ========================================================= */
.sb-container {
  max-width: var(--sb-max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.sb-site-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.sb-main-wrap { flex: 1; padding: 40px 0 60px; }

.sb-content-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: start;
}
.sb-content-layout.sb-no-sidebar { grid-template-columns: 1fr; }

@media (max-width: 880px) {
  .sb-content-layout { grid-template-columns: 1fr; }
}

/* =========================================================
   2. HEADER
   ========================================================= */
.sb-header {
  border-bottom: 1px solid var(--sb-border);
  background: var(--sb-bg);
}

.sb-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 22px 0 14px;
  gap: 16px;
}

.sb-site-branding { display: flex; align-items: center; gap: 14px; }
.sb-site-title {
  font-family: var(--sb-font-heading);
  font-size: 1.9rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.5px;
}
.sb-site-title a { color: #111; }
.sb-site-title a:hover { text-decoration: none; color: var(--sb-accent); }
.sb-site-description {
  font-size: 0.85rem;
  color: var(--sb-text-light);
  margin: 2px 0 0;
  font-family: var(--sb-font-body);
}
.sb-custom-logo img { max-height: 56px; width: auto; }

/* Header ad slot */
.sb-header-ad {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  text-align: center;
}
.sb-header-ad:empty { display: none; }
.sb-ad-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #aaa;
  text-align: center;
  margin-bottom: 4px;
}

/* Primary nav */
.sb-primary-nav {
  border-top: 1px solid var(--sb-border);
}
.sb-primary-nav .sb-container { display: flex; align-items: center; justify-content: space-between; }

.sb-nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.95rem;
}

.sb-menu {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}
.sb-menu li { position: relative; }
.sb-menu > li > a {
  display: block;
  padding: 13px 16px;
  color: var(--sb-text);
  font-size: 0.95rem;
  font-weight: 600;
}
.sb-menu > li > a:hover { color: var(--sb-accent); text-decoration: none; }

.sb-menu ul {
  list-style: none;
  position: absolute;
  top: 100%; left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  padding: 6px 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all .15s ease;
  z-index: 50;
}
.sb-menu li:hover > ul,
.sb-menu li:focus-within > ul { opacity: 1; visibility: visible; transform: translateY(0); }
.sb-menu ul li a { padding: 9px 16px; font-size: 0.9rem; font-weight: 500; }

@media (max-width: 880px) {
  .sb-nav-toggle { display: inline-flex; align-items: center; gap: 6px; }
  .sb-primary-nav .sb-container { flex-wrap: wrap; }
  .sb-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    padding-bottom: 10px;
  }
  .sb-menu.is-open { display: flex; }
  .sb-menu ul { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; padding-left: 14px; display: none; }
  .sb-menu li.sb-submenu-open > ul { display: block; }
}

/* =========================================================
   3. POSTS / ARCHIVE / SINGLE
   ========================================================= */
.sb-post-card {
  padding-bottom: 36px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--sb-border);
}
.sb-post-card:last-child { border-bottom: none; }

.sb-post-thumb { margin-bottom: 18px; border-radius: var(--sb-radius); overflow: hidden; }
.sb-post-thumb img { width: 100%; object-fit: cover; aspect-ratio: 16/9; transition: transform .3s ease; }
.sb-post-thumb a:hover img { transform: scale(1.02); }

.sb-post-title { font-size: 1.55rem; margin: 0 0 8px; }
.sb-post-title a { color: #111; }
.sb-post-title a:hover { color: var(--sb-accent); text-decoration: none; }

.sb-post-meta {
  font-size: 0.82rem;
  color: var(--sb-text-light);
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.sb-post-meta a { color: var(--sb-text-light); }
.sb-post-meta a:hover { color: var(--sb-accent); }

.sb-post-excerpt { color: #3a3a3a; }

.sb-readmore {
  display: inline-block;
  margin-top: 6px;
  font-weight: 600;
  font-size: 0.88rem;
}

.sb-category-badge {
  display: inline-block;
  background: var(--sb-bg-alt);
  color: var(--sb-accent-dark);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 10px;
}

/* Single post */
.sb-single-header { margin-bottom: 22px; }
.sb-single-title { font-size: 2.1rem; }
.sb-single-thumb { margin: 20px 0 30px; border-radius: var(--sb-radius); overflow: hidden; }
.sb-entry-content > * { max-width: 100%; }
.sb-tags { margin: 30px 0; font-size: 0.85rem; }
.sb-tags a {
  display: inline-block;
  background: var(--sb-bg-alt);
  padding: 4px 11px;
  border-radius: 20px;
  margin: 0 6px 6px 0;
  color: var(--sb-text-light);
  font-size: 0.8rem;
}

.sb-author-box {
  display: flex;
  gap: 16px;
  padding: 22px;
  background: var(--sb-bg-alt);
  border-radius: var(--sb-radius);
  margin: 34px 0;
}
.sb-author-box img { border-radius: 50%; width: 64px; height: 64px; }
.sb-author-box h3 { margin: 0 0 6px; font-size: 1rem; }
.sb-author-box p { margin: 0; font-size: 0.9rem; color: var(--sb-text-light); }

.sb-post-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 30px 0;
  padding-top: 20px;
  border-top: 1px solid var(--sb-border);
}
.sb-post-nav > div { max-width: 48%; }
.sb-post-nav span { display: block; font-size: 0.75rem; text-transform: uppercase; color: #999; margin-bottom: 4px; }
.sb-post-nav .sb-nav-next { text-align: right; margin-left: auto; }

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

/* =========================================================
   4. SIDEBAR / WIDGETS
   ========================================================= */
.sb-sidebar .widget {
  margin-bottom: 34px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--sb-border);
}
.sb-sidebar .widget:last-child { border-bottom: none; }
.sb-sidebar .widget-title {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 16px;
}
.sb-sidebar ul { list-style: none; padding: 0; margin: 0; }
.sb-sidebar ul li { padding: 7px 0; border-bottom: 1px dashed var(--sb-border); font-size: 0.92rem; }
.sb-sidebar ul li:last-child { border-bottom: none; }

/* Ad widget (sidebar + header) */
.sb-ad-widget { text-align: center; }
.sb-ad-widget .sb-ad-inner {
  background: var(--sb-bg-alt);
  border: 1px dashed var(--sb-border);
  border-radius: var(--sb-radius);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  overflow: hidden;
}

/* Social icons widget */
.sb-social-icons { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }
.sb-social-icons li { border: none; padding: 0; }
.sb-social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--sb-bg-alt);
  color: var(--sb-text);
  transition: all .2s ease;
}
.sb-social-icons a:hover { background: var(--sb-accent); color: #fff; text-decoration: none; transform: translateY(-2px); }
.sb-social-icons svg { width: 18px; height: 18px; fill: currentColor; }

/* =========================================================
   5. FOOTER
   ========================================================= */
.sb-footer {
  border-top: 1px solid var(--sb-border);
  background: var(--sb-bg-alt);
  padding: 44px 0 24px;
  margin-top: 40px;
}
.sb-footer-widgets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 34px;
  margin-bottom: 30px;
}
@media (max-width: 880px) {
  .sb-footer-widgets { grid-template-columns: 1fr; }
}
.sb-footer-widgets .widget-title { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 14px; }
.sb-footer-bottom {
  border-top: 1px solid var(--sb-border);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--sb-text-light);
}

/* =========================================================
   6. FORMS / COMMENTS / SEARCH
   ========================================================= */
input[type="text"], input[type="email"], input[type="url"], input[type="search"], textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius);
  font-family: inherit;
  font-size: 0.95rem;
}
input:focus, textarea:focus { outline: none; border-color: var(--sb-accent); }

button, input[type="submit"], .sb-btn {
  display: inline-block;
  background: var(--sb-accent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--sb-radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}
button:hover, input[type="submit"]:hover, .sb-btn:hover { background: var(--sb-accent-dark); color: #fff; }

.sb-search-form { display: flex; gap: 8px; }
.sb-search-form input[type="search"] { flex: 1; }

.comment-list { list-style: none; padding: 0; margin: 30px 0; }
.comment-list .children { list-style: none; padding-left: 30px; }
.comment-body { padding: 18px 0; border-bottom: 1px solid var(--sb-border); }
.comment-author img { border-radius: 50%; margin-right: 10px; vertical-align: middle; }
.comment-metadata { font-size: 0.8rem; color: var(--sb-text-light); }
.comment-reply-link { font-size: 0.8rem; font-weight: 600; }

/* =========================================================
   7. UTILITIES / ACCESSIBILITY / PRINT
   ========================================================= */
.sb-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

@media print {
  .sb-header, .sb-footer, .sb-sidebar, .sb-header-ad { display: none !important; }
}
