/*
Theme Name: TinyTech
Theme URI: https://thetinytech.com
Author: The Tiny Tech
Author URI: https://thetinytech.com
Description: A custom dark tech blog theme for The Tiny Tech — yellow & dark, clean and fast.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
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: tinytech
Tags: blog, dark, technology, custom-header, featured-images, post-thumbnails
*/

/* ─── CSS RESET ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── VARIABLES ──────────────────────────────────────────────────────────── */
:root {
  --yellow:      #F5C518;
  --yellow-dark: #c49a0f;
  --dark:        #0D0D0D;
  --dark2:       #141414;
  --dark3:       #1C1C1C;
  --dark4:       #242424;
  --muted:       #888888;
  --lighter:     #aaaaaa;
  --white:       #f5f5f0;
  --card-border: rgba(245, 197, 24, 0.15);
  --font-main:   'Space Grotesk', sans-serif;
  --font-display:'Syne', sans-serif;
}

/* ─── BASE ───────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--dark);
  color: var(--white);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* ─── TYPOGRAPHY ─────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--white);
  letter-spacing: -0.3px;
}

/* ─── HEADER ─────────────────────────────────────────────────────────────── */
#site-header {
  background: var(--dark2);
  border-bottom: 1px solid rgba(245, 197, 24, 0.2);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo img {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.site-logo .logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--white);
  letter-spacing: -0.3px;
}

.site-logo .logo-text span { color: var(--yellow); }

/* Nav */
#main-nav { display: flex; align-items: center; gap: 4px; }

#main-nav a {
  color: var(--lighter);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s;
}

#main-nav a:hover,
#main-nav .current-menu-item > a,
#main-nav .current_page_item > a { color: var(--yellow); background: transparent; }

/* Header right */
.header-right { display: flex; align-items: center; gap: 10px; }

.header-search {
  display: flex;
  align-items: center;
  background: var(--dark3);
  border: 1px solid var(--dark4);
  border-radius: 8px;
  padding: 0 12px;
  height: 36px;
  gap: 8px;
  transition: border-color 0.15s;
}

.header-search:focus-within { border-color: rgba(245,197,24,0.4); }

.header-search svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  flex-shrink: 0;
}

.header-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--white);
  font-family: var(--font-main);
  font-size: 13px;
  width: 150px;
}

.header-search input::placeholder { color: var(--muted); }

.btn-subscribe {
  background: var(--yellow);
  color: var(--dark);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 13px;
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  height: 36px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background 0.15s;
}

.btn-subscribe:hover { background: #e8b800; color: var(--dark); }

/* Mobile toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--dark4);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--lighter);
}

/* ─── SECTION LABELS ─────────────────────────────────────────────────────── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--yellow);
  margin-bottom: 24px;
}

.section-label::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--yellow);
  border-radius: 2px;
}

/* ─── FEATURED / HERO SECTION ────────────────────────────────────────────── */
.featured-section {
  max-width: 1100px;
  margin: 48px auto 0;
  padding: 0 24px;
}

.featured-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  margin-bottom: 60px;
}

/* Main featured card */
.featured-main {
  background: var(--dark3);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  display: block;
  transition: border-color 0.2s, transform 0.2s;
}

.featured-main:hover {
  border-color: rgba(245,197,24,0.4);
  transform: translateY(-2px);
}

.featured-main .post-thumb {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.featured-main .post-thumb-placeholder {
  width: 100%;
  height: 240px;
  background: linear-gradient(135deg, #1a0a2e, #2d1b69);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: rgba(180,130,255,0.2);
}

.feat-body { padding: 20px 22px 22px; }

.post-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--yellow);
  background: rgba(245,197,24,0.1);
  border-radius: 4px;
  padding: 3px 8px;
  margin-bottom: 10px;
  text-decoration: none;
}

.feat-title {
  font-size: 22px;
  color: var(--white);
  margin-bottom: 10px;
}

.feat-excerpt {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.feat-date { display: flex; align-items: center; gap: 5px; }

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--yellow);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.read-more-link {
  color: var(--yellow);
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
}

/* Side small cards */
.featured-side { display: flex; flex-direction: column; gap: 16px; }

.card-sm {
  background: var(--dark3);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex: 1;
  transition: border-color 0.2s, transform 0.2s;
  min-height: 100px;
}

.card-sm:hover {
  border-color: rgba(245,197,24,0.35);
  transform: translateY(-2px);
}

.card-sm-thumb {
  width: 100px;
  flex-shrink: 0;
  object-fit: cover;
}

.card-sm-thumb-placeholder {
  width: 100px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #0a1628, #0c3060);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: rgba(80,160,255,0.25);
}

.card-sm-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.card-sm-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
}

.card-sm-date { font-size: 11px; color: var(--muted); }

/* ─── POSTS GRID SECTION ─────────────────────────────────────────────────── */
.posts-section {
  max-width: 1100px;
  margin: 0 auto 80px;
  padding: 0 24px;
}

.posts-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Post card */
.post-card {
  background: var(--dark3);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  display: block;
  transition: border-color 0.2s, transform 0.2s;
}

.post-card:hover {
  border-color: rgba(245,197,24,0.35);
  transform: translateY(-3px);
}

