/*
Theme Name: John S. James Co. White
Theme URI: http://johnsjames.com/
Author: John S James Co.
Author URI: http://johnsjames.com/
Description: The 2025 John S James Co. Executive Slate Theme - Redesigned with modern design system
Version: 2.0
*/

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==========================================================================
   Color Scheme - Option 2A: Executive Slate
   ========================================================================== */

:root {
    --burgundy: #550F0F;
    --slate: #4a4a4a;
    --steel-blue: #5d8aa8;
    --cloud: #f4f6f7;
    --white: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-light: #e0e0e0;
}

/* ==========================================================================
   Typography - Option 7: Tech-Forward (All Sans-Serif)
   Headlines: DM Sans, Subheadings: Plus Jakarta Sans, Body: Inter
   ========================================================================== */

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--white);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3em; }
h2 { font-size: 2.5em; }
h3 { font-size: 2em; }
h4 { font-size: 1.5em; }
h5 { font-size: 1.25em; }
h6 { font-size: 1em; }

p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

a {
    color: var(--burgundy);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--steel-blue);
}

.assistive-text,
.skip-link {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ==========================================================================
   Layout
   ========================================================================== */

#page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#main {
    flex: 1;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

/* ==========================================================================
   Top Bar
   ========================================================================== */

.top-bar {
    background: var(--slate);
    color: white;
    padding: 10px 0;
    font-size: 0.9em;
}

.top-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.top-bar-links {
    display: flex;
    gap: 25px;
}

.top-bar-links a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.top-bar-links a:hover {
    color: white;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    /* "Depth" treatment to match the homepage hero: layered dark burgundy
       base, a soft top-center glow, and an inset edge vignette (::after). */
    background:
        radial-gradient(ellipse at 50% 0%, rgba(175, 52, 52, 0.45) 0%, rgba(175, 52, 52, 0) 70%),
        linear-gradient(160deg, #4a0d0d 0%, #320a0a 45%, #2a0606 100%);
    border-bottom: 4px solid var(--slate);
    position: relative;
    overflow: hidden;
}

.site-header::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 80px 20px rgba(0, 0, 0, 0.40);
    z-index: 0;
}

.main-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.logo a {
    display: block;
    line-height: 0;
}

.logo-img {
    height: 60px;
    width: auto;
    display: block;
}

.header-cta {
    display: flex;
    gap: 15px;
    align-items: center;
}

.cta-btn {
    padding: 12px 25px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 0.95em;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
}

.cta-primary {
    background: white;
    color: var(--burgundy);
}

.cta-primary:hover {
    background: var(--cloud);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

.cta-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.cta-secondary:hover {
    background: white;
    color: var(--burgundy);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    transition: all 0.3s;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.main-nav {
    background: var(--slate);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 18px 25px;
    display: block;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s;
}

.nav-menu a:hover {
    background: rgba(255,255,255,0.1);
    color: var(--cloud);
}

.nav-menu li.current-menu-item > a,
.nav-menu li.current_page_item > a,
.nav-menu li.current-menu-ancestor > a {
    background: rgba(255,255,255,0.15);
    border-bottom: 3px solid white;
}

/* Submenu current item styling */
.nav-menu ul li.current-menu-item > a,
.nav-menu ul li.current_page_item > a {
    background: rgba(255,255,255,0.2);
    border-bottom: none;
    border-left: 3px solid white;
}

/* Sub-menus */
.nav-menu ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--slate);
    min-width: 220px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1000;
}

.nav-menu li:hover > ul {
    display: block;
}

.nav-menu ul li {
    width: 100%;
}

.nav-menu ul a {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-section {
    /* "Depth" treatment: top glow lifts the center, dark layered base, edges
       recede via the inset vignette (::after below). */
    background:
        radial-gradient(ellipse at 50% 0%, rgba(175, 52, 52, 0.40) 0%, rgba(175, 52, 52, 0) 50%),
        linear-gradient(160deg, #4a0d0d 0%, #320a0a 45%, #222222 100%);
    color: white;
    padding: 80px 30px;
    position: relative;
    overflow: hidden;
}

/* Inset vignette to darken the edges and add depth. */
.hero-section::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 140px 40px rgba(0, 0, 0, 0.55);
    z-index: 1;
}

.hero-pattern {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.03) 10px, rgba(255,255,255,0.03) 20px);
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 3.5em;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.1;
    max-width: 800px;
    color: white;
}

