/*
Theme Name: TechExtreme Hub
Theme URI: https://techextreme.xyz
Author: Auto News Content Hub
Description: Premium editorial technology, IT, and AI news theme for TechExtreme.
Version: 1.5.0
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.1
Text Domain: techextreme-hub
*/

:root {
  --paper: #f7f5f0;
  --surface: #ffffff;
  --ink: #121212;
  --ink-soft: #2a2a2a;
  --muted: #5f6669;
  --line: rgba(18, 18, 18, 0.11);
  --line-strong: rgba(18, 18, 18, 0.2);
  --accent: #0d7a72;
  --accent-hover: #0a635d;
  --header: #0b111a;
  --header-line: rgba(255, 255, 255, 0.1);
  --header-text: #edf7f8;
  --header-muted: #a8bbc2;
  --max: 1240px;
  --article: 680px;
  --display: "Newsreader", "Noto Sans Thai", Georgia, "Times New Roman", serif;
  --sans: "Outfit", "Noto Sans Thai", "Segoe UI", Arial, sans-serif;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 72px;
  --shadow-sm: 0 4px 20px rgba(11, 17, 24, 0.06);
  --shadow-md: 0 12px 40px rgba(11, 17, 24, 0.1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(13, 122, 114, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(33, 214, 200, 0.06), transparent);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body.nav-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; height: auto; }
ul { margin: 0; padding: 0; list-style: none; }

.shell { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: 22px; padding-right: 22px; }
.section-pad { padding-top: var(--space-5); padding-bottom: var(--space-5); }
.section-pad--tight { padding-top: var(--space-3); padding-bottom: var(--space-4); }
.section-label {
  display: flex; align-items: center; gap: 8px; margin: 0 0 var(--space-3);
  font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent);
}
.section-label::before {
  content: ""; display: inline-block; width: 24px; height: 3px;
  background: linear-gradient(90deg, var(--accent), #21d6c8); border-radius: 2px;
}

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--header); color: var(--header-text); box-shadow: 0 1px 0 var(--header-line); }
.site-header::before {
  content: ""; display: block; height: 3px;
  background: linear-gradient(90deg, var(--accent), #21d6c8 55%, rgba(255,255,255,.15));
}
.utility-bar { border-bottom: 1px solid var(--header-line); font-size: 12px; color: var(--header-muted); }
.utility-bar-inner { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.utility-links { display: flex; gap: 16px; }
.utility-links a:hover { color: var(--header-text); }
.masthead { background: var(--header); }
.nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; position: relative; }
.brand { display: flex; align-items: center; flex-shrink: 0; min-width: 0; }
.brand-logo { display: block; height: 34px; width: auto; max-width: none; flex-shrink: 0; }
.nav-panel { display: flex; align-items: center; gap: 28px; flex: 1; justify-content: flex-end; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 14px; font-weight: 600; color: var(--header-muted); list-style: none; margin: 0; padding: 0; }
.nav-links li { margin: 0; padding: 0; }
.nav-links a:hover, .nav-links .current-menu-item > a { color: var(--header-text); background: rgba(255,255,255,.06); }
.header-search { display: flex; align-items: stretch; min-width: 220px; border: 1px solid var(--header-line); background: rgba(255,255,255,.04); }
.header-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--header-text);
  padding: 0 12px; font: inherit; font-size: 13px;
}
.header-search input::placeholder { color: var(--header-muted); }
.header-search button {
  border: 0; background: transparent; color: var(--header-muted); padding: 0 12px; cursor: pointer; font-size: 16px;
}
.header-search button:hover { color: var(--header-text); }
.nav-toggle {
  display: none; width: 44px; height: 44px; border: 1px solid var(--header-line); background: rgba(255,255,255,.04);
  padding: 10px; cursor: pointer; flex-direction: column; justify-content: center; gap: 5px;
}
.nav-toggle-bar { display: block; height: 2px; background: var(--header-text); transition: transform .2s ease, opacity .2s ease; }
body.nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Typography helpers */
.kicker {
  display: inline-block; margin-bottom: 12px; font-family: var(--sans); font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent);
}
.kicker--sm { margin-bottom: 8px; font-size: 10px; }
.story-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.story-byline--compact { margin-top: 10px; font-size: 12px; }
.story-byline--article { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.byline-name { font-weight: 600; color: var(--ink-soft); }
.byline-sep { opacity: 0.45; }
.text-link { display: inline-block; margin-top: 18px; font-weight: 700; color: var(--accent); border-bottom: 1px solid transparent; }
.text-link:hover { border-bottom-color: var(--accent); }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 14px;
  border-radius: var(--radius-sm);
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.button:hover { background: var(--paper); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.button--dark { background: var(--header); color: var(--header-text); border-color: var(--header); }
.button--dark:hover { background: #151d2a; }
.button--light { background: #fff; color: var(--header); border-color: #fff; }
.button--light:hover { background: #f0f0f0; }
.button--outline { background: transparent; }
.button--block { width: 100%; }

/* Homepage hero strip */
.home-hero-strip {
  padding: var(--space-4) 0;
  background: linear-gradient(135deg, rgba(11, 17, 24, 0.04) 0%, rgba(13, 122, 114, 0.1) 100%);
  border-bottom: 1px solid var(--line);
}
.home-hero-strip-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3);
}
.home-hero-eyebrow {
  margin: 0 0 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent);
}
.home-hero-heading {
  margin: 0; font-family: var(--display); font-size: clamp(20px, 3vw, 28px);
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
}
.topic-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.topic-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px;
  border-radius: 999px; font-size: 13px; font-weight: 700;
  border: 1px solid var(--line); background: var(--surface);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.topic-chip:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent);
}
.topic-chip--ai:hover { background: #f0f7ff; border-color: #4a6fa5; }
.topic-chip--tech:hover { background: #f0faf9; border-color: var(--accent); }
.topic-chip--security:hover { background: #fff8f0; border-color: #c97a2e; }
.topic-chip--business:hover { background: #f5f8ff; border-color: #5b6abf; }

/* Homepage lead */
.home-editorial { background: var(--paper); }
.home-lead { background: transparent; border-bottom: 1px solid var(--line); padding-top: var(--space-5); padding-bottom: var(--space-5); }
.lead-story {
  padding: var(--space-4); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.lead-story-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr); gap: var(--space-5); align-items: center; }
.lead-story-title {
  margin: 0; font-family: var(--display); font-size: clamp(36px, 5vw, 62px); line-height: 1.02; letter-spacing: -0.02em; font-weight: 600;
}
.lead-story-title a:hover { color: var(--accent); }
.lead-story-deck { margin: 18px 0 0; max-width: 54ch; font-size: clamp(18px, 2.2vw, 22px); line-height: 1.55; color: var(--ink-soft); }
.lead-story-media { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); aspect-ratio: 16 / 10; background: #e8ecef; }
.lead-story-media img { width: 100%; height: 100%; object-fit: cover; }
.media-placeholder { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #dce8ea, #b8d4d8 45%, #7fb8b0); }
.media-placeholder--lead { min-height: 320px; }

.top-stories-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.top-story {
  padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--surface); transition: transform .15s ease, box-shadow .15s ease;
}
.top-story:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.top-story-title { margin: 0; font-family: var(--display); font-size: clamp(22px, 2.5vw, 28px); line-height: 1.12; font-weight: 600; }
.top-story-title a:hover { color: var(--accent); }

.home-river-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-5); align-items: start; }
.story-river { display: grid; gap: 0; border-top: 1px solid var(--line); }
.river-item {
  display: grid; grid-template-columns: minmax(0, 1fr) 168px; gap: var(--space-3); align-items: start;
  padding: var(--space-4) 0; border-bottom: 1px solid var(--line);
}
.river-item-title { margin: 0; font-family: var(--display); font-size: clamp(24px, 2.8vw, 32px); line-height: 1.12; font-weight: 600; }
.river-item-title a:hover { color: var(--accent); }
.river-item-excerpt { margin: 10px 0 0; max-width: 62ch; color: var(--muted); font-size: 15px; line-height: 1.6; }
.river-item-thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #e8ecef; }
.river-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.home-more { margin-top: var(--space-4); }

.sidebar-panel { padding: var(--space-3); border: 1px solid var(--line); background: var(--surface); margin-bottom: var(--space-3); border-radius: var(--radius-md); }
.sidebar-panel--accent { background: linear-gradient(180deg, #eef8f7, var(--surface)); border-color: rgba(13,122,114,.18); }
.sidebar-title { margin: 0 0 12px; font-family: var(--display); font-size: 24px; font-weight: 600; }
.sidebar-panel p { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.topic-list { display: grid; gap: 0; }
.topic-list a {
  display: grid; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line); transition: color .15s ease;
}
.topic-list a:hover { color: var(--accent); }
.topic-list strong { font-size: 15px; }
.topic-list span { font-size: 13px; color: var(--muted); }

/* Post cards (archives) */
.grid { display: grid; gap: var(--space-3); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.post-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .15s ease, transform .15s ease; }
.post-card:hover { box-shadow: 0 8px 28px rgba(18,18,18,.06); transform: translateY(-2px); }
.post-card-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #e8ecef; }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.post-card-title { margin: 8px 0; font-family: var(--display); font-size: 22px; line-height: 1.18; font-weight: 600; }
.post-card-title a:hover { color: var(--accent); }
.post-card-excerpt { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.post-card-empty { min-height: 220px; justify-content: center; }

/* Article */
.article-shell { background: var(--surface); }
.article-header-inner { padding-top: var(--space-5); padding-bottom: var(--space-3); max-width: calc(var(--article) + 44px); }
.article-title {
  margin: 12px 0 0; max-width: 18ch; font-family: var(--display); font-size: clamp(38px, 5.5vw, 58px);
  line-height: 1.04; letter-spacing: -0.02em; font-weight: 600;
}
.article-lead { margin: 20px 0 0; max-width: 42ch; font-size: 21px; line-height: 1.55; color: var(--ink-soft); }
.article-hero { margin: 0 auto var(--space-4); max-width: var(--max); border: 1px solid var(--line); overflow: hidden; }
.article-layout { padding-bottom: var(--space-5); }
.article-main { max-width: var(--article); }
.article-body { font-family: var(--display); font-size: 20px; line-height: 1.75; color: var(--ink-soft); }
.article-body > *:first-child { margin-top: 0; }
.article-body p { margin: 0 0 1.25em; }
.article-body h2, .article-body h3 { font-family: var(--display); color: var(--ink); line-height: 1.2; }
.article-body h2 { margin: 1.8em 0 .65em; font-size: 30px; font-weight: 600; }
.article-body h3 { margin: 1.5em 0 .55em; font-size: 24px; font-weight: 600; }
.article-body ul, .article-body ol { margin: 0 0 1.25em 1.2em; padding: 0; }
.article-body li { margin-bottom: .45em; }
.article-body blockquote {
  margin: 1.6em 0; padding: 18px 22px; border-left: 3px solid var(--accent); background: rgba(13,122,114,.06);
  font-style: italic; color: var(--ink-soft);
}
.article-body img, .article-body figure { margin: 1.4em 0; }
.article-body img { border: 1px solid var(--line); }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.article-body .source-attribution, .article-attribution {
  margin: 2.2em 0 0; padding: 20px 22px; border: 1px solid var(--line); background: var(--paper); font-family: var(--sans); font-size: 15px;
}
.article-body .source-attribution h2, .article-attribution h2 { margin: 0 0 10px; font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.article-body .source-attribution p, .article-attribution p { margin: 0; color: var(--muted); line-height: 1.6; }
.article-body .source-attribution a, .article-attribution a { color: var(--accent); text-decoration: underline; }
.article-cta {
  margin-top: var(--space-4); padding: var(--space-3); border: 1px solid var(--line); background: var(--paper);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; font-family: var(--sans);
}
.article-cta h2 { margin: 0 0 6px; font-family: var(--display); font-size: 24px; font-weight: 600; }
.article-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.related-posts { margin-top: var(--space-5); padding-top: var(--space-3); border-top: 1px solid var(--line); font-family: var(--sans); }
.related-posts .section-head { margin-bottom: 18px; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.related-posts h2 { margin: 0; font-family: var(--display); font-size: 28px; font-weight: 600; }

/* Archives / pages */
.archive-page, .content { max-width: var(--max); margin: 0 auto; padding: var(--space-5) 22px var(--space-6); }
.archive-header h1, .content > h1 { margin: 0; font-family: var(--display); font-size: clamp(34px, 5vw, 52px); line-height: 1.06; font-weight: 600; }
.archive-description { margin: 12px 0 0; max-width: 720px; font-size: 18px; color: var(--muted); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-head h2 { margin: 0; font-family: var(--display); font-size: clamp(28px, 4vw, 42px); font-weight: 600; }
.muted { color: var(--muted); }
.archive-pagination { grid-column: 1 / -1; margin-top: 12px; }
.archive-pagination .nav-links, .archive-pagination .pagination { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.archive-pagination a, .archive-pagination span {
  display: inline-flex; min-height: 40px; align-items: center; padding: 0 14px; border: 1px solid var(--line); background: var(--surface); font-weight: 700;
}
.archive-pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }
.search-form { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.search-form input[type="search"] {
  flex: 1 1 240px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit;
}
.page-page { max-width: 820px; margin: 0 auto; padding: var(--space-5) 22px var(--space-6); background: var(--surface); min-height: 50vh; }
.page-title { margin: 0; font-family: var(--display); font-size: clamp(34px, 5vw, 52px); line-height: 1.08; font-weight: 600; }
.page-body { font-size: 18px; line-height: 1.8; color: var(--ink-soft); }
.page-body h2 { margin: 1.6em 0 .6em; font-family: var(--display); font-size: 26px; font-weight: 600; color: var(--ink); }
.page-body p { margin: 0 0 1.1em; }
.page-body ul { margin: 0 0 1.2em 1.2em; padding: 0; list-style: disc; }
.page-body li { margin-bottom: .45em; }
.page-body a { color: var(--accent); text-decoration: underline; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.error-page .article-cta { margin-top: 8px; }

/* Footer */
.site-footer { background: var(--header); color: var(--header-muted); margin-top: auto; }
.footer-briefing { border-bottom: 1px solid var(--header-line); }
.footer-briefing-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding-top: var(--space-4); padding-bottom: var(--space-4); }
.footer-briefing-title { margin: 0 0 8px; font-family: var(--display); font-size: 28px; color: var(--header-text); font-weight: 600; }
.footer-briefing p { margin: 0; max-width: 48ch; font-size: 14px; line-height: 1.6; }
.footer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); padding-top: var(--space-4); padding-bottom: var(--space-5); }
.footer-title { margin: 0 0 12px; color: var(--header-text); font-size: 14px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.footer-copyline, .footer-copy { margin: 0; font-size: 14px; line-height: 1.6; }
.footer-links { display: grid; gap: 8px; }
.footer-links a:hover { color: var(--header-text); }
.footer-copy { margin-top: 16px; font-size: 13px; }

@media (max-width: 1024px) {
  .lead-story-grid { grid-template-columns: 1fr; }
  .lead-story-media { order: -1; }
  .home-river-layout { grid-template-columns: 1fr; }
  .home-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
}

@media (max-width: 900px) {
  .grid.three, .top-stories-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .nav { min-height: 64px; }
  .home-hero-strip-inner { flex-direction: column; align-items: flex-start; }
  .lead-story { padding: var(--space-3); }
  .nav-toggle { display: inline-flex; }
  .nav-panel {
    display: none; position: fixed; inset: 98px 0 0 0; flex-direction: column; align-items: stretch; gap: 20px;
    padding: 20px 22px 32px; background: rgba(8, 13, 20, 0.98); border-top: 1px solid var(--header-line); overflow-y: auto; z-index: 40;
  }
  body.nav-open .nav-panel { display: flex; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 14px 0; border-bottom: 1px solid var(--header-line); font-size: 16px; }
  .header-search { min-width: 0; width: 100%; }
  .top-stories-grid, .grid.three, .home-sidebar { grid-template-columns: 1fr; }
  .river-item { grid-template-columns: 1fr; }
  .river-item-thumb { order: -1; max-width: 100%; }
  .article-title { max-width: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .section-head { display: block; }
  .section-head .muted { margin-top: 8px; }
}
