/*
 * Site styles on top of Bootstrap 5.3. Plain CSS, no build step: override
 * Bootstrap's CSS variables here rather than recompiling its SCSS.
 * Check every change in both dark (the default) and light mode.
 */
:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
    --bs-primary: #eeb118;
    --bs-primary-rgb: 238, 177, 24;
}

/* Dark mode uses Grouvee's palette: charcoal ground, a lighter nav, slate
   panels and a bright blue link. Light mode keeps Bootstrap's defaults,
   whose blue a light blue would wash out on white. */
[data-bs-theme="dark"] {
    --bs-body-bg: #2d2d2d;
    --bs-body-bg-rgb: 45, 45, 45;
    --bs-body-color: #fff;
    --bs-body-color-rgb: 255, 255, 255;
    --bs-emphasis-color: #fff;
    --bs-secondary-color: #adb5bd;
    --bs-secondary-color-rgb: 173, 181, 189;
    --bs-tertiary-bg: #393939;
    --bs-border-color: #495057;
    --bs-link-color: #3ca4ff;
    --bs-link-color-rgb: 60, 164, 255;
    --bs-link-hover-color: #6fbcff;
    --bs-link-hover-color-rgb: 111, 188, 255;
    --site-panel-bg: #343a40;
    --site-nav-bg: #393939;
}

[data-bs-theme="light"] {
    --site-panel-bg: #fff;
    --site-nav-bg: #f8f9fa;
}

/* Grouvee's headings are bold, and its links underline only on hover. */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 700;
}

a {
    text-decoration: none;
}

a:hover:not(.btn, .badge, .nav-link, .navbar-brand, .page-link) {
    text-decoration: underline;
}

/* Grouvee's container is a little wider than Bootstrap's at desktop sizes. */
@media (min-width: 1200px) {
    .container {
        max-width: 1240px;
    }
}

.site-nav {
    background-color: var(--site-nav-bg);
}

.btn-primary {
    --bs-btn-bg: #eeb118;
    --bs-btn-border-color: #eeb118;
    --bs-btn-color: #1b1b1b;
    --bs-btn-hover-bg: #d99f10;
    --bs-btn-hover-border-color: #d99f10;
    --bs-btn-hover-color: #1b1b1b;
    --bs-btn-active-bg: #c48f0e;
    --bs-btn-active-border-color: #c48f0e;
    --bs-btn-active-color: #1b1b1b;
}

/* Sign up, sign in and the other account entrance pages: one centered
   card (allauth/layouts/entrance.html). */
.entrance {
    max-width: 28rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
    padding: 2rem;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: 0.75rem;
    background-color: var(--site-panel-bg);
}

@media (max-width: 575.98px) {
    .entrance {
        margin-top: 0;
        padding: 1.5rem 1.25rem;
        border-radius: 0;
        border-inline: 0;
    }
}

/* Django's password rules come as a list; keep them small and tidy. */
.entrance-help ul {
    margin: 0.25rem 0 0;
    padding-left: 1.1rem;
}

/* Search box in the nav. */
.nav-search {
    max-width: 22rem;
}

/* Game lists (Grouvee's game_list_v2): slate rows, 80x120 covers. */
.game-list .list-group-item {
    --bs-list-group-bg: var(--site-panel-bg);
    padding: 0.75rem 1.25rem;
}

.game-row-cover {
    width: 80px;
    height: 120px;
    object-fit: cover;
    object-position: top;
}

.game-row-cover-missing {
    font-size: 10px;
    overflow: hidden;
}

.platform-badge {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

/* Game page (Grouvee's game_details_redo): a banner with the cover
   overlapping it in a left rail. */
.game-hero {
    position: relative;
    width: 100%;
    height: 300px;
    background-size: cover;
    background-position: center 25%;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

.game-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.15) 50%, rgba(0, 0, 0, 0) 100%);
}

.game-rail-cover {
    position: relative;
    z-index: 1;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.game-rail-cover-missing {
    height: 260px;
    background-color: var(--site-panel-bg);
}

/* Below lg the rail stacks above the title, so a full-width cover would
   fill a phone screen. */
@media (max-width: 991.98px) {
    .game-rail-cover {
        max-width: 240px;
        margin-inline: auto;
        display: block;
    }
}

@media (min-width: 992px) {
    .game-rail-overlap {
        margin-top: -100px;
    }
}

.card {
    --bs-card-bg: var(--site-panel-bg);
}

/* Star ratings on display: five stars filled to --stars-fill. */
.stars {
    position: relative;
    display: inline-block;
    font-size: 1.1rem;
    line-height: 1;
    letter-spacing: 0.1em;
    white-space: nowrap;
    vertical-align: -0.1em;
    color: var(--bs-secondary-color);
}

.stars::before {
    content: "\2605\2605\2605\2605\2605";
    opacity: 0.45;
}

.stars::after {
    content: "\2605\2605\2605\2605\2605";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--stars-fill);
    overflow: hidden;
    color: #eeb118;
}

