/* ========================================================================== 
   LAW OFFICES OF GERSHOM YOUNG
   Main stylesheet

   Design goals:
   - traditional law-office letterhead rather than a marketing template;
   - legible on phones, tablets, laptops, and large monitors;
   - no external fonts, frameworks, trackers, or visual dependencies;
   - restrained use of the moustache mark as the identifying device.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens and base rules
   -------------------------------------------------------------------------- */

:root {
    --ink: #171713;
    --ink-soft: #4f4d47;
    --paper: #fffdf8;
    --paper-deep: #f2eee5;
    --rule: #a7a096;
    --accent: #7a332d;
    --accent-dark: #55211d;
    --error: #8a1f19;
    --success: #315f3c;

    --content-width: 72rem;
    --reading-width: 46rem;
    --gutter: 1.15rem;

    --serif: Garamond, "EB Garamond", "Adobe Garamond Pro", "Times New Roman", serif;
    --utility: Georgia, "Times New Roman", serif;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    font-size: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.08rem;
    line-height: 1.62;
    text-rendering: optimizeLegibility;
}

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

a {
    color: var(--accent-dark);
    text-decoration-thickness: 0.06em;
    text-underline-offset: 0.18em;
}

a:hover,
a:focus-visible {
    color: var(--accent);
}

button,
input,
textarea {
    font: inherit;
}

button,
input,
textarea {
    border-radius: 0;
}

:focus-visible {
    outline: 3px solid rgba(122, 51, 45, 0.32);
    outline-offset: 3px;
}

.site-shell {
    width: min(calc(100% - (2 * var(--gutter))), var(--content-width));
    margin-inline: auto;
}

.reading-width {
    max-width: var(--reading-width);
}

.skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 100;
    transform: translateY(-160%);
    padding: 0.55rem 0.75rem;
    background: var(--ink);
    color: var(--paper);
}

.skip-link:focus {
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   2. Letterhead masthead and navigation
   -------------------------------------------------------------------------- */

.site-header {
    background: var(--paper);
    border-bottom: 4px double var(--ink);
}

.masthead {
    padding-block: 1.2rem 1rem;
    text-align: center;
}

.masthead-mark {
    display: inline-block;
    width: 7.75rem;
    line-height: 0;
}

.masthead-mark img {
    width: 100%;
}

.masthead-name {
    margin-top: 0.55rem;
    font-size: clamp(1.65rem, 6vw, 2.55rem);
    line-height: 1.08;
    letter-spacing: 0.015em;
}

.masthead-subtitle {
    margin-top: 0.22rem;
    color: var(--ink-soft);
    font-family: var(--utility);
    font-size: 0.72rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.primary-navigation {
    border-top: 1px solid var(--rule);
}

.primary-navigation ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.15rem 1.1rem;
    margin: 0;
    padding: 0.72rem 0;
    list-style: none;
}

.primary-navigation a {
    display: inline-block;
    padding: 0.18rem 0;
    color: var(--ink);
    font-family: var(--utility);
    font-size: 0.78rem;
    letter-spacing: 0.09em;
    text-decoration: none;
    text-transform: uppercase;
}

.primary-navigation a[aria-current="page"] {
    border-bottom: 1px solid currentColor;
    color: var(--accent-dark);
}

/* --------------------------------------------------------------------------
   3. Typography and shared content patterns
   -------------------------------------------------------------------------- */

main {
    min-height: 52vh;
}

h1,
h2,
h3 {
    margin-top: 0;
    font-weight: 400;
    line-height: 1.12;
}

h1 {
    margin-bottom: 1.1rem;
    font-size: clamp(2.45rem, 10vw, 4.75rem);
    letter-spacing: -0.025em;
}

h2 {
    margin-bottom: 0.8rem;
    font-size: clamp(1.75rem, 6vw, 2.75rem);
    letter-spacing: -0.015em;
}

h3 {
    margin-bottom: 0.45rem;
    font-size: 1.38rem;
}

p,
ul,
ol {
    margin-top: 0;
    margin-bottom: 1.15rem;
}

.lede {
    max-width: 42rem;
    font-size: clamp(1.18rem, 4vw, 1.5rem);
    line-height: 1.47;
}

.eyebrow {
    margin-bottom: 0.65rem;
    color: var(--accent-dark);
    font-family: var(--utility);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.section {
    padding-block: 3.25rem;
}

.section + .section {
    border-top: 1px solid var(--rule);
}

.section-tint {
    background: var(--paper-deep);
}

.page-heading {
    max-width: var(--reading-width);
}

.page-heading .lede {
    margin-bottom: 0;
}

.rule-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.rule-heading::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--rule);
}

/* --------------------------------------------------------------------------
   4. Homepage and gateway layouts
   -------------------------------------------------------------------------- */

.home-intro {
    padding-block: clamp(3.5rem, 11vw, 7.5rem);
}

.home-intro h1 {
    max-width: 50rem;
}

.home-intro .lede {
    margin-bottom: 1.8rem;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem 1.25rem;
}

.button {
    display: inline-block;
    padding: 0.68rem 0.95rem;
    border: 1px solid var(--ink);
    background: transparent;
    color: var(--ink);
    font-family: var(--utility);
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    text-decoration: none;
    text-transform: uppercase;
}

.button:hover,
.button:focus-visible {
    background: var(--ink);
    color: var(--paper);
}

.link-grid {
    display: grid;
    gap: 1.5rem;
}

