/* ==========================================================================
   Strathfield Eyecare — Custom Styles
   Modern refresh built on Bootstrap 5.3.3
   ========================================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
    --color-primary: #7e0330;
    --color-primary-dark: #4c021d;
    --color-primary-light: #fce8ef;
    --color-accent: #1bbc9b;
    --color-accent-dark: #18a689;
    --color-dark: #333333;
    --color-text: #333333;
    --color-text-muted: #6c757d;
    --color-bg: #ffffff;
    --color-bg-alt: #f8f9fa;
    --color-border: #e9ecef;
    --font-heading: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

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

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

/* ---------- Utility ---------- */
.text-primary {
    color: var(--color-primary) !important;
}

.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    border-radius: 50px;
    padding: 0.75rem 2rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    color: #ffffff;
    text-transform: uppercase;
    transition: all var(--transition);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(126, 3, 48, 0.3);
}

.btn-outline-light.btn-social {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1rem;
    transition: all var(--transition);
}

.btn-outline-light.btn-social:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

/* ---------- Navigation ---------- */
#mainNav {
    padding: 1.5rem 0;
    transition: all var(--transition);
    background-color: transparent;
}

#mainNav.navbar-shrink {
    padding: 1rem 0;
    background-color: var(--color-dark);
    box-shadow: var(--shadow-sm);
}

#mainNav.navbar-shrink .navbar-brand {
    color: #ffffff;
}

#mainNav.navbar-shrink .nav-link {
    color: #fff;
}

#mainNav.navbar-shrink .nav-link:hover,
#mainNav.navbar-shrink .nav-link.active {
    color: var(--color-accent);
}

.navbar-brand {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.0625em;
}

.nav-link {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.0625em;
    text-transform: uppercase;
    padding: 0.5rem 1rem !important;
    color: #fff;
    transition: color var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-accent);
}

/* ---------- Masthead ---------- */
.masthead {
    position: relative;
    padding-top: 10.5rem;
    padding-bottom: 6rem;
    text-align: center;
    color: #fff;
    background-image: url("../assets/img/StrathfieldEyeCare-31_1000_400.jpeg");
    background-repeat: no-repeat;
    background-attachment: scroll;
    background-position: center center;
    background-size: cover;
}

.masthead::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.masthead::after {
    content: none;
}

.masthead-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.masthead-heading {
    font-family: var(--font-heading);
    font-size: 3.25rem;
    font-weight: 700;
    line-height: 3.25rem;
    color: #fff;
    margin-bottom: 2rem;
}

.masthead-subheading {
    font-family: var(--font-body);
    font-size: 1.5rem;
    font-style: italic;
    font-weight: 300;
    line-height: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 25px;
}

@media (min-width: 768px) {
    .masthead {
        padding-top: 17rem;
        padding-bottom: 12.5rem;
    }

    .masthead-subheading {
        font-size: 2.25rem;
        line-height: 2.25rem;
        margin-bottom: 2rem;
    }

    .masthead-heading {
        font-size: 4.5rem;
        line-height: 4.5rem;
        margin-bottom: 4rem;
    }
}

.masthead .btn-primary {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: #ffffff;
    font-weight: 700;
}

.masthead .btn-primary:hover {
    background-color: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
    box-shadow: 0 6px 20px rgba(27, 188, 155, 0.4);
}

/* ---------- Sections ---------- */
.page-section {
    padding: 6rem 0;
}

.section-light {
    background-color: var(--color-bg-alt);
}

.section-heading {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    text-transform: uppercase;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.section-subheading {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    font-style: italic;
    color: var(--color-text-muted);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------- Myth Cards ---------- */
.myth-card {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    padding: 2rem 1.5rem;
    height: 100%;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: all var(--transition);
}

.myth-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.myth-img {
    width: 124px;
    height: 124px;
    border-radius: 50%;
}

.myth-card h4 {
    font-size: 1.15rem;
    font-family: var(--font-heading);
    font-weight: 700;
}

/* ---------- Portfolio / Treatment Grid ---------- */
.portfolio-item {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: var(--color-bg);
    transition: all var(--transition);
}

.portfolio-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.portfolio-link {
    display: block;
    position: relative;
    overflow: hidden;
}

.portfolio-link img {
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
}

.portfolio-item:hover .portfolio-link img {
    transform: scale(1.05);
}

.portfolio-hover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(126, 3, 48, 0.85);
    opacity: 0;
    transition: opacity var(--transition);
}

.portfolio-link:hover .portfolio-hover {
    opacity: 1;
}

.portfolio-hover-content {
    color: #fff;
}

.portfolio-caption {
    padding: 1.25rem 1.5rem;
}

.portfolio-caption h5 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
    color: var(--color-text);
}