.stars-lg {
    font-size: 1.4rem;
}

/* The game page rail's Log and Want to Play buttons, in the spot and
   shape of Grouvee's shelf buttons: icon over a small label. */
.game-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.game-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.4rem 0.25rem;
    font-size: 0.8rem;
    line-height: 1.2;
}

.game-action svg {
    width: 1.35rem;
    height: 1.35rem;
}

.game-loved {
    color: #ff8a5c;
}

.d-contents {
    display: contents;
}

/* The log sheet (mockup: docs/mockups/log-sheet). A centered dialog on
   desktop, a bottom sheet on phones. */
.sheet {
    width: min(100% - 2rem, 26rem);
    max-height: calc(100dvh - 2rem);
    padding: 1.25rem;
    border: 0;
    border-radius: 0.75rem;
    background-color: var(--site-panel-bg);
    color: var(--bs-body-color);
    overflow-y: auto;
}

.sheet::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

@media (max-width: 575.98px) {
    dialog.sheet {
        width: 100%;
        max-width: 100%;
        max-height: 92dvh;
        margin: auto 0 0;
        border-radius: 1rem 1rem 0 0;
    }
}

.sheet-page {
    max-width: 26rem;
    border: var(--bs-border-width) solid var(--bs-border-color);
}

.sheet-cover {
    width: 44px;
    height: 60px;
    object-fit: cover;
}

.sheet-eyebrow {
    letter-spacing: 0.06em;
}

.sheet-link {
    font-size: 0.9rem;
    text-decoration: none;
}

.sheet-unknown {
    min-height: 2.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px dashed var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    font-size: 0.9rem;
    color: var(--bs-secondary-color);
}

.sheet-platform {
    width: auto;
    max-width: 60%;
}

/* Rating stars on the sheet: 44px tap targets, filled by the rating
   controller in halves. */
.rating-star {
    position: relative;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
}

.rating-star svg {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 34px;
    height: 34px;
}

.rating-star-outline {
    fill: none;
    stroke: var(--bs-secondary-color);
    stroke-width: 1.5;
    stroke-linejoin: round;
}

.rating-star-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 44px;
    width: 0;
    overflow: hidden;
}

.rating-star-fill svg {
    fill: #eeb118;
    stroke: #eeb118;
    stroke-width: 1.5;
    stroke-linejoin: round;
}

.loved-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 44px;
    padding: 0 0.25rem 0 0.5rem;
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
    cursor: pointer;
}

.loved-toggle svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linejoin: round;
}

.btn-check:checked + .loved-toggle {
    color: #ff8a5c;
}

.btn-check:checked + .loved-toggle svg {
    fill: currentColor;
}

/* The same heart as a button, on the game page rail. */
.loved-button {
    border: 0;
    background: transparent;
    padding: 0 0.5rem;
}

.loved-button:hover {
    color: #ff8a5c;
}

.loved-button.is-loved {
    color: #ff8a5c;
}

.loved-button.is-loved svg {
    fill: currentColor;
}

.btn-check:focus-visible + .loved-toggle {
    outline: 2px solid var(--bs-primary);
    border-radius: var(--bs-border-radius);
}

/* Completed / Abandoned / Paused chips. */
.chip {
    flex: 1 1 0;
    height: 40px;
    border: 1px solid var(--bs-border-color);
    border-radius: 20px;
    background: transparent;
    color: var(--bs-body-color);
    font-size: 0.9rem;
}

.chip[aria-pressed="true"] {
    border-color: #eeb118;
    background: #eeb118;
    color: #1b1b1b;
    font-weight: 600;
}

.sheet-secondary {
    --bs-btn-color: var(--bs-body-color);
    --bs-btn-border-color: var(--bs-border-color);
}

.sheet-done {
    color: #eeb118;
    font-weight: 700;
}

.sheet-review {
    padding: 0.75rem 0.9rem;
    border-radius: 0.5rem;
    background-color: var(--bs-body-bg);
}

.sheet-note {
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

/* Member pages (profiles app): header, cover grids, the diary table. */
.profile-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: #eeb118;
    color: #1b1b1b;
    font-size: 1.5rem;
    font-weight: 700;
}

.profile-avatar-sm {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.85rem;
}

.profile-stats a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.profile-stats strong {
    font-size: 1.25rem;
    line-height: 1.2;
}

