/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Styles */
:root {
    --primary-color: #2c6b9c;
    --secondary-color: #4a90a4;
    --accent-color: #5bc0be;
    --text-color: #333;
    --light-text-color: #fff;
    --light-bg: #f8f9fa;
    --border-color: #ddd;
    --shadow: 0 2px 5px rgba(0,0,0,0.1);
}

body {
    font-family: sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    width: 100%;
}

/* Site Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    padding: 0.625rem 1.5rem;
    gap: 1rem;
}

.logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.site-logo {
    height: 44px;
    width: auto;
}

/* Hamburger toggle (CSS-only, no JS) */
.nav-toggle {
    display: none;
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle:checked + .hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle:checked + .hamburger span:nth-child(2) {
    opacity: 0;
}

.nav-toggle:checked + .hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Main Navigation */
#main-nav {
    margin-left: auto;
}

#main-nav ul {
    display: flex;
    list-style: none;
    gap: 0.125rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

#main-nav ul li a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    display: block;
    transition: background-color 0.2s;
}

#main-nav ul li a:hover,
#main-nav ul li a:focus {
    background-color: var(--light-bg);
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

#main-nav ul li a[aria-current="page"] {
    background-color: rgba(44, 107, 156, 0.1);
    text-decoration: underline;
}

/* Hero Section (index.html only) */
.hero {
    position: relative;
    background-image: url('./img/powell-office.jpg');
    background-size: cover;
    background-position: center;
    min-height: 50vh;
    display: flex;
    align-items: flex-end;
}

.hero-content {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    width: 100%;
    padding: 4rem 1.5rem 2rem;
    color: #fff;
}

.hero-content h1 {
    font-size: 2.25rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.tagline {
    font-size: 1.1rem;
    font-weight: 400;
}

/* Main Content */
main {
    padding: 2rem 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

section {
    margin-bottom: 3rem;
}

h2,
main h1 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 2rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

h4 {
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Only add top margin to h4 when it follows another element (not when first child) */
* + h4 {
    margin-top: 1.25rem;
}

/* Content Spacing */
p {
    margin-bottom: 0.875rem;
}

p:last-child {
    margin-bottom: 0;
}

main ul,
main ol {
    margin: 0.5rem 0 1rem 1.5rem;
}

main li {
    margin-bottom: 0.375rem;
}

main li:last-child {
    margin-bottom: 0;
}

/* Extra breathing room before sections that follow another section */
section + section {
    padding-top: 2rem;
}

/* Service detail subsections (services.html) */
.service-details {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Physician profile layout (meet-the-team.html) */
.physician-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.physician-photo {
    width: 140px;
    height: 140px;
    object-fit: cover;
    object-position: top;
    border-radius: 50%;
    flex-shrink: 0;
}

@media (min-width: 560px) {
    .physician-profile {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* Physician credential rows (meet-the-team.html) */
.physician-details {
    margin-top: 0.5rem;
}

.physician-details p {
    margin-bottom: 0.375rem;
}

.physician-details p:last-child {
    margin-bottom: 0;
}

/* Contact office info block (contact.html) */
.contact-info p {
    margin-bottom: 0.75rem;
}

.contact-info p:last-child {
    margin-bottom: 0;
}

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

.hours-card {
    background-color: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--accent-color);
}

.hours-card h3 {
    margin-top: 0;
}

.note {
    font-style: italic;
    color: #666;
    margin-top: 0.5rem;
}

/* Position Cards (Careers) */
.positions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.position-card {
    background-color: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.position-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

/* Payment Section */
#payment ul {
    list-style-position: inside;
    margin: 1rem 0;
}

#payment li {
    margin-bottom: 0.5rem;
}

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

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-info a:hover,
.contact-info a:focus {
    text-decoration: underline;
    outline: 2px solid var(--primary-color);
}

.map-container {
    min-height: 300px;
}

.map-container iframe {
    border: 0;
    border-radius: 8px;
}

/* Location Cards (contact.html) */
.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.location-card {
    background-color: var(--light-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.location-photo {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.location-card-body {
    padding: 1.5rem;
}

.location-card-body h3 {
    margin-top: 0;
}

.location-card-body address {
    font-style: normal;
}

.location-card-body address p {
    margin-bottom: 0.5rem;
}

.location-card-body address a {
    color: var(--primary-color);
    text-decoration: none;
}

.location-card-body address a:hover,
.location-card-body address a:focus {
    text-decoration: underline;
}

/* Patient Forms list (forms.html) */
.form-list {
    list-style: none;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.form-list li {
    background-color: var(--light-bg);
    border-left: 4px solid var(--accent-color);
    border-radius: 4px;
    padding: 1rem 1.25rem;
    margin-bottom: 0;
}

.form-list a {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.0625rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-list a:hover,
.form-list a:focus {
    text-decoration: underline;
}

.form-desc {
    font-size: 0.9rem;
    color: #555;
    margin-top: 0.375rem;
    margin-bottom: 0;
}

.form-type {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--light-text-color);
    background-color: var(--secondary-color);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

/* Footer */
footer {
    background-color: var(--text-color);
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

.footer-affiliations {
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
    opacity: 0.85;
}

/* Responsive Design */
@media (max-width: 768px) {
    .site-header {
        flex-wrap: wrap;
        padding: 0.5rem 1rem;
    }

    .logo-link {
        order: 1;
        flex: 1;
    }

    .hamburger {
        display: flex;
        order: 2;
    }

    #main-nav {
        order: 3;
        width: 100%;
        margin-left: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        background-color: var(--light-bg);
        border-top: 1px solid var(--border-color);
    }

    .nav-toggle:checked ~ #main-nav {
        max-height: 400px;
    }

    #main-nav ul {
        flex-direction: column;
        padding: 0.5rem;
        gap: 0.125rem;
    }

    #main-nav ul li a {
        padding: 0.75rem 1rem;
        border-radius: 4px;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .hours-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* Focus Styles for Accessibility */
a:focus,
button:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -42px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}