/*
Theme Name: DNS Catalog
Theme URI: https://dnscatalog.org
Author: The DNS Catalog
Author URI: https://dnscatalog.org
Description: Official dark editorial theme for The DNS Catalog — DNS privacy, security, and resolver index.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dns-catalog
Tags: dark, custom-menu, custom-sidebar, responsive-layout, blog
*/

:root {
  --bg: #080d18; --surface: #0f1623; --surface2: #1a2235; --surface3: #1e2a40;
  --border: #1e2d40; --border2: #2a3a54;
  --accent: #38bdf8; --accent2: #14b8a6; --accent3: #818cf8;
  --text: #e2e8f0; --muted: #64748b; --muted2: #94a3b8;
  --danger: #f87171; --warn: #fbbf24; --success: #34d399; --radius: 10px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; line-height: 1.6; font-size: 15px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ── NAV ── */
nav#top-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,13,24,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px; display: flex; align-items: center; justify-content: space-between; height: 56px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1rem; color: var(--text); }
.nav-brand:hover { color: var(--accent); text-decoration: none; }
.nav-brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent2); box-shadow: 0 0 8px var(--accent2); flex-shrink: 0; }
/* WordPress wp_nav_menu output */
#top-nav .nav-menu { list-style: none; display: flex; gap: 4px; }
#top-nav .nav-menu > li > a { color: var(--muted2); font-size: 0.85rem; padding: 6px 12px; border-radius: 6px; transition: all 0.15s; display: block; }
#top-nav .nav-menu > li > a:hover,
#top-nav .nav-menu > li.current-menu-item > a,
#top-nav .nav-menu > li.current_page_item > a { color: var(--text); background: var(--surface2); text-decoration: none; }
#top-nav .nav-menu ul { display: none; } /* depth:1 — no submenus */

/* ── SITE SECTIONS (front page) ── */
.site-section, section { padding: 72px 24px; max-width: 1100px; margin: 0 auto; }
.site-section + .site-section, section + section { border-top: 1px solid var(--border); }
.section-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent2); font-weight: 700; margin-bottom: 10px; }
h2.section-title { font-size: 2rem; font-weight: 800; margin-bottom: 12px; line-height: 1.2; }
.section-sub { color: var(--muted2); max-width: 580px; margin-bottom: 40px; font-size: 0.95rem; }

/* ── PAGE / POST CONTENT ── */
.site-main { max-width: 1100px; margin: 0 auto; padding: 48px 24px; }
.content-wrap { display: grid; grid-template-columns: 1fr 280px; gap: 40px; }
.content-wrap.no-sidebar { grid-template-columns: 1fr; max-width: 760px; }
.entry-header { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.entry-title { font-size: 2rem; font-weight: 800; line-height: 1.2; margin-bottom: 10px; color: var(--text); }
.entry-meta { font-size: 0.78rem; color: var(--muted); }
.entry-meta a { color: var(--muted2); }
.entry-content { font-size: 0.93rem; color: var(--muted2); line-height: 1.8; }
.entry-content h2, .entry-content h3, .entry-content h4 { color: var(--text); margin: 28px 0 12px; line-height: 1.3; }
.entry-content h2 { font-size: 1.4rem; }
.entry-content h3 { font-size: 1.15rem; }
.entry-content p { margin-bottom: 16px; }
.entry-content ul, .entry-content ol { padding-left: 22px; margin-bottom: 16px; }
.entry-content li { margin-bottom: 6px; }
.entry-content a { color: var(--accent); }
.entry-content a:hover { text-decoration: underline; }
.entry-content blockquote { border-left: 3px solid var(--accent2); padding: 10px 16px; margin: 20px 0; background: var(--surface); border-radius: 0 6px 6px 0; font-style: italic; color: var(--muted2); }
.entry-content code { background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-family: 'Courier New', monospace; font-size: 0.85em; color: var(--accent); }
.entry-content pre { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; overflow-x: auto; margin-bottom: 16px; }
.entry-content pre code { background: none; border: none; padding: 0; color: var(--text); }
.entry-content table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 0.85rem; }
.entry-content th { background: var(--surface2); color: var(--muted2); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.entry-content td { padding: 8px 12px; border-bottom: 1px solid var(--border); color: var(--muted2); }
.entry-navigation { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); gap: 12px; }
.entry-navigation a { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; font-size: 0.82rem; color: var(--muted2); transition: border-color 0.15s; flex: 1; display: block; }
.entry-navigation a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.nav-prev { text-align: left; }
.nav-next { text-align: right; }
.nav-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); display: block; margin-bottom: 4px; }

