/*
Theme Name: RidgePages Roofer
Theme URI: https://ridgepages.com
Author: RidgePages
Author URI: https://ridgepages.com
Description: A fast, clean, SEO-ready WordPress theme built for roofing companies. Ships a ready homepage (hero, services, recent projects, reviews, CTA) and renders RidgePages project posts natively. Lightweight — no page builder required.
Version: 1.0.3
Requires at least: 5.6
Tested up to: 6.7
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: ridgepages-roofer
*/

:root {
  --rp-ink: #0f172a;
  --rp-body: #334155;
  --rp-muted: #64748b;
  --rp-line: #e2e8f0;
  --rp-soft: #f1f5f9;
  --rp-page: #f8fafc;
  --rp-accent: #f97316;
  --rp-accent-600: #ea580c;
  --rp-green: #16a34a;
  --rp-wrap: 1160px;
  --rp-radius: 14px;
  --rp-header-h: 72px;
  --rp-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--rp-font);
  color: var(--rp-body);
  background: var(--rp-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rp-accent); text-decoration: none; }
h1, h2, h3 { color: var(--rp-ink); letter-spacing: -0.02em; line-height: 1.12; margin: 0; }
/* Sticky header would otherwise cover a section you jump to via #anchor. */
[id] { scroll-margin-top: calc(var(--rp-header-h) + 18px); }
.rp-wrap { max-width: var(--rp-wrap); margin: 0 auto; padding: 0 clamp(18px, 5vw, 30px); }
.rp-eyebrow { font-size: 13px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rp-accent); margin: 0 0 12px; }

