:root {
    --page-background: #080808;
    --surface: #111111;
    --surface-raised: #191919;
    --surface-soft: #232323;
    --text: #f3f0eb;
    --text-muted: #bdb8b0;
    --accent: #d49a70;
    --accent-bright: #efb185;
    --border: #383532;
    --focus: #ffd2ad;
    --content-width: 1180px;
    --sidebar-width: 224px;
    --masthead-height: 190px;
    --page-gap: 20px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--page-background);
}

body {
    width: auto;
    max-width: var(--content-width);
    min-height: 100vh;
    margin: 0 auto;
    padding: calc(var(--masthead-height) + var(--page-gap)) 20px 32px;
    overflow-wrap: break-word;
    color: var(--text);
    background: var(--page-background);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    font-size: 100%;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
    margin-top: 0;
    color: var(--text);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
    line-height: 1.18;
    text-wrap: balance;
}

h1 {
    margin-bottom: 0.8rem;
    font-size: clamp(2rem, 4vw, 3.4rem);
    letter-spacing: -0.025em;
}

h2 {
    margin-bottom: 0.7rem;
    font-size: clamp(1.25rem, 2.2vw, 1.75rem);
}

h3 {
    font-size: 1.15rem;
}

p {
    margin: 0 0 1.25rem;
}

a {
    color: var(--accent-bright);
    text-decoration-color: rgba(239, 177, 133, 0.65);
    text-underline-offset: 0.2em;
}

a:hover {
    color: #ffffff;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

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

#masthead {
    position: absolute;
    top: 0;
    left: 50%;
    width: calc(100% - 40px);
    max-width: calc(var(--content-width) - 40px);
    height: var(--masthead-height);
    overflow: hidden;
    transform: translateX(-50%);
    background:
        linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.86) 0%,
            rgba(0, 0, 0, 0.58) 38%,
            rgba(0, 0, 0, 0.12) 72%
        ),
        url("images/masthead-broomhead_v2.jpg") center center / cover no-repeat;
    border-bottom: 1px solid var(--border);
}

#masthead .masthead-link {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 24px clamp(24px, 5vw, 64px);
    color: #ffffff;
    text-decoration: none;
}

.masthead-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 34rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.masthead-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.025em;
}

.masthead-byline {
    margin-top: 0.55rem;
    color: #f3f0eb;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.masthead-location {
    margin-top: 0.28rem;
    color: #d7d1c9;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#masthead .masthead-link:hover .masthead-title {
    color: var(--accent-bright);
}

#page_container {
    position: static;
    width: auto;
    min-width: 0;
}

#container {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    grid-template-areas: "sidebar content";
    min-width: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
}

#content {
    grid-area: content;
    float: none;
    width: auto;
    min-width: 0;
    height: auto;
    padding: clamp(24px, 4vw, 52px);
    color: var(--text);
    background: linear-gradient(180deg, #1e1e1d 0%, #141414 100%);
    text-align: left;
}

#content > h1,
.page-introduction {
    text-align: center;
}

.page-introduction {
    margin-right: auto;
    margin-left: auto;
    max-width: 48rem;
    color: var(--text-muted);
    font-family: inherit;
    font-size: clamp(1.05rem, 1.8vw, 1.35rem);
    font-weight: 400;
    line-height: 1.45;
}

.page-introduction-copy {
    max-width: 48rem !important;
    margin-right: auto;
    margin-left: auto;
    text-align: center;
}

#content > p {
    max-width: 52rem;
    margin-right: auto;
    margin-left: auto;
}

#sidebar_a {
    grid-area: sidebar;
    float: none;
    width: auto;
    height: auto;
    padding: 30px 18px;
    color: var(--text-muted);
    background: linear-gradient(180deg, #1e1e1d 0%, #141414 100%);
    border-right: 1px solid var(--border);
}

.sidebar-title {
    margin: 0 0 1rem;
    color: var(--accent-bright);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

#sidebar_a ul {
    width: auto;
    margin: 0;
    padding: 0;
    list-style: none;
    font: inherit;
}

#sidebar_a li {
    margin: 0 0 0.35rem;
    padding: 0;
    overflow: hidden;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 3px;
}

#sidebar_a a,
#sidebar_a a:link,
#sidebar_a a:visited {
    display: block;
    padding: 0.72rem 0.8rem;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
}

#sidebar_a a:hover,
#sidebar_a a:active {
    color: #ffffff;
    background: #34302d;
}

