/*
Theme Name: OpenSquelch
Theme URI: https://opensquelch.com
Author: OpenSquelch
Author URI: https://opensquelch.com
Description: Official WordPress theme for OpenSquelch — precision tools for weather enthusiasts and amateur radio operators. Dark, technical, and built for signal hunters.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: opensquelch
Tags: dark, technology, one-column, custom-menu, featured-images, blog
*/

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  --navy:        #0d1b2e;
  --navy-mid:    #112240;
  --navy-light:  #1a3358;
  --navy-card:   #0f2035;
  --cyan:        #29c4f6;
  --cyan-dim:    #1a9fcf;
  --cyan-glow:   rgba(41, 196, 246, 0.12);
  --accent:      #64dfdf;
  --accent-glow: rgba(100, 223, 223, 0.12);
  --purple:      #a78bfa;
  --purple-glow: rgba(167, 139, 250, 0.12);
  --white:       #e8f4fd;
  --muted:       #7fa8c9;
  --border:      rgba(41, 196, 246, 0.15);
  --border-hover:rgba(41, 196, 246, 0.35);

  --font-head: 'Exo 2', sans-serif;
  --font-body: 'Exo 2', sans-serif;
  --font-mono: 'Source Code Pro', monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --max-width: 1200px;
  --section-pad: 80px 40px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--navy);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent); }
ul, ol { list-style: none; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--white);
}
h1 { font-size: clamp(36px, 5vw, 58px); }
h2 { font-size: clamp(28px, 3.5vw, 40px); }
h3 { font-size: clamp(20px, 2.5vw, 24px); }
h4 { font-size: 18px; font-weight: 700; }
h5 { font-size: 14px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
h6 { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

p { margin-bottom: 1rem; color: var(--muted); font-weight: 300; }
p:last-child { margin-bottom: 0; }

.text-gradient {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--accent) 50%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
}
.section { padding: var(--section-pad); }
.section > .container { max-width: var(--max-width); margin: 0 auto; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 12px;
}
.section-label::before {
  content: '';
  flex: 0 0 28px;
  height: 1px;
  background: var(--cyan);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--cyan-dim), var(--accent));
  color: var(--navy);
}
.btn-primary:hover { opacity: .85; color: var(--navy); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-hover);
  color: var(--white);
}
.btn-outline:hover { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-glow); }
.btn-ghost {
  background: transparent;
  color: var(--cyan);
  padding: 0;
  font-size: 12px;
}
.btn-ghost:hover { color: var(--accent); }
.btn-ghost::after { content: ' →'; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: border-color .25s, transform .25s;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0;
  transition: opacity .25s;
}
.card:hover { border-color: var(--border-hover); transform: translateY(-4px); }
.card:hover::before { opacity: 1; }

/* ============================================================
   BADGES / TAGS
   ============================================================ */
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}
.badge-cyan  { background: var(--cyan-glow);   color: var(--cyan);   border: 1px solid rgba(41,196,246,.2); }
.badge-teal  { background: var(--accent-glow); color: var(--accent); border: 1px solid rgba(100,223,223,.2); }
.badge-purple{ background: var(--purple-glow); color: var(--purple); border: 1px solid rgba(167,139,250,.2); }

/* ============================================================
   SITE HEADER
   ============================================================ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(13, 27, 46, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.site-logo img { width: 40px; height: 40px; object-fit: contain; }
.site-logo .logo-text {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.03em;
}
.site-logo .logo-text span { color: var(--cyan); }

/* Primary Nav */
#primary-nav { display: flex; align-items: center; gap: 8px; }
#primary-nav .menu { display: flex; align-items: center; gap: 4px; list-style: none; }
#primary-nav .menu li a {
  display: block;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border-radius: var(--radius-sm);
  transition: color .2s, background .2s;
}
#primary-nav .menu li a:hover,
#primary-nav .menu li.current-menu-item a {
  color: var(--cyan);
  background: var(--cyan-glow);
}
.header-cta { margin-left: 16px; }

