/* ==========================================================================
   Monica Moritsch – Personal Professional Website
   Color palette: Purples (nature-inspired)
   Typography: Inter (sans-serif)
   WCAG 2.2 Level AA compliant color contrasts
   ========================================================================== */

/* ---------- Custom Properties ---------- */
:root {
    --color-primary: #4e3685;
    --color-primary-dark: #3d2a68;
    --color-primary-light: #6c56a1;
    --color-accent: #6c56a1;
    --color-bg: #ffffff;
    --color-bg-alt: #f4f0fb;
    --color-bg-dark: #271a46;
    --color-text: #2d3436;
    --color-text-muted: #4a5568;
    --color-text-on-dark: #f7f3ff;
    --color-border: #d9cfef;
    --color-hero-overlay: rgba(39, 26, 70, 0.72);
    --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Oxygen, Ubuntu, sans-serif;
    --max-width: 1140px;
    --nav-height: 68px;
    --transition: 0.3s ease;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius: 6px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

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

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

ul,
ol {
    list-style: none;
}

a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color var(--transition);
}

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

/* ---------- Accessibility ---------- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--color-primary);
    color: var(--color-text-on-dark);
    padding: 0.5rem 1rem;
    z-index: 10000;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
}

.skip-link:focus {
    top: 0.5rem;
}

:focus-visible {
    outline: 3px solid var(--color-primary-light);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4 {
    line-height: 1.25;
    color: var(--color-primary);
    font-weight: 700;
}

h1 {
    font-size: 2.75rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.25rem;
}

p + p {
    margin-top: 1rem;
}

/* ---------- Layout ---------- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 3.75rem 0;
}

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

.section--dark {
    background: var(--color-bg-dark);
    color: var(--color-text-on-dark);
}

.section--dark h2,
.section--dark h3 {
    color: var(--color-text-on-dark);
}

.section--dark a {
    color: #d4c6f5;
}

.section--dark a:hover {
    color: #ebe3ff;
}

.section__header {
    text-align: center;
    margin-bottom: 2.25rem;
}

.section__header h2 {
    margin-bottom: 0.75rem;
}

.section__header p {
    color: var(--color-text-muted);
    max-width: 620px;
    margin: 0 auto;
    font-size: 1.05rem;
}

.section--dark .section__header p {
    color: #d6cbf0;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition), transform 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn--primary {
    background: var(--color-primary);
    color: var(--color-text-on-dark);
}

.btn--primary:hover,
.btn--primary:focus {
    background: var(--color-primary-dark);
    color: var(--color-text-on-dark);
}

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

.btn--outline:hover,
.btn--outline:focus {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* ---------- Navigation ---------- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 1000;
    transition: background var(--transition), box-shadow var(--transition);
}

.header--transparent {
    background: transparent;
}

.header--scrolled {
    background: var(--color-primary);
    box-shadow: var(--shadow);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.header__logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.header__logo:hover,
.header__logo:focus {
    color: #ffffff;
    opacity: 0.9;
}

.nav__list {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.nav__link {
    display: block;
    padding: 0.5rem 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
}

.nav__link:hover,
.nav__link:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.nav__toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #ffffff;
}

.nav__toggle svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 40vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("images/Tazzie sunset.jpg");
    background-size: cover;
    background-position: center 60%;
    background-repeat: no-repeat;
    filter: saturate(50%);
    z-index: 0;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--color-hero-overlay);
    z-index: 1;
}

.hero__content {
    position: relative;
    z-index: 2;
    max-width: 680px;
    padding-top: var(--nav-height);
}

.hero__tagline {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #d4c6f5;
    margin-bottom: 1rem;
}

.hero h1 {
    color: #ffffff;
    margin-bottom: 0.5rem;
    font-size: 3rem;
}

.hero__subtitle {
    font-size: 1.3rem;
    color: #d6cbf0;
    margin-bottom: 1.25rem;
    font-weight: 400;
}

.hero__pitch {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ---------- About ---------- */
.about__grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    align-items: start;
}

.about__photo {
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.about__text h2 {
    margin-bottom: 1rem;
}

.about__text p {
    margin-bottom: 1rem;
}

.about__education {
    margin-top: 1.5rem;
}

.about__education h3 {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

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

.about__education li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}

.about__education li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary-light);
}

