/*
Theme Name: Tech Theme
Theme URI: https://softgeek.co.uk/
Author: Raj
Author URI: https://softgeek.co.uk/
Description: A free, lightweight WordPress theme built for tech news, cybersecurity, and software review sites. Features a hero ticker, category badges, a trending numbered grid, a "Most Read" sidebar widget, and a multi-column footer. Fast, translation-ready, and built without a page builder dependency.
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: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tech-theme
Tags: blog, news, one-column, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, theme-options
*/

/* =========================================================
   0. CSS VARIABLES / THEME TOKENS
   ========================================================= */
:root {
  --tt-bg: #ffffff;
  --tt-bg-alt: #f7f8fa;
  --tt-text: #16181d;
  --tt-text-muted: #5b6270;
  --tt-border: #e6e8ec;
  --tt-accent: #2f6fed;
  --tt-accent-dark: #1c4fc7;
  --tt-accent-contrast: #ffffff;
  --tt-dark: #0e1116;
  --tt-radius: 10px;
  --tt-max-width: 1200px;
  --tt-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --tt-font-head: Georgia, "Times New Roman", serif;
}

/* =========================================================
   1. RESET / BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--tt-bg);
  color: var(--tt-text);
  font-family: var(--tt-font-body);
  font-size: 16px;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--tt-accent); text-decoration: none; }
a:hover { color: var(--tt-accent-dark); text-decoration: underline; }
ul, ol { padding-left: 1.2em; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--tt-font-head);
  line-height: 1.25;
  margin: 0 0 .5em;
  font-weight: 700;
}
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
  white-space: nowrap;
}
.container {
  max-width: var(--tt-max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================================================
   2. TOP TICKER
   ========================================================= */
.tt-ticker {
  background: var(--tt-dark);
  color: #cfd6e4;
  font-size: 13px;
}
.tt-ticker .container {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 34px;
  overflow: hidden;
}
.tt-ticker-label {
  color: #8b94a7;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 11px;
}
.tt-ticker-items {
  display: flex;
  gap: 28px;
  white-space: nowrap;
}
.tt-ticker-items a { color: #cfd6e4; }
.tt-ticker-items a:hover { color: #fff; }

/* =========================================================
   3. SITE HEADER
   ========================================================= */
.site-header {
  border-bottom: 1px solid var(--tt-border);
  background: var(--tt-bg);
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: 20px;
  flex-wrap: wrap;
}
.site-branding { display: flex; flex-direction: column; }
.site-title {
  margin: 0;
  font-size: 26px;
  letter-spacing: -.01em;
}
.site-title a { color: var(--tt-text); }
.site-title a:hover { text-decoration: none; color: var(--tt-accent); }
.site-description {
  font-family: var(--tt-font-body);
  font-size: 13px;
  color: var(--tt-text-muted);
  margin-top: 2px;
}
.custom-logo-link img { max-height: 48px; width: auto; }

.primary-nav-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
}
.primary-menu {
  display: flex;
  list-style: none;
  margin: 0; padding: 0;
  gap: 22px;
  flex-wrap: wrap;
}
.primary-menu li { position: relative; }
.primary-menu a {
  color: var(--tt-text);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.primary-menu a:hover { color: var(--tt-accent); text-decoration: none; }
.primary-menu ul {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  background: var(--tt-bg);
  border: 1px solid var(--tt-border);
  border-radius: 8px;
  padding: 8px 0;
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  z-index: 50;
}
.primary-menu li:hover > ul { display: block; }
.primary-menu ul li { display: block; }
.primary-menu ul a {
  display: block;
  padding: 8px 16px;
  text-transform: none;
  font-weight: 500;
}

.tt-search-toggle {
  background: none;
  border: 1px solid var(--tt-border);
  border-radius: 50%;
  width: 38px; height: 38px;
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.tt-search-toggle:hover { border-color: var(--tt-accent); color: var(--tt-accent); }
.tt-header-search {
  display: none;
  padding: 14px 0;
  border-top: 1px solid var(--tt-border);
}
.tt-header-search.is-open { display: block; }
.tt-header-search .search-field {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--tt-border);
  border-radius: var(--tt-radius);
  font-size: 15px;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--tt-border);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
}

/* =========================================================
   4. CATEGORY BADGES
   ========================================================= */
.tt-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--tt-bg-alt);
  color: var(--tt-accent-dark);
  border: 1px solid var(--tt-border);
}
.tt-badge:hover { background: var(--tt-accent); color: #fff; text-decoration: none; border-color: var(--tt-accent); }

/* =========================================================
   5. HERO / FEATURED
   ========================================================= */
.tt-hero {
  padding: 32px 0 8px;
}
.tt-hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
}
.tt-hero-featured { position: relative; }
.tt-hero-featured img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--tt-radius);
}
.tt-hero-featured .tt-badge { margin-bottom: 10px; }
.tt-hero-featured h1, .tt-hero-featured h2 {
  font-size: 30px;
  margin: 12px 0 8px;
}
.tt-hero-excerpt { color: var(--tt-text-muted); font-size: 15px; }
.tt-meta {
  font-size: 12px;
  color: var(--tt-text-muted);
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}
.tt-hero-secondary {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.tt-hero-secondary article {
  display: flex;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--tt-border);
}
.tt-hero-secondary article:last-child { border-bottom: none; }
.tt-hero-secondary img {
  width: 96px; height: 72px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.tt-hero-secondary h3 { font-size: 15px; margin: 0 0 4px; }

/* =========================================================
   6. TRENDING NUMBERED GRID
   ========================================================= */
.tt-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 40px 0 18px;
}
.tt-section-heading h2 {
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-left: 4px solid var(--tt-accent);
  padding-left: 10px;
  margin: 0;
}
.tt-section-heading a { font-size: 13px; font-weight: 600; }

