/*
Theme Name: hubyverse
Theme URI: https://huby.ai
Author: huby
Author URI: https://huby.ai
Description: Official theme for hubyverse — the huby blog. Independent AI evaluation, clean and purposeful design.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hubyverse
Tags: blog, minimal, orange-accent
*/

/* ============================================================
   hubyverse Theme — Main Stylesheet
   Brand: white header + #F07820 orange + #2A2D35 footer
   Fonts: Sora (headings) + Inter (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;1,400&family=Sora:wght@400;600;700&display=swap');

/* ── TOKENS ───────────────────────────────────────────────── */
:root {
  --h-header-bg:    #FFFFFF;
  --h-header-border:#E2E4ED;
  --h-footer-bg:    #2A2D35;
  --h-footer-border:#383D4A;
  --h-orange:       #F07820;
  --h-orange-light: rgba(240,120,32,0.12);
  --h-orange-glow:  rgba(240,120,32,0.06);
  --h-silver:       #E8EAF0;
  --h-silver-2:     #9DA3B4;
  --h-text:         #1E2130;
  --h-text-muted:   #6B7082;
  --h-heading:      #1E2130;
  --h-surface:      #F4F5F9;
  --h-surface-2:    #EDEEF5;
  --h-border:       #E2E4ED;
  --h-white:        #FFFFFF;
  --h-font-body:    'Inter', system-ui, -apple-system, sans-serif;
  --h-font-head:    'Sora', 'Inter', sans-serif;
  --h-radius:       10px;
  --h-radius-lg:    16px;
  --h-max-width:    1140px;
  --h-content-width:780px;
}

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

body {
  font-family: var(--h-font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--h-text);
  background: var(--h-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--h-orange); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.75; }
ul, ol { list-style: none; }

/* ── TYPOGRAPHY ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--h-font-head);
  color: var(--h-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(26px, 4vw, 40px); }
h2 { font-size: clamp(20px, 3vw, 28px); margin-top: 2em; }
h3 { font-size: 20px; margin-top: 1.75em; }
h4 { font-size: 17px; font-weight: 600; }

p { margin-bottom: 1.4em; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; color: var(--h-heading); }
em { font-style: italic; }

/* ── LAYOUT ───────────────────────────────────────────────── */
.site { display: flex; flex-direction: column; min-height: 100vh; }
.site-content { flex: 1; }

.content-area {
  max-width: var(--h-content-width);
  margin: 0 auto;
  padding: 56px 24px 80px;
}

/* ── HEADER ───────────────────────────────────────────────── */
.site-header {
  background: var(--h-header-bg);
  border-bottom: 1px solid var(--h-header-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 12px rgba(0,0,0,0.07);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  max-width: var(--h-max-width);
  margin: 0 auto;
  padding: 0 32px;
}

.site-logo { display: flex; align-items: center; flex-shrink: 0; }

.header-logo-img { height: 38px; width: auto; display: block; }

.text-logo {
  font-family: var(--h-font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--h-heading);
  letter-spacing: -0.02em;
}

/* ── NAV ──────────────────────────────────────────────────── */
.site-nav ul { display: flex; align-items: center; gap: 4px; }

.site-nav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--h-text-muted);
  padding: 8px 14px;
  border-radius: var(--h-radius);
  transition: color 0.15s, background 0.15s;
  display: block;
  white-space: nowrap;
}

.site-nav a:hover { color: var(--h-text); background: var(--h-surface); opacity: 1; }
.site-nav .current-menu-item a,
.site-nav .current_page_item a { color: var(--h-orange); background: var(--h-orange-light); }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--h-border);
  color: var(--h-text-muted);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--h-font-body);
  padding: 8px 14px;
  border-radius: var(--h-radius);
  cursor: pointer;
}

/* ── HERO ─────────────────────────────────────────────────── */
.home-hero {
  background: #2A2D35;
  padding: 72px 32px 64px;
  position: relative;
  overflow: hidden;
}

