/*
Theme Name: Western Nebraska Ham Radio
Theme URI: https://westernnebraskahamradio.com
Author: LGRN
Description: A simple, large-text, easy-to-navigate theme built for Western Nebraska Ham Radio. Designed with an older audience in mind: big readable type, an always-visible search bar, and a one-page "Browse Articles" list for quickly finding older posts.
Version: 1.4
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: wnhr
*/

/* =========================================================
   1. Base / Variables
   ========================================================= */
:root {
  /* Brand blue, sampled directly from the logo artwork. Used for the
     header background, where the logo needs to sit directly on it. */
  --wnhr-header-bg: #6cc0f8;
  --wnhr-header-text: #12335c;
  --wnhr-header-text-muted: #1a4168;

  /* Deeper shades of the same blue, used for the nav bar, buttons,
     borders and footer — kept dark enough for white text on top. */
  --wnhr-navy: #16679c;
  --wnhr-navy-dark: #0f466b;

  --wnhr-ink: #1f2933;
  --wnhr-body-bg: #fdfdfb;
  --wnhr-card-bg: #ffffff;
  --wnhr-border: #d8dee6;
  --wnhr-link: #0b5ed7;
  --wnhr-link-visited: #5a3ea1;

  /* Warm accent, complementary to the brand blue (used for hover states,
     buttons and highlights) — replaces the earlier plain orange. */
  --wnhr-accent: #b85614;
  --wnhr-focus: #b85614;

  --wnhr-font: "Atkinson Hyperlegible", Verdana, Geneva, "Segoe UI", Arial, sans-serif;
  --wnhr-base-size: 20px;
  --wnhr-max-width: 1600px;
}

/* Font-size scale toggled by JS (A- / A / A+) */
html[data-wnhr-size="small"] { --wnhr-base-size: 18px; }
html[data-wnhr-size="normal"] { --wnhr-base-size: 20px; }
html[data-wnhr-size="large"] { --wnhr-base-size: 24px; }

* { box-sizing: border-box; }

html {
  font-size: var(--wnhr-base-size);
  scroll-behavior: smooth;
}

body {
  font-family: var(--wnhr-font);
  color: var(--wnhr-ink);
  background: var(--wnhr-body-bg);
  line-height: 1.6;
  margin: 0;
}

img { max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  color: var(--wnhr-navy-dark);
  line-height: 1.25;
  font-weight: 700;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }

p, li { font-size: 1rem; }

a {
  color: var(--wnhr-link);
  text-decoration: underline;
}
a:visited { color: var(--wnhr-link-visited); }
a:hover, a:focus { color: var(--wnhr-accent); }

a:focus, button:focus, input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--wnhr-focus);
  outline-offset: 2px;
}

.wnhr-container {
  max-width: var(--wnhr-max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--wnhr-navy-dark);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 10000;
  font-size: 1rem;
  border-radius: 0 0 6px 0;
}
.skip-link:focus {
  left: 0;
  top: 0;
}

/* =========================================================
   2. Header
   ========================================================= */
.site-header {
  background: var(--wnhr-header-bg);
  color: var(--wnhr-header-text);
  padding: 0.75rem 0;
  border-bottom: 4px solid var(--wnhr-accent);
}
/* Focus outlines need their own color here — the default accent outline
   doesn't have enough contrast against this lighter header background. */
.site-header :focus {
  outline-color: var(--wnhr-header-text);
}
/* Logo/title is centered in the full header width; the text-size controls
   float in the top-right corner instead of counting as a second column —
   that keeps the logo visually centered instead of centered-minus-widget. */
.site-header-inner {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60px;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}
.text-size-controls {
  position: absolute;
  top: 0.4rem;
  right: 0;
}

@media (max-width: 780px) {
  .site-header-inner {
    flex-direction: column;
    text-align: center;
  }
  .text-size-controls {
    position: static;
    margin-top: 0.75rem;
    justify-content: center;
  }
}
.site-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.site-branding img.custom-logo {
  max-height: 76px;
  width: auto;
}
.site-branding-text a { text-decoration: none; color: var(--wnhr-header-text); }
.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--wnhr-header-text);
}
.site-description {
  margin: 0;
  font-size: 0.95rem;
  color: var(--wnhr-header-text-muted);
}

.text-size-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.text-size-controls span {
  font-size: 0.85rem;
  color: var(--wnhr-header-text-muted);
  margin-right: 0.25rem;
}
.text-size-controls button {
  background: #fff;
  color: var(--wnhr-header-text);
  border: 2px solid var(--wnhr-header-text);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
  min-width: 44px;
  min-height: 44px;
}
.text-size-controls button:hover { background: var(--wnhr-accent); color: #fff; border-color: var(--wnhr-accent); }

/* Primary nav */
.main-navigation {
  background: transparent;
}
.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}
.main-navigation li { position: relative; }
.main-navigation a {
  display: block;
  color: #111111;
  text-decoration: none;
  padding: 0.9rem 1.1rem;
  font-size: 1.05rem;
  font-weight: 700;
  min-height: 44px;
}
.main-navigation a:hover,
.main-navigation a:focus {
  background: var(--wnhr-accent);
  color: #fff;
}
.menu-toggle {
  display: none;
  background: transparent;
  color: #111111;
  border: 2px solid #111111;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.6rem 1rem;
  margin: 0.5rem 1.25rem;
  border-radius: 6px;
  min-height: 44px;
  cursor: pointer;
}
.menu-toggle:hover {
  background: var(--wnhr-accent);
  color: #fff;
  border-color: var(--wnhr-accent);
}