.link-card {
    padding-top: 1.15rem;
    border-top: 1px solid var(--rule);
}

.link-card h2,
.link-card h3 {
    margin-bottom: 0.42rem;
}

.link-card a {
    color: inherit;
}

.link-card p:last-child {
    margin-bottom: 0;
}

.section-index {
    margin: 0;
    padding: 0;
    list-style: none;
}

.section-index li {
    padding-block: 1.1rem;
    border-top: 1px solid var(--rule);
}

.section-index li:last-child {
    border-bottom: 1px solid var(--rule);
}

.section-index a {
    display: inline-block;
    font-size: 1.35rem;
}

.section-index p {
    margin: 0.28rem 0 0;
    color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   5. Practice and place page skeletons
   -------------------------------------------------------------------------- */

.content-grid {
    display: grid;
    gap: 2.25rem;
}

.content-block {
    max-width: var(--reading-width);
}

.outline-list {
    margin: 0;
    padding-left: 1.2rem;
}

.outline-list li {
    margin-bottom: 0.45rem;
}

.note-box {
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--rule);
    background: rgba(255, 255, 255, 0.48);
}

.note-box p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   6. About page
   -------------------------------------------------------------------------- */

.about-layout {
    display: grid;
    gap: 2rem;
    align-items: start;
}

.about-photo {
    max-width: 31rem;
    margin: 0;
}

.about-photo img {
    width: 100%;
    border: 1px solid var(--rule);
}

.about-photo figcaption {
    margin-top: 0.45rem;
    color: var(--ink-soft);
    font-family: var(--utility);
    font-size: 0.72rem;
}

/* --------------------------------------------------------------------------
   7. Contact form
   -------------------------------------------------------------------------- */

.contact-layout {
    display: grid;
    gap: 2.5rem;
    align-items: start;
}

.contact-details {
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--rule);
}

.contact-details address {
    font-style: normal;
}

.form-notice {
    margin-bottom: 1.5rem;
    padding: 1rem 1.1rem;
    border-left: 3px solid var(--accent-dark);
    background: var(--paper-deep);
}

.form-errors {
    margin-bottom: 1.5rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--error);
    color: var(--error);
}

.form-row {
    margin-bottom: 1.25rem;
}

.form-row label,
.form-legend {
    display: block;
    margin-bottom: 0.35rem;
    font-family: var(--utility);
    font-size: 0.77rem;
    font-weight: 700;
    letter-spacing: 0.045em;
}

.required-marker {
    color: var(--error);
}

.form-row input,
.form-row textarea {
    width: 100%;
    padding: 0.68rem 0.72rem;
    border: 1px solid var(--rule);
    background: #fff;
    color: var(--ink);
}

.form-row textarea {
    min-height: 11rem;
    resize: vertical;
}

.form-row input[aria-invalid="true"],
.form-row textarea[aria-invalid="true"] {
    border-color: var(--error);
}

.field-help,
.field-error {
    margin: 0.3rem 0 0;
    font-family: var(--utility);
    font-size: 0.75rem;
}

.field-help {
    color: var(--ink-soft);
}

.field-error {
    color: var(--error);
}

.checkbox-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.65rem;
    align-items: start;
}

.checkbox-row input {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.22rem;
}

.honeypot {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
}

button.button {
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   8. Error and thank-you pages
   -------------------------------------------------------------------------- */

.message-page {
    display: grid;
    min-height: 58vh;
    place-items: center;
    padding-block: 4rem;
    text-align: center;
}

.message-page-inner {
    max-width: 38rem;
}

.message-mark {
    width: 8.5rem;
    margin: 0 auto 1.5rem;
}

.status-code {
    color: var(--accent-dark);
    font-family: var(--utility);
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   9. Footer
   -------------------------------------------------------------------------- */

.site-footer {
    padding-block: 2.5rem;
    border-top: 4px double var(--ink);
    background: var(--paper-deep);
    color: var(--ink-soft);
    font-family: var(--utility);
    font-size: 0.78rem;
}

.footer-grid {
    display: grid;
    gap: 1.5rem;
}

.footer-mark {
    width: 6.5rem;
    margin-bottom: 0.6rem;
}

.footer-firm {
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.22rem;
}

.footer-notice p {
    margin-bottom: 0.65rem;
}

/* --------------------------------------------------------------------------
   10. Wider screens
   -------------------------------------------------------------------------- */

@media (min-width: 44rem) {
    :root {
        --gutter: 1.75rem;
    }

    .link-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content-grid {
        grid-template-columns: minmax(0, 1fr) minmax(14rem, 0.52fr);
    }

    .about-layout {
        grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.72fr);
        gap: 3.5rem;
    }

    .contact-layout {
        grid-template-columns: minmax(15rem, 0.65fr) minmax(0, 1.35fr);
        gap: 4rem;
    }

    .footer-grid {
        grid-template-columns: 1fr 0.75fr 1.35fr;
        gap: 2.5rem;
    }
}

@media (min-width: 68rem) {
    .link-grid.three-columns {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* --------------------------------------------------------------------------
   11. Print
   -------------------------------------------------------------------------- */

@media print {
    body {
        background: #fff;
        color: #000;
        font-size: 11pt;
    }

    .primary-navigation,
    .action-row,
    .site-footer,
    .skip-link,
    form {
        display: none !important;
    }

    .site-header {
        border-bottom: 3px double #000;
    }

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

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
    }
}