/* Mobile hamburger (hidden until breakpoint) */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--cyan);
  border-radius: 2px;
  transition: all .3s;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 40px 80px;
  overflow: hidden;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(41,196,246,.07) 0%, transparent 70%),
              linear-gradient(180deg, var(--navy) 0%, var(--navy-mid) 100%);
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(41,196,246,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41,196,246,.04) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
}
.hero-content { position: relative; max-width: 760px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(41,196,246,.1);
  border: 1px solid rgba(41,196,246,.3);
  padding: 6px 18px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 28px;
}
.badge-pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse { 0%,100%{opacity:1} 50%{opacity:.25} }
.hero h1 { margin-bottom: 20px; color: var(--white); }
.hero p { font-size: 18px; max-width: 520px; margin: 0 auto 40px; color: var(--muted); }
.hero-ctas { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.hero-wave {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--accent), transparent);
}

/* ============================================================
   APP CARDS SECTION
   ============================================================ */
.apps-section { background: var(--navy); }
.app-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin-bottom: 18px;
}
.icon-wx     { background: var(--cyan-glow); }
.icon-radio  { background: var(--accent-glow); }
.icon-more   { background: var(--purple-glow); }

/* ============================================================
   FEATURES STRIP
   ============================================================ */
.features-strip {
  background: var(--navy-light);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 56px 40px;
}
.features-strip .container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}
.feat-item { text-align: center; }
.feat-icon-wrap { font-size: 32px; margin-bottom: 14px; }
.feat-item h4 { font-size: 13px; font-weight: 700; color: var(--cyan); margin-bottom: 6px; }
.feat-item p { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0; }

/* ============================================================
   BLOG / NEWS
   ============================================================ */
