/* =====================================================
   MEDIABROS — main.css
   Global styles, components, layout, utilities
   ===================================================== */

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ---- BASE ---- */
body {
  font-family: var(--font-b);
  background: var(--dark);
  color: var(--white);
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.mediabros-theme { background: var(--dark); }

/* ---- TYPOGRAPHY ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-d);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
p { line-height: 1.75; }
a { text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--or3); }
ul, ol { list-style: none; }

/* =====================================================
   NAVIGATION
   ===================================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(13,13,13,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-logo img { height: 36px; width: auto; }
.nav-logo-text {
  font-family: var(--font-d); font-size: 18px; font-weight: 800;
  color: var(--white); letter-spacing: -0.02em;
}
.nav-logo-text span { color: var(--or2); }
.nav-links {
  display: flex; align-items: center; gap: 2rem;
  list-style: none;
}
.nav-links a {
  font-size: var(--text-md); color: rgba(255,255,255,0.5);
  text-decoration: none; transition: color 0.2s;
}
.nav-links a:hover,
.nav-links .current-menu-item > a,
.nav-links .current-page-ancestor > a { color: var(--white); }
.nav-cta {
  background: var(--grad); color: var(--white) !important;
  font-size: var(--text-md); font-weight: 600;
  padding: 8px 20px; border-radius: var(--r-sm);
  text-decoration: none; transition: opacity 0.2s;
  white-space: nowrap;
}
.nav-cta:hover { opacity: 0.85; color: var(--white) !important; }

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none;
  padding: 8px; cursor: pointer;
}
.hamburger-bar {
  display: block; width: 24px; height: 2px;
  background: rgba(255,255,255,0.7);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-hamburger[aria-expanded="true"] .hamburger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger[aria-expanded="true"] .hamburger-bar:nth-child(2) { opacity: 0; }
.nav-hamburger[aria-expanded="true"] .hamburger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-hamburger { display: flex; }
  .nav-menu-wrap {
    display: none; position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    background: rgba(13,13,13,0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem 2rem;
    flex-direction: column; gap: 1rem;
  }
  .nav-menu-wrap.is-open { display: flex; }
  .nav-links { flex-direction: column; align-items: flex-start; gap: 0; width: 100%; }
  .nav-links li { width: 100%; border-bottom: 1px solid var(--border); }
  .nav-links a { display: block; padding: 14px 0; font-size: 16px; color: rgba(255,255,255,0.7); }
  .nav-cta { align-self: flex-start; margin-top: 0.5rem; }
}

/* =====================================================
   LAYOUT UTILITIES
   ===================================================== */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}
.section-pad { padding: 5rem 2rem; }
.section-pad-sm { padding: 3rem 2rem; }
.section-alt { background: var(--dark2); }

/* =====================================================
   TYPOGRAPHY COMPONENTS
   ===================================================== */
.eyebrow {
  font-size: var(--text-xs); font-weight: 600; color: var(--or2);
  text-transform: uppercase; letter-spacing: 0.12em;
  display: block; margin-bottom: 0.75rem;
}
.section-title {
  font-family: var(--font-d); font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.1;
}
.section-lead {
  font-size: var(--text-base); font-weight: 300;
  color: var(--muted); line-height: 1.8;
  max-width: 560px;
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn-hot {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--grad); color: var(--white);
  font-family: var(--font-b); font-size: var(--text-md); font-weight: 600;
  padding: 12px 24px; border-radius: var(--r-sm);
  text-decoration: none; border: none;
  box-shadow: var(--shadow-hot);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  cursor: pointer;
}
.btn-hot:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(249,115,22,0.4);
  color: var(--white);
}
.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: rgba(255,255,255,0.75);
  font-family: var(--font-b); font-size: var(--text-md); font-weight: 400;
  padding: 12px 24px; border-radius: var(--r-sm);
  text-decoration: none;
  border: 1px solid var(--border);
  transition: border-color 0.2s, color 0.2s;
}
.btn-outline:hover { border-color: rgba(255,255,255,0.35); color: var(--white); }
.btn-ghost-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--or3); font-size: var(--text-md); font-weight: 500;
  text-decoration: none; padding: 12px 8px;
  transition: gap 0.2s;
}
.btn-ghost-link:hover { gap: 10px; color: var(--or3); }
.btn-white {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--white); color: var(--or1);
  font-family: var(--font-b); font-size: var(--text-md); font-weight: 700;
  padding: 12px 28px; border-radius: var(--r-sm);
  text-decoration: none; white-space: nowrap;
  transition: background 0.2s;
}
.btn-white:hover { background: rgba(255,255,255,0.9); color: var(--or1); }
.btn-disabled {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.25);
  font-size: var(--text-md); font-weight: 400;
  padding: 12px 24px; border-radius: var(--r-sm);
  border: 1px solid var(--border); cursor: default;
}

