@font-face {
    font-family: 'Courier Prime';
    src: url('../fonts/CourierPrime-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Courier Prime';
    src: url('../fonts/CourierPrime-Italic.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'Courier Prime';
    src: url('../fonts/CourierPrime-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Courier Prime';
    src: url('../fonts/CourierPrime-BoldItalic.ttf') format('truetype');
    font-weight: bold;
    font-style: italic;
}

.screenplay-page {
    font-family: "Courier Prime", "Courier New", Courier, monospace;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin: 2rem auto;
    padding: 1in 1in 1in 1.5in;
    width: 8.5in;
    height: 11in;
    box-sizing: border-box;
    font-size: 12pt;
    display: flex;
    flex-direction: column;
    position: relative;
    color: black;
}

.page-number {
    position: absolute;
    top: 0.5in;
    right: 1in;
    font-size: 12pt;
}

.page-content {
    margin-top: 0; /* Approximate starting position from top of paper */
}


/* --- Script Element Styles --- */

/* Base for all lines to prevent CSS wrapping */
.scene-heading-line,
.action-line,
.character-line,
.dialogue-line,
.parenthetical-line,
.transition-line,
.centered-line,
.synopsis-line,
.lyric-line {
    white-space: nowrap;
    height: 1em;
}

.scene-heading-line {
    text-transform: uppercase;
    font-weight: bold;
    margin-left: 0; /* Continuation lines will correctly start at the content margin */
    transition: background-color 0.2s ease-in-out;
}

.scene-heading-line:hover {
    background-color: #f0f0f0; /* light gray */
    cursor: pointer;
}

/* This is the primary heading line that gets numbers */
.scene-heading-line.with-number {
    position: relative;
}

/* The text of the heading itself aligns with other content */
.scene-heading-line .scene-heading-text {
    /* This will now align correctly by default */
}

/* Position the left number inside the page's left margin */
.scene-heading-line .scene-number-left {
    position: absolute;
    left: -0.5in; /* Move it 0.5in into the 1.5in left padding */
    width: 0.4in;
    text-align: left;
}

/* Position the right number at the far right of the content area */
.scene-heading-line .scene-number-right {
    position: absolute;
    right: -0.5in;
    width: 0.5in;
    text-align: right;
}

.action-line {
    margin-left: 0;
}

.character-line {
    margin-left: 2.2in; /* 3.7in from paper edge */
    text-transform: uppercase;
}

.dialogue-line {
    margin-left: 1.0in; /* 2.5in from paper edge */
}

.parenthetical-line {
    margin-left: 1.6in; /* 3.1in from paper edge */
}

.transition-line {
    margin-left: 4.5in; /* 6.0in from paper edge */
    text-transform: uppercase;
}

.centered-line {
    text-align: center;
    margin-left: 0;
}

.section-line {
    margin-left: 0;
    font-weight: bold;
}

.synopsis-line {
    margin-left: 0.5in;
    font-style: italic;
    color: #555;
}

.lyric-line {
    margin-left: 2.5in;
    width: 3.5in;
    font-style: italic;
}

.empty-line {
    height: 1em; /* Represents a blank line */
} 

/* --- Title Page Styles --- */
.title-page {
    font-family: "Courier Prime", "Courier New", Courier, monospace;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin: 2rem auto;
    padding: 1in 1in 1in 1.5in; /* Same as screenplay-page */
    width: 8.5in;
    height: 11in;
    box-sizing: border-box;
    font-size: 12pt;
    position: relative;
    color: black;
}

.title-center {
    position: absolute;
    top: 22%; /* roughly industry placement */
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    line-height: 1em;
}

.right-block {
    position: absolute;
    right: 1in;
    bottom: 2.5in; /* approx middle-lower area */
    text-align: right;
}

.bottom-left {
    position: absolute;
    left: 1in;
    bottom: 1in;
} 