/* =================================================================
   TECHEARTHS THEME — main.css v2.0
   Edit :root variables to customize colors, fonts, layout
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=Nunito+Sans:wght@300;400;600;700&display=swap&font-display=swap');

:root {
  --c-accent:       #0057ff;
  --c-accent-dark:  #003db3;
  --c-accent-light: #e8efff;
  --c-orange:       #f04e23;
  --c-green:        #0a8a4f;
  --c-purple:       #6d28d9;
  --c-bg:           #f8fafc;
  --c-surface:      #ffffff;
  --c-surface2:     #f1f5f9;
  --c-border:       #e2e8f0;
  --c-text:         #0f172a;
  --c-text-muted:   #64748b;
  --font-head:      'Syne', sans-serif;
  --font-body:      'Nunito Sans', sans-serif;
  --max-w:          1200px;
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      14px;
  --topbar-bg:      #0057ff;
  --header-bg:      #ffffff;
  --logo-color1:    #0f172a;
  --logo-color2:    #0057ff;
  --logo-dot:       #f04e23;
  --footer-bg:      #0f172a;
  --footer-accent:  #60a5fa;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.08);
  --shadow-hover:   0 8px 24px rgba(0,0,0,0.10);
}

/* ─── BASE ─── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--c-bg); color: var(--c-text); line-height: 1.65; font-size: 15px; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; transition: color .2s; }
button { font-family: var(--font-body); cursor: pointer; border: none; }
ul { list-style: none; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* ─── TOPBAR TICKER ─── */
.topbar { background: var(--topbar-bg); overflow: hidden; padding: 6px 0; }
.topbar-track { display: flex; width: max-content; animation: ticker 40s linear infinite; }
.topbar-track:hover { animation-play-state: paused; }
.topbar-item { display: flex; align-items: center; gap: 20px; padding: 0 32px; font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase; color: #fff; white-space: nowrap; }
.topbar-item .dot { width: 5px; height: 5px; background: rgba(255,255,255,.4); border-radius: 50%; flex-shrink: 0; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ─── HEADER ─── */
.site-header { background: var(--header-bg); border-bottom: 1px solid var(--c-border); position: sticky; top: 0; z-index: 900; box-shadow: var(--shadow-sm); }
.header-logo-row { display: flex; align-items: center; justify-content: center; padding: 20px 20px 16px; position: relative; }
.site-logo { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; }
.logo-mark { font-family: var(--font-head); font-size: 36px; font-weight: 800; letter-spacing: -2px; line-height: 1; display: flex; align-items: center; gap: 2px; }
.logo-mark .lt { color: var(--logo-color1); }
.logo-mark .le { color: var(--logo-color2); }
.logo-mark .ld { width: 9px; height: 9px; background: var(--logo-dot); border-radius: 50%; margin-bottom: 6px; margin-left: 1px; flex-shrink: 0; }
.logo-sub { font-family: var(--font-body); font-size: 10px; font-weight: 600; letter-spacing: 4px; text-transform: uppercase; color: var(--c-text-muted); }
.header-search-btn { position: absolute; left: 20px; display: flex; align-items: center; gap: 8px; background: var(--c-surface2); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 8px 14px; color: var(--c-text-muted); font-size: 13px; font-weight: 600; transition: all .2s; }
.header-search-btn:hover { border-color: var(--c-accent); color: var(--c-accent); }
.header-search-btn svg { width: 15px; height: 15px; }
.search-kbd { font-size: 10px; background: var(--c-surface2); border: 1px solid var(--c-border); border-radius: 3px; padding: 1px 5px; color: var(--c-text-muted); }
.header-sub-btn { position: absolute; right: 20px; background: var(--c-accent); color: #fff; border-radius: var(--radius-sm); padding: 8px 18px; font-size: 13px; font-weight: 700; transition: background .2s; }
.header-sub-btn:hover { background: var(--c-accent-dark); }

/* ─── NAV ─── */
.primary-nav { border-top: 1px solid var(--c-border); }
.primary-nav ul { display: flex; justify-content: center; align-items: center; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.primary-nav ul::-webkit-scrollbar { display: none; }
.primary-nav ul li a { display: block; padding: 11px 16px; font-family: var(--font-head); font-size: 13px; font-weight: 700; color: var(--c-text-muted); border-bottom: 2px solid transparent; white-space: nowrap; transition: all .2s; }
.primary-nav ul li a:hover,
.primary-nav ul li a.current-menu-item,
.primary-nav ul li a.active { color: var(--c-accent); border-bottom-color: var(--c-accent); }

/* ─── SEARCH OVERLAY ─── */
.search-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 9999; backdrop-filter: blur(4px); }
.search-overlay.open { display: flex; align-items: flex-start; justify-content: center; padding-top: 80px; }
.search-box { background: var(--c-surface); border-radius: var(--radius-lg); width: min(640px, 94vw); overflow: hidden; box-shadow: var(--shadow-hover); }
.search-input-row { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--c-border); }
.search-input-row svg { width: 18px; height: 18px; color: var(--c-text-muted); flex-shrink: 0; }
.search-input-row input { flex: 1; border: none; outline: none; font-family: var(--font-body); font-size: 16px; color: var(--c-text); background: transparent; }
.search-input-row input::placeholder { color: var(--c-text-muted); }
.search-close { background: var(--c-surface2); border: 1px solid var(--c-border); border-radius: 5px; padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--c-text-muted); cursor: pointer; }
.search-results-list { padding: 8px 0; max-height: 340px; overflow-y: auto; }
.search-hit { display: flex; align-items: center; gap: 14px; padding: 12px 20px; cursor: pointer; transition: background .15s; }
.search-hit:hover { background: var(--c-surface2); }
.search-hit-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 11px; font-weight: 700; flex-shrink: 0; }
.hi-blue { background: #e8efff; color: #0057ff; }
.hi-orange { background: #fff1ed; color: #f04e23; }
.hi-green { background: #e6f5ee; color: #0a8a4f; }
.hi-purple { background: #f0ebff; color: #6d28d9; }
.search-hit-title { font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--c-text); }
.search-hit-sub { font-size: 11px; color: var(--c-text-muted); margin-top: 2px; }
.search-hint { padding: 12px 20px; border-top: 1px solid var(--c-border); font-size: 12px; color: var(--c-text-muted); }

/* ─── HERO ─── */
.hero { padding: 28px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 20px; }
.hero-main { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: box-shadow .2s; }
.hero-main:hover { box-shadow: var(--shadow-hover); }
.hero-img { width: 100%; aspect-ratio: 16/9; background: linear-gradient(135deg,#c8d4e8,#dde5f0); position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }
.hero-img-ph { font-family: var(--font-head); font-size: 72px; font-weight: 800; color: rgba(255,255,255,.35); letter-spacing: -3px; user-select: none; }
.hero-top-badge { position: absolute; top: 14px; left: 14px; font-family: var(--font-head); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; background: var(--c-accent); color: #fff; padding: 4px 11px; border-radius: 4px; }
.hero-body { padding: 24px 28px 28px; }
.hero-cat { font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--c-accent); margin-bottom: 10px; }
.hero-title { font-family: var(--font-head); font-size: 26px; font-weight: 800; line-height: 1.22; letter-spacing: -.5px; color: var(--c-text); margin-bottom: 12px; }
.hero-title a:hover { color: var(--c-accent); }
.hero-excerpt { font-size: 15px; color: var(--c-text-muted); line-height: 1.7; margin-bottom: 18px; }
.hero-footer { display: flex; align-items: center; justify-content: space-between; }
.hero-meta { font-size: 12px; color: var(--c-text-muted); }
.read-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--c-accent); color: #fff; font-family: var(--font-head); font-size: 12px; font-weight: 700; padding: 9px 18px; border-radius: var(--radius-sm); transition: background .2s; }
.read-btn:hover { background: var(--c-accent-dark); color: #fff; }
.hero-side { display: flex; flex-direction: column; gap: 14px; }
.side-card { display: flex; gap: 14px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: 14px; box-shadow: var(--shadow-sm); transition: all .2s; }
.side-card:hover { border-color: var(--c-accent); box-shadow: var(--shadow-hover); transform: translateX(3px); }
.side-thumb { width: 90px; height: 78px; background: linear-gradient(135deg,#dde5f0,#c8d4e8); border-radius: var(--radius-sm); flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.side-thumb img { width: 100%; height: 100%; object-fit: cover; }
.side-thumb-ph { font-family: var(--font-head); font-size: 18px; font-weight: 800; color: rgba(100,116,139,.4); }
.side-body { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.side-cat { font-family: var(--font-head); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--c-accent); }
.side-title { font-family: var(--font-head); font-size: 14px; font-weight: 700; line-height: 1.35; color: var(--c-text); }
.side-title:hover { color: var(--c-accent); }
.side-date { font-size: 11px; color: var(--c-text-muted); }

/* ─── CATEGORY SECTIONS ─── */
.cat-section { margin-bottom: 50px; }
.cat-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--c-border); padding-bottom: 10px; margin-bottom: 22px; position: relative; }
.cat-header::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 80px; height: 2px; background: var(--cat-bar, var(--c-accent)); }
.cat-name { font-family: var(--font-head); font-size: 20px; font-weight: 800; letter-spacing: -.5px; color: var(--c-text); display: flex; align-items: center; gap: 10px; }
.cat-name-bar { width: 4px; height: 22px; border-radius: 2px; background: var(--cat-bar, var(--c-accent)); flex-shrink: 0; }
.cat-more { font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--cat-bar, var(--c-accent)); display: flex; align-items: center; gap: 4px; transition: gap .2s; }
.cat-more:hover { gap: 8px; }
.cat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
.cat-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); overflow: hidden; display: flex; flex-direction: column; transition: all .2s; box-shadow: var(--shadow-sm); }
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: transparent; }
.cat-card-img { aspect-ratio: 16/9; background: linear-gradient(135deg,#dde5f0,#c8d4e8); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cat-card-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-img-ph { font-family: var(--font-head); font-size: 28px; font-weight: 800; color: rgba(100,116,139,.28); }
.cat-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cat-card-date { font-size: 11px; color: var(--c-text-muted); }
.cat-card-title { font-family: var(--font-head); font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--c-text); }
.cat-card-title a:hover { color: var(--c-accent); }
.cat-card-excerpt { font-size: 13px; color: var(--c-text-muted); line-height: 1.6; margin-top: 4px; }

/* ─── NEWSLETTER ─── */
.nl-strip { background: var(--c-accent); padding: 40px 0; margin-bottom: 50px; position: relative; overflow: hidden; }
.nl-strip::before { content: ''; position: absolute; right: -80px; top: -80px; width: 300px; height: 300px; border-radius: 50%; background: rgba(255,255,255,.07); }
.nl-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; position: relative; z-index: 1; }
.nl-label { font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: rgba(255,255,255,.6); margin-bottom: 6px; }
.nl-headline { font-family: var(--font-head); font-size: 24px; font-weight: 800; color: #fff; letter-spacing: -.5px; line-height: 1.2; }
.nl-sub { font-size: 14px; color: rgba(255,255,255,.72); margin-top: 6px; }
.nl-form { display: flex; gap: 8px; flex-shrink: 0; }
.nl-input { background: rgba(255,255,255,.15); border: 1.5px solid rgba(255,255,255,.25); border-radius: var(--radius-sm); padding: 11px 18px; font-family: var(--font-body); font-size: 14px; color: #fff; width: 230px; outline: none; }
.nl-input:focus { border-color: rgba(255,255,255,.6); }
.nl-input::placeholder { color: rgba(255,255,255,.5); }
.nl-btn { background: #fff; color: var(--c-accent); border-radius: var(--radius-sm); padding: 11px 24px; font-family: var(--font-head); font-size: 13px; font-weight: 800; transition: all .2s; }
.nl-btn:hover { background: #f0f4ff; }

/* ─── FOOTER ─── */
.site-footer { background: var(--footer-bg); border-top: 4px solid var(--c-accent); }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 48px; padding: 52px 0 48px; align-items: start; }
.ft-col { display: flex; flex-direction: column; }
.ft-col-label { font-family: var(--font-head); font-size: 10px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: rgba(255,255,255,.28); border-bottom: 1px solid rgba(255,255,255,.07); padding-bottom: 12px; margin-bottom: 18px; }
.ft-logo { font-family: var(--font-head); font-size: 26px; font-weight: 800; letter-spacing: -1.5px; color: #fff; margin-bottom: 4px; display: flex; align-items: center; gap: 2px; }
.ft-logo .le { color: var(--footer-accent); }
.ft-logo .ld { width: 7px; height: 7px; background: var(--logo-dot); border-radius: 50%; margin-bottom: 4px; flex-shrink: 0; }
.ft-tagline { font-size: 10px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: rgba(255,255,255,.22); margin-bottom: 16px; }
.ft-about { font-size: 13px; line-height: 1.8; color: rgba(255,255,255,.45); flex: 1; }
.ft-social { display: flex; gap: 8px; margin-top: 20px; }
.ft-soc-btn { width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 11px; font-weight: 700; color: rgba(255,255,255,.35); background: transparent; transition: all .2s; cursor: pointer; }
.ft-soc-btn:hover { border-color: var(--footer-accent); color: var(--footer-accent); }
.ft-posts { display: flex; flex-direction: column; flex: 1; }
.ft-post { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,.05); cursor: pointer; }
.ft-post:last-child { border-bottom: none; }
.ft-post-num { font-family: var(--font-head); font-size: 20px; font-weight: 800; color: rgba(255,255,255,.1); line-height: 1.2; min-width: 26px; flex-shrink: 0; }
.ft-post-title { font-family: var(--font-head); font-size: 13px; font-weight: 700; color: rgba(255,255,255,.65); line-height: 1.5; transition: color .2s; }
.ft-post:hover .ft-post-title { color: var(--footer-accent); }
.ft-pages { display: flex; flex-direction: column; flex: 1; }
.ft-page-link { display: flex; align-items: center; gap: 10px; padding: 13px 10px; border-radius: 6px; font-family: var(--font-body); font-size: 13px; font-weight: 600; color: rgba(255,255,255,.5); transition: all .2s; border-bottom: 1px solid rgba(255,255,255,.04); }
.ft-page-link:last-child { border-bottom: none; }
.ft-page-link:hover { background: rgba(255,255,255,.05); color: #fff; padding-left: 16px; }
.ft-page-arr { font-size: 13px; color: rgba(255,255,255,.18); transition: color .2s; flex-shrink: 0; }
.ft-page-link:hover .ft-page-arr { color: var(--footer-accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.06); padding: 18px 0; text-align: center; }
.footer-copy { font-family: var(--font-body); font-size: 13px; color: rgba(255,255,255,.22); }
.footer-copy strong { color: rgba(255,255,255,.38); font-weight: 700; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
  .cat-grid { grid-template-columns: repeat(2,1fr); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { display: grid; grid-template-columns: repeat(2,1fr); }
  .footer-cols { grid-template-columns: 1fr; gap: 32px; padding: 36px 0 28px; }
}
@media (max-width: 768px) {
  .logo-mark { font-size: 28px; }
  .header-search-btn .search-kbd { display: none; }
  .hero-title { font-size: 20px; }
  .nl-inner { flex-direction: column; text-align: center; }
  .nl-form { flex-direction: column; width: 100%; }
  .nl-input { width: 100%; }
  .cat-grid { grid-template-columns: repeat(2,1fr); }
  .hero-side { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .cat-grid { grid-template-columns: 1fr; }
  .hero-body { padding: 18px; }
  .hero-title { font-size: 18px; }
}
