/*
Theme Name: RichHimself Modern
Theme URI: https://www.richhimself.com/
Author: RichHimself
Author URI: https://www.richhimself.com/
Description: A clean, modern, content-first WordPress theme for RichHimself, designed for technology, projects, motors and everything in between. Includes dedicated widget areas for advertising and a responsive reading experience.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: richhimself-modern
Tags: blog, technology, responsive-layout, accessibility-ready, custom-logo, custom-background, custom-menu, featured-images
*/

:root {
  --rh-bg: #f7f8fa;
  --rh-surface: #ffffff;
  --rh-surface-2: #f0f3f6;
  --rh-text: #18212b;
  --rh-muted: #667381;
  --rh-border: #e2e7ec;
  --rh-accent: #1769e0;
  --rh-accent-dark: #0d4fae;
  --rh-max: 1180px;
  --rh-radius: 14px;
  --rh-shadow: 0 10px 35px rgba(24, 33, 43, .07);
  --rh-code: #17202a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--rh-bg);
  color: var(--rh-text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.75;
}
img { max-width: 100%; height: auto; }
a { color: var(--rh-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--rh-accent-dark); }
button, input, textarea, select { font: inherit; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; z-index: 99999; top: 10px; left: 10px;
  width: auto; height: auto; padding: 10px 14px; margin: 0;
  clip: auto; background: #111; color: #fff;
}

.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--rh-border);
  backdrop-filter: blur(12px);
}
.header-inner {
  max-width: var(--rh-max); margin: auto; padding: 0 24px;
  min-height: 76px; display: flex; align-items: center; gap: 28px;
}
.site-branding { margin-right: auto; }
.site-title {
  color: var(--rh-text); text-decoration: none; font-size: 1.55rem; font-weight: 800;
  letter-spacing: -.045em; line-height: 1;
}
.site-description { display: none; }
.custom-logo { max-height: 48px; width: auto; }

.primary-navigation ul {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  margin: 0; padding: 0; list-style: none;
}
.primary-navigation a {
  display: block; padding: 9px 11px; color: var(--rh-text); text-decoration: none;
  border-radius: 9px; font-size: .93rem; font-weight: 650;
}
.primary-navigation a:hover,
.primary-navigation .current-menu-item > a { background: var(--rh-surface-2); color: var(--rh-accent); }

.menu-toggle {
  display: none; border: 1px solid var(--rh-border); background: var(--rh-surface);
  border-radius: 9px; padding: 8px 11px; cursor: pointer;
}

.site-main { padding: 44px 24px 70px; }
.container { max-width: var(--rh-max); margin: 0 auto; }
.content-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 34px; align-items: start;
}

.hero {
  background: linear-gradient(135deg, #fff 0%, #eef5ff 100%);
  border: 1px solid var(--rh-border); border-radius: 20px; padding: 38px;
  margin-bottom: 34px; box-shadow: var(--rh-shadow);
}
.eyebrow {
  margin: 0 0 8px; color: var(--rh-accent); font-size: .78rem; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase;
}
.hero h1 { max-width: 760px; margin: 0 0 10px; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.08; letter-spacing: -.055em; }
.hero p { max-width: 720px; margin: 0; color: var(--rh-muted); font-size: 1.08rem; }

.section-heading {
  display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 0 0 18px;
}
.section-heading h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.035em; }
.section-heading a { font-size: .9rem; font-weight: 700; }

.posts-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px;
}
.post-card {
  background: var(--rh-surface); border: 1px solid var(--rh-border); border-radius: var(--rh-radius);
  overflow: hidden; box-shadow: 0 5px 22px rgba(24,33,43,.04);
  transition: transform .18s ease, box-shadow .18s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--rh-shadow); }