.home-hero::before {
  content: "";
  position: absolute;
  top: -80px; right: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(240,120,32,0.18) 0%, transparent 65%);
  pointer-events: none;
}

.home-hero::after {
  content: "";
  position: absolute;
  bottom: -60px; left: 10%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(240,120,32,0.08) 0%, transparent 65%);
  pointer-events: none;
}

.hero-inner {
  max-width: var(--h-content-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--h-orange);
  background: var(--h-orange-light);
  border: 1px solid rgba(240,120,32,0.25);
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.hero-title {
  font-family: var(--h-font-head);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  color: var(--h-white);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero-title em { color: var(--h-orange); font-style: italic; }

.hero-desc {
  font-size: 17px;
  color: var(--h-silver-2);
  line-height: 1.7;
  max-width: 540px;
  margin-bottom: 0;
}

/* ── POST LIST ────────────────────────────────────────────── */
.posts-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--h-border);
}

.posts-header h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--h-text-muted);
  margin: 0;
}

.post-card {
  background: var(--h-white);
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius-lg);
  padding: 36px;
  margin-bottom: 20px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.post-card::before {
  content: "";
  display: block;
  width: 36px;
  height: 3px;
  background: var(--h-orange);
  border-radius: 2px;
  margin-bottom: 18px;
}

.post-card:hover {
  border-color: var(--h-orange);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(240,120,32,0.1);
}

.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.post-card-meta time {
  font-size: 12px;
  font-weight: 500;
  color: var(--h-text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.post-card-title {
  font-family: var(--h-font-head);
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 700;
  color: var(--h-heading);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.post-card-title a { color: var(--h-heading); text-decoration: none; }
.post-card-title a:hover { color: var(--h-orange); opacity: 1; }

.post-card-excerpt {
  font-size: 15px;
  color: var(--h-text-muted);
  line-height: 1.75;
  margin-bottom: 20px;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.read-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--h-orange);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.read-more::after { content: "→"; }
.read-more:hover { opacity: 0.7; }

/* ── BADGES ───────────────────────────────────────────────── */
.cat-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--h-orange-light);
  color: var(--h-orange);
  border: 1px solid rgba(240,120,32,0.2);
}
.cat-badge:hover { background: rgba(240,120,32,0.2); opacity: 1; }
.tags-list { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── SINGLE POST ──────────────────────────────────────────── */
.single-post-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--h-border);
}

.single-post-title {
  font-family: var(--h-font-head);
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  color: var(--h-heading);
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.post-content {
  background: var(--h-white);
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius-lg);
  padding: 48px;
}

.post-content p { font-size: 16px; line-height: 1.85; color: var(--h-text); }
.post-content h2, .post-content h3, .post-content h4 { margin-top: 2em; margin-bottom: 0.75em; }
.post-content a { text-decoration: underline; text-underline-offset: 3px; }
.post-content ul, .post-content ol { padding-left: 1.5em; margin-bottom: 1.5em; list-style: revert; }
.post-content li { margin-bottom: 0.5em; }
.post-content > p:first-of-type { font-size: 18px; line-height: 1.7; color: var(--h-text-muted); }

.post-content blockquote {
  border-left: 3px solid var(--h-orange);
  background: var(--h-orange-glow);
  margin: 2em 0;
  padding: 1.25em 1.75em;
  border-radius: 0 var(--h-radius) var(--h-radius) 0;
  font-style: italic;
  font-size: 17px;
}
.post-content blockquote p { margin: 0; color: var(--h-heading); }

.post-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  background: var(--h-surface-2);
  border: 1px solid var(--h-border);
  border-radius: 4px;
  padding: 2px 7px;
  color: var(--h-heading);
}

