/* ReadLog theme — ported from the original MUI palette.
   primary #5D4E37 (espresso), secondary #8B6914 (ochre),
   page bg #FAFAF5, surfaces #FFFFFF. */

:root {
    --rl-primary: #5d4e37;
    --rl-primary-dark: #3e2723;
    --rl-secondary: #8b6914;
    --rl-bg: #fafaf5;
    --rl-surface: #ffffff;
    --rl-text: #2e2a23;

    /* Re-point Bootstrap's primary onto the ReadLog espresso brown.
       (Link colours are themed by the explicit `a {}` rules below so anchors read as the
       ReadLog espresso brown rather than Bootstrap's default link blue.) */
    --bs-primary: var(--rl-primary);
    --bs-primary-rgb: 93, 78, 55;
}

html {
    position: relative;
    min-height: 100%;
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin: 0;
    margin-bottom: 60px;
    background-color: var(--rl-bg);
    color: var(--rl-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.rl-navbar {
    background-color: var(--rl-surface);
    border-bottom: 1px solid rgba(93, 78, 55, 0.15);
    box-shadow: 0 1px 3px rgba(62, 39, 35, 0.06);
}

.rl-brand {
    font-weight: 700;
    color: var(--rl-primary) !important;
}

.rl-navbar .nav-link {
    color: var(--rl-primary);
    font-weight: 500;
}

.rl-navbar .nav-link:hover,
.rl-navbar .nav-link.active {
    color: var(--rl-primary-dark);
}

.rl-main {
    min-height: 70vh;
}

/* Buttons / accents map onto the brand browns. */
.btn-primary {
    --bs-btn-bg: var(--rl-primary);
    --bs-btn-border-color: var(--rl-primary);
    --bs-btn-hover-bg: var(--rl-primary-dark);
    --bs-btn-hover-border-color: var(--rl-primary-dark);
    --bs-btn-active-bg: var(--rl-primary-dark);
    --bs-btn-active-border-color: var(--rl-primary-dark);
    --bs-btn-disabled-bg: var(--rl-primary);
    --bs-btn-disabled-border-color: var(--rl-primary);
}

.btn-outline-primary {
    --bs-btn-color: var(--rl-primary);
    --bs-btn-border-color: var(--rl-primary);
    --bs-btn-hover-bg: var(--rl-primary);
    --bs-btn-hover-border-color: var(--rl-primary);
    --bs-btn-active-bg: var(--rl-primary-dark);
    --bs-btn-active-border-color: var(--rl-primary-dark);
}

a {
    color: var(--rl-primary);
}

a:hover {
    color: var(--rl-primary-dark);
}

.rl-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 60px;
    background-color: var(--rl-surface);
    border-top: 1px solid rgba(93, 78, 55, 0.15);
}

/* --- Layout widths ----------------------------------------------------- */
.rl-narrow {
    max-width: 560px;
    margin: 0 auto;
}

.rl-medium {
    max-width: 820px;
    margin: 0 auto;
}

.rl-page-title {
    color: var(--rl-primary);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.min-w-0 {
    min-width: 0;
}

/* --- Book covers ------------------------------------------------------- */
.rl-cover {
    object-fit: cover;
    border-radius: 6px;
    background-color: #efece3;
    flex-shrink: 0;
}

.rl-cover-sm { width: 40px; height: 60px; }
.rl-cover-md { width: 80px; height: 120px; }
.rl-cover-lg { width: 120px; height: 180px; box-shadow: 0 1px 4px rgba(62, 39, 35, 0.2); }

.rl-cover-grid {
    width: 100%;
    aspect-ratio: 2 / 3;
    box-shadow: 0 1px 4px rgba(62, 39, 35, 0.15);
}

.rl-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--rl-secondary);
}

/* --- Cards / feed ------------------------------------------------------ */
.rl-feed-card {
    transition: box-shadow 0.15s ease;
}

.rl-feed-card:hover {
    box-shadow: 0 2px 10px rgba(62, 39, 35, 0.12);
}

.rl-grid-item {
    display: block;
    text-align: center;
}

.rl-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Format badge ------------------------------------------------------ */
.rl-format-badge {
    color: var(--rl-primary);
    background-color: transparent;
    border: 1px solid rgba(93, 78, 55, 0.4);
    font-weight: 500;
}

/* --- Star ratings ------------------------------------------------------ */
.rl-stars {
    color: var(--rl-secondary);
    letter-spacing: 1px;
    font-size: 0.95rem;
    white-space: nowrap;
}

.rl-star {
    color: rgba(93, 78, 55, 0.3);
}

.rl-star-filled {
    color: var(--rl-secondary);
}

/* --- Account avatar ---------------------------------------------------- */
.rl-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--rl-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* --- Book detail description ------------------------------------------- */
.rl-description {
    line-height: 1.7;
}

/* --- Misc -------------------------------------------------------------- */
.rl-grid-author {
    font-size: 0.75rem;
}

.rl-avatar-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* A <legend> styled to read like a normal form label (it defaults larger). */
legend.form-label {
    font-size: 1rem;
    width: auto;
}
