:root {
    /* Colors */
    --bar-bg: #545454;
    --bar-fg: #fdfcfa;

    /* Spacing */
    --spacing-xxs: 2px;
    --spacing-xs: 10px;
    --spacing-sm: 14px;
    --spacing-md: 16px;
    --spacing-lg: 18px;
    --spacing-xl: 20px;

    /* Image overlap */
    --image-overlap: 0px;
    --gap-cover-height: 200px;

    /* Layout */
    --content-width: 80%;
    --max-content-width: 1100px;
    --strip-col-padding: 18px;
    --strip-col-min-height: 70px;

    /* Typography */
    --font-size-sm: 14px;
    --font-size-md: 20px;
    --letter-spacing-tight: 0.02em;
    --letter-spacing-normal: 0.05em;
    --letter-spacing-wide: 0.08em;
    --line-height-strip: 1.65;
    --font-weight-semibold: 600;

    /* Borders */
    --border-width: 2px;
    --border-width-thin: 1px;

    /* Z-index layers */
    --z-image: 0;
    --z-base: 1;
    --z-content: 2;

    /* Breakpoints */
    --breakpoint-desktop: 1200px;
    --breakpoint-tablet: 768px;
    --breakpoint-mobile: 480px;

    /* Productions page */
    --productions-section-spacing: 60px;
    --productions-entry-spacing: 40px;
    --productions-image-width: 300px;
    --productions-gallery-gap: 16px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: "Work Sans", sans-serif;
    font-optical-sizing: auto;
    background: var(--bar-bg);
    color: var(--bar-fg);
    position: relative;
    z-index: var(--z-base);
}

body.page-landing {
    background: transparent;
}

main {
    flex: 1 0 auto;
}

body.page-landing main {
    min-height: calc(100vh - 200px);
}

#background-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: calc(var(--z-image) - 1);
    pointer-events: none;
}

header {
    position: relative;
    z-index: var(--z-base);
    flex: 0 0 auto;
}

main {
    position: relative;
    z-index: var(--z-content);
}

main::after {
    content: "";
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: var(--gap-cover-height);
    z-index: var(--z-content);
    pointer-events: auto;
    background: transparent;
}

.site-strip {
    /* background: var(--bar-bg); */
    background: transparent;
    color: var(--bar-fg);
    padding: var(--spacing-lg) 0 0 0;
    position: relative;
    z-index: var(--z-content);
    margin-top: auto;
    display: flex;
    flex-direction: column;
    min-height: fit-content;
}

.site-strip > .strip-inner,
.site-strip > .copyright {
    position: relative;
    z-index: calc(var(--z-content) + 2);
}

.site-strip > .footer-image-wrapper {
    margin-bottom: 0;
    padding-bottom: 0;
    z-index: calc(var(--z-content) + 1);
    order: 3; /* Ensure it's last in flex order */
}

.site-strip a {
    color: var(--bar-fg);
}

.strip-inner {
    width: 100%;
    max-width: 100%;
    padding: 0 var(--spacing-md) var(--spacing-xs) var(--spacing-md);
    position: relative;
    box-sizing: border-box;
}

.strip-inner::before {
    content: "";
    position: absolute;
    left: var(--spacing-md);
    right: var(--spacing-md);
    top: calc(-1 * var(--spacing-xs));
    height: var(--border-width-thin);
    background: var(--bar-fg);
}

.strip-inner::after {
    content: "";
    position: absolute;
    left: var(--spacing-md);
    right: var(--spacing-md);
    bottom: 0;
    height: var(--border-width-thin);
    background: var(--bar-fg);
}

.strip-grid-wrapper {
    max-width: var(--max-content-width);
    margin: 0 auto;
}

.strip-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.strip-col {
    padding: 0 var(--strip-col-padding);
    min-height: var(--strip-col-min-height);
    display: flex;
    flex-direction: column;
}

.strip-col + .strip-col {
    border-left: var(--border-width) solid var(--bar-fg);
}

