
html {
    width: 100%;
}
body {
    background-color: #fffbeb;
    background-image: url("papyrus_tile.jpg");
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: serif;
    width: 100%;
}

#density {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

#navbar {
    display: flex;
/*    position: sticky;*/
    top: 0;
    background-color: rgba(255, 245, 233, 0.7);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.1);
    width: 100%;
    justify-content: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1;
    padding: 10px 0;
}

#search-input {
    box-sizing: border-box;
    background-color: rgb(245, 238, 220);
    width: 100%;
    max-width: 500px;
    padding: 15px 20px 15px 44px;
    border-radius: 15px;
    border: 1px solid rgba(0, 0, 0, 0.2 );
}

#search-input:focus-visible {
    outline: 1px solid rgba(0, 0, 0, 0.3);
}

#search {
    display: flex;
    position: relative;
    align-items: center;
}

#search-icon {
    position: absolute;
    left: 14px;
    margin: auto 0;
    opacity: 0.5;
}

#search-filters {
    display: flex;
    flex-direction: row;
    gap: 5px;
    align-items: center;
    margin-left: 10px;
}

.search-filter {
    cursor: pointer;
    font-family: sans-serif;
    background-color: #c7ffa2;
    border-radius: 15px;
    padding: 7px 12px 7px 9px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

#footer {
    display: flex;
    flex-wrap: wrap;
    font-size: 0.8em;
    justify-content: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    flex-direction: column;
    align-items: center;
    width: 100%;
}

a {
    text-decoration: none;
}

#footer a {
    display: flex;
    align-items: center;
}

#footer a img {
    margin-right: 5px;
}

#quotes-list {
    margin-top: 10px;
    width: 100%;
}

#content {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    max-width: 1200px;
    width: 100%;
    background-color: #f7eedb;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.quote {
    position: relative;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: row;
    background-color: #FFF4C6;
    border-radius: 5px;
    align-items: center;
    margin: 1px 0;
}

.interesting-TRUE {
    background-color: #ffe8c6;
}

.quote:hover {
    background-color: #ffeda3;
}

.quote-selected {
    align-items: start;
    background-color: #ffeea3;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.quote-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: center;
    padding: 5px 10px;
    box-sizing: border-box;
}

.quote-share {
    display: none;
    flex-direction: row;
    opacity: 0.8;
    gap: 5px;
    align-items: center;
}

.quote-share a {
    display: flex;
}

.quote-share img {
    cursor: pointer;
}

/* Slightly bigger icons and tap areas on touch screens */
@media (pointer: coarse) {
    .quote-share {
        gap: 0;
    }

    .quote-share img {
        width: 19px;
        height: 19px;
        padding: 6px;
    }
}

.quote-selected .quote-share {
    display: flex;
}

.quote-image-preview {
    height: 50px;
    width: 118px;
    object-fit: contain;
}

.quote-image-full {
    display: none;
    object-fit: contain;
}

.quote-selected .quote-image-preview {
    height: 200px;
    width: 470px;
}

.quote-selected .quote-image-full {
    position: absolute;
    top: 0;
    left: 0;
    height: 200px;
    width: 470px;
    display: block;
}

.quote-base {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.quote-expanded {
    display: flex;
    flex-direction: column;
    margin-top: 5px;
}

.quote-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    font-family: "Fira Sans Extra Condensed", sans-serif;
    font-style: normal;
    flex-grow: 1;
    gap: 10px;
    padding-right: 10px;
}

.quote-timecode {
    opacity: 0.3;
    font-family: monospace;
    font-size: 0.8em;
}

.quote-explication {
    margin-bottom: 5px;
}

.quote-explication-title {
    opacity: 0.5;
}

.quote-tag-title {
    opacity: 0.5;
    padding-right: 5px;
}

.quote-tags {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 5px;
}

.quote-tag {
    font-family: sans-serif;
    font-size: 12px;
    background-color: #c7ffa2;
    border-radius: 5px;
    padding: 2px 5px;
    margin-right: 5px;
    margin-bottom: 5px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.quote-expanded {
    display: none;
}

.quote-selected .quote-expanded {
    display: flex;
}


@media all and (orientation: portrait) {
    .quote-image-full {
        max-width: 100%;
    }

    .quote-image-preview {
        max-width: 100%;
    }

    .quote-selected .quote-content {
        width: 100%;
        padding: 10px 15px;
    }

    .quote-selected {
        align-items: center;
        flex-direction: column;
    }

    /* Size the preview to the frame's aspect ratio (no letterboxing),
       and center the full image exactly on top of it. */
    .quote-selected .quote-image-preview {
        height: auto;
        aspect-ratio: 1280 / 544;
    }

    .quote-selected .quote-image-full {
        height: auto;
        aspect-ratio: 1280 / 544;
        top: 0;
        right: 0;
        margin: 0 auto;
    }
}


/* Small links to /stats and /personnages in the footer */

.footer-links {
    margin-top: 5px;
}

#footer .footer-links a {
    display: inline;
}

/* /stats and /personnages */

.page {
    align-items: stretch !important;
}

.page-back {
    margin: 0 0 10px;
    text-align: center;
}

.page-title {
    font-family: "Fira Sans Extra Condensed", sans-serif;
    font-weight: normal;
    font-size: 2.2em;
    margin: 0 0 10px;
    text-align: center;
}

.stats-section {
    margin-top: 30px;
}

