/*
Theme Name: Rank Shifters
Theme URI: https://rankshifters.com
Author: Antigravity
Author URI: https://rankshifters.com
Description: A premium, high-performance WordPress theme designed for Rank Shifters, a Link Building Agency. Features SEO-optimized structure, fast loading times, and a conversion-focused design.
Version: 3.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rank-shifters
Tags: one-column, two-columns, right-sidebar, custom-colors, custom-menu, featured-images, light, seo
*/

/* ==========================================================================
   #VARIABLES
   ========================================================================== */
:root {
    /* Color Palette: Light Green & White */
    --color-bg: #ffffff;
    --color-bg-alt: #f0fdf4; /* Very light green background for sections */
    --color-bg-dark: #14532d; /* Dark green for footer/dark sections */
    
    --color-primary: #16a34a; /* Vibrant Green */
    --color-primary-hover: #15803d; /* Darker Green for hover */
    --color-secondary: #0f172a; /* Dark Blue/Black for contrast */
    
    --color-text-main: #374151; /* Dark Gray */
    --color-text-light: #6b7280; /* Light Gray */
    --color-text-heading: #111827; /* Near Black */
    --color-white: #ffffff;
    
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    --border-radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   #RESET & BASE
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-text-heading);
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    line-height: 1.25;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); color: var(--color-secondary); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-xl) 0;
}

/* ==========================================================================
   #HEADER
   ========================================================================== */
.site-header {
    background-color: var(--color-white);
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 0;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid #e5e7eb;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90px;
}

.site-branding a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-secondary);
    letter-spacing: -0.5px;
    margin: 0;
}

.site-title span {
    color: var(--color-primary);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: block; /* Show by default on mobile */
    background: transparent;
    border: none;
    color: var(--color-secondary);
    cursor: pointer;
    padding: 0.5rem;
}

.main-navigation {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--color-white);
    padding: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-top: 1px solid #f3f4f6;
}

.main-navigation.toggled {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.main-navigation ul {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    padding: 1rem 0;
}

@media (min-width: 768px) {
    .menu-toggle {
        display: none; /* Hide on desktop */
    }

    .main-navigation {
        position: static;
        width: auto;
        padding: 0;
        box-shadow: none;
        transform: none;
        opacity: 1;
        visibility: visible;
        border-top: none;
    }

    .main-navigation ul {
        flex-direction: row;
        gap: 2.5rem;
    }
}

.btn {
    display: inline-block;
    padding: 0.9rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all var(--transition-medium);
    text-align: center;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    border: 2px solid var(--color-primary);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover {
    background-color: var(--color-bg-alt);
}

/* ==========================================================================
   #HERO
   ========================================================================== */
.hero {
    padding: 8rem 0 6rem;
    background: linear-gradient(135deg, var(--color-bg-alt) 0%, #ffffff 100%);
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr; /* 1 column by default (Mobile) */
    gap: 3rem;
    align-items: center;
}

@media (min-width: 768px) {
    .hero .container {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
}

.hero-badge {
    display: inline-block;
    background-color: #d1fae5;
    color: var(--color-primary-hover);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--color-text-light);
    margin-bottom: 2.5rem;
    max-width: 540px;
}

.hero-image {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   #SECTIONS
   ========================================================================== */
.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    color: var(--color-secondary);
}

.section-title p {
    color: var(--color-text-light);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 1rem auto 0;
}

/* Process Steps */
.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.process-item {
    text-align: center;
}

.process-number {
    width: 60px;
    height: 60px;
    background-color: var(--color-bg-alt);
    color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1.5rem;
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    align-items: stretch; /* Ensure cards are same height */
}

.service-card {
    background-color: var(--color-white);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    border: 1px solid #e5e7eb;
    transition: var(--transition-medium);
    display: flex;
    flex-direction: column;
    height: 100%; /* Force full height usage */
}

.service-card p {
    flex-grow: 1; /* Pushes content to fill space evenly */
}

.service-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
}

/* Testimonials */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background-color: var(--color-bg-alt);
    padding: 2rem;
    border-radius: var(--border-radius);
}

.stars {
    color: #ffd700;
    margin-bottom: 1rem;
}

/* ==========================================================================
   #FOOTER
   ========================================================================== */
.site-footer {
    background-color: var(--color-bg-dark);
    color: #e2e8f0;
    padding: var(--spacing-lg) 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr; /* 1 column mobile */
    gap: 3rem;
    margin-bottom: 4rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr; /* 2 columns tablet */
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr; /* 4 columns desktop */
        gap: 4rem;
    }
}