.about__affiliations {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.about__affiliations a {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 2rem;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
    transition: background var(--transition), border-color var(--transition);
}

.about__affiliations a:hover {
    background: #ebe3ff;
    border-color: var(--color-primary-light);
}

/* ---------- Services ---------- */
.services__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.service-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    transition: box-shadow var(--transition), transform 0.2s ease;
}

.service-card:hover {
    box-shadow: var(--shadow);
}

.service-card__icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.service-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.service-card p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* ---------- Work / Projects ---------- */
.project {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 4rem;
}

.project:last-child {
    margin-bottom: 0;
}

.project--reverse .project__image {
    order: 2;
}

.project--reverse .project__body {
    order: 1;
}

.project__image img {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    object-fit: cover;
    max-height: 420px;
}

.project__image-button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}

.project__image-button img {
    display: block;
}

.project__image--top {
    object-position: top;
}

.project__body h3 {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}

.project__body p {
    margin-bottom: 0.75rem;
    font-size: 0.97rem;
}

.project__body .project__link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.project__body .project__link svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition);
}

.project__body .project__link:hover svg {
    transform: translateX(3px);
}

/* ---------- Lightbox ---------- */
.lightbox[hidden] {
    display: none;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(14, 10, 24, 0.82);
}

.lightbox__dialog {
    position: relative;
    z-index: 1;
    max-width: min(96vw, 1400px);
    max-height: 92vh;
}

.lightbox__dialog img {
    display: block;
    max-width: 100%;
    max-height: 92vh;
    width: auto;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.lightbox__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 999px;
    background: rgba(14, 10, 24, 0.75);
    color: #ffffff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.lightbox__close:hover,
.lightbox__close:focus {
    background: rgba(14, 10, 24, 0.9);
}

/* ---------- Map Services List ---------- */
.map-services-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0;
    columns: 2;
    column-gap: 1.5rem;
}

.map-services-list li {
    position: relative;
    padding-left: 1.1rem;
    margin-bottom: 0.3rem;
    font-size: 0.93rem;
    break-inside: avoid;
}

.map-services-list li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: 700;
}

/* ---------- Contact ---------- */
.contact__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

.contact__info h2 {
    margin-bottom: 1rem;
}

.contact__info p {
    margin-bottom: 1rem;
    color: #d6cbf0;
}

.contact__details {
    margin-top: 1.5rem;
}

.contact__detail {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.contact__detail svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #d4c6f5;
}

.contact__detail a {
    color: var(--color-primary);
}

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

.contact__form {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 2rem;
}

.form__group {
    margin-bottom: 1.25rem;
}

.form__group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: #e3daf8;
}

.form__group input,
.form__group textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    color: #ffffff;
    font-family: var(--font-family);
    font-size: 0.95rem;
    transition: border-color var(--transition), background var(--transition);
}

.form__group input:focus,
.form__group textarea:focus {
    border-color: var(--color-primary-light);
    background: rgba(255, 255, 255, 0.12);
    outline: none;
    box-shadow: 0 0 0 3px rgba(78, 54, 133, 0.3);
}

.form__group input::placeholder,
.form__group textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form__group textarea {
    resize: vertical;
    min-height: 120px;
}

.form__submit {
    width: 100%;
}

.form__status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    display: none;
}

.form__status--success {
    display: block;
    background: rgba(46, 139, 87, 0.2);
    border: 1px solid rgba(46, 139, 87, 0.4);
    color: #d4c6f5;
}

.form__status--error {
    display: block;
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: #f5a8b0;
}

/* ---------- Footer ---------- */
.footer {
    background: #072a2e;
    color: #8fa8a3;
    padding: 2rem 0;
    text-align: center;
    font-size: 0.88rem;
}

.footer a {
    color: #d4c6f5;
}

.footer__links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

/* ---------- Publications Page ---------- */
.page-header {
    background: var(--color-primary);
    padding: 5.25rem 0 2.25rem;
    text-align: center;
}