.strip-title {
    font-size: var(--font-size-sm);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
    margin: 0 0 var(--spacing-xs) 0;
    font-weight: var(--font-weight-semibold);
}

.strip-title a {
    color: var(--bar-fg);
    text-decoration: none;
}

.strip-links,
.strip-text {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--font-size-sm);
    line-height: var(--line-height-strip);
    letter-spacing: var(--letter-spacing-tight);
    text-transform: uppercase;
}

.strip-links a {
    color: var(--bar-fg);
    text-decoration: none;
}

.strip-links a:hover {
    text-decoration: underline;
}

.newsletter-caption {
    margin-bottom: var(--spacing-xs);
    text-transform: none;
    letter-spacing: var(--letter-spacing-tight);
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin: 0;
}

.newsletter-input {
    appearance: none;
    background: transparent;
    color: var(--bar-fg);
    border: var(--border-width-thin) solid var(--bar-fg);
    padding: 8px 10px;
    font: inherit;
    font-size: var(--font-size-sm);
    letter-spacing: var(--letter-spacing-tight);
    border-radius: 0;
    width: 100%;
    min-width: 0;
}

.newsletter-input::placeholder {
    color: var(--bar-fg);
    opacity: 0.55;
}

.newsletter-input:focus {
    outline: var(--border-width-thin) solid var(--bar-fg);
    outline-offset: 2px;
}

.newsletter-submit {
    appearance: none;
    background: var(--bar-fg);
    color: var(--bar-bg);
    border: var(--border-width-thin) solid var(--bar-fg);
    padding: 8px 14px;
    font: inherit;
    font-size: var(--font-size-sm);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
    cursor: pointer;
    align-self: flex-start;
}

.newsletter-submit:hover,
.newsletter-submit:focus-visible {
    background: transparent;
    color: var(--bar-fg);
}

.newsletter-status {
    margin: 0;
    font-size: var(--font-size-sm);
    min-height: 1.2em;
    letter-spacing: var(--letter-spacing-tight);
}

.newsletter-status[data-state="error"] {
    color: #ffd2c0;
}

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

.copyright {
    text-align: right;
    padding: var(--spacing-xs) var(--spacing-md) var(--spacing-xxs) 0;
    font-size: var(--font-size-sm);
    margin: 0;
}

.footer-image-wrapper {
    overflow: visible;
    margin-top: calc(-1 * var(--image-overlap));
    width: 100%;
    position: relative;
    z-index: calc(var(--z-content) + 1);
    flex-shrink: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    line-height: 0;
}

.footer-image-wrapper img {
    display: block;
    margin: 0 auto;
    width: var(--content-width);
    max-width: 100%;
    height: auto;
    vertical-align: bottom;
}

.top-image-wrapper {
    overflow: visible;
    margin-bottom: calc(-1 * var(--image-overlap));
    position: relative;
    pointer-events: none;
    width: 100%;
}

.top-image-wrapper a {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
    z-index: var(--z-image);
    pointer-events: auto;
    clip-path: inset(0 0 var(--image-overlap) 0);
}

/* Ensure top image is visible on small screens - reduce clipping significantly */
@media (max-width: 768px) {
    .top-image-wrapper {
        overflow: visible;
    }

    .top-image-wrapper a {
        clip-path: inset(0 0 50px 0) !important;
    }
}

@media (max-width: 600px) {
    .top-image-wrapper a {
        clip-path: inset(0 0 30px 0) !important;
    }
}

/* On phones there isn't room for the desktop "logo overlaps content" effect,
   so disable both the negative-margin overlap (via --image-overlap in the
   :root override blocks below) and the bottom clip-path mask. */
@media (max-width: 480px) {
    .top-image-wrapper a {
        clip-path: inset(0 0 0 0) !important;
    }
}

@media (max-width: 400px) {
    .top-image-wrapper a {
        clip-path: inset(0 0 0 0) !important;
    }
}

@media (max-width: 360px) {
    .top-image-wrapper a {
        clip-path: inset(0 0 0 0) !important;
    }
}