.post-content pre {
  background: #2A2D35;
  border-radius: var(--h-radius);
  padding: 1.5em;
  overflow-x: auto;
  margin: 1.75em 0;
}
.post-content pre code { background: none; border: none; color: var(--h-silver); padding: 0; font-size: 13px; line-height: 1.7; }

/* Post nav */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; }
.post-nav-item { background: var(--h-white); border: 1px solid var(--h-border); border-radius: var(--h-radius); padding: 20px; transition: border-color 0.15s; display: block; }
.post-nav-item:hover { border-color: var(--h-orange); opacity: 1; }
.post-nav-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--h-text-muted); margin-bottom: 6px; }
.post-nav-title { font-size: 14px; font-weight: 500; color: var(--h-heading); line-height: 1.4; }

/* ── COMMENTS ─────────────────────────────────────────────── */
.comments-area { margin-top: 48px; padding-top: 36px; border-top: 1px solid var(--h-border); }
.comments-title { font-size: 20px; font-family: var(--h-font-head); margin-bottom: 24px; color: var(--h-heading); }
.comment-list { padding: 0; }
.comment-body { background: var(--h-white); border: 1px solid var(--h-border); border-radius: var(--h-radius); padding: 20px 24px; margin-bottom: 16px; }
.comment-author .fn { font-weight: 600; font-size: 14px; color: var(--h-heading); }
.comment-metadata { font-size: 12px; color: var(--h-text-muted); margin-top: 2px; }
.comment-content p { font-size: 15px; margin-top: 10px; }
.reply a { font-size: 12px; font-weight: 600; color: var(--h-orange); }
.comment-form label { display: block; font-size: 13px; font-weight: 500; color: var(--h-text-muted); margin-bottom: 6px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form textarea { width: 100%; border: 1px solid var(--h-border); border-radius: var(--h-radius); padding: 10px 16px; font-family: var(--h-font-body); font-size: 15px; color: var(--h-text); background: var(--h-white); transition: border-color 0.15s, box-shadow 0.15s; margin-bottom: 16px; }
.comment-form textarea { min-height: 140px; resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--h-orange); outline: none; box-shadow: 0 0 0 3px rgba(240,120,32,0.15); }
.comment-form input[type="submit"], .submit { background: var(--h-orange); color: var(--h-white); font-family: var(--h-font-body); font-size: 14px; font-weight: 600; padding: 11px 24px; border-radius: var(--h-radius); border: none; cursor: pointer; transition: opacity 0.15s; }
.comment-form input[type="submit"]:hover { opacity: 0.85; }

/* ── PAGINATION ───────────────────────────────────────────── */
.pagination { display: flex; gap: 8px; margin: 48px 0 0; flex-wrap: wrap; }
.page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 14px; border-radius: var(--h-radius); border: 1px solid var(--h-border); font-size: 14px; font-weight: 500; color: var(--h-text); background: var(--h-white); transition: all 0.15s; }
.page-numbers.current, .page-numbers:hover { background: var(--h-orange); border-color: var(--h-orange); color: var(--h-white); opacity: 1; }

/* ── PAGES ────────────────────────────────────────────────── */
.page-content { background: var(--h-white); border: 1px solid var(--h-border); border-radius: var(--h-radius-lg); padding: 48px; }
.page-content h2 { margin-top: 2.25em; }
.page-content ul, .page-content ol { padding-left: 1.5em; margin: 1em 0 1.5em; list-style: revert; }
.page-content li { margin-bottom: 0.6em; }
.page-content a { text-decoration: underline; text-underline-offset: 3px; }

/* ── WIDGETS ──────────────────────────────────────────────── */
.widget { background: var(--h-white); border: 1px solid var(--h-border); border-radius: var(--h-radius-lg); padding: 24px; margin-bottom: 20px; }
.widget-title { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--h-text-muted); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--h-border); }
.widget ul { padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px solid var(--h-surface-2); font-size: 14px; }
.widget li:last-child { border-bottom: none; }
.widget li a { color: var(--h-text); }
.widget li a:hover { color: var(--h-orange); opacity: 1; }

