/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 License: none (public domain) */

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small,
strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form,
label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas,
details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section,
summary, time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: inherit;
    font: inherit;
    vertical-align: baseline;
}
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
    display: block;
}
ol, ul {
    list-style: none;
}
blockquote, q {
    quotes: none;
}
blockquote:before, blockquote:after, q:before, q:after {
    content: '';
    content: none;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* BEGIN MY STYLES */

/* --- General Layout --- */

html {
    height: 100%;
    overflow-y: scroll;
    scrollbar-width: none;      /* Firefox */
    -ms-overflow-style: none;   /* IE 10+ */
}
html::-webkit-scrollbar {      /* WebKit */
    width: 0;
    height: 0;
}
body {
    display: flex;
    flex-flow: column;
    min-height: 100%;           /* CHANGED: height → min-height so body can grow with content */
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1a1a1a;
}
i, em {
    font-style: italic;
}
b, strong {
    font-weight: bold;
}
h1, h2, h3 {
    font-weight: bold;
    padding: 0;
    margin: 0;
    line-height: 1.3em;
}
h1 {
    font-size: 2em;
}
h2 {
    font-size: 1.5em;
}
ul, li {
    list-style-type: none;
    margin: 0;
    padding: 0;
    line-height: 1.25em;
}
a:link,
a:visited {
    text-decoration: none;
    color: inherit;
}

/* --- Header --- */

.header {
    background: linear-gradient(135deg, #4a1060 0%, #6b1f82 100%); /* CHANGED: flat color → subtle gradient */
    color: #ffffff;
    font-family: 'Merriweather', serif;
    text-align: center;
    padding: 1.25em 0;                      /* CHANGED: height:15% → padding-based */
    width: 100%;
    font-size: 1.15em;
    border-bottom: 3px solid #3d1147;       /* CHANGED: 1px black → 3px dark plum */
    box-shadow: 0 2px 8px rgba(0,0,0,0.3); /* ADDED: lifts header off the page */
}
.header-content {
    margin: 0 2%;
    display: flex;
    flex-flow: row nowrap;
    justify-content: flex-start;
    align-items: center;                    /* ADDED: vertical centering on parent */
    gap: 2em;
}
.header-title {
    flex-basis: 34%;
    display: flex;
    flex-direction: column;     /* stacks h1 and h2 vertically */
    gap: 0.4em;                 /* space between title and subtitle */
}
.header-title h1 {
    font-size: 1.8em;
    letter-spacing: 0.02em;
}
.header-title h2 {
    font-size: 1.1em;
    font-weight: normal;
    letter-spacing: 0.03em;
    opacity: 0.9;
    /* REMOVED: margin-bottom — gap on parent handles spacing now */
}
.header-attribution {
    flex-basis: 66%;
    text-align: left;
    padding-left: 2em;
    border-left: 1px solid rgba(255,255,255,0.3);
    align-self: center;
}
.header-attribution p {
    font-size: 0.8em;
    opacity: 0.75;                          /* ADDED: attribution is tertiary information */
    font-family: 'Lato', sans-serif;        /* ADDED: Lato reads better than Merriweather at small sizes */
}

/* --- Main --- */

.main {
    display: flex;
    flex-grow: 1;
    align-items: flex-start;               /* ADDED: required for sticky sidebars to work */
}

/* --- Title Navigation --- */

#play_titles_frame {
    background: #d4a8e8;
    flex-basis: 20%;
    flex-shrink: 0;                         /* ADDED: prevents flex from squishing sidebar */
    border-right: 1px solid #3d1147;
    font-family: 'Merriweather', serif;
    position: sticky;                       /* ADDED: sidebar stays in view while page scrolls */
    top: 0;
    height: 100vh;                          /* ADDED: full viewport height */
    overflow-y: auto;                       /* ADDED: sidebar scrolls independently */
    scrollbar-width: thin;                  /* ADDED: thin scrollbar in Firefox */
    scrollbar-color: #b080c8 #d4a8e8;      /* ADDED: themed scrollbar colors */
}
#play_titles_frame::-webkit-scrollbar {    /* ADDED: thin scrollbar in WebKit */
    width: 5px;
}
#play_titles_frame::-webkit-scrollbar-thumb {
    background: #b080c8;
    border-radius: 5px;
}
#play_titles {
    margin: 5%;
}
#play_titles li {
    text-shadow: 1px 1px 10px #707070;
    font-weight: bold;
    font-size: 1em;
    line-height: 1.6em;                     /* CHANGED: 1.25em → 1.6em, Merriweather needs more room */
    border-bottom: 1px solid rgba(0,0,0,0.08); /* ADDED: subtle row separator */
}

/* --- Play Navigation --- */