/* =====================================================
   BADGES & TAGS
   ===================================================== */
.badge {
  font-size: var(--text-xs); padding: 2px 9px; border-radius: 100px;
  display: inline-block; white-space: nowrap;
}
.b-wp   { background: rgba(16,185,129,0.1);  color: #6EE7B7; border: 1px solid rgba(16,185,129,0.2); }
.b-woo  { background: rgba(99,102,241,0.1);  color: #A5B4FC; border: 1px solid rgba(99,102,241,0.2); }
.b-app  { background: rgba(249,115,22,0.1);  color: var(--or3); border: 1px solid rgba(249,115,22,0.2); }
.b-oss  { background: rgba(168,85,247,0.1);  color: #D8B4FE; border: 1px solid rgba(168,85,247,0.2); }
.b-saas { background: rgba(251,191,36,0.1);  color: #FDE68A; border: 1px solid rgba(251,191,36,0.2); }
.b-erp  { background: rgba(239,68,68,0.1);   color: #FCA5A5; border: 1px solid rgba(239,68,68,0.2); }
.b-ai   { background: rgba(99,102,241,0.1);  color: #A5B4FC; border: 1px solid rgba(99,102,241,0.2); }

.stack-tag {
  font-size: var(--text-xs); font-weight: 500;
  padding: 3px 10px; border-radius: 100px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.45);
}
.stack-tag.ai { background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.2); color: #A5B4FC; }

/* =====================================================
   CARDS
   ===================================================== */
.card-dark {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
}
.card-dark:hover { border-color: rgba(249,115,22,0.3); }

/* =====================================================
   CTA STRIP
   ===================================================== */
.cta-strip {
  background: var(--grad);
  border-radius: var(--r-xl); padding: 3rem;
  display: grid; grid-template-columns: 1fr auto;
  gap: 2rem; align-items: center;
  position: relative; overflow: hidden;
}
.cta-strip::before {
  content: ''; position: absolute;
  top: -40%; right: -5%; width: 400px; height: 400px;
  background: rgba(255,255,255,0.06); border-radius: 50%;
  pointer-events: none;
}
.cta-content { position: relative; z-index: 1; }
.cta-content h2 {
  font-family: var(--font-d); font-size: var(--text-2xl);
  font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px;
}
.cta-content p { font-size: var(--text-md); color: rgba(255,255,255,0.75); font-weight: 300; }
@media (max-width: 640px) {
  .cta-strip { grid-template-columns: 1fr; }
}

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2rem; background: var(--dark);
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2rem;
  padding-bottom: 2rem;
}
.footer-logo-text {
  font-family: var(--font-d); font-size: 20px; font-weight: 800;
  color: var(--white); display: block; margin-bottom: 8px;
}
.footer-logo-text span { color: var(--or2); }
.footer-logo img { height: 40px; width: auto; margin-bottom: 8px; }
.footer-tagline { font-size: var(--text-sm); font-weight: 300; color: rgba(255,255,255,0.3); line-height: 1.6; }
.footer-col-title {
  font-size: var(--text-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: rgba(255,255,255,0.25); margin-bottom: 12px;
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: var(--text-md); font-weight: 300; color: rgba(255,255,255,0.45); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--or3); }
.footer-location { font-size: var(--text-md); color: rgba(255,255,255,0.4); font-weight: 300; }
.footer-location--gap { margin-top: 8px; }
.footer-phone-label { font-size: var(--text-xs); color: rgba(255,255,255,0.25); margin-left: 4px; }
.footer-bottom {
  max-width: var(--max-w); margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.04);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.footer-copy { font-size: var(--text-sm); color: rgba(255,255,255,0.18); font-weight: 300; }
.footer-bottom-right { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.footer-social { display: flex; align-items: center; gap: 12px; }
.social-link { color: rgba(255,255,255,0.3); text-decoration: none; transition: color 0.2s; display: flex; align-items: center; }
.social-link:hover { color: var(--or3); }
.footer-legal { display: flex; align-items: center; gap: 8px; }
.footer-legal-link { font-size: var(--text-sm); color: rgba(255,255,255,0.2); text-decoration: none; transition: color 0.2s; }
.footer-legal-link:hover { color: rgba(255,255,255,0.5); }
.footer-legal-sep { font-size: var(--text-sm); color: rgba(255,255,255,0.1); }

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

/* =====================================================
   BLOG / SINGLE
   ===================================================== */
.post-wrap {
  max-width: 740px; margin: 0 auto;
  padding: calc(var(--nav-h) + 4rem) 2rem 4rem;
}
.post-header { margin-bottom: 2.5rem; }
.post-cats { display: flex; gap: 8px; margin-bottom: 1rem; }
.post-cat {
  font-size: var(--text-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--or3); background: rgba(249,115,22,0.1);
  border: 1px solid rgba(249,115,22,0.2);
  padding: 3px 10px; border-radius: 100px;
}
.post-title {
  font-family: var(--font-d); font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 800; letter-spacing: -0.02em; margin-bottom: 1rem;
}
.post-meta {
  font-size: var(--text-sm); color: rgba(255,255,255,0.35); font-weight: 300;
}
.post-thumbnail { border-radius: var(--r-lg); overflow: hidden; margin-bottom: 2.5rem; }
.post-thumbnail img { width: 100%; height: auto; }
.post-content {
  font-size: var(--text-base); font-weight: 300; line-height: 1.85;
  color: rgba(255,255,255,0.75);
}
.post-content h2, .post-content h3 {
  font-family: var(--font-d); font-weight: 700; margin: 2rem 0 0.75rem;
  color: var(--white);
}
.post-content h2 { font-size: 1.5rem; }
.post-content h3 { font-size: 1.2rem; }
.post-content p { margin-bottom: 1.25rem; }
.post-content a { color: var(--or3); text-decoration: underline; }
.post-content ul, .post-content ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.post-content li { list-style: disc; margin-bottom: 0.5rem; }
.post-content blockquote {
  border-left: 3px solid var(--or2); padding-left: 1.25rem;
  margin: 1.5rem 0; font-style: italic; color: rgba(255,255,255,0.5);
}
.post-content img { border-radius: var(--r-md); margin: 1.5rem 0; }
.post-content code {
  background: rgba(255,255,255,0.05); padding: 2px 6px;
  border-radius: 4px; font-size: 0.9em; font-family: monospace;
}
.post-content pre {
  background: rgba(0,0,0,0.4); border-radius: var(--r-md);
  padding: 1.25rem; overflow-x: auto; margin: 1.5rem 0;
}
.post-content pre code { background: none; padding: 0; font-size: 13px; }

/* =====================================================
   404 PAGE
   ===================================================== */
.error-404-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 2rem;
}
.error-404-num {
  font-family: var(--font-d); font-size: clamp(6rem, 15vw, 12rem); font-weight: 800;
  background: var(--grad); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1; margin-bottom: 1rem;
}
.error-404-title { font-family: var(--font-d); font-size: 1.5rem; font-weight: 700; margin-bottom: 0.75rem; }
.error-404-text { font-size: var(--text-base); color: var(--muted); font-weight: 300; margin-bottom: 2rem; }

/* =====================================================
   MISC 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;
}
.text-muted { color: var(--muted); }
.text-orange { color: var(--or2); }
.mt-auto { margin-top: auto; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-wrap { display: flex; flex-wrap: wrap; }

/* =====================================================
   BLOG INDEX
   ===================================================== */
.page-hero--blog {
  padding: 140px 2rem 80px;
  border-bottom: 1px solid var(--border);
}
.page-hero--blog h1 { font-size: var(--text-4xl); margin-bottom: 1rem; }
.page-hero--blog .page-hero-lead { font-size: var(--text-lg); font-weight: 300; color: var(--muted); line-height: 1.75; max-width: 560px; }

.blog-wrap { padding: 4rem 0; }
.blog-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 20px;
  margin-bottom: 3rem;
}
.blog-card {
  background: var(--dark2); border: 1px solid var(--border);
  border-radius: var(--r-xl); overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
  display: flex; flex-direction: column;
}
.blog-card:hover { border-color: rgba(249,115,22,0.3); transform: translateY(-3px); }
.blog-card-thumb { display: block; overflow: hidden; aspect-ratio: 16/9; }
.blog-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.blog-card:hover .blog-card-thumb img { transform: scale(1.04); }
.blog-card-body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.blog-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.blog-cat {
  font-size: var(--text-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--or3);
  background: rgba(249,115,22,0.1); border: 1px solid rgba(249,115,22,0.2);
  padding: 2px 9px; border-radius: 100px; text-decoration: none;
}
.blog-date { font-size: var(--text-xs); color: rgba(255,255,255,0.3); }
.blog-card-title { font-family: var(--font-d); font-size: var(--text-xl); font-weight: 700; letter-spacing: -0.01em; margin-bottom: 8px; line-height: 1.3; }
.blog-card-title a { text-decoration: none; color: inherit; }
.blog-card-title a:hover { color: var(--or3); }
.blog-card-excerpt { font-size: var(--text-sm); font-weight: 300; color: var(--muted); line-height: 1.65; margin-bottom: 1rem; flex: 1; }
.blog-read-more { font-size: var(--text-sm); font-weight: 500; color: var(--or3); text-decoration: none; transition: gap 0.2s; display: inline-flex; align-items: center; gap: 4px; margin-top: auto; }
.blog-read-more:hover { color: var(--or3); gap: 8px; }
.blog-empty { text-align: center; padding: 4rem 2rem; }
.blog-empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.blog-empty h2 { font-family: var(--font-d); font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.blog-empty p { color: var(--muted); font-size: var(--text-base); font-weight: 300; }
.blog-pagination { display: flex; justify-content: center; }
.blog-pagination .nav-links { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.blog-pagination .page-numbers {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r-sm);
  font-size: var(--text-sm); font-weight: 500; text-decoration: none;
  background: var(--dark2); border: 1px solid var(--border); color: rgba(255,255,255,0.5);
  transition: all 0.2s;
}
.blog-pagination .page-numbers:hover,
.blog-pagination .page-numbers.current { background: rgba(249,115,22,0.1); border-color: rgba(249,115,22,0.3); color: var(--or3); }
.blog-pagination .page-numbers.dots { background: none; border: none; cursor: default; }
.blog-pagination .prev, .blog-pagination .next { width: auto; padding: 0 14px; }

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

/* =====================================================
   SINGLE POST — footer extras
   ===================================================== */
.post-footer { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 2rem; }
.post-tag {
  font-size: var(--text-xs); padding: 3px 10px; border-radius: 100px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: rgba(255,255,255,0.45); text-decoration: none; transition: border-color 0.2s, color 0.2s;
}
.post-tag:hover { border-color: rgba(249,115,22,0.3); color: var(--or3); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.post-nav-prev, .post-nav-next { background: var(--dark2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1rem 1.25rem; }
.post-nav-next { text-align: right; }
.post-nav-label { font-size: var(--text-xs); color: rgba(255,255,255,0.3); display: block; margin-bottom: 4px; }
.post-nav-title { font-size: var(--text-sm); font-weight: 500; color: rgba(255,255,255,0.7); text-decoration: none; line-height: 1.4; display: block; }
.post-nav-title:hover { color: var(--or3); }
@media (max-width: 540px) { .post-nav { grid-template-columns: 1fr; } }
