/* Define variables in :root for global scope */
:root {
    --primary-color: #233065;
    --accent-color: #76d0eb;
    --highlight-color: #77b0c1;
    --secondary-color: #b5e2ed;
    --text-color: #252525;
    --white: #fff;
    --overlay-color: rgba(35, 48, 101, 0.5);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Figtree', 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: none;
    position: relative;
}

/* Header */
#header {
    background: var(--white);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

#logo {
    flex: 0 0 auto;
}

#logo a {
    display: block;
    width: 212px;
    height: 66px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    text-indent: -9999px;
}

@media (min-width: 769px) {
    #main-navigation ul li { margin-left: 40px; }
    #main-navigation ul li a { font-size: 16px; }
}

.home-icon {
    display: block;
    width: 224px;
    height: 224px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: 0 auto;
    text-indent: -9999px;
}

.menu-toggle {
    display: none;
    cursor: pointer;
    width: 30px;
    height: 25px;
    position: relative;
    flex: 0 0 auto;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    position: absolute;
    transition: all 0.3s ease;
}

.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.menu-toggle span:nth-child(3) { bottom: 0; }

.menu-toggle.active span:nth-child(1) { transform: translateY(11px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-11px) rotate(-45deg); }

#main-navigation {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

#main-navigation ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

#main-navigation ul li { margin-left: 30px; }

#main-navigation ul li a {
    text-decoration: none;
    color: var(--primary-color);
    font-family: 'Figtree', 'Open Sans', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
}

#main-navigation ul li a:hover { color: var(--accent-color); }

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

/* Sections */
.section.page-section {
    position: relative;
    min-height: 64vh;
}

/* Divider Styles */
.divider {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 400px;
    overflow: hidden;
}

.divider-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    transform: translateY(0);
    transition: transform 0.1s ease-out;
    z-index: -1;
}

@media (min-width: 769px) {
    .divider-bg {
        background-size: 120%;
    }
    #section-home .divider-bg {
        background-size: cover;
        background-position: center top;
    }
}

/* Specific positioning adjustments */
.home-divider .divider-bg {
    background-position: 60% center;
}

#section-why-stonewell .divider {
    min-height: 500px;
}

#section-why-stonewell .divider .divider-bg {
    background-position: 50% center;
}

#section-about-us .divider {
    min-height: 600px;
}

#section-services .divider {
    min-height: 500px;
}

.divider .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-color);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    color: var(--white);
    text-align: center;
    padding: 40px 0;
}

@media (min-width: 769px) {
    #section-home .hero-content {
        padding-top: 80px;
    }
    .hero-content {
        padding: 60px 0;
        margin-top: 48px; /* Moved here for desktop only */
    }
    .hero-content h1 {
        font-size: 60px;
    }
    .hero-content h2 {
        font-size: 48px;
    }
    .hero-content h3 {
        font-size: 24px;
    }
}