.post-card-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.post-card-thumb-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, #1a0a2e, #2d1b69);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: rgba(180,130,255,0.15);
}

.post-card-body { padding: 16px 18px 18px; }

.post-card-title {
  font-size: 15px;
  color: var(--white);
  line-height: 1.35;
  margin-bottom: 8px;
}

.post-card-excerpt {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.post-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* ─── SINGLE POST ────────────────────────────────────────────────────────── */
.single-post-wrap {
  max-width: 780px;
  margin: 48px auto 80px;
  padding: 0 24px;
}

.single-post-header { margin-bottom: 32px; }

.single-post-header .post-tag { margin-bottom: 14px; }

.single-post-title {
  font-size: 36px;
  line-height: 1.2;
  margin-bottom: 16px;
}

.single-post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

.single-post-thumb {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 40px;
  display: block;
}

.post-content {
  font-size: 17px;
  line-height: 1.8;
  color: #d0d0c8;
}

.post-content h2, .post-content h3 { margin: 36px 0 16px; color: var(--white); }
.post-content p { margin-bottom: 20px; }
.post-content a { color: var(--yellow); text-decoration: underline; }
.post-content ul, .post-content ol { margin: 0 0 20px 24px; }
.post-content li { margin-bottom: 8px; }
.post-content blockquote { border-left: 3px solid var(--yellow); padding: 16px 20px; margin: 28px 0; background: var(--dark3); border-radius: 0 8px 8px 0; font-style: italic; color: var(--lighter); }
.post-content code { background: var(--dark3); padding: 2px 6px; border-radius: 4px; font-size: 14px; color: var(--yellow); }
.post-content pre { background: var(--dark3); border: 1px solid var(--dark4); padding: 20px; border-radius: 10px; overflow-x: auto; margin-bottom: 24px; }
.post-content img { border-radius: 10px; margin: 24px 0; }

/* ─── PAGINATION ─────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 0 60px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--dark4);
  background: var(--dark3);
  color: var(--lighter);
  text-decoration: none;
  transition: all 0.15s;
}

.pagination a:hover { border-color: rgba(245,197,24,0.3); color: var(--yellow); }
.pagination .current { background: var(--yellow); color: var(--dark); border-color: var(--yellow); font-weight: 700; }

/* ─── SIDEBAR ────────────────────────────────────────────────────────────── */
.content-sidebar-wrap {
  max-width: 1100px;
  margin: 0 auto 80px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
}

.widget {
  background: var(--dark3);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
}

.widget-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--lighter);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.widget ul { list-style: none; }
.widget ul li { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { font-size: 14px; color: var(--muted); text-decoration: none; transition: color 0.15s; }
.widget ul li a:hover { color: var(--yellow); }

/* ─── FOOTER ─────────────────────────────────────────────────────────────── */
#site-footer {
  background: var(--dark2);
  border-top: 1px solid rgba(245,197,24,0.15);
  padding: 52px 24px 28px;
}

.footer-inner { max-width: 1100px; margin: 0 auto; }

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .site-logo { margin-bottom: 12px; }
.footer-brand p { font-size: 13px; color: var(--muted); line-height: 1.65; max-width: 240px; }

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--lighter);
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col ul li a { font-size: 13px; color: var(--muted); text-decoration: none; transition: color 0.15s; }
.footer-col ul li a:hover { color: var(--yellow); }

.footer-newsletter p { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 12px; }

.newsletter-form { display: flex; gap: 8px; }
.newsletter-form input {
  flex: 1;
  background: var(--dark3);
  border: 1px solid var(--dark4);
  border-radius: 8px;
  padding: 0 12px;
  height: 36px;
  color: var(--white);
  font-family: var(--font-main);
  font-size: 13px;
  outline: none;
  min-width: 0;
  transition: border-color 0.15s;
}
.newsletter-form input:focus { border-color: rgba(245,197,24,0.4); }
.newsletter-form input::placeholder { color: var(--muted); }
.newsletter-form button {
  background: var(--yellow);
  color: var(--dark);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 12px;
  border: none;
  border-radius: 8px;
  padding: 0 14px;
  height: 36px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.newsletter-form button:hover { background: #e8b800; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom a { color: var(--muted); text-decoration: none; transition: color 0.15s; }
.footer-bottom a:hover { color: var(--yellow); }

.social-links { display: flex; gap: 10px; }

.social-link {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--dark3);
  border: 1px solid var(--dark4);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: border-color 0.15s;
}

.social-link:hover { border-color: rgba(245,197,24,0.3); }
.social-link svg { width: 14px; height: 14px; fill: var(--muted); transition: fill 0.15s; }
.social-link:hover svg { fill: var(--yellow); }

/* ─── NO RESULTS / 404 ───────────────────────────────────────────────────── */
.no-results {
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
}
.no-results h2 { font-size: 28px; margin-bottom: 12px; color: var(--white); }

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .featured-grid { grid-template-columns: 1fr; }
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .content-sidebar-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  #main-nav { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--dark2); padding: 12px 24px 20px; border-bottom: 1px solid rgba(245,197,24,0.15); }
  #main-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .header-search { display: none; }
  .posts-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .single-post-title { font-size: 26px; }
  .single-post-thumb { height: 240px; }
}
