/*
Theme Name: Resource Help Network
Theme URI: https://resourcehelpnetwork.com
Author: Arnel Colar
Description: A complete, standalone block theme purpose-built for Resource Help Network; category-driven homepage, sticky-sidebar articles, and reusable content patterns, all editable natively through the Site Editor. No parent theme, no page builder required.
Version: 1.0
Requires at least: 6.4
Requires PHP: 7.4
Tested up to: 6.9
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rhn
*/

/* ==========================================================================
   BASE / RESET
   ========================================================================== */
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--wp--preset--color--text, #444d4d);
  background: var(--wp--preset--color--background, #ffffff);
}
a { color: var(--wp--preset--color--link, #066aab); }
a:hover { color: var(--wp--preset--color--link-hover, #47c1e6); }
img { max-width: 100%; height: auto; }

/* ==========================================================================
   HEADER
   ========================================================================== */
.rhn-site-header {
  border-bottom: 1px solid var(--wp--preset--color--border, #dcd9d9);
  padding: 14px 20px;
}
.rhn-header-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.rhn-logo {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--wp--preset--color--ink, #08133d);
  text-decoration: none !important;
}
.rhn-logo span { color: var(--wp--preset--color--primary, #066aab); }
.rhn-main-nav ul {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  font-weight: 600;
}
.rhn-main-nav a {
  color: var(--wp--preset--color--ink, #08133d);
  text-decoration: none !important;
}
.rhn-main-nav a:hover { color: var(--wp--preset--color--primary, #066aab); }
.rhn-contact-btn a {
  display: inline-block;
  background: var(--wp--preset--color--primary, #066aab);
  color: #fff !important;
  padding: 10px 24px;
  border-radius: 24px;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none !important;
  flex-shrink: 0;
}
.rhn-contact-btn a:hover { background: var(--wp--preset--color--primary-hover, #04517f); }

@media (max-width: 782px) {
  .rhn-main-nav { display: none; }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.rhn-site-footer {
  background: var(--wp--preset--color--tint, #eaf6fb);
  padding: 40px 20px 20px;
}
.rhn-footer-top {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 40px;
  padding-bottom: 24px;
}
.rhn-footer-top > div:first-child { flex: 0 0 auto; min-width: 200px; }
.rhn-footer-logo { font-weight: 800; font-size: 1.1rem; margin-bottom: 14px; }
.rhn-footer-social { display: flex; gap: 12px; }
.rhn-footer-social a {
  width: 32px; height: 32px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.rhn-footer-social a svg { width: 16px; height: 16px; }
.rhn-footer-nav-cols {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  flex: 0 0 auto;
  min-width: 140px;
}
.rhn-footer-nav-cols a { color: var(--wp--preset--color--ink, #08133d); text-decoration: none !important; }
.rhn-footer-disclaimer {
  flex: 1 1 320px;
  font-size: 0.78rem;
  color: var(--wp--preset--color--text, #444d4d);
  line-height: 1.7;
}
.rhn-footer-bottom {
  max-width: 1140px;
  margin: 0 auto;
  border-top: 1px solid var(--wp--preset--color--border, #dcd9d9);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.72rem;
  color: var(--wp--preset--color--text, #444d4d);
}
.rhn-footer-bottom-nav { display: flex; gap: 14px; flex-wrap: wrap; }
.rhn-footer-bottom-nav a { color: inherit; text-decoration: none !important; }

@media (max-width: 900px) {
  .rhn-footer-top { flex-direction: column; }
}

/* ==========================================================================
   RHN COMPONENTS (article body patterns)
   ========================================================================== */
.rhn-sticky-toc {
  position: sticky; top: 24px;
  background: var(--wp--preset--color--card-bg, #ffffff);
  border: 1px solid var(--wp--preset--color--border, #dcd9d9);
  border-radius: 8px; padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.rhn-sticky-toc ol { margin: 0; padding-left: 20px; }
.rhn-sticky-toc li a { text-decoration: none; color: var(--wp--preset--color--link, #066aab); font-weight: 500; }
.rhn-sticky-toc li a:hover { text-decoration: underline; }

.rhn-card {
  background: var(--wp--preset--color--card-bg, #ffffff);
  border: 1px solid var(--wp--preset--color--border, #dcd9d9);
  border-radius: 10px; padding: 24px 28px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.rhn-comparison-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.rhn-comparison-table thead th {
  background: var(--wp--preset--color--primary, #066aab); color: #fff;
  text-align: left; padding: 12px 16px; position: sticky; top: 0;
}
.rhn-comparison-table tbody tr:nth-child(even) { background: var(--wp--preset--color--surface, #F9F9F9); }
.rhn-comparison-table td, .rhn-comparison-table th {
  padding: 12px 16px; border-bottom: 1px solid var(--wp--preset--color--border, #dcd9d9);
}

.rhn-cta-button { background: transparent !important; padding: 0 !important; }
.rhn-cta-button .wp-block-button__link {
  background: var(--wp--preset--color--primary, #066aab) !important;
  color: #fff !important; padding: 12px 28px !important; border-radius: 24px;
  font-weight: 600; text-decoration: none !important;
}
.rhn-cta-button .wp-block-button__link:hover { background: var(--wp--preset--color--primary-hover, #04517f) !important; }

.rhn-key-takeaways {
  background: var(--wp--preset--color--surface, #F9F9F9);
  border-left: 4px solid var(--wp--preset--color--primary, #066aab);
  border-radius: 0 8px 8px 0; padding: 20px 24px;
}
.rhn-key-takeaways ul { margin: 8px 0 0; }

@media (max-width: 782px) { .rhn-sticky-toc { position: static; } }

/* ==========================================================================
   HOMEPAGE
   ========================================================================== */
.rhn-home-wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

.rhn-cat-section { background: var(--wp--preset--color--tint, #eaf6fb); padding: 32px 20px 40px; }
.rhn-cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; text-align: left; }
.rhn-cat-grid.rhn-hidden-row { display: none; margin-top: 16px; }
.rhn-cat-grid.rhn-hidden-row.rhn-open { display: grid; }
.rhn-cat-card {
  background: #fff; border-radius: 8px; padding: 24px;
  box-shadow: 3px 3px 0 rgba(10,14,18,0.04);
  display: flex; align-items: center; gap: 16px;
}
.rhn-cat-card .rhn-icon-box {
  width: 40px; height: 40px; border-radius: 6px;
  background: var(--wp--preset--color--tint, #eaf6fb);
  display: flex; align-items: center; justify-content: center;
  color: var(--wp--preset--color--primary, #066aab); font-weight: 700; flex-shrink: 0;
  margin: 0;
}
.rhn-cat-card h3 { font-size: 1.1rem; margin: 0 0 2px; }
.rhn-cat-card .rhn-label { font-size: 0.72rem; color: var(--wp--preset--color--text, #444d4d); letter-spacing: 0.03em; margin: 0; }
.rhn-highlight-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.rhn-highlight-card {
  background: #fff; border-radius: 8px; padding: 16px;
  box-shadow: 0 -3px 0 var(--wp--preset--color--accent, #f26b42) inset;
}
.rhn-highlight-card .rhn-tag { font-size: 0.7rem; font-style: italic; color: var(--wp--preset--color--text, #444d4d); margin: 0 0 6px; }
.rhn-highlight-card .rhn-action { font-size: 0.78rem; font-weight: 700; text-decoration: underline; margin: 0; }
.rhn-show-more-btn {
  margin-top: 20px; background: rgba(255,255,255,0.5); border: none; height: 40px; width: 100%;
  font-weight: 700; font-size: 0.85rem; cursor: pointer; border-radius: 4px;
}

.rhn-offer-card {
  background: linear-gradient(120deg, var(--wp--preset--color--primary, #066aab) 0%, var(--wp--preset--color--primary-hover, #04517f) 100%);
  border-radius: 6px; padding: 32px 36px; color: #fff;
}
.rhn-offer-badge {
  background: var(--wp--preset--color--accent, #f26b42); color: #fff; display: inline-block;
  padding: 4px 12px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.03em; margin-bottom: 10px;
}
.rhn-offer-btn { background: transparent !important; padding: 0 !important; margin-top: 12px; }
.rhn-offer-btn .wp-block-button__link {
  background: #fff !important;
  color: var(--wp--preset--color--primary, #066aab) !important;
  padding: 11px 26px !important;
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 24px;
  text-decoration: none !important;
}

.rhn-awards-banner { background: var(--wp--preset--color--primary-hover, #04517f); border-radius: 6px; padding: 36px 40px; color: #fff; }
.rhn-awards-btn { background: transparent !important; padding: 0 !important; }
.rhn-awards-btn .wp-block-button__link {
  background: var(--wp--preset--color--accent, #f26b42) !important;
  color: #fff !important;
  padding: 12px 30px !important;
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 24px;
  text-decoration: none !important;
}

.rhn-guides-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rhn-guide-link {
  border: 1px solid var(--wp--preset--color--border, #dcd9d9); border-radius: 4px; padding: 10px;
  display: flex; align-items: center; gap: 14px; font-weight: 700; font-size: 0.9rem; text-decoration: none !important;
  box-sizing: border-box; width: 100%;
}
.rhn-guide-icon {
  background: var(--wp--preset--color--accent, #f26b42); border-radius: 4px; padding: 10px; flex-shrink: 0;
  width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; color: #fff;
}

.rhn-picks-section { background: var(--wp--preset--color--tint, #eaf6fb); padding: 36px 20px; }
.rhn-picks-col { background: #fff; padding: 24px; }
.rhn-picks-col ul {
  list-style: none; margin: 0; padding: 14px 0 0;
  border-top: 4px solid var(--wp--preset--color--primary, #066aab);
}
.rhn-picks-col li { position: relative; padding-left: 16px; margin-bottom: 10px; font-size: 0.85rem; }
.rhn-picks-col li:before {
  content: ""; position: absolute; left: 0; top: 6px; width: 6px; height: 6px;
  background: var(--wp--preset--color--primary, #066aab);
}

.rhn-trust-section {
  background: linear-gradient(120deg, var(--wp--preset--color--primary-hover, #04517f), var(--wp--preset--color--ink, #08133d));
  padding: 44px 20px; color: #fff; text-align: center;
}
.rhn-trust-stats { max-width: 600px; margin: 24px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.rhn-trust-stats .rhn-num { font-size: 1.6rem; font-weight: 800; margin: 0; }

.rhn-author-card { background: var(--wp--preset--color--tint, #eaf6fb); padding: 28px; border-radius: 4px; }
.rhn-author-avatar {
  width: 56px; height: 56px; border-radius: 50%; background: var(--wp--preset--color--primary, #066aab);
  margin-bottom: 10px; display: flex; align-items: center; justify-content: center;
}
.rhn-author-card .rhn-bio {
  border-left: 1px solid var(--wp--preset--color--accent-blue, #47c1e6); padding-left: 14px;
  font-size: 0.85rem; color: var(--wp--preset--color--text, #444d4d);
}

.rhn-recent-thumb { height: 150px; border-radius: 4px; background: var(--wp--preset--color--tint, #eaf6fb); margin-bottom: 10px; overflow: hidden; }
.rhn-recent-thumb img { width: 100%; height: 100%; object-fit: cover; }

.rhn-basics-col ul {
  list-style: none; margin: 0; padding: 14px 0 0;
  border-top: 4px solid var(--wp--preset--color--primary, #066aab);
}
.rhn-basics-col li { position: relative; padding-left: 16px; margin-bottom: 8px; font-size: 0.85rem; }
.rhn-basics-col li:before {
  content: ""; position: absolute; left: 0; top: 6px; width: 6px; height: 6px;
  background: var(--wp--preset--color--primary, #066aab);
}

.rhn-topics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rhn-topic-pill {
  background: var(--wp--preset--color--surface, #F9F9F9); border: 1px solid var(--wp--preset--color--border, #dcd9d9);
  border-radius: 4px; padding: 12px 18px; font-weight: 700; font-size: 0.85rem;
  display: flex; justify-content: space-between; align-items: center; text-decoration: none !important;
  box-sizing: border-box; width: 100%;
}
.rhn-topic-pill:hover { background: var(--wp--preset--color--primary, #066aab); color: #fff !important; }

/* ==========================================================================
   HIGH-SPECIFICITY OVERRIDES — WordPress's default .is-layout-flow /
   .is-layout-constrained rules on wp-block-group beat plain class selectors
   for grid-template-columns and background. Forcing with !important and
   resetting any width/margin WP imposes on grid children.
   ========================================================================== */
body .rhn-topics-grid,
body .rhn-guides-grid,
body .rhn-cat-grid,
body .rhn-highlight-row {
  display: grid !important;
}
body .rhn-topics-grid { grid-template-columns: repeat(4, 1fr) !important; }
body .rhn-guides-grid { grid-template-columns: repeat(3, 1fr) !important; }
body .rhn-cat-grid { grid-template-columns: repeat(3, 1fr) !important; }
body .rhn-highlight-row { grid-template-columns: repeat(3, 1fr) !important; }

body .rhn-topics-grid > *,
body .rhn-guides-grid > *,
body .rhn-cat-grid > *,
body .rhn-highlight-row > * {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}

body .rhn-site-footer {
  background: var(--wp--preset--color--tint, #eaf6fb) !important;
}
body .rhn-cat-section {
  background: var(--wp--preset--color--tint, #eaf6fb) !important;
}
body .rhn-picks-section {
  background: var(--wp--preset--color--tint, #eaf6fb) !important;
}

@media (max-width: 900px) {
  body .rhn-topics-grid,
  body .rhn-guides-grid,
  body .rhn-cat-grid,
  body .rhn-highlight-row {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   CONTACT PAGE FORM
   ========================================================================== */
.rhn-contact-form input,
.rhn-contact-form textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--wp--preset--color--border, #dcd9d9);
  border-radius: 4px; font-family: inherit; font-size: 0.95rem; margin-bottom: 14px;
}
.rhn-contact-form button {
  background: var(--wp--preset--color--primary, #066aab); color: #fff; border: none;
  padding: 12px 30px; font-weight: 700; border-radius: 4px; cursor: pointer;
}