.hero-subtitle {
    font-size: 1.4em;
    font-weight: 400;
    margin-bottom: 35px;
    color: white;
    opacity: 0.95;
    max-width: 700px;
}

.hero-ctas {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-btn {
    padding: 18px 40px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 1.1em;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
}

.hero-btn-primary {
    background: white;
    color: var(--burgundy);
}

.hero-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.hero-btn-secondary {
    background: transparent;
    color: white;
    border: 3px solid white;
}

.hero-btn-secondary:hover {
    background: white;
    color: var(--burgundy);
}

/* ==========================================================================
   Services Grid
   ========================================================================== */

.services-section {
    padding: 80px 30px;
    background: white;
}

.section-content {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 2.8em;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.section-subtitle {
    font-size: 1.2em;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.service-card {
    background: white;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    padding: 35px 30px;
    transition: all 0.3s;
    cursor: pointer;
}

.service-card:hover {
    border-color: var(--burgundy);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(85, 15, 15, 0.15);
}

.service-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.4em;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.service-description {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 15px;
}

.service-link {
    color: var(--burgundy);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.service-link:hover {
    color: var(--steel-blue);
}

/* ==========================================================================
   Trust Section
   ========================================================================== */

.trust-section {
    background: var(--cloud);
    padding: 60px 30px;
}

.trust-stats {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    text-align: center;
}

.stat-card {
    background: white;
    padding: 30px 20px;
    border-radius: 10px;
    border-left: 4px solid var(--burgundy);
}

.stat-number {
    font-family: 'DM Sans', sans-serif;
    font-size: 3em;
    font-weight: 800;
    color: var(--burgundy);
    display: block;
    margin-bottom: 10px;
}

.stat-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1em;
    font-weight: 600;
    color: var(--text-dark);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background: var(--slate);
    color: rgba(255,255,255,0.9);
    padding: 50px 0 0;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    padding: 0 30px 40px;
}

.footer-widget-area {
    color: rgba(255,255,255,0.9);
}

.footer-widget-area h3 {
    color: white;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.2em;
    margin-bottom: 20px;
}

.footer-widget-area a {
    color: rgba(255,255,255,0.8);
}

.footer-widget-area a:hover {
    color: white;
}

.footer-bottom {
    background: rgba(0,0,0,0.2);
    padding: 25px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-bottom-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright {
    margin: 0;
    font-size: 0.9em;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    font-size: 0.9em;
}

.footer-links a:hover {
    color: white;
}

/* ==========================================================================
   Content Styles
   ========================================================================== */

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* --------------------------------------------------------------------------
   Default Page Template (page.php)
   -------------------------------------------------------------------------- */

.page-header {
    background: linear-gradient(135deg, var(--burgundy) 0%, var(--slate) 100%);
    color: white;
    padding: 45px calc(5vw + 30px);
}

.page-header-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.page-header .page-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 2.4em;
    font-weight: 800;
    line-height: 1.15;
    color: white;
    margin: 0;
}

.page-header .page-breadcrumbs,
.page-header .page-breadcrumbs a,
.page-header #breadcrumbs,
.page-header #breadcrumbs a {
    color: rgba(255,255,255,0.85);
    font-size: 0.95em;
}

.page-header .page-breadcrumbs {
    margin-bottom: 14px;
}

.page-header .page-breadcrumbs a:hover,
.page-header #breadcrumbs a:hover {
    color: white;
}

/* Fluid-width content area that breathes with the browser */
.page-main {
    padding: 50px calc(5vw + 30px) 70px;
}

.page-content-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.page-main .entry-content {
    font-size: 1.05em;
    line-height: 1.8;
    color: var(--text-dark);
}

/* Start the content flush with the top of the column (drop the first
   element's top margin, which otherwise pushes everything down). */
.page-main .entry-content > *:first-child {
    margin-top: 0;
}

/* Headings — descendant selectors (not >) so they style even when wrapped
   in leftover Elementor / block container divs. */
.page-main .entry-content h2 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.8em;
    font-weight: 800;
    line-height: 1.25;
    color: var(--burgundy);
    margin: 1.6em 0 0.5em;
}

