/*
Theme Name: HogarTecno
Theme URI: https://hogartecno.click
Author: Solkaris Tech Labs
Author URI: https://hogartecno.click
Description: Tema nativo para HogarTecno — blog de tecnología doméstica y afiliación Amazon ES. Optimizado para Core Web Vitals, SEO y conversión.
Version: 1.0.0
Requires at least: 6.3
Tested up to: 6.7
Requires PHP: 8.1
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
Text Domain: hogar-tecno
Tags: affiliate, smart-home, blog, seo
*/

:root {
  --bg: #f8f9fb;
  --text: #1b1b1d;
  --muted: #51535a;
  --accent: #ffa500;
  --accent-dark: #e69500;
  --white: #ffffff;
  --dark: #101218;
  --soft-gray: #e9ecf2;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-md: 0 18px 36px rgba(16,18,24,.12);
  --shadow-sm: 0 8px 20px rgba(16,18,24,.1);
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Roboto', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── SCREEN READER SKIP ── */
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--accent); color: #fff;
  padding: 8px 16px; z-index: 10000;
  transition: top .2s;
}
.skip-link:focus { top: 0; }

/* ── NAV ── */
.hogar-header {
  position: sticky; top: 0; z-index: 900;
  background: #fff;
  border-bottom: 1px solid var(--soft-gray);
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  height: var(--nav-h);
}
.hogar-nav-container {
  max-width: 1200px; margin: 0 auto;
  padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}
.hogar-logo a, .hogar-logo {
  font-size: 1.4rem; font-weight: 900;
  letter-spacing: -1px; color: #111827;
  text-decoration: none;
}
.hogar-logo span { color: var(--accent); }
.hogar-logo img { height: 40px; width: auto; }

