/*
Theme Name: iatricks
Theme URI: https://iatricks.win
Description: Dark minimal tech news theme for iatricks.win — AI & tech news, SEO optimized.
Version: 1.0.0
Author: iatricks
Text Domain: iatricks
*/

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --bg-base:      #0A0A0A;
  --bg-card:      #111111;
  --bg-card-hover:#161616;
  --border:       #1E1E1E;
  --border-hover: #2E2E2E;
  --text-primary: #F0F0F0;
  --text-muted:   #888888;
  --text-faint:   #555555;
  --accent:       #22D3EE;   /* cyan — tech/AI feel */
  --accent-dim:   rgba(34,211,238,.12);
  --red-tag:      #EF4444;
  --font-head:    'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --radius-card:  10px;
  --shadow-card:  0 1px 3px rgba(0,0,0,.6);
  --shadow-hover: 0 8px 24px rgba(0,0,0,.7);
  --max-w:        1200px;
  --nav-h:        64px;
  --transition:   200ms ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

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

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ============================================================
   LAYOUT
   ============================================================ */
.site { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(10,10,10,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  transition: color var(--transition);
}
.site-logo span { color: var(--accent); }
.site-logo:hover { color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 4px; }

.site-nav a {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}
.site-nav a:hover,
.site-nav a.current-menu-item {
  color: var(--text-primary);
  background: var(--border);
}

.nav-search {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-search {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
  cursor: pointer;
}
.btn-search:hover { color: var(--text-primary); background: var(--border); }
.btn-search svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* Mobile burger */
.nav-toggle { display: none; }
@media (max-width: 768px) {
  .site-nav { display: none; }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
    cursor: pointer;
  }
  .nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform var(--transition);
  }
}

/* ============================================================
   HERO — LATEST POST FEATURED
   ============================================================ */
.hero {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.hero-image {
  aspect-ratio: 16/9;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg-card);
}
.hero-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.hero-image:hover img { transform: scale(1.03); }

.hero-content { display: flex; flex-direction: column; gap: 16px; }

.post-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
}
.post-category::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(26px, 3.5vw, 42px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  transition: color var(--transition);
}
.hero-title:hover { color: var(--accent); }

.hero-excerpt {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-faint);
}
.post-meta time { color: var(--text-muted); }
.post-meta-dot { color: var(--border-hover); }

@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; gap: 24px; }
}

/* ============================================================
   AD BANNER ZONE
   ============================================================ */
.ad-zone {
  padding: 20px 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.ad-zone-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.ad-placeholder {
  display: inline-block;
  width: 100%;
  max-width: 728px;
  height: 90px;
  background: var(--bg-card);
  border: 1px dashed var(--border-hover);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 13px;
}

/* ============================================================
   MAIN LAYOUT — CONTENT + SIDEBAR
   ============================================================ */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  padding: 48px 0 64px;
}

@media (max-width: 1024px) {
  .main-layout { grid-template-columns: 1fr; }
  .site-sidebar { display: none; }
}

/* ============================================================
   SECTION TITLES
   ============================================================ */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.section-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.section-title span { color: var(--accent); }
.section-link {
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--transition);
}
.section-link:hover { color: var(--accent); }

/* ============================================================
   POST GRID — CARDS
   ============================================================ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

@media (max-width: 900px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .posts-grid { grid-template-columns: 1fr; }
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #111;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 350ms ease;
}
.post-card:hover .card-thumb img { transform: scale(1.05); }

.card-thumb-empty {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #111 0%, #1a1a1a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-thumb-empty svg { width: 32px; height: 32px; opacity: .15; }

.card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 10px; }

.card-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
}

.card-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  transition: color var(--transition);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card:hover .card-title { color: var(--accent); }

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

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-faint);
}
.card-read-time { display: flex; align-items: center; gap: 4px; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 0;
}
.pagination a,
.pagination .current {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.pagination a { color: var(--text-muted); }
.pagination a:hover { color: var(--text-primary); border-color: var(--border-hover); background: var(--bg-card); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.site-sidebar { display: flex; flex-direction: column; gap: 32px; }

.widget-block { border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; }
.widget-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.widget-body { padding: 18px; }

/* Sidebar ad */
.sidebar-ad {
  background: var(--bg-card);
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-card);
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--text-faint);
  font-size: 13px;
}

/* Trending list */
.trending-list { display: flex; flex-direction: column; gap: 0; }
.trending-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
  cursor: pointer;
}
.trending-item:last-child { border-bottom: none; padding-bottom: 0; }
.trending-item:hover .trending-title { color: var(--accent); }

.trending-num {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
  color: var(--border-hover);
  line-height: 1;
  flex-shrink: 0;
  width: 28px;
}
.trending-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.45;
  transition: color var(--transition);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.trending-date { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

/* Tags cloud */
.tags-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  color: var(--text-muted);
  transition: all var(--transition);
  cursor: pointer;
}
.tag-item:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ============================================================
   SINGLE POST
   ============================================================ */
.single-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  padding: 48px 0 64px;
}
@media (max-width: 1024px) {
  .single-layout { grid-template-columns: 1fr; }
}

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

.post-title {
  font-family: var(--font-head);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.post-info {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.post-featured-image {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 36px;
}
.post-featured-image img { width: 100%; height: 100%; object-fit: cover; }

/* Post content typography */
.post-content {
  font-size: 17px;
  line-height: 1.8;
  color: #D0D0D0;
  max-width: 720px;
}
.post-content h2 {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 40px 0 16px;
}
.post-content h3 {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 32px 0 12px;
}
.post-content p { margin-bottom: 20px; }
.post-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { opacity: .8; }
.post-content ul, .post-content ol { padding-left: 24px; margin-bottom: 20px; }
.post-content li { margin-bottom: 8px; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  margin: 28px 0;
  background: var(--bg-card);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--text-muted);
}
.post-content pre {
  background: #0D0D0D;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  overflow-x: auto;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.6;
}
.post-content code {
  font-family: 'Fira Code', monospace;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 14px;
}
.post-content img {
  width: 100%;
  border-radius: 8px;
  margin: 24px 0;
}

/* In-content ad */
.post-ad-mid {
  margin: 36px 0;
  padding: 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-card);
  text-align: center;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 13px;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

/* Related posts */
.related-posts { margin-top: 56px; }

/* ============================================================
   SEARCH BOX
   ============================================================ */
.search-form {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  transition: border-color var(--transition);
}
.search-form:focus-within { border-color: var(--accent); }
.search-input {
  flex: 1;
  background: none;
  border: none;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}
.search-input::placeholder { color: var(--text-faint); }
.search-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  background: var(--accent);
  color: #000;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: opacity var(--transition);
}
.search-submit:hover { opacity: .9; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand { display: flex; flex-direction: column; gap: 12px; }
.footer-desc { font-size: 14px; color: var(--text-muted); line-height: 1.7; max-width: 260px; }

.footer-col h4 {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 14px; color: var(--text-faint); transition: color var(--transition); }
.footer-links a:hover { color: var(--text-primary); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-faint);
  flex-wrap: wrap;
  gap: 8px;
}
.footer-bottom a { color: var(--accent); }
.footer-bottom a:hover { text-decoration: underline; }

/* ============================================================
   UTILITIES
   ============================================================ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.badge-hot { background: rgba(239,68,68,.1); border-color: var(--red-tag); color: var(--red-tag); }

/* ============================================================
   CATEGORY BADGES
   ============================================================ */
.cat-ia     { color: #22D3EE; }
.cat-tool   { color: #A78BFA; }
.cat-news   { color: #34D399; }
.cat-tuto   { color: #FBBF24; }