.stats-title {
    font-family: "Fira Sans Extra Condensed", sans-serif;
    font-weight: normal;
    font-size: 1.6em;
    margin: 0 0 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.stats-intro {
    margin: 5px 0 15px;
    opacity: 0.7;
}

.stats-facts {
    margin: 15px 0 0;
    padding-left: 20px;
    line-height: 1.6;
}

.stats-summary {
    margin: 0;
    text-align: center;
}

/* Horizontal bars */

.bars {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bar-row {
    display: grid;
    grid-template-columns: minmax(130px, 30%) 1fr 3em;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.bar-row:hover {
    background-color: rgba(255, 237, 163, 0.6);
}

.bar-label {
    font-family: "Fira Sans Extra Condensed", sans-serif;
    font-size: 1.1em;
}

.bar-label a {
    color: inherit;
}

.bar-label a:hover {
    text-decoration: underline;
}

.bar-note {
    font-family: serif;
    font-size: 0.8em;
    opacity: 0.6;
}

.bar-aside {
    display: inline-block;
    font-size: 0.75em;
    width: 1.3em;
    height: 1.3em;
    line-height: 1.3em;
    text-align: center;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
    opacity: 0.6;
}

.bar-track {
    height: 14px;
}

.bar {
    height: 100%;
    min-width: 2px;
    background-color: #c8962e;
    border-radius: 0 4px 4px 0;
}

.bar-value {
    font-family: monospace;
    text-align: right;
}

/* Most viewed jokes */

.top-quotes {
    display: flex;
    flex-direction: column;
}

.top-quote {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    margin: 1px 0;
    color: inherit;
    background-color: #FFF4C6;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    font-family: "Fira Sans Extra Condensed", sans-serif;
}

.top-quote:hover {
    background-color: #ffeda3;
}

.top-rank {
    width: 1.5em;
    text-align: right;
    opacity: 0.5;
}

.top-title {
    flex-grow: 1;
}

.top-shares {
    font-size: 0.85em;
    opacity: 0.6;
    white-space: nowrap;
}

.top-count {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 90px;
    flex-shrink: 0;
    font-family: monospace;
}

.top-bar {
    height: 10px;
    margin-right: 8px;
    background-color: #c8962e;
    border-radius: 0 4px 4px 0;
    max-width: 55px;
}

/* Jokes along the film */

.timeline {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 170px;
    padding-top: 20px;
    background-color: black;
    border-radius: 5px;
    padding: 20px 8px 0;
}

.timeline-col {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
}

.timeline-bar {
    background-color: rgb(255, 204, 0);
    border-radius: 4px 4px 0 0;
    min-height: 1px;
}

.timeline-col:hover .timeline-bar {
    background-color: #fff3b0;
}

.timeline-value {
    color: rgb(255, 204, 0);
    font-family: monospace;
    font-size: 0.8em;
    text-align: center;
}

.timeline-label {
    position: absolute;
    bottom: -22px;
    left: 0;
    color: rgba(0, 0, 0, 0.6);
    font-family: monospace;
    font-size: 0.8em;
    white-space: nowrap;
}

.timeline + .stats-facts {
    margin-top: 30px;
}

/* /personnages */

.persos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.perso {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background-color: #FFF4C6;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    padding: 10px 15px 10px 10px;
    scroll-margin-top: 20px;
}

.perso-body {
    flex: 1;
    min-width: 0;
}

.perso-photo {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    margin-top: 4px;
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    object-fit: cover;
    background-color: #f0e2b8;
}

.perso-photo-empty {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Fira Sans Extra Condensed", sans-serif;
    font-size: 2.2em;
    color: rgba(0, 0, 0, 0.25);
}

.perso:target {
    background-color: #ffeea3;
    border-color: rgba(0, 0, 0, 0.3);
}

.perso-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 10px;
}

.perso-name {
    font-family: "Fira Sans Extra Condensed", sans-serif;
    font-size: 1.5em;
}

.perso-actor {
    opacity: 0.6;
    font-size: 0.9em;
}

.perso-role {
    opacity: 0.7;
    font-size: 0.9em;
}

.perso-pun {
    font-family: "Fira Sans Extra Condensed", sans-serif;
    font-size: 1.2em;
    margin-top: 6px;
}

.perso-pun::before {
    content: "= ";
    opacity: 0.4;
}

.perso-text {
    margin-top: 4px;
}

.perso-links {
    margin-top: 6px;
    font-size: 0.9em;
}

.perso-badge {
    font-family: sans-serif;
    font-size: 11px;
    vertical-align: middle;
    background-color: #ffe0a8;
    border-radius: 5px;
    padding: 2px 5px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.perso-badge-unsure {
    background-color: #ffc9b8;
}

@media (max-width: 700px) {
    .persos {
        grid-template-columns: 1fr;
    }

    .perso-photo {
        width: 64px;
        height: 64px;
    }

    .bar-row {
        grid-template-columns: 40% 1fr 2.5em;
        gap: 6px;
    }

    .top-quote {
        flex-wrap: wrap;
        gap: 2px 8px;
    }

    .top-title {
        flex-basis: calc(100% - 3em);
        order: 1;
    }

    .top-rank {
        order: 0;
    }

    .top-quote .quote-timecode {
        order: 2;
        margin-left: 2em;
    }

    .top-shares {
        order: 3;
    }

    .top-count {
        order: 4;
        margin-left: auto;
    }

    .timeline {
        height: 130px;
        padding: 20px 4px 0;
        gap: 1px;
    }
}