.big-title {
    width: var(--content-width);
    max-width: 100%;
    display: block;
    margin: 0 auto;
    height: auto;
}

.button-row {
    display: flex;
    justify-content: space-between;
    width: var(--content-width);
    max-width: 100%;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md) 0 var(--spacing-md);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    position: relative;
    z-index: var(--z-content);
    box-sizing: border-box;
}

.main-button {
    font-size: var(--font-size-md);
    color: var(--bar-fg);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-normal);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.main-button:hover {
    text-decoration: underline;
}

/* Active nav item styling */
.page-productions .nav-productions,
.page-studio .nav-studio {
    font-weight: var(--font-weight-semibold);
}

/* Medium screens (tablets and small laptops) */
@media (max-width: 768px) {
    :root {
        --content-width: 90%;
        --image-overlap: 100px;
        --productions-section-spacing: 40px;
        --productions-entry-spacing: 30px;
    }

    .top-image-wrapper {
        margin-bottom: calc(-1 * var(--image-overlap));
    }

    .footer-image-wrapper {
        margin-top: calc(-1 * var(--image-overlap));
    }

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

    .strip-col:nth-child(1),
    .strip-col:nth-child(3) {
        border-left: none;
    }

    .button-row {
        flex-wrap: wrap;
        gap: var(--spacing-md);
    }

    .main-button {
        font-size: 18px;
    }
}

/* Productions page styles */
.productions-main {
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
}

.productions-section {
    margin-bottom: var(--productions-section-spacing);
}

.productions-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: var(--font-size-md);
    text-transform: lowercase;
    letter-spacing: var(--letter-spacing-normal);
    margin: 0 0 var(--spacing-xl) 0;
    font-weight: var(--font-weight-semibold);
}

.production-entry {
    margin-bottom: var(--productions-entry-spacing);
}

.production-entry:last-child {
    margin-bottom: 0;
}

.production-header {
    display: flex;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    align-items: flex-start;
}

.production-image {
    flex: 0 0 auto;
    min-width: var(--productions-image-width);
    max-width: 100%;
}

.poster-container {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.poster-container.one-poster img {
    width: auto;
    height: auto;
    max-width: 600px;
    display: block;
}

.poster-container.two-poster img {
    width: auto;
    height: auto;
    max-width: 300px;
    display: block;
}

.production-blurb {
    flex: 1;
    padding-left: var(--spacing-md);
    text-align: right;
    min-width: 0; /* Allows flex item to shrink below content size */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.production-blurb p {
    font-size: var(--font-size-md);
    margin: 0 0 var(--spacing-md) 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    -webkit-hyphens: none;
    -ms-hyphens: none;
    hyphens: none;
    /* line-height: var(--line-height-strip); */
}

.production-location {
    text-align: right;
    margin-top: var(--spacing-lg);
    font-weight: var(--font-weight-semibold);
}

.production-location p {
    margin: 0;
    font-size: var(--font-size-sm);
    /* line-height: var(--line-height-strip); */
}

.watch-now-link {
    display: inline-block;
    color: #fff;
    text-decoration: none;
    border: var(--border-width-thin) solid var(--bar-fg);
    border-radius: 6px;
    padding: 4px 12px;
    font-size: var(--font-size-md);
}

.watch-now-link:hover {
    background: var(--bar-fg);
    color: var(--bar-bg);
}

.production-name {
    font-size: var(--font-size-md);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-normal);
    margin: var(--spacing-xl) 0;
    font-weight: var(--font-weight-semibold);
}

.production-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--productions-gallery-gap);
    margin: var(--spacing-xl) 0;
}

/* Medium-large screens - 3 column gallery */
@media (max-width: 1000px) and (min-width: 769px) {
    .production-gallery {
        grid-template-columns: repeat(3, 1fr);
    }

    /* No clean half on a 3-col grid; give each wide image its own full row */
    .production-gallery img.gallery-wide {
        grid-column: 1 / -1;
    }
}

