/* Forum styles — Infinity at the Colony */

:root {
    --colony-blue: #1a3a5c;
    --colony-gold: #d4af37;
    --colony-light: #f5f2ee;
    --colony-text: #1a1a1a;
    --colony-muted: #6a6a6a;
    --colony-danger: #c0392b;
}

/* Base */
html { font-size: 18px; }
body { font-family: 'Montserrat', sans-serif; line-height: 1.65; color: var(--colony-text); background: #fdfbf8; }

/* Headings */
h1, h2, h3 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    letter-spacing: 0.5px;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }
h4, h5, h6 { font-size: 1.1rem; }

/* Large tap targets — btn-sm keeps Bootstrap's compact sizing */
.btn:not(.btn-sm), button:not(.btn-sm), a.btn:not(.btn-sm) {
    min-height: 48px;
    min-width: 120px;
    font-size: 1rem;
    padding: 0.6rem 1.4rem;
    border-radius: 6px;
}

/* Form controls */
.form-control, .form-select {
    font-size: 1rem;
    min-height: 48px;
    padding: 0.5rem 0.75rem;
    font-family: 'Montserrat', sans-serif;
    border: 1px solid #b8ad97;
    background-color: #fff;
    color: var(--colony-text);
}
.form-control:focus, .form-select:focus {
    border-color: var(--colony-gold);
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25);
    outline: none;
}
.form-control::placeholder { color: #8a8278; }

label { font-size: 1rem; font-weight: 600; display: block; margin-bottom: 0.35rem; }

/* Error messages */
.validation-message, .field-error {
    color: var(--colony-danger);
    font-size: 1rem;
    margin-top: 0.4rem;
}

/* Forum header */
.forum-header {
    background: linear-gradient(135deg, #0d2038 0%, var(--colony-blue) 100%);
    color: #fff;
    padding: 1.1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid rgba(212, 175, 55, 0.35);
}

.forum-brand {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #fff;
    text-decoration: none;
}
.forum-brand:hover { color: var(--colony-gold); text-decoration: none; }

.forum-header nav a { color: var(--colony-gold); text-decoration: none; font-weight: 500; font-size: 0.9rem; letter-spacing: 0.5px; }
.forum-header nav a:hover { color: #e8c94a; text-decoration: none; }
.forum-header nav a.btn-colony { color: #000; }
.forum-header nav a.btn-colony:hover { color: #fff; }
.forum-header .text-white { font-size: 0.9rem; }

.forum-container { max-width: 900px; margin: 0 auto; padding: 2rem 1rem; }

/* Forum footer */
.forum-footer {
    background: #0d2038;
    padding: 30px 20px;
    text-align: center;
}
.forum-footer p { margin: 6px 0; font-size: 0.9rem; color: #aaa; line-height: 1.6; }
.forum-footer .tagline { font-style: italic; color: var(--colony-gold); font-size: 0.95rem; letter-spacing: 1.5px; }

/* Category card */
.category-card {
    border: 1px solid #cfc8bd;
    border-left: 3px solid var(--colony-gold);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    background: var(--colony-light);
    text-decoration: none;
    color: var(--colony-text);
    display: block;
    transition: box-shadow 0.2s, transform 0.15s;
}
.category-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.14); transform: translateY(-1px); text-decoration: none; color: var(--colony-text); }
.category-card h3 { color: var(--colony-blue); margin-bottom: 0.25rem; }
.category-card .meta { color: #4a4a4a; font-size: 0.85rem; }

/* Topic list */
.topic-row {
    border: 1px solid #cfc8bd;
    border-left: 3px solid var(--colony-gold);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    background: #ede8e0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s, transform 0.15s;
}
.topic-row:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.10); transform: translateY(-1px); }
.topic-row .topic-title { font-size: 1.1rem; font-weight: 600; color: var(--colony-blue); }
.topic-row .topic-preview { font-size: 0.88rem; color: var(--colony-muted); }
.pinned-badge { background: var(--colony-gold); color: #fff; font-size: 0.72rem; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.locked-badge { background: #999; color: #fff; font-size: 0.72rem; padding: 2px 8px; border-radius: 4px; }

/* Post */
.post-card {
    border: 1px solid #d4cdc0;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: #ede8e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.post-card .post-author { font-weight: 700; color: var(--colony-blue); font-family: 'Cormorant Garamond', serif; font-size: 1.15rem; letter-spacing: 0.5px; }
.post-card .post-meta { font-size: 0.82rem; color: #4a4a4a; margin-bottom: 0.75rem; }
.post-card .post-body { white-space: pre-wrap; font-size: 1rem; line-height: 1.75; }

/* Buttons */
.btn-colony {
    background: var(--colony-gold);
    border-color: var(--colony-gold);
    color: #fff;
    font-weight: 600;
}
.btn-colony:hover { background: #b8962b; border-color: #b8962b; color: #fff; }

.btn-colony-outline {
    border: 2px solid var(--colony-gold);
    color: var(--colony-gold);
    background: transparent;
    font-weight: 600;
}
.btn-colony-outline:hover { background: var(--colony-gold); color: #fff; }

/* Reply / join box */
.reply-box {
    background: var(--colony-light);
    border-radius: 10px;
    padding: 1.5rem;
    border-left: 3px solid var(--colony-gold);
    margin-top: 1.5rem;
}

/* Pagination */
.pagination-bar { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1.5rem; }
.pagination-bar button { min-width: 48px; min-height: 48px; }

/* Alert */
.alert { font-size: 1rem; padding: 0.85rem 1.1rem; border-radius: 6px; }

/* Reply textarea */
textarea.form-control { min-height: 130px; }

/* Avatar */
.avatar-img {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.08);
}
.avatar-circle {
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    line-height: 1;
    border: 1px solid rgba(0,0,0,0.08);
}
.post-author-block {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.topic-author-line {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--colony-muted);
    margin-top: 0.25rem;
}

/* Profile page */
.profile-section {
    background: var(--colony-light);
    border: 1px solid #cfc8bd;
    border-left: 3px solid var(--colony-gold);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.profile-section h3 { margin-bottom: 1rem; color: var(--colony-blue); }
.avatar-preview-block {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

/* Post images gallery */
.post-images { display: flex; flex-wrap: wrap; gap: 8px; }
.post-image-thumb { max-height: 200px; max-width: 300px; object-fit: cover; border-radius: 4px; cursor: pointer; border: 1px solid #e8e4e0; }
.post-image-preview { position: relative; display: inline-block; }
.btn-remove-image {
    position: absolute; top: 2px; right: 2px;
    background: rgba(0,0,0,0.55); color: #fff;
    border: none; border-radius: 50%;
    width: 20px; height: 20px;
    font-size: 13px; line-height: 1; cursor: pointer; padding: 0;
}
.btn-remove-image:hover { background: rgba(0,0,0,0.8); }

/* ── Tablet breakpoint ── */
@media (max-width: 768px) {
    html { font-size: 16px; }

    .forum-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .forum-brand { font-size: 1.15rem; letter-spacing: 1px; }
    .forum-header nav { gap: 0.75rem; font-size: 0.85rem; }
    .forum-container { padding: 1.25rem 0.75rem; }

    /* Category page: let title + gold button wrap to a second line */
    .forum-container > .d-flex.justify-content-between { flex-wrap: wrap; gap: 0.75rem; }

    /* Post card: let action buttons wrap below author block */
    .post-card .d-flex.justify-content-between { flex-wrap: wrap; gap: 0.5rem; }

    .topic-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ── Phone breakpoint ── */
@media (max-width: 480px) {
    .forum-brand { font-size: 1rem; letter-spacing: 0.5px; }
    .forum-header nav { font-size: 0.8rem; gap: 0.5rem; }

    /* "Join the Forum" gold button in unauthenticated header stays compact */
    .forum-header nav .btn-colony {
        min-height: 0;
        min-width: 0;
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.45rem; }
    h3 { font-size: 1.2rem; }

    .category-card { padding: 1rem 1.15rem; }
    .post-card { padding: 1rem; }
    .reply-box { padding: 1rem 1.25rem; }
    .breadcrumb { font-size: 0.85rem; }
}