.post-card-image { display: block; aspect-ratio: 16/9; background: var(--rh-surface-2); overflow: hidden; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-body { padding: 21px; }
.post-meta { color: var(--rh-muted); font-size: .8rem; line-height: 1.5; }
.post-card h3 { margin: 8px 0 9px; font-size: 1.25rem; line-height: 1.28; letter-spacing: -.025em; }
.post-card h3 a { color: var(--rh-text); text-decoration: none; }
.post-card h3 a:hover { color: var(--rh-accent); }
.post-excerpt { margin: 0; color: var(--rh-muted); font-size: .94rem; line-height: 1.6; }

.no-image { display: grid; place-items: center; color: #8b98a6; font-size: .85rem; font-weight: 700; }

.sidebar { position: sticky; top: 102px; }
.widget {
  background: var(--rh-surface); border: 1px solid var(--rh-border); border-radius: var(--rh-radius);
  padding: 21px; margin-bottom: 20px;
}
.widget-title { margin: 0 0 13px; font-size: 1rem; letter-spacing: -.015em; }
.widget ul { margin: 0; padding-left: 18px; }
.widget li + li { margin-top: 7px; }
.ad-widget { text-align: center; min-height: 90px; }
.ad-label { color: #98a2ad; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 7px; }

.article-header { max-width: 850px; margin: 0 auto 30px; }
.article-header h1, .archive-header h1 {
  margin: 0 0 12px; font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.07; letter-spacing: -.055em;
}
.article-meta { color: var(--rh-muted); font-size: .9rem; }
.article-category { font-weight: 750; color: var(--rh-accent); }
.article-layout { max-width: 850px; margin: 0 auto; }
.article-content {
  background: var(--rh-surface); border: 1px solid var(--rh-border); border-radius: 18px;
  padding: clamp(24px, 5vw, 50px); box-shadow: var(--rh-shadow);
}
.article-content > *:first-child { margin-top: 0; }
.article-content h2 { margin-top: 2em; font-size: 1.75rem; line-height: 1.2; letter-spacing: -.035em; }
.article-content h3 { margin-top: 1.8em; font-size: 1.35rem; line-height: 1.3; }
.article-content p, .article-content ul, .article-content ol { margin-top: 1.1em; }
.article-content blockquote {
  margin: 1.5em 0; padding: 1px 22px; border-left: 4px solid var(--rh-accent);
  background: var(--rh-surface-2); color: #4f5c68;
}
.article-content pre {
  position: relative; overflow: auto; margin: 1.5em 0; padding: 20px;
  background: var(--rh-code); color: #eef3f7; border-radius: 10px; font-size: .88em;
}
.article-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .9em;
}
.article-content :not(pre) > code { padding: 2px 6px; border-radius: 5px; background: var(--rh-surface-2); }
.article-content table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
.article-content th, .article-content td { border: 1px solid var(--rh-border); padding: 9px 11px; text-align: left; }
.article-content th { background: var(--rh-surface-2); }
.article-content .wp-caption { max-width: 100%; }
.article-content .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.article-content .wp-block-image img { border-radius: 9px; }
.wp-block-button__link { text-decoration: none; }

.ad-slot {
  margin: 22px 0; padding: 4px; text-align: center; min-height: 60px;
}
.ad-slot .ad-label { display: block; }

.post-footer {
  margin-top: 28px; padding-top: 25px; border-top: 1px solid var(--rh-border);
}
.post-tags a {
  display: inline-block; margin: 0 6px 6px 0; padding: 5px 9px; border-radius: 999px;
  background: var(--rh-surface-2); color: var(--rh-muted); text-decoration: none; font-size: .8rem;
}
.related-posts { margin-top: 34px; }
.related-posts .posts-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.pagination { display: flex; justify-content: center; gap: 7px; margin-top: 32px; }
.pagination .page-numbers {
  display: inline-block; padding: 8px 12px; border: 1px solid var(--rh-border);
  background: var(--rh-surface); border-radius: 8px; text-decoration: none;
}
.pagination .current { background: var(--rh-accent); border-color: var(--rh-accent); color: #fff; }

.archive-header { margin-bottom: 28px; }
.archive-header p { color: var(--rh-muted); margin-top: 0; }

.site-footer {
  border-top: 1px solid var(--rh-border); background: #fff; padding: 45px 24px;
}
.footer-grid {
  max-width: var(--rh-max); margin: auto; display: grid;
  grid-template-columns: 1.3fr 1fr 1fr; gap: 35px;
}
.footer-title { font-size: 1rem; font-weight: 800; margin: 0 0 10px; }
.site-footer p, .site-footer li { color: var(--rh-muted); font-size: .9rem; }
.site-footer ul { padding-left: 18px; }
.footer-bottom {
  max-width: var(--rh-max); margin: 30px auto 0; padding-top: 18px;
  border-top: 1px solid var(--rh-border); color: var(--rh-muted); font-size: .8rem;
}
.search-form { display: flex; gap: 8px; }
.search-form label { flex: 1; }
.search-field {
  width: 100%; border: 1px solid var(--rh-border); border-radius: 8px; padding: 9px 11px; background: #fff;
}
.search-submit {
  border: 0; border-radius: 8px; padding: 9px 13px; background: var(--rh-accent); color: #fff; cursor: pointer;
}

@media (max-width: 900px) {
  .header-inner { min-height: 68px; }
  .menu-toggle { display: block; }
  .primary-navigation { display: none; width: 100%; }
  .primary-navigation.is-open { display: block; }
  .header-inner { flex-wrap: wrap; }
  .primary-navigation ul { flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  .content-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .site-main { padding: 28px 15px 55px; }
  .header-inner { padding: 0 15px; }
  .hero { padding: 26px 21px; border-radius: 15px; }
  .posts-grid, .related-posts .posts-grid { grid-template-columns: 1fr; }
  .article-header h1, .archive-header h1 { font-size: 2.35rem; }
  .article-content { padding: 23px 18px; border-radius: 13px; }
  .footer-grid { grid-template-columns: 1fr; }
}