/* Search bar - always visible in header, never hidden behind an icon */
.header-search {
  background: #f2f5fa;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--wnhr-border);
}
.wnhr-search-form {
  display: flex;
  gap: 0.5rem;
  max-width: 560px;
  margin: 0 auto;
}
.wnhr-search-form label { flex: 1; }
.wnhr-search-form input[type="search"] {
  width: 100%;
  font-size: 1.1rem;
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--wnhr-navy);
  border-radius: 6px;
  min-height: 44px;
}
.wnhr-search-form button {
  background: var(--wnhr-navy);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
}
.wnhr-search-form button:hover { background: var(--wnhr-accent); }

/* =========================================================
   3. Layout
   ========================================================= */
.site-content {
  padding: 2rem 0 3rem;
}
.content-layout {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}
.primary-content { flex: 1 1 620px; min-width: 0; }
.widget-area { flex: 0 1 340px; }

@media (max-width: 780px) {
  .content-layout { flex-direction: column; }
  .widget-area { flex: 1 1 auto; width: 100%; }
  .main-navigation ul { display: none; flex-direction: column; }
  .main-navigation ul.is-open { display: flex; }
  .menu-toggle { display: block; }
}

/* =========================================================
   4. Posts / cards
   ========================================================= */
.post-card {
  background: var(--wnhr-card-bg);
  border: 1px solid var(--wnhr-border);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.75rem;
}
.post-card h2 { margin-top: 0; }
.post-card h2 a { text-decoration: none; }
.post-card h2 a:hover { text-decoration: underline; }
.post-meta {
  color: #55606b;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}
.post-thumb img { border-radius: 8px; margin-bottom: 1rem; }
.read-more-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-weight: 700;
}

.entry-content { font-size: 1.05rem; }
.entry-content p { margin: 0 0 1.2em; }
.entry-content img { border-radius: 8px; }
.entry-content ul, .entry-content ol { padding-left: 1.5em; }

/* Galleries */
.wp-block-gallery, .gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}
.gallery-item, .wp-block-gallery figure {
  margin: 0;
  flex: 1 1 200px;
  max-width: 260px;
}
.gallery-item img, .wp-block-gallery img {
  border-radius: 8px;
  width: 100%;
  height: auto;
}

/* Big, obvious pagination */
.wnhr-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0;
}
.wnhr-pagination a, .wnhr-pagination span {
  display: inline-block;
  padding: 0.6rem 1rem;
  border: 2px solid var(--wnhr-navy);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  min-height: 44px;
  min-width: 44px;
  text-align: center;
}
.wnhr-pagination a { color: var(--wnhr-navy); }
.wnhr-pagination a:hover { background: var(--wnhr-navy); color: #fff; }
.wnhr-pagination span.current { background: var(--wnhr-navy); color: #fff; }

.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}
.post-navigation a {
  display: inline-block;
  padding: 0.75rem 1.1rem;
  border: 2px solid var(--wnhr-navy);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  color: var(--wnhr-navy);
}
.post-navigation a:hover { background: var(--wnhr-navy); color: #fff; }

.back-to-articles {
  display: inline-block;
  margin: 1.5rem 0;
  font-weight: 700;
  font-size: 1.05rem;
}

/* =========================================================
   5. Widgets / sidebar
   ========================================================= */
.widget {
  background: var(--wnhr-card-bg);
  border: 1px solid var(--wnhr-border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.widget-title {
  margin-top: 0;
  font-size: 1.2rem;
  border-bottom: 3px solid var(--wnhr-accent);
  padding-bottom: 0.4rem;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 0.4rem 0; border-bottom: 1px solid #eef1f5; font-size: 1.02rem; }
.widget li:last-child { border-bottom: none; }
.widget select { width: 100%; padding: 0.5rem; font-size: 1rem; }

/* =========================================================
   6. Browse Articles (all-posts) template
   ========================================================= */
.browse-intro {
  background: #f2f5fa;
  border: 1px solid var(--wnhr-border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  font-size: 1.05rem;
}
.year-jumplist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0 2rem;
}
.year-jumplist a {
  border: 2px solid var(--wnhr-navy);
  color: var(--wnhr-navy);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 700;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.year-jumplist a:hover { background: var(--wnhr-navy); color: #fff; }

.year-group { margin-bottom: 2.5rem; }
.year-group h2 {
  background: var(--wnhr-navy);
  color: #fff;
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 6px 6px 0 0;
  margin: 0;
}
.year-post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--wnhr-border);
  border-top: none;
  border-radius: 0 6px 6px 6px;
  overflow: hidden;
}
.year-post-list li {
  border-bottom: 1px solid var(--wnhr-border);
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
}
.year-post-list li:last-child { border-bottom: none; }
.year-post-list li:nth-child(odd) { background: #fafbfd; }
.year-post-list a { font-size: 1.1rem; font-weight: 600; }
.year-post-list .post-date { color: #55606b; font-size: 0.95rem; white-space: nowrap; }

/* =========================================================
   7. Footer
   ========================================================= */
.site-footer {
  background: var(--wnhr-navy-dark);
  color: #e6ecf5;
  padding: 2.5rem 0 1.5rem;
  margin-top: 3rem;
}
.footer-widgets {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 1.5rem;
}
.footer-widgets .widget-area { flex: 1 1 260px; }
.site-footer .widget {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.15);
  color: #e6ecf5;
}
.site-footer .widget-title { color: #fff; }
.site-footer a { color: #cfe0f7; }
.site-footer a:visited { color: #cfe0f7; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 1.25rem;
  text-align: center;
  font-size: 0.95rem;
}

/* =========================================================
   8. Misc
   ========================================================= */
.wnhr-callout {
  background: #fff7ec;
  border: 1px solid #f0d5ab;
  border-left: 6px solid var(--wnhr-accent);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.search-no-results { font-size: 1.1rem; }
.comment-respond input, .comment-respond textarea { font-size: 1rem; padding: 0.5rem; }