.tt-trending-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.tt-trending-card { position: relative; }
.tt-trending-card .tt-num {
  font-family: var(--tt-font-head);
  font-size: 13px;
  color: var(--tt-text-muted);
  display: block;
  margin-bottom: 8px;
}
.tt-trending-card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: var(--tt-radius);
  margin-bottom: 10px;
}
.tt-trending-card h3 { font-size: 16px; margin: 0 0 6px; }
.tt-trending-card p { color: var(--tt-text-muted); font-size: 13px; margin: 0; }

/* =========================================================
   7. CONTENT + SIDEBAR LAYOUT
   ========================================================= */
.tt-layout {
  display: grid;
  grid-template-columns: 2.1fr 1fr;
  gap: 40px;
  padding: 20px 0 50px;
}
.tt-post-list article {
  display: flex;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--tt-border);
}
.tt-post-list img {
  width: 220px; height: 140px;
  object-fit: cover;
  border-radius: var(--tt-radius);
  flex-shrink: 0;
}
.tt-post-list h2 { font-size: 20px; margin: 6px 0 8px; }
.tt-post-list .excerpt { color: var(--tt-text-muted); font-size: 14.5px; }

.tt-pagination {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.tt-pagination a, .tt-pagination span {
  padding: 8px 14px;
  border: 1px solid var(--tt-border);
  border-radius: 6px;
  font-size: 13px;
}
.tt-pagination .current { background: var(--tt-accent); color: #fff; border-color: var(--tt-accent); }

/* Sidebar */
.widget {
  margin-bottom: 34px;
  background: var(--tt-bg-alt);
  border: 1px solid var(--tt-border);
  border-radius: var(--tt-radius);
  padding: 22px;
}
.widget-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--tt-text-muted);
  margin: 0 0 16px;
}
.tt-mostread { list-style: none; margin: 0; padding: 0; }
.tt-mostread li {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--tt-border);
}
.tt-mostread li:last-child { border-bottom: none; padding-bottom: 0; }
.tt-mostread .num {
  font-family: var(--tt-font-head);
  font-size: 20px;
  color: var(--tt-border);
  font-weight: 700;
  flex-shrink: 0;
  width: 24px;
}
.tt-mostread h4 { font-size: 14px; margin: 0 0 4px; }
.tt-mostread .tt-meta { margin-top: 0; }

