/* ==========================================================================
   Site stylesheet — typography, layout, shared components, page styles.
   ========================================================================== */

/* ----- Reset / base ----- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: "Helvetica", Verdana, Arial, sans-serif;
    font-size: 20px;
    line-height: 1.6;
    color: #808080;
    background: #fff;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
@media (max-width: 800px) {
    body { font-size: 16px; line-height: 1.45; }
}
img { max-width: 100%; height: auto; }
a { color: #aa0606; text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

/* ----- Layout ----- */
.site-main {
    padding: 50px 0 80px;
    min-height: 50vh;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

/* ----- Headings: bold red with gold underline ----- */
.page-heading {
    color: #aa0606;
    font-weight: 700;
    text-align: center;
    margin: 0 auto 40px;
    line-height: 1.2;
}
.page-heading::after {
    content: "";
    display: block;
    width: 280px;
    max-width: 80%;
    height: 1px;
    background: #c5a352;
    margin: 22px auto 0;
}
h1.page-heading { font-size: 2.4rem; }
h2.page-heading { font-size: 1.6rem; margin-top: 2.5rem; }
h2.page-heading::after { width: 200px; margin-top: 14px; }

/* Subheadings — same style as page-heading but smaller and left-aligned.
   width: fit-content makes the heading shrink to its text, so the
   underline (::after at 100%) matches the heading's actual width. */
.subheading {
    color: #aa0606;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 1em;
    width: fit-content;
}
.subheading::after {
    content: "";
    display: block;
    width: 100%;
    height: 1px;
    background: #c5a352;
    margin-top: 10px;
}
h2.subheading { font-size: 1.5rem; }


/* ==========================================================================
   Contact page
   ========================================================================== */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
    margin-top: 40px;
}

/* Left column: map + contact info */
.contact-map {
    width: 100%;
    height: 280px;
    border: 0;
    display: block;
    margin-bottom: 24px;
}
.contact-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.contact-info-list li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 10px 0;
}
.contact-info-list .icon {
    color: #aa0606;
    font-size: 22px;
    line-height: 1.5;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}
.contact-info-list a,
.contact-info-list .text {
    color: #c5a352;
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.5;
}
.contact-info-list a:hover,
.contact-info-list a:focus {
    color: #aa0606;
    text-decoration: none;
}