/* ── FOOTER ───────────────────────────────────────────────── */
.site-footer {
  background: var(--h-footer-bg);
  color: var(--h-silver-2);
  padding: 48px 0 28px;
  margin-top: 80px;
  font-size: 13px;
}

.footer-inner { max-width: var(--h-max-width); margin: 0 auto; padding: 0 32px; }

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--h-footer-border);
  margin-bottom: 28px;
}

/* Footer logo — invert to show on dark background */
.footer-logo-img {
  height: 32px;
  width: auto;
  margin-bottom: 12px;
  filter: invert(1) grayscale(1) brightness(2);
}

/* Fallback text logo for footer */
.footer-text-logo {
  display: block;
  font-family: var(--h-font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--h-white);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.footer-tagline { font-size: 12px; color: var(--h-silver-2); opacity: 0.65; letter-spacing: 0.04em; }

.footer-nav { display: flex; gap: 48px; flex-wrap: wrap; }

.footer-nav-group h4 {
  font-family: var(--h-font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--h-silver-2);
  margin: 0 0 12px;
  opacity: 0.65;
}

.footer-nav-group ul { padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-nav-group a { color: var(--h-silver-2); font-size: 13px; opacity: 0.65; }
.footer-nav-group a:hover { color: var(--h-orange); opacity: 1; }

.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-copy { font-size: 12px; color: var(--h-silver-2); opacity: 0.45; }
.footer-copy a { color: inherit; opacity: 1; }

.footer-accent { width: 40px; height: 3px; background: var(--h-orange); border-radius: 2px; margin-bottom: 36px; }

/* ── SEARCH ───────────────────────────────────────────────── */
.search-form { display: flex; gap: 8px; }
.search-field { flex: 1; border: 1px solid var(--h-border); border-radius: var(--h-radius); padding: 10px 16px; font-family: var(--h-font-body); font-size: 14px; color: var(--h-text); background: var(--h-white); transition: border-color 0.15s, box-shadow 0.15s; }
.search-field:focus { border-color: var(--h-orange); outline: none; box-shadow: 0 0 0 3px rgba(240,120,32,0.15); }
.search-submit { background: var(--h-orange); color: var(--h-white); border: none; border-radius: var(--h-radius); padding: 10px 18px; font-family: var(--h-font-body); font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity 0.15s; }
.search-submit:hover { opacity: 0.85; }

/* ── 404 ──────────────────────────────────────────────────── */
.not-found-content, .no-results { background: var(--h-white); border: 1px solid var(--h-border); border-radius: var(--h-radius-lg); padding: 64px 48px; text-align: center; }
.not-found-content h1 { font-size: 80px; color: var(--h-orange); margin-bottom: 8px; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 900px) { .footer-nav { gap: 28px; } }

@media (max-width: 768px) {
  .header-inner { padding: 0 16px; height: 60px; }
  .site-nav { display: none; }
  .site-nav.is-open { display: block; position: absolute; top: 60px; left: 0; right: 0; background: var(--h-white); padding: 16px; border-bottom: 1px solid var(--h-border); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
  .site-nav.is-open ul { flex-direction: column; }
  .menu-toggle { display: block; }
  .home-hero { padding: 48px 16px 40px; }
  .hero-title { font-size: 28px; }
  .content-area { padding: 32px 16px 56px; }
  .post-card { padding: 24px; }
  .post-content, .page-content { padding: 28px 20px; }
  .post-nav { grid-template-columns: 1fr; }
  .site-footer { margin-top: 48px; }
  .footer-inner { padding: 0 16px; }
  .footer-top { flex-direction: column; gap: 28px; }
}

@media (max-width: 480px) {
  .post-card { padding: 18px; }
  .post-content, .page-content { padding: 20px 16px; }
  h1 { font-size: 22px; }
  .hero-title { font-size: 24px; }
}