.page-main .entry-content h3 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.35em;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-dark);
    margin: 1.4em 0 0.5em;
}

.page-main .entry-content h4 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.15em;
    font-weight: 700;
    color: var(--slate);
    margin: 1.3em 0 0.4em;
}

.page-main .entry-content p {
    margin: 0 0 1.4em;
}

/* Links inside body content. */
.page-main .entry-content a {
    color: var(--burgundy);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.page-main .entry-content a:hover {
    color: var(--steel-blue);
}

/* Lists. */
.page-main .entry-content ul,
.page-main .entry-content ol {
    margin: 0 0 1.4em 1.4em;
    padding: 0;
}

.page-main .entry-content li {
    margin-bottom: 0.5em;
}

.page-main .entry-content ul li {
    list-style: disc;
}

.page-main .entry-content ol li {
    list-style: decimal;
}

/* Images & figures — responsive, softly rounded, never overflow. */
.page-main .entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.page-main .entry-content figure {
    margin: 1.6em 0;
}

.page-main .entry-content figure img,
.page-main .entry-content .wp-caption img {
    display: block;
}

.page-main .entry-content figcaption,
.page-main .entry-content .wp-caption-text {
    font-size: 0.9em;
    color: var(--text-light);
    margin-top: 0.5em;
    text-align: center;
}

/* A bare image link (common in the orphaned Elementor markup) shouldn't get
   the body-link underline. */
.page-main .entry-content a:has(> img) {
    text-decoration: none;
}

/* Horizontal rule as a subtle section divider. */
.page-main .entry-content hr {
    border: 0;
    height: 1px;
    background: var(--border-light);
    margin: 2.4em 0;
}

/* Blockquotes. */
.page-main .entry-content blockquote {
    margin: 1.6em 0;
    padding: 0.6em 0 0.6em 1.4em;
    border-left: 4px solid var(--burgundy);
    color: var(--slate);
    font-style: italic;
}

/* Tables. */
.page-main .entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.6em;
    font-size: 0.97em;
}

.page-main .entry-content th,
.page-main .entry-content td {
    border: 1px solid var(--border-light);
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
}

.page-main .entry-content th {
    background: var(--cloud);
    font-weight: 700;
    color: var(--text-dark);
}

/* Center-aligned blocks (Gutenberg has-text-align-center). */
.page-main .entry-content .has-text-align-center {
    text-align: center;
}

@media (max-width: 767px) {
    .page-header {
        padding: 32px 20px;
    }
    .page-header .page-title {
        font-size: 1.9em;
    }
    .page-main {
        padding: 32px 20px 50px;
    }
}

/* ==========================================================================
   Responsive Design
   Breakpoints: Mobile (320-767px), Tablet (768-1023px), Desktop (1024px+)
   ========================================================================== */

@media (max-width: 1023px) {
    /* Tablet */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .trust-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 2.5em;
    }

    .hero-subtitle {
        font-size: 1.2em;
    }
}