/* ---------- Timeline ---------- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--color-primary-light), var(--color-primary), var(--color-primary-light));
    border-radius: 3px;
}

.timeline-item {
    position: relative;
    padding-left: 80px;
    margin-bottom: 3rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: 14px;
    top: 0;
    width: 34px;
    height: 34px;
    background: var(--color-primary);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 0 0 4px var(--color-primary-light);
}

.timeline-content {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.timeline-content h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.timeline-content ul {
    padding-left: 1.25rem;
    margin: 0;
}

.timeline-content li {
    margin-bottom: 0.75rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.timeline-content li:last-child {
    margin-bottom: 0;
}

.timeline-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 1.25rem;
}

@media (min-width: 768px) {
    .timeline::before {
        left: 50%;
        transform: translateX(-50%);
    }

    .timeline-item {
        padding-left: 0;
        width: 50%;
    }

    .timeline-item:nth-child(odd) {
        padding-right: 3rem;
        text-align: right;
    }

    .timeline-item:nth-child(odd) .timeline-content ul {
        padding-left: 0;
        padding-right: 1.25rem;
        list-style-position: inside;
    }

    .timeline-item:nth-child(even) {
        margin-left: 50%;
        padding-left: 3rem;
    }

    .timeline-item:nth-child(odd) .timeline-marker {
        left: auto;
        right: -17px;
    }

    .timeline-item:nth-child(even) .timeline-marker {
        left: -17px;
    }
}

/* ---------- Contact ---------- */
.contact-card {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    height: 100%;
    transition: all var(--transition);
}

.contact-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.contact-card p {
    margin: 0;
    color: var(--color-text-muted);
}

.contact-card a {
    color: var(--color-text-muted);
}

.contact-card a:hover {
    color: var(--color-accent);
}

.map-container {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* ---------- Footer ---------- */
.site-footer {
    background-color: var(--color-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 2.5rem 0;
}

.site-footer p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.back-to-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    transition: all var(--transition);
}

.back-to-top:hover {
    background: var(--color-accent);
    color: #fff;
    transform: translateY(-2px);
}

/* ---------- Modals ---------- */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--color-border);
    padding: 1.5rem 2rem;
}

.modal-title {
    font-size: 1.5rem;
    color: var(--color-text);
}

.modal-body {
    padding: 2rem;
}

.modal-body p {
    color: var(--color-text-muted);
    line-height: 1.8;
}

.modal-footer {
    border-top: 1px solid var(--color-border);
    padding: 1rem 2rem;
}

/* Causes list in modal */
.causes-list dt {
    font-family: var(--font-body);
    font-weight: 700;
    color: var(--color-text);
    margin-top: 1rem;
}

.causes-list dd {
    color: var(--color-text-muted);
    margin-left: 0;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    border-left: 3px solid var(--color-primary-light);
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    #mainNav {
        background-color: var(--color-dark);
    }

    .page-section {
        padding: 4rem 0;
    }
}

@media (max-width: 767.98px) {
    .masthead {
        min-height: 80vh;
    }

    .timeline-img {
        width: 140px;
        height: 140px;
    }
}

/* ---------- Animations ---------- */
@media (prefers-reduced-motion: no-preference) {
    .myth-card,
    .portfolio-item,
    .contact-card,
    .timeline-content {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.6s ease, transform 0.6s ease, box-shadow var(--transition);
    }

    .myth-card.visible,
    .portfolio-item.visible,
    .contact-card.visible,
    .timeline-content.visible {
        opacity: 1;
        transform: translateY(0);
    }
}