/* Buttons */
.rp-btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 9px; padding: 14px 26px; font-weight: 700; font-size: 16px; cursor: pointer; border: 1px solid transparent; white-space: nowrap; transition: background .15s, border-color .15s; }
.rp-btn-primary { background: var(--rp-accent); color: #fff; }
.rp-btn-primary:hover { background: var(--rp-accent-600); }
.rp-btn-ghost { background: #fff; color: var(--rp-ink); border-color: #cbd5e1; }
.rp-btn-ghost:hover { border-color: #94a3b8; }
.rp-btn-white { background: #fff; color: var(--rp-ink); }

/* Header */
.rp-header { position: sticky; top: 0; z-index: 50; background: rgba(248,250,252,0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rp-line); }
.rp-header-in { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 20px; }
.rp-brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 21px; color: var(--rp-ink); letter-spacing: -0.02em; white-space: nowrap; }
.rp-brand svg { flex: none; }
.rp-nav { display: flex; align-items: center; gap: 26px; }
.rp-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--rp-body); font-weight: 500; font-size: 15px; }
.rp-nav a:hover { color: var(--rp-ink); }
.rp-header-cta { display: flex; align-items: center; gap: 16px; }
.rp-phone { display: flex; flex-direction: column; justify-content: center; min-height: 44px; font-weight: 800; color: var(--rp-ink); font-size: 16px; white-space: nowrap; }
.rp-phone span { color: var(--rp-muted); font-weight: 600; font-size: 12px; display: block; letter-spacing: 0.04em; text-transform: uppercase; }

/* Mobile menu */
.rp-burger { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 0 10px; background: transparent; border: 1px solid var(--rp-line); border-radius: 9px; cursor: pointer; }
.rp-burger span { display: block; height: 2px; background: var(--rp-ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
.rp-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.rp-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.rp-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.rp-mobile { display: none; border-top: 1px solid var(--rp-line); background: #fff; }
.rp-mobile.open { display: block; }
.rp-mobile a { display: block; padding: 15px clamp(18px, 5vw, 30px); font-size: 16px; font-weight: 600; color: var(--rp-body); border-bottom: 1px solid var(--rp-soft); }
.rp-mobile a:hover { color: var(--rp-ink); background: var(--rp-soft); }
.rp-mobile-call { color: var(--rp-accent) !important; font-weight: 800 !important; display: flex !important; align-items: center; gap: 8px; border-bottom: none !important; }

/* Laptop / iPad landscape: the full nav + phone + CTA needs ~1060px. Between
   the nav breakpoint and that, tighten the row instead of letting it overflow. */
@media (max-width: 1120px) and (min-width: 901px) {
  .rp-nav { gap: 17px; }
  .rp-nav a, .rp-drop-toggle { font-size: 14px; }
  .rp-phone { font-size: 15px; }
  .rp-phone span { display: none; }
  .rp-header-cta { gap: 12px; }
  .rp-header .rp-btn { padding: 12px 18px; font-size: 15px; }
  .rp-brand { font-size: 19px; }
}

@media (max-width: 900px) {
  .rp-nav { display: none; }
  .rp-burger { display: flex; }
  /* Keep the phone on tablet — it's the primary conversion. Drop the sublabel
     so it fits next to the brand, CTA and burger. */
  .rp-phone { font-size: 15px; }
  .rp-phone span { display: none; }
  .rp-header-cta { gap: 12px; }
}
@media (max-width: 720px) {
  .rp-phone { display: none; } /* burger "Call" row takes over */
}
@media (max-width: 640px) {
  .rp-cta-btn { display: none; } /* hero CTA + burger "Call" cover mobile */
  .rp-brand { font-size: 18px; gap: 8px; }
}

/* Hero — premium even with no photo: layered navy gradient + faint roofline
   pattern + a warm orange glow. Add a photo (Customize) and a scrim keeps text
   legible. */
.rp-hero { position: relative; color: #fff; overflow: hidden; }
.rp-hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(115% 85% at 88% -8%, rgba(249,115,22,0.22), transparent 55%),
    linear-gradient(158deg, #13233d 0%, #0f172a 52%, #0b1120 100%);
}
.rp-hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='240'%20height='120'%3E%3Cg%20fill='none'%20stroke='%23ffffff'%20stroke-opacity='0.06'%20stroke-width='2'%3E%3Cpath%20d='M-40%20120%20L120%2024%20L280%20120'/%3E%3Cpath%20d='M-40%20168%20L120%2072%20L280%20168'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 240px 120px;
}
.rp-hero-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.5; }
.rp-hero--photo .rp-hero-bg::before { opacity: 0.18; }
.rp-hero--photo .rp-hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(92deg, rgba(9,14,25,0.94) 0%, rgba(9,14,25,0.6) 52%, rgba(9,14,25,0.22) 100%);
}
.rp-hero-in { position: relative; padding-top: clamp(56px, 8vw, 108px); padding-bottom: clamp(56px, 8vw, 108px); max-width: 46rem; }
.rp-hero .rp-eyebrow { color: #fdba74; }
.rp-hero h1 { color: #fff; font-size: clamp(34px, 5.2vw, 60px); font-weight: 900; letter-spacing: -0.03em; }
.rp-hero p { font-size: clamp(17px, 1.6vw, 20px); color: #e2e8f0; margin: 20px 0 0; max-width: 34rem; }
.rp-hero-cta { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; }
.rp-trust { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.rp-trust span { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: #f1f5f9; }
.rp-trust svg { color: var(--rp-accent); flex: none; }

/* Sections */
.rp-section { padding: clamp(52px, 7vw, 90px) 0; }
.rp-section.alt { background: var(--rp-soft); border-top: 1px solid var(--rp-line); border-bottom: 1px solid var(--rp-line); }
.rp-head { max-width: 40rem; margin: 0 0 40px; }
.rp-head h2 { font-size: clamp(27px, 3.6vw, 42px); font-weight: 900; }
.rp-head p { margin: 14px 0 0; font-size: 18px; color: var(--rp-muted); }

/* Services */
.rp-grid { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .rp-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .rp-grid { grid-template-columns: 1fr; } }
.rp-card { background: #fff; border: 1px solid var(--rp-line); border-radius: var(--rp-radius); padding: 26px; transition: box-shadow .2s, transform .2s; }
.rp-card:hover { box-shadow: 0 18px 40px -24px rgba(15,23,42,0.35); transform: translateY(-2px); }
.rp-ico { width: 46px; height: 46px; border-radius: 11px; background: #fff7ed; color: var(--rp-accent); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.rp-card h3 { font-size: 19px; font-weight: 800; }
.rp-card p { margin: 8px 0 0; font-size: 15px; color: var(--rp-muted); }
.rp-card a.rp-more, .rp-card .rp-more { display: inline-block; margin-top: 14px; font-weight: 700; font-size: 14px; color: var(--rp-accent); }
.rp-card[href]:hover .rp-more { text-decoration: underline; }

/* Why / stats */
.rp-stats { display: grid; gap: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* 4-up gets cramped well before phone width — "2,000+" at 40px needs room. */
@media (max-width: 980px) { .rp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rp-stat { text-align: center; padding: 22px 18px; background: #fff; border: 1px solid var(--rp-line); border-radius: var(--rp-radius); }
.rp-stat b { display: block; font-size: clamp(28px, 5vw, 40px); font-weight: 900; color: var(--rp-ink); letter-spacing: -0.03em; }
.rp-stat span { display: block; font-size: 14px; color: var(--rp-muted); font-weight: 600; text-wrap: balance; }

/* Reviews */
.rp-reviews { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
/* Tablet: 2-up with the last one spanning, rather than 3 full-width slabs. */
@media (max-width: 980px) {
  .rp-reviews { grid-template-columns: 1fr 1fr; }
  .rp-reviews > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .rp-reviews { grid-template-columns: 1fr; }
  .rp-reviews > :last-child { grid-column: auto; }
}
.rp-review { background: #fff; border: 1px solid var(--rp-line); border-radius: var(--rp-radius); padding: 24px; }
.rp-stars { color: var(--rp-accent); letter-spacing: 2px; font-size: 15px; }
.rp-review p { margin: 10px 0 0; color: var(--rp-body); }
.rp-review cite { display: block; margin-top: 12px; font-style: normal; font-weight: 700; color: var(--rp-ink); font-size: 14px; }

/* CTA band */
.rp-cta { background: var(--rp-accent); color: #fff; }
.rp-cta-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding-top: clamp(36px, 5vw, 60px); padding-bottom: clamp(36px, 5vw, 60px); }
.rp-cta h2 { color: #fff; font-size: clamp(24px, 3vw, 36px); font-weight: 900; max-width: 30rem; }
.rp-cta p { margin: 8px 0 0; color: rgba(255,255,255,0.9); }
/* On orange, the default ghost button reads as a second white button — no
   hierarchy. Outline it instead so "Call" stays the clear primary. */
.rp-cta .rp-btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.6); }
.rp-cta .rp-btn-ghost:hover { background: rgba(255,255,255,0.14); border-color: #fff; }

/* Footer */
.rp-footer { background: var(--rp-ink); color: #94a3b8; }
.rp-footer-in { padding-top: 54px; padding-bottom: 28px; display: grid; gap: 32px; grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 900px) {
  .rp-footer-in { grid-template-columns: 1fr 1fr; gap: 28px 32px; }
  .rp-footer-in > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) { .rp-footer-in { grid-template-columns: 1fr; } }
.rp-footer h4 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 14px; }
/* 44px min height — these are the smallest tap targets on the page. */
.rp-footer a { color: #cbd5e1; display: flex; align-items: center; min-height: 44px; padding: 4px 0; font-size: 14px; }
.rp-footer a:hover { color: #fff; }
.rp-footer .rp-brand { color: #fff; margin-bottom: 12px; }
.rp-footer-p { font-size: 14px; line-height: 1.7; max-width: 24rem; }
.rp-footer-legal { border-top: 1px solid #1e293b; margin-top: 32px; padding-top: 20px; font-size: 13px; color: #64748b; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* Single project post: give the plugin's scoped .rp-project block a clean home */
.rp-single { padding: clamp(36px, 5vw, 60px) 0; }
.rp-single .rp-back { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--rp-muted); margin-bottom: 20px; }
.rp-page-title { max-width: 820px; margin: 0 auto clamp(20px,3vw,32px); }
.rp-page-title h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 900; }
.rp-page-body { max-width: 820px; margin: 0 auto; }
.rp-page-body p { margin: 0 0 16px; }

/* Archive / projects listing */
.rp-list { display: grid; gap: 22px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .rp-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .rp-list { grid-template-columns: 1fr; } }
.rp-list-card { display: block; background: #fff; border: 1px solid var(--rp-line); border-radius: var(--rp-radius); overflow: hidden; color: inherit; }
.rp-list-card .rp-thumb { aspect-ratio: 4/3; background: var(--rp-soft); overflow: hidden; }
.rp-list-card .rp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rp-list-card .rp-list-body { padding: 16px 18px; }
.rp-list-card h3 { font-size: 16px; font-weight: 700; }

/* Services dropdown (desktop) */
.rp-has-drop { position: relative; }
.rp-drop-toggle { display: inline-flex !important; align-items: center; gap: 5px; cursor: pointer; }
.rp-drop-toggle svg { transition: transform .2s; }
.rp-has-drop:hover .rp-drop-toggle svg,
.rp-has-drop:focus-within .rp-drop-toggle svg { transform: rotate(180deg); }
.rp-drop { position: absolute; top: calc(100% + 16px); left: 50%; transform: translateX(-50%) translateY(6px);
  width: 560px; max-width: 92vw; background: #fff; border: 1px solid var(--rp-line); border-radius: 16px;
  box-shadow: 0 30px 60px -24px rgba(15,23,42,0.4); padding: 14px; z-index: 60;
  opacity: 0; visibility: hidden; transition: opacity .18s ease, transform .18s ease; }
.rp-has-drop:hover .rp-drop,
.rp-has-drop:focus-within .rp-drop { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.rp-drop::before { content: ""; position: absolute; top: -16px; left: 0; right: 0; height: 16px; } /* hover bridge */
.rp-drop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.rp-drop-item { display: flex; gap: 12px; padding: 12px; border-radius: 11px; align-items: flex-start; }
.rp-drop-item:hover { background: var(--rp-soft); }
.rp-drop-ico { flex: none; width: 38px; height: 38px; border-radius: 10px; background: #fff7ed; color: var(--rp-accent); display: flex; align-items: center; justify-content: center; }
.rp-drop-txt { display: flex; flex-direction: column; }
.rp-drop-txt b { color: var(--rp-ink); font-size: 15px; font-weight: 700; }
.rp-drop-txt small { color: var(--rp-muted); font-size: 12.5px; line-height: 1.4; margin-top: 2px; }
.rp-drop-foot { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; padding: 13px; border-radius: 11px; background: var(--rp-ink); color: #fff !important; font-weight: 700; font-size: 14px; }
.rp-drop-foot:hover { background: #1e293b; }
.rp-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Narrow phones: side-by-side buttons end up ragged and half-width. Stack them
   full-width so both CTAs are equally thumb-sized. */
@media (max-width: 480px) {
  .rp-hero-cta, .rp-cta-actions { flex-direction: column; align-items: stretch; width: 100%; }
  .rp-hero-cta .rp-btn, .rp-cta-actions .rp-btn { width: 100%; justify-content: center; }
}

/* Balance section headings so they don't leave a one-word last line. */
.rp-head h2, .rp-cta h2 { text-wrap: balance; }
.rp-head p, .rp-hero p { text-wrap: pretty; }

/* Mobile services submenu */
.rp-mobile-h { display: block; padding: 15px clamp(18px,5vw,30px) 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rp-muted); }
.rp-mobile-sub { padding-left: clamp(30px,7vw,44px) !important; font-size: 15px !important; }