/* ── BLOG ARCHIVE ── */
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 14px; transition: border-color 0.2s; }
.post-card:hover { border-color: var(--border2); }
.post-card .post-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.post-card .post-title a { color: var(--text); }
.post-card .post-title a:hover { color: var(--accent); text-decoration: none; }
.post-card .post-meta { font-size: 0.75rem; color: var(--muted); margin-bottom: 10px; }
.post-card .post-excerpt { font-size: 0.85rem; color: var(--muted2); }
.post-card .read-more { display: inline-block; margin-top: 10px; font-size: 0.8rem; color: var(--accent); }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; }
.pagination .page-numbers { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px; font-size: 0.82rem; color: var(--muted2); }
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }
.pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.archive-header { margin-bottom: 32px; }
.archive-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; }
.archive-desc { color: var(--muted2); font-size: 0.9rem; }

/* ── SIDEBAR ── */
.sidebar { }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.widget-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 12px; }
.widget ul { list-style: none; padding: 0; }
.widget ul li { padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: var(--muted2); }
.widget ul li a:hover { color: var(--accent); }
.widget_search .search-form { display: flex; gap: 6px; }
.widget_search input[type=search] { flex: 1; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); padding: 6px 10px; font-size: 0.82rem; outline: none; }
.widget_search input[type=search]:focus { border-color: var(--accent); }
.widget_search input[type=submit] { background: var(--accent); border: none; border-radius: 6px; color: #000; padding: 6px 10px; font-size: 0.78rem; font-weight: 700; cursor: pointer; }

/* ── FOOTER ── */
footer.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 32px 24px; text-align: center; color: var(--muted); font-size: 0.78rem; }
footer.site-footer a { color: var(--muted2); }
footer.site-footer p { margin-bottom: 4px; }

/* ── SHARED UTILITIES ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 8px; font-size: 0.85rem; font-weight: 600; cursor: pointer; border: none; transition: all 0.15s; text-decoration: none !important; }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: #7dd3fc; }
.btn-outline { background: transparent; border: 1px solid var(--border2); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.pill { display: inline-block; font-size: 0.68rem; font-weight: 700; padding: 2px 7px; border-radius: 10px; margin-right: 4px; }
.pill-blue  { background: rgba(56,189,248,0.15); color: var(--accent); }
.pill-teal  { background: rgba(20,184,166,0.15); color: var(--accent2); }
.pill-purple{ background: rgba(129,140,248,0.15); color: var(--accent3); }
.pill-green { background: rgba(52,211,153,0.12); color: var(--success); }
.pill-red   { background: rgba(248,113,113,0.12); color: var(--danger); }
.pill-warn  { background: rgba(251,191,36,0.12); color: var(--warn); }
input[type=text], input[type=url], input[type=search], select, textarea {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 8px 12px; font-size: 0.85rem; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .content-wrap { grid-template-columns: 1fr; }
  nav#top-nav { padding: 0 14px; }
  section, .site-section { padding: 48px 16px; }
  .site-main { padding: 32px 16px; }
  h2.section-title { font-size: 1.5rem; }
}
@media (max-width: 500px) {
  #top-nav .nav-menu > li > a { padding: 6px 8px; font-size: 0.78rem; }
}