.profile-stats span {
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}

.profile-tabs {
    border-bottom: var(--bs-border-width) solid var(--bs-border-color);
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.profile-tabs .nav-link {
    color: var(--bs-secondary-color);
}

.profile-tabs .nav-link.active {
    color: var(--bs-body-color);
}

/* Covers: a wrapping grid on the tab pages, one row of eight on the
   profile. */
.poster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
    gap: 1rem 0.75rem;
}

.poster-row {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.75rem;
}

@media (max-width: 767.98px) {
    .poster-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

.poster-link {
    display: block;
    aspect-ratio: 3 / 4;
    border-radius: var(--bs-border-radius);
    overflow: hidden;
    background-color: var(--site-panel-bg);
    box-shadow: inset 0 0 0 1px var(--bs-border-color-translucent);
}

.poster-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.poster-link:hover {
    outline: 2px solid #eeb118;
    outline-offset: 1px;
}

.poster-missing {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0.5rem;
    font-size: 0.75rem;
    text-align: center;
    color: var(--bs-secondary-color);
}

.poster-meta {
    margin-top: 0.3rem;
    font-size: 0.8rem;
    line-height: 1.3;
}

.poster-caption {
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
}

.stars-sm {
    font-size: 0.8rem;
}

/* The diary, Letterboxd-style: compact rows under month headings. */
.diary-heading {
    margin: 0 0 0.25rem;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}

/* Fixed column widths, so every month's table lines up with the others. */
.diary-table {
    --bs-table-bg: transparent;
    table-layout: fixed;
}

.diary-table td {
    padding: 0.4rem 0.5rem;
}

.diary-day {
    width: 2.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    color: var(--bs-secondary-color);
}

.diary-cover {
    width: 2.75rem;
}

.diary-cover img,
.diary-cover-missing {
    display: block;
    width: 2.25rem;
    height: 3rem;
    object-fit: cover;
    border-radius: 3px;
    background-color: var(--site-panel-bg);
}

.diary-rating {
    width: 7.5rem;
    white-space: nowrap;
}

.diary-outcome {
    width: 6.5rem;
}

.diary-platform {
    width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.diary-marks {
    width: 3rem;
    white-space: nowrap;
}

.diary-title {
    overflow: hidden;
    text-overflow: ellipsis;
}

.diary-edit {
    width: 3rem;
    text-align: right;
}

/* A member's page for one game. */
.member-log {
    padding: 0.75rem 0;
    border-top: var(--bs-border-width) solid var(--bs-border-color);
}

.member-log:target {
    background-color: rgba(238, 177, 24, 0.08);
}

.member-review {
    max-width: 48rem;
    white-space: normal;
}

/* The feed (social app). */
.feed-entry {
    padding: 1rem 0;
    border-bottom: var(--bs-border-width) solid var(--bs-border-color);
}

.feed-cover {
    width: 4.5rem;
    height: 6rem;
    object-fit: cover;
    background-color: var(--site-panel-bg);
}

.feed-review {
    max-width: 40rem;
}

.feed-burst {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(3rem, 1fr));
    gap: 0.4rem;
    max-width: 40rem;
}

.feed-burst a {
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 3px;
    background-color: var(--site-panel-bg);
}

.feed-burst img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feed-burst span {
    display: block;
    padding: 0.2rem;
    font-size: 0.55rem;
    color: var(--bs-secondary-color);
}

.feed-empty {
    padding: 1.5rem;
    border: 1px dashed var(--bs-border-color);
    border-radius: 0.5rem;
}

.people-list li + li {
    border-top: var(--bs-border-width) solid var(--bs-border-color);
}

/* Edit and Remove beside a collection copy: a link and a form button,
   styled the same so they line up. */
.copy-actions .btn-link {
    font-size: 0.875rem;
    line-height: 1.5;
    text-decoration: none;
    vertical-align: baseline;
}

/* The settings page: one readable column. */
.settings {
    max-width: 36rem;
}

.settings .form-check-input {
    cursor: pointer;
}

/* Log, Want to Play and Collection on game list rows: a column on the
   right on wide screens (Grouvee's spot), under the game's text on tablets
   and phones. 18rem keeps "Want to Play" on one line (it wraps below
   17rem). */
.game-row-actions {
    width: 100%;
    max-width: 18rem;
    margin-top: 0.5rem;
}

.game-actions-row {
    grid-template-columns: repeat(3, 1fr);
}

@media (min-width: 992px) {
    .game-row-actions {
        width: 18rem;
        margin-top: 0;
        margin-left: 1rem;
        flex-shrink: 0;
    }
}