.footer-logo {
    color: var(--color-white);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: block;
}

.footer-about p {
    color: #94a3b8;
    max-width: 300px;
    margin-bottom: 1.5rem;
}

.footer-widget h4 {
    color: var(--color-white);
    margin-bottom: 1.5rem;
}

.footer-widget ul li {
    margin-bottom: 0.75rem;
}

.footer-widget a {
    color: #94a3b8;
}

.footer-widget a:hover {
    color: var(--color-white);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    text-align: center;
/* ==========================================================================
   #CONTACT PAGE
   ========================================================================== */
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: start;
}

@media (min-width: 992px) {
    .contact-wrapper {
        grid-template-columns: 350px 1fr;
        gap: 4rem;
    }
}

/* Sidebar Styles */
.contact-sidebar .sidebar-title {
    font-size: 1.8rem;
    color: var(--color-secondary);
    margin-bottom: 1rem;
}

.contact-sidebar .sidebar-subtitle {
    color: var(--color-text-light);
    line-height: 1.5;
    margin-bottom: 2.5rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #f3f4f6;
}

.contact-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.icon-box {
    width: 50px;
    height: 50px;
    background-color: var(--color-bg-alt);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.5rem;
    flex-shrink: 0;
    color: var(--color-primary);
}

.contact-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--color-text-heading);
}

.contact-item a, .contact-item p {
    color: var(--color-text-light);
    font-size: 1rem;
}

.contact-item a:hover {
    color: var(--color-primary);
}

/* CTA Box Styles */
.contact-cta-box {
    background-color: var(--color-bg-alt);
    padding: 4rem;
    border-radius: var(--border-radius);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.contact-cta-box h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.contact-cta-box p {
    color: var(--color-text-light);
    margin-bottom: 3rem;
    max-width: 400px;
}

.cta-button {
    display: inline-block;
    background-color: var(--color-primary);
    color: white;
    padding: 1.25rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.125rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(22, 163, 74, 0.3);
}

.cta-button:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 15px rgba(22, 163, 74, 0.4);
    color: white;
}

/* ==========================================================================
   #MODAL
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background-color: white;
    width: 90%;
    max-width: 500px;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-light);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--color-danger);
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.modal-header h3 {
    font-size: 1.5rem;
    color: var(--color-secondary);
    margin-bottom: 0.5rem;
}

.modal-header p {
    font-size: 0.95rem;
    color: var(--color-text-light);
}

/* Improved Form Styling */
.contact-form-box {
    background: #fff;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #e5e7eb;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-heading);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    display: block;
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-text);
    background-color: #f9fafb;
    background-clip: padding-box;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    margin-bottom: 0; 
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    color: var(--color-text);
    background-color: #fff;
    border-color: var(--color-primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

    background-color: var(--color-primary-hover);
}

/* ==========================================================================
   #BLOG GRID MODERN
   ========================================================================== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 3rem;
}

.blog-card-modern {
    background-color: transparent;
}

.blog-card-inner {
    background: var(--color-white);
    border-radius: 20px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.blog-card-inner:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.blog-card-image {
    position: relative;
    padding-top: 60%; /* Aspect Ratio */
    overflow: hidden;
}