.hero-content h1 {
    font-family: 'Abril Fatface', serif;
    font-size: 48px;
    font-weight: 400;
    letter-spacing: 2px;
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.hero-content h2 {
    font-family: 'Abril Fatface', serif;
    font-size: 36px;
    font-weight: 400;
    letter-spacing: 2px;
    margin-bottom: 20px;
    color: white;
}

.hero-content h3 {
    font-family: 'Figtree', 'Open Sans', sans-serif;
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 1px;
    margin-top: 20px;
}

@media (min-width: 769px) {
    .hero-content {
        padding: 60px 0;
        margin: 0;
    }
    .hero-content h1 {
        font-size: 60px;
    }
    .hero-content h2 {
        font-size: 48px;
    }
    .hero-content h3 {
        font-size: 24px;
    }
}

hr {
    height: 4px;
    width: 120px;
    margin: 20px auto;
    border: none;
    background: linear-gradient(to bottom, var(--primary-color) 50%, var(--accent-color) 50%);
    opacity: 1;
}

.main-content-wrapper {
    position: relative;
    background: var(--white);
    padding: 60px 0;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

@media (min-width: 769px) {
    .main-content-wrapper {
        padding: 80px 0;
    }
}

.main-content h2 {
    font-family: 'Abril Fatface', serif;
    font-size: 36px;
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--primary-color);
    text-align: center;
}

.main-content h3 {
    font-family: 'Figtree', 'Open Sans', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    padding: 34px 0 10px;
}

.main-content h4 {
    font-family: 'Figtree', 'Open Sans', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
    padding: 20px 0 10px;
}

@media (min-width: 769px) {
    .main-content h2 {
        font-size: 48px;
    }
    .main-content h3 {
        font-size: 24px;
    }
}

.main-content ul {
    list-style: disc;
    margin-left: 20px;
    margin-bottom: 20px;
    color: var(--text-color);
}

.main-content ul ul {
    list-style: circle;
    margin-left: 20px;
}

/* Service Titles in Blue */
.service-title {
    color: var(--white);
    font-family: 'Figtree', 'Open Sans', sans-serif;
    font-size: 20px;
    font-weight: 700;
    padding: 34px 0 10px;
}

/* Buttons */
.btn, a.btn, a.btn:visited {
    background: var(--accent-color);
    border-radius: 30px;
    font-size: 14px;
    color: var(--white);
    padding: 10px 24px;
    text-decoration: none;
    text-transform: uppercase;
    display: inline-block;
    font-family: 'Figtree', 'Open Sans', sans-serif;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease, transform 0.2s ease;
}

@media (min-width: 769px) {
    .btn, a.btn, a.btn:visited {
        font-size: 16px;
        padding: 12px 28px;
    }
}

.btn:hover, a.btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

/* Social Links */
.social-link svg.icon {
    width: 24px;
    height: 24px;
    fill: var(--accent-color);
    margin: 0 10px;
    transition: fill 0.3s ease;
}

.social-link svg.icon:hover {
    fill: var(--primary-color);
}

/* Contact Section Specific Styles */
.contact-content {
    position: relative;
}

/* Desktop-specific contact layout */
@media (min-width: 769px) {
    .contact-content {
        display: flex;
        align-items: stretch;
        justify-content: space-between;
        
    }
    .contact-left {
        flex: 2;
        text-align: left;
        padding-right: 40px;
    }
    .contact-left h2 {
        text-align: left;
    }
    .contact-left hr {
        margin: 20px 0;
    }
    .contact-left .row {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    .contact-left .col-sm-4 {
        width: 33.33%;
        text-align: left;
    }
    .contact-divider {
        width: 4px;
        background: linear-gradient(to bottom, var(--primary-color) 50%, var(--accent-color) 50%);
        margin: 0 20px;
    }
    .contact-right {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding-left: 40px;
    }
    .contact-right .btn {
        margin-bottom: 20px;
        padding: 16px 32px; /* Larger for emphasis */
        font-size: 18px;
    }
    .contact-right .contact-phone {
        font-size: 18px;
        color: var(--primary-color);
        font-weight: 700;
    }
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 30px 0;
    position: relative;
    z-index: 2;
}

.footer-wrapper .container { text-align: center; }

.footer-content {
    display: block;
}

.footer-column {
    margin-bottom: 20px;
}

.footer-column h4 {
    font-family: 'Figtree', 'Open Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.footer-column p {
    font-size: 14px;
}

.footer-column ul {
    list-style: none;
    padding: 0;
}

.footer-column ul li {
    margin-bottom: 8px;
}

.footer-column ul li a {
    color: var(--white);
    text-decoration: none;
    font-size: 14px;
}

.footer-column ul li a:hover {
    color: var(--accent-color);
}

.footer-copyright {
    font-size: 14px;
    margin-top: 20px;
}

@media (min-width: 769px) {
    .footer-content {
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        text-align: left;
    }
    .footer-column {
        flex: 1;
        min-width: 200px;
        margin: 0 15px;
    }
    .footer-copyright {
        width: 100%;
        text-align: center;
        margin-top: 30px;
    }
}

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-sm-4, .col-xs-12 { padding: 15px; }

.col-sm-4 { width: 33.33%; }
.col-xs-12 { width: 100%; }

/* Accordion Styles */
.accordion {
    margin-top: 20px;
}

@media (min-width: 769px) {
    .accordion {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

.accordion-item {
    margin-bottom: 15px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.accordion-header {
    cursor: pointer;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    transition: background 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 72px;
    position: relative;
    text-align: center;
    color: var(--white);
}

@media (min-width: 769px) {
    .accordion-header {
        padding: 20px;
        font-size: 22px;
    }
}

.accordion-item:nth-child(odd) .accordion-header {
    background: var(--primary-color);
    color: var(--white);
}

.accordion-item:nth-child(even) .accordion-header {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.accordion-header.active::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--white);
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from { width: 0; }
    to { width: 100px; }
}

.accordion-content {
    display: none;
    padding: 20px;
    background: var(--white);
    border: 1px solid var(--highlight-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.accordion-content.active {
    display: block;
}

#main-navigation ul li a[href="#new-dentist-network"]:hover {
    color: var(--accent-color);
}


/* Responsive Mobile */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
        padding: 10px 15px;
    }
    #header {
        width: 100%;
        top: 0;
        left: 0;
    }
    #logo { order: 1; }
    .menu-toggle { display: block; order: 2; }
    #main-navigation {
        display: none;
        width: 100%;
        order: 3;
        position: absolute;
        top: 100%;
        left: 0;
        background: var(--white);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }
    #main-navigation ul {
        flex-direction: column;
        text-align: center;
        padding: 20px 0;
    }
    #main-navigation ul li { margin: 10px 0; }
    .divider {
        min-height: 300px;
    }
    #section-home .divider { min-height: 760px; }
    #section-why-stonewell .divider { min-height: 350px; }
    #section-about-us .divider { min-height: 400px; }
    #section-services .divider { min-height: 350px; }
    #section-contact .divider { min-height: 300px; }
    .hero-content h1 { font-size: 36px; }
    .hero-content h2 { font-size: 28px; }
    .col-sm-4 { width: 100%; }
    .container { padding: 0 20px; }
    #logo a {
        width: 175px;
        height: 54px;
    }
}

/* Center Contact Us section on mobile */
@media (max-width: 768px) {
    .contact-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .contact-left {
        padding-right: 0;
        width: 100%;
    }

    .contact-left h2 {
        text-align: center;
    }

    .contact-left .row {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .contact-left .col-sm-4 {
        width: 100%;
        padding: 10px 0;
    }

    .contact-divider {
        display: none;
    }

    .contact-right {
        padding-left: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .contact-right .btn {
        margin-bottom: 15px;
    }

    .contact-right .contact-phone {
        font-size: 16px;
    }
}