.production-gallery img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Landscape images that occupy the top row of a gallery (2 across a 4-col grid) */
.production-gallery img.gallery-wide {
    grid-column: span 2;
}

.production-credits {
    font-size: var(--font-size-sm);
    /* line-height: var(--line-height-strip); */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* padding: var(--spacing-md); */
}

.credits-title {
    font-size: var(--font-size-md);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-normal);
    margin: 0 0 var(--spacing-md) 0;
    font-weight: var(--font-weight-semibold);
}

.production-credits p {
    margin: 0 0 var(--spacing-xs) 0;
}

.production-credits.left {
    text-align: left;
    align-items: flex-start;
}

.production-credits.right {
    text-align: right;
    align-items: flex-end;
}

/* Medium screens - adjust production layout before full mobile */
@media (max-width: 900px) and (min-width: 769px) {
    .production-header {
        gap: var(--spacing-lg);
    }

    .production-image {
        min-width: 250px;
    }

    .poster-container img {
        max-width: 250px;
    }
}

@media (max-width: 768px) {
    .production-header {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .production-image {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
    }

    .poster-container {
        flex-wrap: wrap;
        justify-content: center;
    }

    .poster-container img {
        max-width: 100%;
        flex: 1 1 auto;
        min-width: 0;
    }

    .production-blurb {
        padding-left: 0;
        text-align: left;
    }

    .production-location {
        text-align: left;
    }

    .production-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-title {
        font-size: 18px;
    }

    .production-name {
        font-size: 18px;
    }
}

/* Small screens (mobile) */
@media (max-width: 480px) {
    :root {
        --content-width: 95%;
        --image-overlap: 0px;
        --gap-cover-height: 80px;
        --productions-section-spacing: 30px;
        --productions-entry-spacing: 25px;
        --spacing-xl: 18px;
        --spacing-lg: 16px;
        --spacing-md: 14px;
        --font-size-md: 18px;
        --font-size-sm: 15px;
        --line-height-strip: 1.55;
        --letter-spacing-tight: 0.03em;
        --strip-col-padding: 14px;
    }

    .top-image-wrapper {
        margin-bottom: calc(-1 * var(--image-overlap));
    }

    .footer-image-wrapper {
        margin-top: calc(-1 * var(--image-overlap));
    }

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

    .strip-col + .strip-col {
        border-left: none;
        border-top: var(--border-width-thin) solid var(--bar-fg);
        padding-top: var(--spacing-sm);
        margin-top: var(--spacing-sm);
    }

    .button-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
        padding-top: var(--spacing-lg);
    }

    .main-button {
        font-size: var(--font-size-md);
        padding: 6px 0;
    }

    .production-gallery {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .production-header {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .poster-container {
        flex-direction: column;
        align-items: stretch;
    }

    .poster-container img {
        width: 100%;
        max-width: 100%;
    }

    .productions-main {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .section-title {
        font-size: var(--font-size-md);
        margin-bottom: var(--spacing-lg);
    }

    .production-name {
        font-size: var(--font-size-md);
        margin: var(--spacing-lg) 0;
    }

    .copyright {
        text-align: center;
        padding: var(--spacing-xs) var(--spacing-md);
    }

    /* Comfortable paragraph rhythm on small screens */
    .production-blurb p {
        line-height: 1.55;
    }
}

/* Large screens - ensure content doesn't get too wide
   NOTE: var() inside @media conditions is invalid CSS, so this query is intentionally a no-op
   to preserve the current desktop presentation (--content-width stays at the :root value). */
@media (min-width: var(--breakpoint-desktop)) {
    :root {
        --content-width: 70%;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    :root {
        --content-width: 98%;
        --image-overlap: 0px;
        --gap-cover-height: 60px;
    }

    .button-row {
        padding-left: var(--spacing-sm);
        padding-right: var(--spacing-sm);
    }

    .top-image-wrapper {
        margin-bottom: calc(-1 * var(--image-overlap));
    }

    .footer-image-wrapper {
        margin-top: calc(-1 * var(--image-overlap));
    }
}
