/* =========================================================
   WordPress-specific styles for the Reliable Handyman theme.
   Design tokens come from styles.css (brand guideline).
   ========================================================= */

/* Accessibility helpers */
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.screen-reader-text:focus {
  clip: auto; width: auto; height: auto; margin: 0; padding: 10px 16px; z-index: 100000;
  background: var(--white); color: var(--navy); left: 12px; top: 12px;
}
.rh-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Sticky header below the admin bar */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

/* Menus rendered by wp_nav_menu() */
.site-nav .nav-list { list-style: none; padding: 0; }
.footer-bottom ul { list-style: none; margin: 0; padding: 0; }

/* Blog sidebar categories (links in WordPress) */
.cat-list a {
  display: flex; align-items: center; gap: 14px; padding: 6px 0; text-decoration: none;
  font-family: var(--font-body); font-size: 14.5px; color: var(--navy);
}
.cat-list a:hover, .cat-list a[aria-current="page"] { color: var(--green-text); }
.cat-list a[aria-current="page"] { font-weight: 700; }

/* Posts without a featured image */
.thumb-placeholder {
  display: grid; place-items: center; width: 100%; height: 100%; min-height: 120px;
  background: linear-gradient(135deg, var(--navy) 0%, #123f7a 70%, var(--orange) 140%);
}
.thumb-placeholder img { width: 46%; max-width: 220px; height: auto; object-fit: contain; opacity: 0.95; transform: none !important; }
.thumb-placeholder--sm { width: 70px; height: 54px; min-height: 0; border-radius: var(--radius); flex-shrink: 0; }
.card-media img { display: block; }

/* Testimonials: initial avatar (no stock photos) */
.avatar-initial {
  display: grid !important; place-items: center; flex-shrink: 0; width: 52px; height: 52px; border-radius: 50%;
  background: var(--navy); color: var(--white) !important; font-family: var(--font-head); font-weight: 700; font-size: 20px !important;
}

/* Pagination */
.pagination { margin-top: 28px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers {
  display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 14px;
  border: 1.5px solid var(--gray-300); border-radius: var(--radius); background: var(--white);
  font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--navy); text-decoration: none;
}
.pagination .page-numbers:hover { border-color: var(--navy); }
.pagination .page-numbers.current { background: var(--navy); border-color: var(--navy); color: var(--white); }
.pagination .page-numbers.dots { border: 0; background: none; }

/* No results */
div.no-results { display: grid; gap: 12px; justify-items: center; }
div.no-results p { margin: 0; }

/* ---------- Generic pages & posts ---------- */
.entry-hero { padding: 40px 0 24px; }
.entry-hero h1 {
  max-width: 900px; margin: 0; font-weight: 800; font-size: clamp(32px, 3.4vw, 48px);
  line-height: 1.1; letter-spacing: -0.03em; color: var(--navy);
}
.entry-hero .breadcrumbs { margin-bottom: 18px; }
.entry-hero .post-cat { display: block; margin: 0 0 10px; }
.entry-hero--404 { padding: 72px 0 88px; }
.entry-hero--404 .lede { margin: 16px 0 0; font-size: 18px; color: var(--text-muted); }
.entry-hero--404 .hero-ctas { margin-top: 26px; }

.entry-meta {
  display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 16px 0 0;
  font-family: var(--font-head); font-size: 14px; color: var(--secondary);
}
.entry-meta span { display: inline-flex; align-items: center; gap: 8px; }
.entry-meta .ico { width: 18px; height: 18px; color: var(--orange); }

.entry-feature { margin: 8px 0 0; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); }
.entry-feature img { width: 100%; height: auto; max-height: 520px; object-fit: cover; }