.blog-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card-inner:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-content {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-meta-top {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.read-time-badge {
    background-color: #f3f4f6;
    color: var(--color-text-light);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #e5e7eb;
}

.blog-card-modern h3.entry-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.blog-card-modern h3.entry-title a {
    color: var(--color-secondary);
    text-decoration: none;
    background-image: linear-gradient(var(--color-secondary), var(--color-secondary));
    background-size: 0% 1px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size 0.3s;
}

.blog-card-inner:hover h3.entry-title a {
    color: var(--color-primary);
}

.entry-excerpt {
    color: var(--color-text-light);
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
    flex-grow: 1;
}

.blog-card-footer {
    padding-top: 1.5rem;
    border-top: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-more-link {
    font-weight: 600;
    color: var(--color-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.read-more-link .arrow {
    transition: transform 0.2s ease;
}

.read-more-link:hover .arrow {
    transform: translateX(4px);
}

/* ==========================================================================
   #SINGLE POST LAYOUT
   ========================================================================== */
.post-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 992px) {
    .post-layout-grid {
        grid-template-columns: 300px 1fr; /* Sidebar Left, Content Right */
        gap: 4rem;
        align-items: start;
    }
}

/* Sidebar TOC */
.post-sidebar {
    display: none; /* Hide on mobile by default */
}

@media (min-width: 992px) {
    .post-sidebar {
        display: block;
    }
}

.toc-sticky-container {
    position: sticky;
    top: 120px; /* Offset for sticky header */
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.toc-title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-light);
    margin-bottom: 1rem;
    font-weight: 700;
}

.toc-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toc-nav a {
    color: var(--color-text-main);
    font-size: 0.95rem;
    text-decoration: none;
    display: block;
    line-height: 1.4;
    padding-left: 0.75rem;
    border-left: 2px solid transparent;
    transition: all 0.2s;
}

.toc-nav a:hover {
    color: var(--color-primary);
    border-left-color: var(--color-primary);
}

/* Indent h3 items */
.toc-item.toc-h3 a {
    padding-left: 1.5rem;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

/* Single Post Content */
.post-content-area {
    min-width: 0; /* Prevents flex/grid overflow issues */
}

.entry-content {
    font-size: 1.125rem; /* Larger readable text */
    line-height: 1.8;
    color: #334155;
}

.entry-content h2 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    color: var(--color-secondary);
}

.entry-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: var(--color-secondary);
}

.entry-content p {
    margin-bottom: 1.5rem;
}

.entry-content ul {
    list-style-type: disc;
    margin-bottom: 2rem;
    padding-left: 1.5rem;
}

.entry-content ol {
    list-style-type: decimal;
    margin-bottom: 2rem;
    padding-left: 1.5rem;
}

.entry-content li {
    margin-bottom: 0.75rem;
}

/* Meta Badges */
.post-cat-badge {
    background-color: #dcfce7;
    color: #166534;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    text-transform: uppercase;
}

/* ==========================================================================
   #FAQ ACCORDION
   ========================================================================== */
.faq-accordion {
    margin-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.faq-item {
    border-bottom: 1px solid #e5e7eb;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 1.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: color 0.2s;
}

.faq-question:hover {
    color: var(--color-primary);
}

.faq-question span:first-child {
    padding-right: 1.5rem;
}

.faq-icon {
    display: flex;
    align-items: center;
    color: var(--color-text-light);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
    color: var(--color-primary);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-answer > * {
    margin-bottom: 1.5rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

.faq-answer > *:first-child {
    margin-top: 0;
}

.faq-answer > *:last-child {
    margin-bottom: 1.5rem;
}

.entry-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding-left: 1rem;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 2rem;
    font-style: italic;
    color: var(--color-text-light);
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
}

.entry-content table {
    width: 100%;
    margin-bottom: 2rem;
    border-collapse: collapse;
}

.entry-content table th,
.entry-content table td {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.entry-content table th {
    background-color: #f9fafb;
    font-weight: 600;
}