.page-header h1 {
    color: #ffffff;
    font-size: 2.1rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #d6cbf0;
    font-size: 1.05rem;
    max-width: 550px;
    margin: 0 auto;
}

.pub-section {
    margin-bottom: 2.5rem;
}

.pub-section h2 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

.pub-list {
    list-style: none;
    padding: 0;
}

.pub-list li {
    padding: 1rem 0;
    font-size: 0.95rem;
    line-height: 1.65;
}

.pub-list .pub-title {
    font-weight: 600;
    color: var(--color-text);
}

.pub-list .pub-journal {
    font-style: italic;
    color: var(--color-text-muted);
}

.pub-list .pub-link {
    font-size: 0.88rem;
    margin-left: 0.25rem;
}

.pub-scholar-link {
    text-align: center;
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--color-bg-alt);
    border-radius: var(--radius);
}

/* ---------- Map Gallery ---------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.gallery-tile {
    display: block;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition);
}

.gallery-tile:hover,
.gallery-tile:focus-visible {
    box-shadow: var(--shadow-lg);
}

.gallery-tile img {
    display: block;
    width: 100%;
    height: 240px;
    object-fit: cover;
    object-position: top;
}

/* Gallery Lightbox */
.gallery-lightbox[hidden] {
    display: none;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(14, 10, 24, 0.88);
}

.gallery-lightbox__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: min(96vw, 1400px);
    max-height: 92vh;
}

.gallery-lightbox__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: 92vh;
}

.gallery-lightbox__content img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.gallery-lightbox__caption {
    width: 100%;
    min-height: 2.75rem;
    margin-top: 0.75rem;
    padding: 0 0.5rem;
    color: #d6cbf0;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
}

.gallery-lightbox__close {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    z-index: 2;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 999px;
    background: rgba(14, 10, 24, 0.75);
    color: #ffffff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.gallery-lightbox__close:hover,
.gallery-lightbox__close:focus {
    background: rgba(14, 10, 24, 0.95);
}

.gallery-lightbox__arrow {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

.gallery-lightbox__arrow:hover,
.gallery-lightbox__arrow:focus {
    background: rgba(255, 255, 255, 0.25);
}

.gallery-lightbox__arrow svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-tile img {
        height: 200px;
    }

    .gallery-lightbox__arrow {
        width: 2.25rem;
        height: 2.25rem;
    }

    .gallery-lightbox__arrow svg {
        width: 18px;
        height: 18px;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .services__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .project {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project--reverse .project__image {
        order: 0;
    }

    .project--reverse .project__body {
        order: 0;
    }

    .contact__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero__subtitle {
        font-size: 1.1rem;
    }

    .hero {
        min-height: 40vh;
    }

    .section {
        padding: 2.75rem 0;
    }

    .about__grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about__photo {
        max-width: 240px;
        margin: 0 auto;
    }

    .about__affiliations {
        justify-content: center;
    }

    .map-services-list {
        columns: 1;
    }

    /* Mobile navigation */
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--color-primary-dark);
        padding: 5rem 1.5rem 2rem;
        transition: right var(--transition);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
        z-index: 999;
    }

    .nav--open {
        right: 0;
    }

    .nav__list {
        flex-direction: column;
        gap: 0.25rem;
    }

    .nav__link {
        padding: 0.75rem 1rem;
        font-size: 1.05rem;
        width: 100%;
    }

    .nav__toggle {
        display: block;
        z-index: 1001;
    }

    .nav__overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }

    .nav__overlay--visible {
        display: block;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.85rem;
    }

    .hero__subtitle {
        font-size: 1rem;
    }

    .hero__pitch {
        font-size: 1rem;
    }

    .services__grid {
        grid-template-columns: 1fr;
    }

    .contact__form {
        padding: 1.25rem;
    }

    .hero__actions {
        flex-direction: column;
    }

    .hero__actions .btn {
        text-align: center;
    }
}

/* ---------- Print ---------- */
@media print {
    .header,
    .hero::before,
    .nav__toggle,
    .contact__form,
    .footer {
        display: none;
    }

    .section {
        padding: 1.5rem 0;
    }

    body {
        font-size: 11pt;
        color: #000;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}