.tt-newsletter { background: var(--tt-dark); color: #fff; text-align: center; }
.tt-newsletter .widget-title { color: #cfd6e4; }
.tt-newsletter p { font-size: 13px; color: #b7bfd0; margin: 0 0 14px; }
.tt-newsletter .tt-btn { width: 100%; }

.tt-btn {
  display: inline-block;
  background: var(--tt-accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-align: center;
}
.tt-btn:hover { background: var(--tt-accent-dark); color: #fff; text-decoration: none; }

/* =========================================================
   8. SINGLE POST
   ========================================================= */
.single .entry-header { padding: 30px 0 10px; }
.single .entry-title { font-size: 34px; }
.single .entry-thumbnail img {
  width: 100%;
  border-radius: var(--tt-radius);
  margin: 16px 0 24px;
}
.entry-content { font-size: 17px; }
.entry-content p { margin: 0 0 1.2em; }
.entry-content h2 { font-size: 24px; margin-top: 1.4em; }
.entry-content h3 { font-size: 20px; margin-top: 1.2em; }
.entry-content img { border-radius: 8px; margin: 1em 0; }
.entry-content blockquote {
  border-left: 4px solid var(--tt-accent);
  margin: 1.5em 0;
  padding: 4px 0 4px 18px;
  color: var(--tt-text-muted);
  font-style: italic;
}
.entry-content pre {
  background: var(--tt-dark);
  color: #e6e8ec;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
}
.entry-footer {
  margin: 30px 0;
  padding: 18px 0;
  border-top: 1px solid var(--tt-border);
  border-bottom: 1px solid var(--tt-border);
  font-size: 13px;
  color: var(--tt-text-muted);
}
.entry-tags a { margin-right: 8px; }

.author-box {
  display: flex;
  gap: 16px;
  background: var(--tt-bg-alt);
  border: 1px solid var(--tt-border);
  border-radius: var(--tt-radius);
  padding: 20px;
  margin: 30px 0;
}
.author-box img { width: 64px; height: 64px; border-radius: 50%; }
.author-box h3 { font-size: 15px; margin: 0 0 6px; }
.author-box p { font-size: 13.5px; color: var(--tt-text-muted); margin: 0; }

/* Comments */
.comments-area { margin-top: 40px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-body {
  border: 1px solid var(--tt-border);
  border-radius: var(--tt-radius);
  padding: 18px;
  margin-bottom: 16px;
}
.comment-list .children { list-style: none; margin: 0 0 0 30px; padding: 0; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--tt-border);
  border-radius: 8px;
  margin-bottom: 14px;
  font-family: inherit;
  font-size: 15px;
}

/* =========================================================
   9. FOOTER
   ========================================================= */
.site-footer {
  background: var(--tt-dark);
  color: #b7bfd0;
  margin-top: 40px;
}
.footer-widgets {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 30px;
  padding: 50px 0 30px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-widgets .widget {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
}
.footer-widgets .widget-title { color: #fff; font-size: 13px; }
.footer-widgets ul { list-style: none; margin: 0; padding: 0; }
.footer-widgets li { margin-bottom: 10px; font-size: 14px; }
.footer-widgets a { color: #b7bfd0; }
.footer-widgets a:hover { color: #fff; }
.footer-about p { font-size: 14px; line-height: 1.7; }
.footer-social { display: flex; gap: 10px; margin-top: 14px; }
.footer-social a {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.site-info {
  padding: 18px 0;
  text-align: center;
  font-size: 13px;
  color: #7c8499;
}

/* =========================================================
   10. RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .tt-hero-grid { grid-template-columns: 1fr; }
  .tt-trending-grid { grid-template-columns: repeat(2, 1fr); }
  .tt-layout { grid-template-columns: 1fr; }
  .footer-widgets { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .primary-nav-wrap .primary-menu { display: none; }
  .menu-toggle { display: block; }
  .primary-nav-wrap.is-open .primary-menu {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
  }
  .primary-nav-wrap.is-open .primary-menu li { width: 100%; border-bottom: 1px solid var(--tt-border); }
  .primary-nav-wrap.is-open .primary-menu a { display: block; padding: 12px 0; }
  .tt-trending-grid { grid-template-columns: 1fr; }
  .tt-post-list article { flex-direction: column; }
  .tt-post-list img { width: 100%; height: 200px; }
  .footer-widgets { grid-template-columns: 1fr; }
  .single .entry-title { font-size: 26px; }
}