@media (max-width: 767px) {
    /* Mobile */
    .top-bar {
        display: none;
    }

    .main-header {
        padding: 15px 20px;
        flex-wrap: wrap;
    }

    .header-cta {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
        order: 3;
    }

    .logo {
        order: 1;
    }

    .logo-img {
        height: 45px;
    }

    /* Mobile Navigation */
    .main-nav {
        display: none;
    }

    .main-nav.mobile-active {
        display: block;
    }

    .nav-content {
        padding: 0;
    }

    .nav-menu {
        flex-direction: column;
    }

    .nav-menu a {
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .nav-menu ul {
        position: static;
        display: none;
        box-shadow: none;
    }

    .nav-menu li:hover > ul {
        display: block;
    }

    .nav-menu ul a {
        padding-left: 40px;
        background: rgba(0,0,0,0.2);
    }

    /* Hero */
    .hero-section {
        padding: 50px 20px;
    }

    .hero-title {
        font-size: 2em;
    }

    .hero-subtitle {
        font-size: 1.1em;
    }

    .hero-btn {
        padding: 15px 30px;
        font-size: 1em;
    }

    /* Grids */
    .services-grid,
    .trust-stats {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .section-title {
        font-size: 2em;
    }

    h1 { font-size: 2em; }
    h2 { font-size: 1.75em; }
    h3 { font-size: 1.5em; }

    .footer-widgets {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-bottom-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

*:focus {
    outline: 3px solid var(--steel-blue);
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 3px solid var(--steel-blue);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --burgundy: #440000;
        --text-light: #666;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ==========================================================================
   Service Page Template
   ========================================================================== */

/* Page Hero */
.page-hero {
    background: linear-gradient(135deg, var(--burgundy) 0%, var(--slate) 100%);
    color: white;
    padding: 60px calc(5vw + 30px) 80px;
    position: relative;
    overflow: hidden;
}

.page-hero-pattern {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.02) 10px, rgba(255,255,255,0.02) 20px);
    pointer-events: none;
}

.page-hero-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.page-breadcrumbs {
    margin-bottom: 20px;
    font-size: 0.95em;
}

.page-breadcrumbs,
.page-breadcrumbs a {
    color: rgba(255,255,255,0.8);
}

.page-breadcrumbs a:hover {
    color: white;
}

#breadcrumbs {
    color: rgba(255,255,255,0.8);
}

#breadcrumbs a {
    color: rgba(255,255,255,0.9);
}

#breadcrumbs a:hover {
    color: white;
}

.page-hero-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 3.2em;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.1;
    color: white;
}

.page-hero-subtitle {
    font-size: 1.25em;
    font-weight: 400;
    color: rgba(255,255,255,0.9);
    max-width: 800px;
    line-height: 1.6;
    margin: 0;
}

/* Service Content */
.service-content {
    background: var(--cloud);
    padding: 60px calc(5vw + 30px);
}

.service-container {
    max-width: 1200px;
    margin: 0 auto;
}

