/* ==========================================================================
   Rexalist Blog Post
   Front end styles for the writing form, the blog grid, the photo gallery,
   the video player and the Report Fake Post button.

   Everything is namespaced under rex-blog-* and the structural bits use
   !important, because most themes apply wide rules to buttons, forms, figures
   and inputs that would otherwise flatten this layout.
   ========================================================================== */

/* Form primitives -------------------------------------------------------- */

.rex-blog-btn,
button.rex-blog-btn,
input[type="submit"].rex-blog-btn,
a.rex-blog-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    box-sizing: border-box;
    width: auto;
    max-width: 100%;
    margin: 8px 8px 0 0;
    padding: 11px 20px;
    background: #2b6cb0 !important;
    background-image: none !important;
    color: #ffffff !important;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    text-decoration: none !important;
    border: 1px solid #2b6cb0 !important;
    border-radius: 6px;
    box-shadow: none;
    cursor: pointer;
    vertical-align: middle;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.rex-blog-btn:hover,
.rex-blog-btn:focus,
a.rex-blog-btn:hover {
    background: #22548a !important;
    border-color: #22548a !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

.rex-blog-btn--primary {
    background: #2b6cb0 !important;
    border-color: #2b6cb0 !important;
}

.rex-blog-btn--danger {
    background: #c53030 !important;
    border-color: #c53030 !important;
}

.rex-blog-btn--danger:hover,
.rex-blog-btn--danger:focus {
    background: #9b2c2c !important;
    border-color: #9b2c2c !important;
}

.rex-blog-post-button {
    margin: 0;
}

/* Alerts ----------------------------------------------------------------- */

.rex-blog-alert {
    margin: 0 0 18px;
    padding: 12px 16px;
    background: #edf2f7;
    color: #2d3748;
    font-size: 15px;
    line-height: 1.5;
    border-left: 4px solid #2b6cb0;
    border-radius: 4px;
}

.rex-blog-alert--success {
    background: #f0fff4;
    border-left-color: #38a169;
}

.rex-blog-alert--error {
    background: #fff5f5;
    border-left-color: #c53030;
}

/* The form --------------------------------------------------------------- */

.rex-blog-form,
.rex-blog-card,
.rex-blog-mine {
    box-sizing: border-box;
    margin: 0 0 32px;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.rex-blog-title {
    margin: 0 0 8px;
    padding: 0;
    color: #1a202c;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
}

.rex-blog-intro {
    margin: 0 0 20px;
    color: #4a5568;
    font-size: 15px;
}

.rex-blog-field {
    display: block;
    margin: 0 0 20px;
}

.rex-blog-field > label,
.rex-blog-report__reasons legend {
    display: block;
    margin: 0 0 6px;
    padding: 0;
    color: #2d3748;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.rex-blog-field input[type="text"],
.rex-blog-field input[type="url"],
.rex-blog-field select,
.rex-blog-field textarea,
.rex-blog-report__note-field textarea {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 10px 12px;
    background: #ffffff;
    color: #1a202c;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    box-shadow: none;
}

.rex-blog-field input[type="file"] {
    display: block;
    width: 100%;
    margin: 0;
    padding: 10px;
    background: #f7fafc;
    font-size: 14px;
    border: 1px dashed #cbd5e0;
    border-radius: 6px;
}

.rex-blog-field textarea {
    min-height: 180px;
    resize: vertical;
}

.rex-blog-field input:focus,
.rex-blog-field select:focus,
.rex-blog-field textarea:focus {
    outline: none;
    border-color: #2b6cb0;
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}

.rex-blog-req {
    color: #c53030;
}

.rex-blog-hint {
    display: block;
    margin: 6px 0 0;
    color: #718096;
    font-size: 13px;
    line-height: 1.45;
}

.rex-blog-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 24px 0 0;
    padding: 0;
}

/* Honeypot: visible to bots, invisible to people. */
.rex-blog-hp {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.rex-blog-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -10px 0 20px;
    padding: 0;
    list-style: none;
}

.rex-blog-strip li {
    margin: 0;
}

.rex-blog-strip img {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

.rex-blog-current-video video {
    display: block;
    width: 100%;
    max-width: 640px;
    margin: 0 0 20px;
    border-radius: 6px;
}

/* The member's own posts ------------------------------------------------- */

.rex-blog-mine__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rex-blog-mine__item {
    margin: 0;
    padding: 14px 0;
    border-top: 1px solid #edf2f7;
}

.rex-blog-mine__item:first-child {
    border-top: 0;
}

.rex-blog-mine__main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}

.rex-blog-mine__main a {
    color: #2b6cb0;
}

.rex-blog-mine__date {
    color: #718096;
    font-size: 13px;
}

.rex-blog-mine__actions {
    margin: 6px 0 0;
    font-size: 14px;
}

.rex-blog-mine__actions a {
    margin-right: 14px;
    color: #2b6cb0;
}

.rex-blog-mine__delete {
    color: #c53030 !important;
}

.rex-blog-mine__note {
    margin: 8px 0 0;
    padding: 8px 12px;
    background: #fffaf0;
    border-left: 3px solid #dd6b20;
    font-size: 14px;
}

.rex-blog-badge {
    display: inline-block;
    margin: 0;
    padding: 2px 9px;
    background: #edf2f7;
    color: #4a5568;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-radius: 10px;
}

.rex-blog-badge--publish {
    background: #c6f6d5;
    color: #22543d;
}

.rex-blog-badge--rex_blog_pending {
    background: #feebc8;
    color: #7b341e;
}

.rex-blog-badge--rex_blog_rejected,
.rex-blog-badge--rex_blog_flagged {
    background: #fed7d7;
    color: #742a2a;
}

/* The blog grid ---------------------------------------------------------- */

.rex-blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin: 0 0 32px;
}

.rex-blog-card {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.rex-blog-card__thumb {
    display: block;
    margin: 0;
    background: #edf2f7;
    text-decoration: none !important;
}

.rex-blog-card__thumb img {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.rex-blog-card__placeholder {
    display: block;
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
}

.rex-blog-card__body {
    padding: 16px 18px 20px;
}

.rex-blog-card__topic {
    display: inline-block;
    margin: 0 0 8px;
    color: #2b6cb0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rex-blog-card__title {
    margin: 0 0 8px;
    padding: 0;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
}

.rex-blog-card__title a {
    color: #1a202c;
    text-decoration: none;
}

.rex-blog-card__title a:hover {
    color: #2b6cb0;
}

.rex-blog-card__meta {
    margin: 0 0 10px;
    color: #718096;
    font-size: 13px;
}

.rex-blog-card__author::before {
    content: " \00b7 ";
}

.rex-blog-card__excerpt {
    margin: 0;
    color: #4a5568;
    font-size: 15px;
    line-height: 1.6;
}

.rex-blog-pagination {
    margin: 0 0 32px;
    text-align: center;
}

.rex-blog-pagination .page-numbers {
    display: inline-block;
    min-width: 38px;
    margin: 0 3px;
    padding: 8px 12px;
    background: #ffffff;
    color: #2b6cb0;
    font-size: 15px;
    text-decoration: none !important;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

.rex-blog-pagination .page-numbers.current,
.rex-blog-pagination .page-numbers:hover {
    background: #2b6cb0;
    color: #ffffff;
    border-color: #2b6cb0;
}

/* Photo gallery ---------------------------------------------------------- */

.rex-blog-gallery {
    position: relative;
    margin: 24px 0;
    overflow: hidden;
    background: #1a202c;
    border-radius: 8px;
}

.rex-blog-gallery__track {
    display: flex;
    align-items: center;
    overflow: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.rex-blog-gallery__item {
    flex: 0 0 100%;
    position: relative;
    margin: 0;
    scroll-snap-align: center;
}

.rex-blog-gallery__item a {
    display: block;
    line-height: 0;
}

.rex-blog-gallery__item img {
    display: block;
    width: 100%;
    max-width: none;
    max-height: 520px;
    margin: 0 auto;
    object-fit: contain;
}

.rex-blog-gallery__count {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 3px 10px;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    font-size: 13px;
    line-height: 1.6;
    border-radius: 12px;
}

.rex-blog-gallery__nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.55);
    background-image: none !important;
    color: #ffffff !important;
    font-size: 28px;
    line-height: 1;
    border: 0 !important;
    border-radius: 50%;
    cursor: pointer;
    transform: translateY(-50%);
}

.rex-blog-gallery__nav--prev {
    left: 12px;
}

.rex-blog-gallery__nav--next {
    right: 12px;
}

.rex-blog-gallery__nav:hover {
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff !important;
}

/* Video and source link -------------------------------------------------- */

.rex-blog-video {
    margin: 24px 0;
}

.rex-blog-video video {
    display: block;
    width: 100%;
    max-width: 760px;
    height: auto;
    margin: 0;
    background: #000000;
    border-radius: 8px;
}

.rex-blog-source {
    margin: 16px 0;
    font-size: 14px;
    word-break: break-word;
}

/* Report Fake Post ------------------------------------------------------- */

.rex-blog-report {
    margin: 32px 0 0;
    padding: 20px 0 0;
    border-top: 1px solid #e2e8f0;
}

.rex-blog-report__toggle {
    margin: 0;
}

.rex-blog-report__toggle > summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 9px 18px;
    background: #fff5f5;
    color: #c53030;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    list-style: none;
    border: 1px solid #feb2b2;
    border-radius: 6px;
    cursor: pointer;
}

.rex-blog-report__toggle > summary::-webkit-details-marker {
    display: none;
}

.rex-blog-report__toggle > summary:hover {
    background: #fed7d7;
}

.rex-blog-report__toggle[open] > summary {
    background: #c53030;
    color: #ffffff;
    border-color: #c53030;
}

.rex-blog-report__body {
    margin: 18px 0 0;
    padding: 18px;
    background: #fffaf5;
    border: 1px solid #fed7aa;
    border-radius: 8px;
}

.rex-blog-report__lead {
    margin: 0 0 16px;
    color: #742a2a;
    font-size: 15px;
}

.rex-blog-report__reasons {
    margin: 0 0 16px;
    padding: 0;
    border: 0;
}

.rex-blog-report__reasons legend {
    margin: 0 0 8px;
}

.rex-blog-report__reason {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    cursor: pointer;
}

.rex-blog-report__reason input[type="radio"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: #c53030;
}

.rex-blog-report__note-field label {
    display: block;
    margin: 0 0 6px;
    color: #742a2a;
    font-size: 15px;
    font-weight: 600;
}

.rex-blog-report__actions {
    margin: 16px 0 0;
}

/* Menu ------------------------------------------------------------------- */

.rex-blog-current > a {
    font-weight: 700;
}

/* Small screens ---------------------------------------------------------- */

@media (max-width: 600px) {
    .rex-blog-form,
    .rex-blog-card,
    .rex-blog-mine {
        padding: 18px;
    }

    .rex-blog-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .rex-blog-gallery__nav {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    .rex-blog-actions .rex-blog-btn {
        width: 100%;
        margin-right: 0;
    }
}

/* Admin moderation console (front end) ------------------------------------ */

.rex-blog-admin {
    background: #fafafa;
    border: 1px solid #e2e2e2;
    border-radius: 6px;
    padding: 20px 22px;
    margin: 0 0 24px;
}

.rex-blog-admin__title {
    margin: 0 0 10px;
    font-size: 15px;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.rex-blog-admin__links {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
}

.rex-blog-admin__links a {
    font-weight: 700;
}

.rex-blog-admin__count {
    display: inline-block;
    min-width: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: #c93b3b;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
}

.rex-blog-admin__queue {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid #e2e2e2;
}

.rex-blog-admin__queue li {
    padding: 10px 0;
    border-bottom: 1px solid #e2e2e2;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.rex-blog-admin__item-title {
    font-weight: 700;
    margin-right: 4px;
}

.rex-blog-admin__author {
    color: #767676;
    text-decoration: none;
}

.rex-blog-admin__author:hover {
    color: #1d2327;
}

.rex-blog-admin__act.rex-blog-btn {
    margin: 0 0 0 4px;
}

.rex-blog-admin__empty {
    margin: 0;
    color: #767676;
}

@media (max-width: 600px) {
    .rex-blog-admin {
        padding: 18px;
    }

    .rex-blog-admin__queue li {
        display: block;
    }

    .rex-blog-admin__act.rex-blog-btn {
        display: inline-block;
        margin: 6px 6px 0 0;
    }
}