.blog-section { background: var(--navy-mid); }
.post-card { background: var(--navy-card); border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); transition: border-color .25s, transform .25s; }
.post-card:hover { border-color: var(--border-hover); transform: translateY(-4px); }
.post-thumb {
  height: 160px;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px;
  position: relative;
  overflow: hidden;
}
.post-thumb.thumb-wx   { background: linear-gradient(135deg, #0d2a45, #1a4d7a); }
.post-thumb.thumb-ham  { background: linear-gradient(135deg, #0d2e2e, #0d4545); }
.post-thumb.thumb-dev  { background: linear-gradient(135deg, #1a0d2e, #2e1a45); }
.post-thumb svg { position: absolute; bottom: 12px; left: 0; right: 0; opacity: .35; }
.post-body { padding: 22px; }
.post-cat {
  font-size: 10px; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 10px;
}
.post-body h3 { font-size: 16px; margin-bottom: 10px; color: var(--white); }
.post-body p { font-size: 13px; line-height: 1.6; color: var(--muted); }
.post-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 11px; color: var(--muted);
  font-family: var(--font-mono);
}

/* ============================================================
   SINGLE POST
   ============================================================ */
.post-header { padding: 80px 40px 40px; background: var(--navy-mid); border-bottom: 1px solid var(--border); }
.post-header .container { max-width: 760px; margin: 0 auto; }
.post-header .post-cat { margin-bottom: 16px; }
.post-header h1 { margin-bottom: 20px; }
.post-header .post-meta { justify-content: flex-start; gap: 24px; padding: 0; border: 0; margin: 0; }

.entry-content {
  max-width: 760px; margin: 0 auto;
  padding: 56px 40px;
  font-size: 17px; line-height: 1.75;
  color: var(--muted);
}
.entry-content h2,
.entry-content h3 { color: var(--white); margin: 2rem 0 1rem; }
.entry-content p { color: var(--muted); margin-bottom: 1.25rem; }
.entry-content a { color: var(--cyan); }
.entry-content a:hover { color: var(--accent); }
.entry-content ul, .entry-content ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.entry-content li { margin-bottom: .5rem; color: var(--muted); }
.entry-content ul li { list-style: disc; }
.entry-content ol li { list-style: decimal; }
.entry-content blockquote {
  border-left: 3px solid var(--cyan);
  padding: 16px 24px;
  margin: 2rem 0;
  background: var(--cyan-glow);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}
.entry-content pre, .entry-content code {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.entry-content pre { padding: 20px 24px; overflow-x: auto; margin: 1.5rem 0; }
.entry-content code { padding: 2px 6px; }
.entry-content pre code { background: none; border: none; padding: 0; }
.entry-content img { border-radius: var(--radius-md); border: 1px solid var(--border); margin: 2rem 0; }
.entry-content hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.widget-title {
  font-size: 11px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--cyan);
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.widget { margin-bottom: 32px; }
.widget ul { list-style: none; }
.widget ul li { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: 14px; }
.widget ul li a { color: var(--muted); }
.widget ul li a:hover { color: var(--cyan); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  padding: 40px 0;
}
.page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  color: var(--muted);
  transition: all .2s;
}
.page-numbers:hover, .page-numbers.current {
  border-color: var(--cyan); color: var(--cyan);
  background: var(--cyan-glow);
}

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-area {
  max-width: 760px; margin: 0 auto;
  padding: 0 40px 56px;
}
.comments-title { font-size: 20px; color: var(--white); margin-bottom: 28px; }
.comment-body {
  padding: 20px;
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.comment-author { font-weight: 700; color: var(--cyan); margin-bottom: 4px; }
.comment-meta { font-size: 11px; color: var(--muted); margin-bottom: 12px; font-family: var(--font-mono); }

/* Comment form */
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  margin-bottom: 16px;
  transition: border-color .2s;
}
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--cyan);
}
.comment-form textarea { min-height: 140px; resize: vertical; }
.comment-form input[type="submit"] {
  background: linear-gradient(135deg, var(--cyan-dim), var(--accent));
  color: var(--navy);
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity .2s;
}
.comment-form input[type="submit"]:hover { opacity: .85; }

/* ============================================================
   SEARCH FORM
   ============================================================ */
.search-form { display: flex; gap: 0; }
.search-field {
  flex: 1;
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  padding: 10px 16px;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 13px;
}
.search-field:focus { outline: none; border-color: var(--cyan); }
.search-submit {
  background: var(--cyan-glow);
  border: 1px solid var(--border-hover);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 16px;
  color: var(--cyan);
  cursor: pointer;
  font-size: 14px;
  transition: background .2s;
}
.search-submit:hover { background: rgba(41,196,246,.2); }

/* ============================================================
   404 PAGE
   ============================================================ */
.error-404 {
  text-align: center;
  padding: 120px 40px;
}
.error-code {
  font-size: 120px; font-weight: 800;
  background: linear-gradient(135deg, var(--cyan), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 16px;
}
.error-404 h2 { color: var(--white); margin-bottom: 16px; }
.error-404 p { color: var(--muted); max-width: 400px; margin: 0 auto 32px; }

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
  background: rgba(10, 20, 36, 0.97);
  border-top: 1px solid var(--border);
}
.footer-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px 40px 40px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}
.footer-brand .logo-text { font-size: 20px; font-weight: 800; color: var(--white); letter-spacing: -.03em; }
.footer-brand .logo-text span { color: var(--cyan); }
.footer-brand p { font-size: 13px; color: var(--muted); line-height: 1.7; margin-top: 14px; max-width: 260px; }
.footer-col-title {
  font-size: 11px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--cyan);
  margin-bottom: 18px;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { font-size: 13px; color: var(--muted); transition: color .2s; }
.footer-col ul li a:hover { color: var(--white); }

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 40px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 12px;
}
.freq-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cyan);
  background: var(--cyan-glow);
  border: 1px solid rgba(41,196,246,.2);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  letter-spacing: .05em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .features-strip .container { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .footer-main { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 768px) {
  :root { --section-pad: 56px 24px; }
  .container { padding: 0 24px; }
  .header-inner { padding: 0 24px; }
  #primary-nav .menu { display: none; flex-direction: column; position: fixed; top: 72px; left: 0; right: 0; bottom: 0; background: var(--navy-mid); padding: 32px 24px; gap: 4px; z-index: 199; }
  #primary-nav .menu.is-open { display: flex; }
  #primary-nav .menu li a { font-size: 16px; padding: 14px 16px; }
  .menu-toggle { display: flex; }
  .header-cta { display: none; }
  .hero { padding: 80px 24px 60px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .features-strip .container { grid-template-columns: 1fr 1fr; }
  .footer-main { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .entry-content, .comments-area { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 480px) {
  .hero h1 { font-size: 32px; }
  .features-strip .container { grid-template-columns: 1fr; }
}
