/*
Theme Name: TecnoGreenRD
Theme URI: https://tecnogreenrd.com/
Author: TecnoGreenRD
Author URI: https://tecnogreenrd.com/
Description: Portal de noticias de tecnología: portada con destacado, últimas noticias y secciones por categoría. Diseñado para TecnoGreenRD.
Version: 3.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tecnogreenrd
Tags: news, blog, featured-images, custom-logo, custom-menu
*/

/* =Reset y base
----------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: #222;
  background: #f2f5f3;
}
a { color: #00B090; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.25; color: #111; }
p { margin: 0 0 1em; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 0 16px; }

/* =Barra superior
----------------------------------------------- */
.topbar { background: #eef2ef; color: #44524b; font-size: 13px; }
.topbar .wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 6px; padding-bottom: 6px; }
.topbar p { margin: 0; }

/* =Header
----------------------------------------------- */
.site-header { background: #fff; color: #222; }
.site-header .wrap { display: flex; align-items: center; gap: 8px; padding-top: 20px; padding-bottom: 20px; flex-wrap: wrap; }
.site-brand a { color: #222; text-decoration: none; }
.site-title { margin: 0; font-size: 34px; letter-spacing: -0.5px; }
.site-title a:hover { text-decoration: none; }
.site-tagline { margin: 2px 0 0; color: #5a6b62; font-size: 14px; }
.header-search { margin-left: auto; }
.header-search form { display: flex; }
.header-search input[type="search"] {
  border: 1px solid #ccc; background: #fff; color: #222;
  padding: 8px 10px; border-radius: 4px 0 0 4px; font-size: 14px; width: 200px;
}
.header-search input[type="submit"] {
  border: 1px solid #00B090; background: #00B090; color: #fff;
  padding: 8px 14px; border-radius: 0 4px 4px 0; cursor: pointer; font-size: 14px;
}

/* =Logo del sitio: cambia con el modo claro/oscuro
----------------------------------------------- */
.site-logo { display: inline-flex; align-items: center; line-height: 0; }
.site-logo img { display: block; height: 64px; width: auto; }
.site-logo .logo-dark { display: none; }
body.dark .site-logo .logo-dark { display: block; }
body.dark .site-logo .logo-light { display: none; }
.theme-icon-moon { display: none; }
.header-theme-btn { background: none; border: 0; cursor: pointer; padding: 8px; line-height: 0; }
.header-theme-btn svg { display: block; }

/* =Main menu
----------------------------------------------- */
.main-nav { background: #fff; border-bottom: 1px solid #e3e8e6; }
.main-nav .wrap { overflow-x: auto; scrollbar-width: none; }
.main-nav .wrap::-webkit-scrollbar { display: none; }
.main-nav ul { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-wrap: nowrap; width: max-content; }
.main-nav li { margin: 0; flex-shrink: 0; }
.main-nav a {
  display: block; padding: 11px 14px; color: #1a1f1d; font-weight: 600;
  font-size: 15px; text-decoration: none; white-space: nowrap;
}
.main-nav a:hover, .main-nav .current-menu-item a, .main-nav .current-cat a { background: #e9f4f0; color: #008a70; text-decoration: none; }
.main-nav ul ul { display: none; }
.mobile-bar { display: none; }
.mobile-search-row { display: none; }

/* =Portada: destacado
----------------------------------------------- */
.hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 24px auto; }
.hero-card { position: relative; overflow: hidden; border-radius: 8px; background: #111; aspect-ratio: 1 / 1; }
.hero-card img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; position: absolute; inset: 0; }
.hero-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85)); color: #fff; }
.hero-text .cat-label { background: #00B090; }
.hero-text h2, .hero-text h3 { margin: 8px 0 4px; color: #fff; }
.hero-text h2 { font-size: 30px; }
.hero-text h3 { font-size: 19px; }
.hero-text h2 a, .hero-text h3 a { color: #fff; }
.hero-text p { margin: 0; color: #ddd; font-size: 14px; }
.cat-label {
  display: inline-block; background: #00B090; color: #fff; font-size: 12px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 3px 9px; border-radius: 3px;
}
.cat-label:hover { text-decoration: none; }

/* =Section headings
----------------------------------------------- */
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 32px 0 14px; border-bottom: 3px solid #00B090; padding-bottom: 6px; }
.section-head h2 { margin: 0; font-size: 22px; text-transform: uppercase; letter-spacing: 0.5px; }
.section-head a { margin-left: auto; font-size: 14px; font-weight: 600; white-space: nowrap; }

/* =News cards
----------------------------------------------- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.card img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.card-body { padding: 14px 16px 16px; }
.card-body h3 { margin: 8px 0 6px; font-size: 18px; }
.card-body h3 a { color: #111; }
.card-body p { font-size: 14px; color: #555; }
.post-meta { font-size: 13px; color: #888; }
.post-meta a { color: #888; }

/* =Content + sidebar
----------------------------------------------- */
.content-area { display: grid; grid-template-columns: 1fr; gap: 28px; margin: 12px auto 24px; align-items: start; }
.single-article, .page-article { background: #fff; border-radius: 8px; padding: 28px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.single-article h1, .page-article h1 { margin: 0 0 10px; font-size: 34px; }
.single-article .post-meta { margin-bottom: 16px; }
.single-article .featured { margin: 0 0 20px; }
.single-article .featured img { border-radius: 6px; }
.entry-content { overflow-wrap: break-word; }
.entry-content img { border-radius: 4px; }
.entry-content figure { margin: 1em 0; }
.entry-content figcaption { font-size: 13px; color: #888; text-align: center; }
.entry-content blockquote { border-left: 4px solid #00B090; margin: 1em 0; padding: 0.5em 1em; color: #444; background: #f7faf8; }
.post-tags { margin-top: 24px; font-size: 14px; }
.post-tags a { display: inline-block; background: #e9f4f0; padding: 3px 10px; border-radius: 20px; margin: 0 6px 6px 0; }
.post-tags a:hover { text-decoration: none; background: #d2ece3; }
.related { margin-top: 32px; }
.related h2 { font-size: 20px; }
.related .news-grid { grid-template-columns: repeat(3, 1fr); }
.post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; font-size: 14px; }

/* =Barra lateral
----------------------------------------------- */
.sidebar .widget { background: #fff; border-radius: 8px; padding: 18px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.sidebar .widget h2, .sidebar .widget-title { margin: 0 0 12px; font-size: 18px; text-transform: uppercase; border-bottom: 3px solid #00B090; padding-bottom: 6px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 8px 0; border-bottom: 1px solid #eee; font-size: 15px; }
.sidebar li:last-child { border-bottom: 0; }
.most-read { counter-reset: most; }
.most-read li { display: flex; gap: 12px; align-items: flex-start; }
.most-read li::before {
  counter-increment: most; content: counter(most); flex: 0 0 28px; height: 28px;
  background: #00B090; color: #fff; font-weight: 800; text-align: center;
  line-height: 28px; border-radius: 50%; font-size: 14px;
}
.most-read a { color: #111; }
.most-read .views { display: block; font-size: 12px; color: #888; }

/* =Paginación, búsqueda, 404, comentarios
----------------------------------------------- */
.pagination { margin: 28px 0; text-align: center; }
.pagination .nav-links { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-block; padding: 8px 14px; background: #fff; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.pagination .current { background: #00B090; color: #fff; }
.search-results h1, .error-404 h1 { font-size: 28px; }
.comments { margin-top: 32px; }
.comments h2 { font-size: 20px; }
.comment-list { list-style: none; padding: 0; }
.comment-list li { background: #f7faf8; border-radius: 6px; padding: 14px 16px; margin-bottom: 12px; }
.comment-author { font-weight: 700; }
.comment-meta { font-size: 12px; color: #888; }
.comment-form label { display: block; font-weight: 600; margin-top: 10px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
  width: 100%; padding: 9px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 15px;
}
.comment-form input[type="submit"] { background: #00B090; color: #fff; border: 0; padding: 10px 20px; border-radius: 4px; cursor: pointer; margin-top: 12px; font-size: 15px; }

/* =Footer
----------------------------------------------- */
.site-footer { background: #101613; color: #cfd8d3; margin-top: 40px; }
.site-footer .wrap { padding-top: 28px; padding-bottom: 28px; }
.footer-nav ul { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-nav a { color: #cfd8d3; font-size: 14px; }
.site-footer .fine { font-size: 13px; color: #8fa39a; margin: 0; }
.site-footer .fine a { color: #cfd8d3; text-decoration: none; }
.site-footer .fine a:hover { text-decoration: underline; }

/* =Banner de cookies
----------------------------------------------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  background: #fff; color: #222; border-top: 3px solid #00B090;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.15);
  padding: 14px 16px; display: flex; align-items: center; gap: 16px;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; font-size: 14px; flex: 1; }
.cookie-banner a { color: #00B090; }
.cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-btn { border: 0; border-radius: 6px; padding: 9px 18px; font-size: 14px; font-weight: 600; cursor: pointer; }
.cookie-accept { background: #00B090; color: #fff; }
.cookie-reject { background: #eef2ef; color: #222; }
body.dark .cookie-banner { background: #1c1f1e; color: #e8ecea; }
body.dark .cookie-reject { background: #2a2e2d; color: #e8ecea; }

/* =Responsive
----------------------------------------------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-card { aspect-ratio: 16 / 9; }
  .news-grid, .related .news-grid { grid-template-columns: repeat(2, 1fr); }
  .content-area { grid-template-columns: 1fr; }
  .topbar { display: none; }
  .site-header .wrap { padding-top: 0; padding-bottom: 0; }
  .site-header .site-brand { display: none; }
  .header-theme-btn { display: none; }
  .header-search { display: none; }
  .mobile-bar { display: flex; align-items: center; gap: 8px; background: #fff; height: 56px; padding: 0 12px; position: relative; }
  .mobile-bar button { background: none; border: 0; cursor: pointer; padding: 8px; line-height: 0; }
  .mobile-menu-btn { color: #222; font-size: 26px; line-height: 1; }
  .mobile-brand { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; max-width: 60%; }
  .mobile-brand img { max-height: 48px; max-width: 100%; width: auto; }
  .mobile-brand .site-title { margin: 0; font-size: 24px; }
  .mobile-brand .site-title a { color: #fff; }
  .mobile-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }
  .mobile-actions svg { display: block; }
  .theme-icon-moon { display: none; }
  .mobile-search-row { display: none; background: #fff; border-top: 1px solid #e2e8e4; }
  body.search-open .mobile-search-row { display: block; }
  .mobile-search-row form { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
  .mobile-search-row input[type="search"] { flex: 1; min-width: 0; background: transparent; border: 0; color: #222; font-size: 20px; padding: 6px 0; outline: none; }
  .mobile-search-row input[type="search"]::placeholder { color: #888; }
  .mobile-search-close { background: none; border: 0; color: #222; font-size: 34px; line-height: 1; cursor: pointer; padding: 0 4px; }
  .main-nav ul { display: none; flex-direction: column; width: auto; margin: 0; }
  body.nav-open .main-nav ul { display: flex; }
}
@media (max-width: 600px) {
  .news-grid, .related .news-grid { grid-template-columns: 1fr; }
  .single-article, .page-article { padding: 18px; }
  .single-article h1, .page-article h1 { font-size: 26px; }
  .hero-text h2 { font-size: 24px; }
  .site-title { font-size: 28px; }
  .topbar .tagline { display: none; }
  .cookie-banner { flex-direction: column; align-items: stretch; gap: 10px; }
  .cookie-actions { justify-content: flex-end; }
}

/* =Modo oscuro
----------------------------------------------- */
body.dark { background: #111; color: #ddd; }
body.dark .topbar { background: #0b0f0e; color: #cfd8d3; }
body.dark .site-header { background: #101613; color: #fff; }
body.dark .main-nav { background: #101613; border-bottom-color: #262d2a; }
body.dark .main-nav a { color: #e8ecea; }
body.dark .main-nav a:hover, body.dark .main-nav .current-menu-item a, body.dark .main-nav .current-cat a { background: #1e2b26; color: #00B090; }
body.dark .site-brand a { color: #fff; }
body.dark .site-tagline { color: #9fb3a8; }
body.dark .header-search input[type="search"] { border-color: #2a3a33; background: #1c2823; color: #fff; }
body.dark .mobile-bar { background: #0b0f0e; }
body.dark .mobile-menu-btn { color: #fff; }
body.dark .mobile-search-row { background: #0b0f0e; border-top-color: #2e3338; }
body.dark .mobile-search-row input[type="search"] { color: #fff; }
body.dark .mobile-search-row input[type="search"]::placeholder { color: #9aa3a0; }
body.dark .mobile-search-close { color: #fff; }
body.dark h1, body.dark h2, body.dark h3, body.dark h4 { color: #f0f0f0; }
body.dark .card, body.dark .single-article, body.dark .page-article, body.dark .sidebar .widget, body.dark .pagination a, body.dark .pagination span { background: #1c1f1e; }
body.dark .card-body h3 a { color: #f0f0f0; }
body.dark .card-body p { color: #bbb; }
body.dark .post-meta, body.dark .post-meta a, body.dark .entry-content figcaption { color: #aaa; }
body.dark .sidebar li { border-bottom-color: #2a2e2d; }
body.dark .entry-content blockquote { background: #1c1f1e; color: #bbb; }
body.dark .post-tags a { background: #243830; }
body.dark .comment-list li { background: #1c1f1e; }
body.dark .comment-form input[type="text"], body.dark .comment-form input[type="email"], body.dark .comment-form input[type="url"], body.dark .comment-form textarea { background: #222; color: #ddd; border-color: #444; }
body.dark .theme-icon-moon { display: inline; }
body.dark .theme-icon-sun { display: none; }

/* =Artículo en móvil como La Manzana Mordida: sin tarjeta, texto directo sobre el fondo
----------------------------------------------- */
@media (max-width: 600px) {
  .single-article, .page-article { background: transparent; box-shadow: none; padding: 0 4px; }
  body.dark .single-article, body.dark .page-article { background: transparent; box-shadow: none; }
}