.hogar-nav-actions { display: flex; align-items: center; gap: 16px; }
.hogar-main-nav { display: flex; align-items: center; }
ul.hogar-menu { list-style: none; display: flex; gap: 4px; }
ul.hogar-menu li a {
  display: block; padding: 8px 14px;
  font-size: .9rem; font-weight: 600; color: #374151;
  border-radius: 8px; transition: background .15s, color .15s;
  text-decoration: none;
}
ul.hogar-menu li a:hover,
ul.hogar-menu li.current-menu-item a { background: #fff7ed; color: var(--accent); }

.hogar-menu-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.hogar-menu-toggle__bar {
  display: block; width: 22px; height: 2px;
  background: #374151; border-radius: 2px; transition: all .25s;
}

.chat-fab-header {
  background: var(--accent); color: #fff; border: none;
  border-radius: 50%; width: 40px; height: 40px;
  font-size: 1.1rem; cursor: pointer;
  box-shadow: 0 4px 12px rgba(255,165,0,.4);
  transition: transform .2s, box-shadow .2s;
  display: flex; align-items: center; justify-content: center;
}
.chat-fab-header:hover { transform: scale(1.1); box-shadow: 0 6px 18px rgba(255,165,0,.5); }
.chat-mini-container { display: none; }

/* ── CONTENIDO PRINCIPAL ── */
#primary { min-height: 60vh; }

/* ── SINGLE POST ── */
.ht-single { max-width: 780px; margin: 0 auto; padding: 48px 20px 80px; }
.ht-single-header { margin-bottom: 32px; }
.ht-single-cat {
  display: inline-block; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  background: #dbeafe; color: #1d4ed8;
  padding: 4px 12px; border-radius: 999px; margin-bottom: 14px;
}
.ht-single-title {
  font-size: clamp(1.8rem,4vw,2.8rem); font-weight: 900;
  line-height: 1.1; color: #0f172a; margin-bottom: 14px;
}
.ht-single-meta { font-size: .85rem; color: #64748b; }
.ht-single-meta a { color: #64748b; }
.ht-single-thumb {
  width: 100%; border-radius: 18px; margin-bottom: 36px;
  aspect-ratio: 16/9; object-fit: cover;
}
.ht-single-content {
  font-size: 1.05rem; line-height: 1.75; color: #1e293b;
}
.ht-single-content h2 { font-size: 1.6rem; font-weight: 800; margin: 40px 0 16px; color: #0f172a; }
.ht-single-content h3 { font-size: 1.25rem; font-weight: 700; margin: 30px 0 12px; color: #0f172a; }
.ht-single-content p { margin-bottom: 20px; }
.ht-single-content ul, .ht-single-content ol { margin: 0 0 20px 24px; }
.ht-single-content li { margin-bottom: 6px; }
.ht-single-content img { border-radius: 12px; margin: 24px auto; }
.ht-single-content blockquote {
  border-left: 4px solid var(--accent); padding: 16px 24px;
  background: #fff9f0; border-radius: 0 12px 12px 0;
  margin: 28px 0; font-style: italic; color: #475569;
}
.ht-single-content table { width: 100%; border-collapse: collapse; margin: 24px 0; }
.ht-single-content th, .ht-single-content td {
  padding: 10px 14px; text-align: left;
  border: 1px solid #e2e8f0; font-size: .95rem;
}
.ht-single-content th { background: #f8fafc; font-weight: 700; }
.ht-single-content tr:nth-child(even) td { background: #fafafa; }

.ht-post-nav {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 48px; padding-top: 32px;
  border-top: 1px solid var(--soft-gray);
}
.ht-post-nav a {
  flex: 1; padding: 16px 18px; border-radius: 14px;
  background: #fff; border: 1px solid var(--soft-gray);
  color: #1e293b; font-size: .9rem; font-weight: 700;
  transition: border-color .2s, box-shadow .2s; text-decoration: none;
}
.ht-post-nav a:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); color: var(--accent); }
.ht-post-nav .next { text-align: right; }
.ht-post-nav span { display: block; font-size: .75rem; color: #94a3b8; font-weight: 400; margin-bottom: 4px; }

/* ── ARCHIVE / BLOG ── */
.ht-archive { max-width: 1180px; margin: 0 auto; padding: 48px 20px 80px; }
.ht-archive-header { margin-bottom: 36px; }
.ht-archive-title { font-size: clamp(1.6rem,3vw,2.4rem); font-weight: 900; color: #0f172a; margin-bottom: 6px; }
.ht-archive-desc { color: #64748b; }
.ht-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 24px;
}
.ht-arc-card {
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  transition: transform .25s, box-shadow .25s;
  border: 1px solid var(--soft-gray);
}
.ht-arc-card:hover { transform: translateY(-5px); box-shadow: 0 10px 28px rgba(0,0,0,.13); border-color: #ffb84d; text-decoration: none; }
.ht-arc-card__img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.ht-arc-card__placeholder {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(135deg,#0ea5e9,#6366f1);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.8rem;
}
.ht-arc-card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.ht-arc-card__meta { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.ht-arc-card__cat {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: #fff; background: #0ea5e9;
  padding: 3px 9px; border-radius: 20px;
}
.ht-arc-card__date { font-size: .72rem; color: #94a3b8; }
.ht-arc-card__title { font-size: 1rem; font-weight: 700; line-height: 1.35; margin: 0 0 9px; color: #1e293b; }
.ht-arc-card__excerpt { font-size: .85rem; color: #64748b; line-height: 1.55; margin: 0; flex: 1; }
.ht-arc-card__cta { margin-top: 14px; font-size: .8rem; font-weight: 700; color: #0ea5e9; }

.ht-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 48px; }
.ht-pagination a, .ht-pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  font-weight: 700; font-size: .9rem;
  border: 1px solid var(--soft-gray); color: #374151;
  text-decoration: none; transition: all .15s;
}
.ht-pagination a:hover { border-color: var(--accent); color: var(--accent); }
.ht-pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── PAGE ── */
.ht-page { max-width: 860px; margin: 0 auto; padding: 48px 20px 80px; }
.ht-page-title { font-size: clamp(1.8rem,4vw,2.6rem); font-weight: 900; color: #0f172a; margin-bottom: 32px; }
.ht-page-content { font-size: 1.05rem; line-height: 1.75; color: #1e293b; }
.ht-page-content h2 { font-size: 1.5rem; font-weight: 800; margin: 36px 0 14px; color: #0f172a; }
.ht-page-content h3 { font-size: 1.2rem; font-weight: 700; margin: 28px 0 10px; }
.ht-page-content p { margin-bottom: 18px; }
.ht-page-content ul, .ht-page-content ol { margin: 0 0 18px 24px; }

/* ── FOOTER ── */
.hogar-footer {
  background: #0f172a; color: #94a3b8;
  padding: 48px 20px 32px;
}
.hogar-footer-content {
  max-width: 1180px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center;
  gap: 20px; text-align: center;
}
.hogar-footer .hogar-logo { color: #fff; font-size: 1.5rem; font-weight: 900; }
.hogar-footer .hogar-logo span { color: var(--accent); }
ul.hogar-footer-menu { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 20px; justify-content: center; }
ul.hogar-footer-menu a { color: #94a3b8; font-size: .88rem; transition: color .15s; text-decoration: none; }
ul.hogar-footer-menu a:hover { color: var(--accent); }
.hogar-footer-disclaimer { font-size: .8rem; color: #64748b; max-width: 600px; }

/* ── 404 ── */
.ht-404 { text-align: center; padding: 80px 20px; }
.ht-404__code { font-size: 8rem; font-weight: 900; color: var(--accent); line-height: 1; }
.ht-404__msg { font-size: 1.3rem; font-weight: 700; color: #0f172a; margin: 16px 0 8px; }
.ht-404__sub { color: #64748b; margin-bottom: 32px; }
.ht-404__btn {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 14px 32px; border-radius: 999px; font-weight: 700;
  text-decoration: none; transition: background .2s;
}
.ht-404__btn:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hogar-menu-toggle { display: flex; }
  .hogar-main-nav {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: #fff; padding: 16px 20px;
    border-bottom: 1px solid var(--soft-gray);
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    display: none;
  }
  .hogar-main-nav.is-open { display: flex; }
  ul.hogar-menu { flex-direction: column; width: 100%; gap: 2px; }
  ul.hogar-menu li a { padding: 12px 16px; }
  .ht-post-nav { flex-direction: column; }
}
@media (max-width: 480px) {
  .ht-single, .ht-archive, .ht-page { padding: 28px 16px 60px; }
}