.entry-wrap { padding-top: 32px; padding-bottom: 56px; }
.entry-wrap--post { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; align-items: start; }
.entry-content { max-width: 760px; font-size: 17px; line-height: 1.7; color: var(--text-muted); }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content > :first-child { margin-top: 0; }
.entry-content h2, .entry-content h3, .entry-content h4 {
  font-family: var(--font-head); color: var(--navy); line-height: 1.25; margin: 1.8em 0 0.4em; scroll-margin-top: 110px;
}
.entry-content h2 { font-weight: 800; font-size: 28px; letter-spacing: -0.01em; }
.entry-content h3 { font-weight: 700; font-size: 21px; }
.entry-content h4 { font-weight: 600; font-size: 18px; }
.entry-content p { margin: 0; }
.entry-content a { color: var(--navy); text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.entry-content a:hover { color: var(--orange-600); }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li + li { margin-top: 0.4em; }
.entry-content ul li::marker { color: var(--orange); }
.entry-content img { height: auto; border-radius: var(--radius-lg); }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption, .wp-caption-text { margin-top: 8px; font-size: 14px; color: var(--secondary); text-align: center; }
.entry-content blockquote {
  margin-left: 0; margin-right: 0; padding: 18px 22px; border-left: 4px solid var(--orange);
  background: var(--gray-50); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; font-size: 18px; color: var(--navy);
}
.entry-content table { width: 100%; border-collapse: collapse; font-size: 15px; }
.entry-content th, .entry-content td { padding: 10px 12px; border: 1px solid var(--gray-300); text-align: left; }
.entry-content th { background: var(--gray-50); color: var(--navy); font-family: var(--font-head); }
.entry-content hr { border: 0; border-top: 1px solid var(--gray-300); margin: 2em 0; }
.entry-content .wp-block-button__link, .entry-content .wp-element-button {
  display: inline-block; padding: 12px 24px; border-radius: var(--radius); background: var(--orange);
  color: var(--white); font-family: var(--font-head); font-weight: 600; text-decoration: none;
}
.entry-content .wp-block-button__link:hover { background: var(--orange-600); color: var(--white); }
/* Callout boxes: add class "tip", "warning" or "callout" to a Group block */
.entry-content .tip, .entry-content .warning, .entry-content .callout {
  padding: 18px 22px; border-radius: var(--radius-lg); border-left: 4px solid var(--green);
  background: var(--tint-green); color: var(--text-muted);
}
.entry-content .warning { border-left-color: var(--warning); background: #fff8e1; }
.entry-content .callout { border-left-color: var(--info); background: var(--tint-blue); }
.alignleft { float: left; margin: 0.3em 1.5em 1em 0; }
.alignright { float: right; margin: 0.3em 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide, .alignfull { max-width: 100%; }

.author-box {
  display: flex; gap: 18px; align-items: center; margin-top: 2.4em !important; padding: 20px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white);
}
.author-box img { border-radius: 50%; flex-shrink: 0; }
.author-box p { margin: 0; font-size: 15px; line-height: 1.5; }
.author-box .author-name { font-family: var(--font-head); font-weight: 700; font-size: 17px; color: var(--navy); }

.entry-aside { position: sticky; top: 120px; display: grid; gap: 16px; }
.toc h2 { font-size: 17px !important; margin-bottom: 10px !important; }
.toc ol { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; font-size: 14.5px; }
.toc a { color: var(--navy); text-decoration: none; }
.toc a:hover { color: var(--orange-600); text-decoration: underline; }
.entry-aside .good-hands { border-radius: var(--radius-lg); gap: 12px; }
.entry-aside .good-hands > p { border-bottom: 0; padding-bottom: 0; }
.entry-aside .good-hands .btn { width: 100%; }
.good-hands-call { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--white); font-family: var(--font-head); font-weight: 600; text-decoration: none; }
.good-hands-call .ico { width: 18px; height: 18px; color: var(--orange); }
.good-hands-call:hover { text-decoration: underline; }

.related { background: var(--gray-50); }
.related-title { font-weight: 800; font-size: 28px; color: var(--navy); margin-bottom: 20px; }
.related .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 60; background: transparent; }
.admin-bar .reading-progress { top: 32px; }
.reading-progress span { display: block; height: 100%; background: var(--orange); transform: scaleX(0); transform-origin: 0 50%; }

@media (max-width: 1140px) {
  .entry-wrap--post { grid-template-columns: 1fr; gap: 32px; }
  .entry-aside { position: static; }
  .related .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .related .post-grid { grid-template-columns: 1fr; }
  .entry-content { font-size: 16px; }
}
