/*
Theme Name: Threshold Review
Theme URI: https://thresholdreview.com
Author: Threshold Review
Description: Independent technology and AI newsroom.
Version: 1.0
*/

/* =========================
   RESET / GLOBAL
========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

:root {
  --bg: #ffffff;
  --text: #0b0b0b;
  --muted: #666666;
  --border: #e5e5e5;
}

body.dark {
  --bg: #0b0b0b;
  --text: #eaeaea;
  --muted: #9a9a9a;
  --border: #222222;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  transition: background 0.3s, color 0.3s;
}

/* =========================
   HEADER (STICKY REAL)
========================= */

.site-header {
  position: fixed;      /* CLAVE */
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;

  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}


body.dark .site-header {
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}


/* =========================
   LOGO
========================= */

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.site-logo {
  width: 28px;
  height: 28px;
  display: block;
}

.site-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* =========================
   NAVIGATION
========================= */

.main-nav ul {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  text-decoration: none;
  font-size: 16px;
  color: var(--muted);
}

.main-nav a:hover {
  color: var(--text);
}

/* =========================
   HEADER ACTIONS
========================= */

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* =========================
   SEARCH (DESKTOP)
========================= */

.header-search {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 6px;
  background: var(--bg);
}

.header-search input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  padding: 8px 6px;
  width: 160px;
  font-size: 15px;
}

.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
}

/* =========================
   MENU TOGGLE (MOBILE)
========================= */

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
}

.menu-toggle span {
  width: 22px;
  height: 2px;
  background: currentColor;
}

/* =========================
   THEME TOGGLE
========================= */

#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--text);
}

#theme-toggle svg {
  width: 19px;
  height: 19px;
}

.icon-sun {
  display: none;
}

.icon-moon {
  display: inline;
}

body.dark .icon-sun {
  display: inline;
}

body.dark .icon-moon {
  display: none;
}

/* =========================
   MOBILE NAV
========================= */

.mobile-search {
  display: none;
}

@media (max-width: 768px) {

  .menu-toggle {
    display: flex;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    display: none;
    padding: 1.5rem;
  }

  .main-nav.active {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 1rem;
  }

  /* Oculta buscador del header */
  .header-actions .header-search {
    display: none !important;
  }

  /* Buscador dentro del menú */
  .main-nav.active .mobile-search {
    display: flex;
    width: 100%;
    margin-top: 1.5rem;
  }

  .main-nav.active .mobile-search input {
    width: 100%;
  }
}

/* =========================
   CONTENT GLOBAL (FIX DEFINITIVO)
========================= */

.site-main {
  max-width: 760px;
  margin: 0 auto 120px;
  padding: 120px 20px 0;
}


.page .site-main,
.single .site-main,
.archive .site-main,
.search .site-main {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
}

.site-main h1 {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 32px;
}

.site-main h2 {
  font-size: 22px;
  margin: 56px 0 20px;
}

.site-main h3 {
  font-size: 18px;
  margin: 36px 0 16px;
}

.site-main p {
  margin-bottom: 20px;
}

.site-main ul,
.site-main ol {
  margin: 24px 0 24px 20px;
}

.site-main li {
  margin-bottom: 10px;
}

/* =========================
   FOOTER
========================= */

.tr-footer {
  background: #0b0b0b;
  color: #e5e5e5;
  padding: 60px 20px;
  font-size: 15px;
}

.tr-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.tr-footer-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

.tr-footer h4,
.tr-footer h5 {
  color: #ffffff;
  margin-bottom: 12px;
}

.tr-footer a {
  color: #cccccc;
  text-decoration: none;
}

.tr-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.tr-footer-bottom {
  border-top: 1px solid #2a2a2a;
  margin-top: 40px;
  padding-top: 20px;
  text-align: center;
  font-size: 14px;
  opacity: 0.7;
}

/* Footer logo */

.tr-footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tr-footer-logo {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* =========================
   FOOTER RESPONSIVE
========================= */

@media (max-width: 900px) {
  .tr-footer-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .tr-footer-columns {
    grid-template-columns: 1fr;
  }
}

.site-main {
  padding-top: 96px;
}
.page-title {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 40px;
}
.archive-header {
  margin-bottom: 48px;
}

.archive-title {
  font-size: 34px;
  font-weight: 600;
  margin-bottom: 12px;
}

.archive-description {
  font-size: 16px;
  color: var(--muted);
  max-width: 600px;
}

.archive-post h2 {
  font-size: 20px;
  margin-bottom: 20px;
}

.archive-post a {
  text-decoration: none;
  color: var(--text);
}

.archive-post a:hover {
  text-decoration: underline;
}