#play_menu_frame {
    display: none;
    flex-basis: 20%;
    flex-shrink: 0;                         /* ADDED */
    background: #eddff5;
    border-right: 1px solid #3d1147;
    position: sticky;                       /* ADDED */
    top: 0;
    height: 100vh;                          /* ADDED */
    overflow-y: auto;                       /* ADDED */
    scrollbar-width: thin;                  /* ADDED */
    scrollbar-color: #c9a0e0 #eddff5;      /* ADDED */
}
#play_menu_frame::-webkit-scrollbar {      /* ADDED */
    width: 5px;
}
#play_menu_frame::-webkit-scrollbar-thumb {
    background: #c9a0e0;
    border-radius: 5px;
}
#play_menu {
    margin: 1em 5%;
    font-size: 1em;
    font-family: 'Merriweather', serif;
}
#play_menu h2 {
    text-align: center;
    font-size: 1.25em;
    margin-bottom: 1em;
    font-weight: bold;
}
#play_menu ul li {                          /* act items */
    margin-left: 3em;
    text-shadow: 1px 1px 10px #707070;
    font-weight: bold;
    line-height: 1.6em;                     /* CHANGED: 1.25em → 1.6em */
}
#play_menu li ~ ul li {                    /* ADDED: scene items recede behind act items */
    font-size: 0.9em;
    font-weight: normal;                    /* acts bold, scenes normal = clear hierarchy */
    line-height: 1.6em;
}
#play_menu li ~ ul {
    margin-left: 2em;
}

/* --- Shared Sidebar Link Hover and Active States --- */
/* ADDED: entire block was missing - clickable items with no feedback look broken */

#play_titles a,
#play_menu a {
    display: block;                         /* makes entire row clickable */
    border-radius: 3px;
    padding: 0.3em 0.5em;
    transition: background 0.15s ease, padding-left 0.15s ease;
    color: inherit;
}
#play_titles a:hover,
#play_menu a:hover {
    text-decoration: none;                  /* overrides general a:hover underline */
    background: rgba(255,255,255,0.4);
    padding-left: 0.75em;                   /* slight indent on hover */
}
#play_titles a.active,
#play_menu a.active {                       /* set via JS - shows what is currently loaded */
    background: rgba(255,255,255,0.6);
    border-left: 3px solid #6b1f82;
    padding-left: 0.5em;
}

/* --- Play Text --- */

#play_text_frame {
    flex-basis: 60%;
    background: #faf9fb;                    /* ADDED: barely-there tint, not stark white */
    /* REMOVED: align-contents:top - invalid CSS property */
}
#play_text {
    margin: 2em auto;                       /* CHANGED: 1em 5% → 2em auto, centers within frame */
    padding: 0 2em;                         /* ADDED: internal breathing room */
    font-size: 1em;
    max-width: 75ch;                        /* ADDED: limits line length for readability */
}
#play_text p {
    margin-bottom: 1em;
}
#play_text h2 {
    text-align: center;
    font-size: 1.25em;
    margin-bottom: 1.25em;                  /* CHANGED: 1em → 1.25em */
    font-weight: bold;
    font-family: 'Merriweather', serif;
    color: #4a1060;                         /* ADDED: matches header, anchors headings to scheme */
    letter-spacing: 0.02em;                 /* ADDED */
}
#play_text ul {
    padding-left: 1em;                      /* ADDED: indents play text from frame edge */
}
#play_text ul li {
    margin-left: 1em;                       /* CHANGED: 2em → 1em, less aggressive with new padding */
    line-height: 1.5em;                     /* ADDED: play verse lines need breathing room */
    text-shadow: 1px 1px 8px #b0a0b8;      /* CHANGED: #707070 → warmer purple-toned shadow */
}

/* ADDED: replaces inline style="text-decoration:underline" removed from HTML */
#charts,
#hundred {
    text-decoration: underline;
}

/* --- Options Panel --- */

#options_frame {
    position: fixed;
    bottom: 1.5%;
    right: 1.5%;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.75em;            /* space between options box and topButton */
    align-items: stretch;   /* both children match the width of the widest one */
    z-index: 99;
}
#options {
    border: none;
    background: #eddff5;
    padding: 12px 15px;
    font-size: 0.75em;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(61,17,71,0.25);
    min-width: 180px;
    /* REMOVED: position:fixed; bottom:1.5%; right:1.5% */
}
#options h3 {
    font-size: 0.9em;                       /* CHANGED: 1em → 0.9em for uppercase treatment */
    margin-bottom: 0.75em;                  /* CHANGED: 0.5em → more space */
    padding-bottom: 0.5em;                  /* ADDED */
    border-bottom: 1px solid rgba(61,17,71,0.2); /* ADDED: section separator */
    letter-spacing: 0.05em;                 /* ADDED */
    text-transform: uppercase;              /* ADDED: small caps heading treatment */
}
#options ul li {
    margin-left: 0;                         /* CHANGED: 0.5em → 0 with new padding */
    padding: 0.25em 0;                      /* CHANGED: 0.15em → more spacing between options */
}
#options input[type="radio"] {
    accent-color: #6b1f82;                  /* ADDED: colors radio button to match scheme */
    margin-right: 0.4em;                    /* ADDED */
}

/* --- Buttons (shared) --- */

#options button,
#topButton {
    display: none;
    position: static;
    font-size: 0.75em;
    outline: none;
    /* REMOVED: position:fixed; bottom:1%; right:1%; z-index:99 */
}
#options button:hover,
#topButton:hover {
    background-color: #c9a8e0;             /* ADDED: hover state was missing entirely */
}
#options button {
    display: block;
    margin: 0.5em auto 0;                  /* CHANGED: margin-left:30% → auto centers it */
}

/* --- Back to Top Button --- */

#topButton {
    display: none;
    position: fixed;
    bottom: 1%;
    right: 1%;
    z-index: 99;
    font-size: 0.75em;
    outline: none;
    /* REMOVED: duplicate border - handled by shared rule above */
}