.service-main {
    background: white;
    border-radius: 16px;
    padding: 50px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.service-intro {
    max-width: 900px;
    margin: 0 auto;
}

.service-intro p {
    font-size: 1.1em;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 1.5em;
}

.service-intro p:first-of-type {
    font-size: 1.2em;
    color: var(--slate);
}

.service-intro h2,
.service-intro h3,
.service-intro h4 {
    margin-top: 2em;
    margin-bottom: 0.75em;
    color: var(--burgundy);
}

.service-intro h3 {
    font-size: 1.6em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid var(--border-light);
}

.service-intro ul,
.service-intro ol {
    margin: 1.5em 0;
    padding-left: 1.5em;
}

.service-intro li {
    margin-bottom: 0.75em;
    line-height: 1.7;
}

.service-intro img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2em 0;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.service-intro .alignleft,
.page-main .entry-content .alignleft {
    float: left;
    margin: 0.5em 2em 1.5em 0;
    max-width: 40%;
}

.service-intro .alignright,
.page-main .entry-content .alignright {
    float: right;
    margin: 0.5em 0 1.5em 2em;
    max-width: 40%;
}

.service-intro .aligncenter,
.page-main .entry-content .aligncenter {
    display: block;
    margin: 2em auto;
}

/* Centered images: a block-level <figure> fills the row, so margin:auto
   can't visibly center it. Shrink any centered figure (Gutenberg blocks AND
   Elementor-orphan markup, where .aligncenter sits on a bare <figure> with
   .wp-block-image on a parent div) to its content width so auto-margins
   actually center the image. The figure img is centered as a fallback for
   cases where the figure itself can't shrink (e.g. inside a flex column). */
.page-main .entry-content figure.aligncenter,
.page-main .entry-content .wp-block-image.aligncenter,
.service-intro figure.aligncenter,
.service-intro .wp-block-image.aligncenter {
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.page-main .entry-content figure.aligncenter img,
.page-main .entry-content .wp-block-image.aligncenter img,
.service-intro figure.aligncenter img,
.service-intro .wp-block-image.aligncenter img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* When the centered image is trapped in a Gutenberg column wrapper, center
   the image within the full-width column too. */
.page-main .entry-content .wp-block-column > .wp-block-image > figure.aligncenter img,
.page-main .entry-content .wp-block-column figure.aligncenter img {
    margin-left: auto;
    margin-right: auto;
}

.service-intro figure,
.page-main .entry-content figure {
    margin: 2em 0;
}

.service-intro figure.alignleft,
.page-main .entry-content figure.alignleft {
    float: left;
    margin: 0.5em 2em 1.5em 0;
    max-width: 40%;
}

.service-intro figure img {
    margin: 0;
}

.service-intro figcaption {
    font-size: 0.9em;
    color: var(--text-light);
    margin-top: 0.5em;
    font-style: italic;
}

/* Service CTA Section */
.service-cta {
    background: var(--slate);
    padding: 80px calc(5vw + 30px);
    text-align: center;
}

.service-cta-content {
    max-width: 700px;
    margin: 0 auto;
}

.service-cta h2 {
    font-family: 'DM Sans', sans-serif;
    font-size: 2.5em;
    font-weight: 800;
    color: white;
    margin-bottom: 15px;
}

.service-cta p {
    font-size: 1.2em;
    color: rgba(255,255,255,0.9);
    margin-bottom: 30px;
}

.service-cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.service-cta .cta-btn {
    padding: 16px 35px;
    font-size: 1.05em;
}

.service-cta .cta-primary {
    background: white;
    color: var(--burgundy);
}

.service-cta .cta-primary:hover {
    background: var(--cloud);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.service-cta .cta-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.service-cta .cta-secondary:hover {
    background: white;
    color: var(--slate);
}

/* Service Page Responsive */
@media (max-width: 1023px) {
    .page-hero {
        padding: 50px 40px 60px;
    }

    .page-hero-title {
        font-size: 2.5em;
    }

    .service-content {
        padding: 50px 40px;
    }

    .service-main {
        padding: 40px 35px;
    }

    .service-cta {
        padding: 60px 40px;
    }

    .service-intro .alignleft,
    .service-intro .alignright,
    .service-intro figure.alignleft {
        max-width: 50%;
    }
}

@media (max-width: 767px) {
    .page-hero {
        padding: 40px 20px 50px;
    }

    .page-hero-title {
        font-size: 2em;
    }

    .page-hero-subtitle {
        font-size: 1.1em;
    }

    .service-content {
        padding: 30px 15px;
    }

    .service-main {
        padding: 30px 20px;
        border-radius: 12px;
    }

    .service-intro p {
        font-size: 1em;
    }

    .service-intro p:first-of-type {
        font-size: 1.05em;
    }

    .service-intro h3 {
        font-size: 1.4em;
    }

    .service-intro .alignleft,
    .service-intro .alignright,
    .service-intro figure.alignleft {
        float: none;
        max-width: 100%;
        margin: 1.5em 0;
    }

    .service-cta {
        padding: 50px 20px;
    }

    .service-cta h2 {
        font-size: 1.8em;
    }

    .service-cta p {
        font-size: 1.05em;
    }

    .service-cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .service-cta .cta-btn {
        width: 100%;
        max-width: 280px;
    }
}

/* ==========================================================================
   Section Landing Template (page-section.php)
   Auto-generated child-card grid. Cards are <a> elements reusing
   .service-card styling, so they need link resets.
   ========================================================================== */

.section-children {
    /* Tighten the gap when an intro precedes the cards; the intro's
       .page-main already supplies top spacing. */
    padding-top: 20px;
}

/* Whole-card anchors should not look like inline links. */
a.service-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

a.service-card:hover,
a.service-card:focus {
    text-decoration: none;
}

/* Keep the title/body colors stable; only the arrow shifts on hover. */
a.service-card .service-title,
a.service-card .service-description {
    color: var(--text-dark);
}

a.service-card .service-description {
    color: var(--text-light);
}

a.service-card:hover .service-link {
    color: var(--steel-blue);
}

/* When the landing page has no intro text, give the card grid breathing
   room below the page header. */
.page-main:empty + .section-children,
.section-children:first-of-type {
    padding-top: 0;
}