/* Right column: form */
.contact-form {
    background: #efefef;
    padding: 30px;
}
.contact-form h2 { margin-top: 0; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-field {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}
.form-field label {
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 6px;
}
.form-field .req { color: #aa0606; }
.form-field input,
.form-field textarea {
    font: inherit;
    color: #333;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0;
    width: 100%;
}
.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #aa0606;
    box-shadow: 0 0 0 2px rgba(170, 6, 6, 0.15);
}
.form-field textarea { min-height: 130px; resize: vertical; }
.form-field .sublabel {
    font-size: 0.8rem;
    color: #888;
    margin-top: 4px;
}

.form-honeypot { position: absolute; left: -9999px; top: -9999px; }

.form-message {
    padding: 12px 16px;
    margin-bottom: 16px;
    border-left: 4px solid;
}
.form-message.success { background: #f0f8f0; border-color: #4a7; color: #234; }
.form-message.error { background: #fef3f3; border-color: #d33; color: #621; }

.form-turnstile { margin: 16px 0; }

.form-actions {
    text-align: center;
    margin-top: 18px;
}
.btn-submit {
    background: #aa0606;
    color: #fff;
    border: 0;
    padding: 12px 36px;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.btn-submit:hover, .btn-submit:focus { background: #8a0505; }


/* ==========================================================================
   About page
   Photo + content rows. Background alternates white/gray;
   photo position alternates left/right (set manually in the template).
   ========================================================================== */

.about-row {
    background: #ffffff;
    padding: 60px 0;
}
.about-row:nth-child(even) {
    background: #f4f4f4;
}
/* Wider row gives photos more room. Content is capped narrower and aligned
   toward the inner edge, so the visible "text column" stays at the original width. */
.about-row .about-row-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}
.about-row .about-row-inner > div {
    max-width: 500px;
    width: 100%;
}
.about-row .about-row-inner > div:first-child { justify-self: end; }
.about-row .about-row-inner > div:last-child { justify-self: start; }
.about-row img {
    width: 100%;
    display: block;
}
.about-row img.photo-square {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center top;
}
.about-row img.photo-landscape {
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
.about-row .subheading { margin-top: 0; }

/* Bulleted list inside about content */
.about-row ul {
    padding-left: 22px;
    margin: 1em 0 0;
}
.about-row li { margin-bottom: 0.6em; }

/* ==========================================================================
   Home page
   ========================================================================== */

.home-hero {
    background-image: url('/static/photos/home/lady-justice.jpg');
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
    background-repeat: no-repeat;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.home-hero-overlay {
    width: 100%;
    text-align: center;
}
/* Semi-transparent bars span the full screen width */
.home-hero-bar {
    background: rgba(255, 255, 255, 0.7);
    padding: 24px 30px;
    margin: 14px 0;
    width: 100%;
}
.home-hero-bar-logo { padding: 32px 30px 26px; }
.home-hero-rule {
    width: 480px;
    max-width: 60%;
    height: 1px;
    background: #c5a352;
    margin: 0 auto 26px;
}
.home-hero-bar-logo img {
    width: 240px;
    max-width: 80%;
    height: auto;
    display: block;
    margin: 0 auto;
}
.home-hero-bar-nav {
    display: flex;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}
.home-hero-bar-nav a {
    position: relative;
    display: inline-block;
    color: #aa0606;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 17px;
    letter-spacing: 0.7px;
    font-weight: 600;
    transition: color 0.15s ease;
}
.home-hero-bar-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: #c5a352;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}
.home-hero-bar-nav a:hover,
.home-hero-bar-nav a:focus { color: #8a0505; text-decoration: none; }
.home-hero-bar-nav a:hover::after,
.home-hero-bar-nav a:focus::after { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) {
    .home-hero-bar-nav a::after { transition: none; }
}

/* Hero content section */
.home-content { padding: 70px 0 90px; }
.home-bio {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 50px;
    align-items: start;
    max-width: 1100px;
    margin: 30px auto 0;
}
.home-bio img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center top;
    display: block;
}

/* Reveal-on-scroll animations */
.reveal-expand {
    transform: scaleX(0);
    opacity: 0;
    transition: transform 0.9s ease-out, opacity 0.9s ease-out;
}
.reveal-expand.is-revealed {
    transform: scaleX(1);
    opacity: 1;
}
.reveal-slide-right {
    opacity: 0;
    transition: opacity 0.9s ease-out;
}
.reveal-slide-right.is-revealed { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
    .reveal-expand, .reveal-slide-right {
        transform: none;
        opacity: 1;
        transition: none;
    }
}


/* ==========================================================================
   Publications page
   ========================================================================== */

.publications-intro {
    max-width: 540px;
    margin: 0 auto 50px;
    text-align: center;
}

.publications-list {
    columns: 2;
    column-gap: 50px;
    list-style: disc;
    padding-left: 22px;
    margin: 0;
}
.publications-list li {
    margin: 0 0 1em;
    break-inside: avoid;
    padding-left: 4px;
}


/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 800px) {
    /* Contact: stack map+info above form */
    .contact-grid { grid-template-columns: 1fr; gap: 30px; }

    /* About: stack photo above content; always photo first regardless of HTML order */
    .about-row { padding: 30px 0; }
    .about-row .about-row-inner {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 20px;
    }
    .about-row .about-row-inner img { order: -1; }
    .about-row .about-row-inner > div {
        max-width: none;
        justify-self: stretch;
    }

    /* Publications: single column */
    .publications-list { columns: 1; }

    /* Home: disable parallax (iOS Safari is glitchy with fixed bg), full-height hero, stack bio */
    .home-hero {
        background-attachment: scroll;
        height: 100vh;
        min-height: 0;
        align-items: flex-start;
        padding-top: 18vh;  /* push the white bar higher up over Lady Justice */
    }
    .home-bio {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    .home-content { padding: 40px 0 60px; }
}

@media (max-width: 640px) {
    h1.page-heading { font-size: 1.8rem; }
    h2.page-heading { font-size: 1.3rem; }
    .page-heading::after { width: 200px; margin-top: 14px; }
    .site-main { padding: 30px 0 50px; }
    .container { padding: 0 18px; }
}

@media (max-width: 500px) {
    /* Contact form: stack first/last name and phone/email */
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .contact-form { padding: 20px; }
    .contact-map { height: 220px; }
}