.sidebar-contact {
    margin: 1.5rem 0 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.sidebar-contact a,
.sidebar-contact a:link,
.sidebar-contact a:visited {
    display: inline;
    padding: 0;
    color: var(--accent-bright) !important;
    font-size: inherit;
    text-decoration: underline;
}

.gallery-collection-introduction {
    max-width: 48rem !important;
    margin: 0 auto 2rem;
    color: var(--text-muted);
    text-align: center;
}

.gallery-tabs {
    margin: 2rem auto 2.75rem;
    max-width: 52rem;
}

.gallery-tabs ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gallery-tabs li {
    margin: 0;
}

.gallery-tabs a,
.gallery-tabs a:link,
.gallery-tabs a:visited {
    display: block;
    min-height: 44px;
    padding: 0.65rem 1rem;
    color: var(--text);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.92rem;
    font-weight: 650;
    line-height: 1.35;
    text-decoration: none;
}

.gallery-tabs a:hover {
    color: #ffffff;
    background: #34302d;
}

.gallery-tabs a[aria-current="page"] {
    color: #080808;
    background: var(--accent-bright);
    border-color: var(--accent-bright);
}

.gallery-section-title {
    margin-bottom: 1rem;
    text-align: center;
}

.gallery-section-description {
    max-width: 52rem !important;
    margin-right: auto;
    margin-left: auto;
}

.about-layout {
    display: grid;
    grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
    align-items: start;
    gap: clamp(28px, 5vw, 56px);
    max-width: 52rem;
    margin: 2rem auto 0;
}

.about-portrait {
    margin: 0;
}

.about-portrait img {
    display: block;
    width: 100%;
    height: auto;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 3px;
}

.about-portrait figcaption {
    margin-top: 0.65rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.45;
    text-align: center;
}

.about-copy p {
    margin-bottom: 1.15rem;
}

.about-copy .about-lead {
    color: var(--text);
    font-size: 1.15rem;
    line-height: 1.55;
}

.about-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.25rem;
    padding-top: 0.4rem;
}

.gallery-item {
    margin: 3rem auto 0;
    padding: 0 0 3rem;
    max-width: 860px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.gallery-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.gallery-title {
    margin-bottom: 1.1rem;
    color: var(--text);
    font-size: clamp(1.35rem, 2.5vw, 2rem);
}

.gallery-image-link {
    display: block;
    background: transparent;
}

.gallery-image-link .photo,
.photo {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.gallery-description {
    margin: 1rem auto 0;
    max-width: 46rem;
    color: var(--text-muted);
    text-align: center;
}

.gallery-enquiry {
    margin: 1rem 0 0;
    text-align: center;
}

#content a.normal_link,
#footer a.normal_link,
a.normal_link {
    color: var(--accent-bright) !important;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

#content a.normal_link:hover,
#footer a.normal_link:hover,
a.normal_link:hover {
    color: #ffffff !important;
}

#footer {
    clear: both;
    width: auto;
    margin: 18px 0 0;
    padding: 24px clamp(20px, 4vw, 48px);
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.92rem;
    text-align: center;
}

#footer h1 {
    color: var(--text);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
}

#footer p {
    margin: 0 0 0.75rem;
    text-align: center;
}

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

.site-footer-content {
    margin: 0 auto;
    max-width: 52rem;
}

iframe {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
}

code {
    overflow-wrap: anywhere;
}

@media (max-width: 820px) {
    :root {
        --masthead-height: 112px;
        --page-gap: 12px;
    }

    body {
        padding-right: 12px;
        padding-bottom: 20px;
        padding-left: 12px;
    }

    #masthead {
        width: calc(100% - 24px);
        background-position: 32% center;
    }

    #masthead .masthead-link {
        padding: 14px 18px;
    }

    .masthead-title {
        font-size: clamp(1.45rem, 7vw, 2rem);
    }

    .masthead-byline {
        margin-top: 0.35rem;
        font-size: 0.82rem;
    }

    .masthead-location {
        display: none;
    }

    #container {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "sidebar"
            "content";
    }

    #sidebar_a {
        padding: 12px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .sidebar-title {
        margin-bottom: 0.5rem;
    }

    #sidebar_a ul {
        display: flex;
        gap: 0.5rem;
        padding-bottom: 0.35rem;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
    }

    #sidebar_a li {
        flex: 0 0 auto;
        margin: 0;
    }

    #sidebar_a a,
    #sidebar_a a:link,
    #sidebar_a a:visited {
        min-height: 44px;
        padding: 0.7rem 0.85rem;
        white-space: nowrap;
    }

    .sidebar-contact {
        display: none;
    }

    #content {
        padding: 26px 18px 34px;
    }

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

    .about-portrait {
        width: min(100%, 320px);
        margin: 0 auto;
    }

    .gallery-item {
        margin-top: 2.25rem;
        padding-bottom: 2.25rem;
    }

    #footer {
        margin-top: 12px;
        padding: 22px 18px;
    }
}

@media (max-width: 480px) {
    #masthead {
        background:
            linear-gradient(
                90deg,
                rgba(0, 0, 0, 0.88) 0%,
                rgba(0, 0, 0, 0.62) 58%,
                rgba(0, 0, 0, 0.22) 100%
            ),
            url("images/masthead-broomhead-mobile_v2.jpg")
                left center / cover no-repeat;
    }

    body {
        font-size: 95%;
    }

    #content {
        padding-right: 14px;
        padding-left: 14px;
    }

    .gallery-title {
        font-size: 1.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }
}
