/* ════════════════════════════════════════════════════════════════════
   Requirements Cards — MC Requires Box
   Style 5: Elevated Filled with thumbnail + Minecraft badge
   ════════════════════════════════════════════════════════════════════ */

/* ── Section wrapper ───────────────────────────────────────────────── */
.mcap-requires-section {
    margin: 32px 0;
    padding: 0;
}

.mcap-requires-section h3 {
    position: relative;
    display: inline-block;
    margin: 0 0 18px 0;
    padding: 0 0 8px 0;
    font-size: 22px;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: -0.3px;
    text-decoration: none !important;
    border-bottom: 0 !important;
    background: none !important;
}
.mcap-requires-section h3 a,
.mcap-requires-section h3 span {
    text-decoration: none !important;
    border-bottom: 0 !important;
}

.mcap-requires-section h3::before {
    content: "⚙";
    margin-right: 8px;
    color: #2271b1;
}

.mcap-requires-section h3::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #2271b1 0%, #46b1e8 100%);
    border-radius: 2px;
}

/* ── Layout — flexbox để 1-2 card không stretch full width ─────────── */
.mcap-requires-section .mcap-req-grid {
    display: flex !important;
    flex-wrap: wrap;
    gap: 14px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Diệt mọi <br> mà wpautop có thể chèn */
.mcap-requires-section .mcap-req-grid > br,
.mcap-requires-section .mcap-req-grid > p:empty {
    display: none !important;
}
.mcap-requires-section .mcap-req-grid > p {
    margin: 0 !important;
    padding: 0 !important;
}

/* ── Card base ─────────────────────────────────────────────────────── */
.mcap-req-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 21px 8px 16px;
    border-radius: 12px;
    border: 1.5px solid transparent;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    text-decoration: none !important;
    color: inherit !important;
    box-sizing: border-box;
    /* Auto-size theo nội dung — không fixed width nên card không dư padding phải */
    flex: 0 0 auto;
    max-width: 100%;
}

/* ── Type variants — White background, colored border only ────────── */

/* 🔴 Required — Redstone red */
.mcap-req-type-required {
    background: #fff;
    border-color: #fecaca;
}
.mcap-req-type-required.mcap-req-linked:hover {
    border-color: #dc2626;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.22);
    transform: translateY(-2px);
}

/* 🟢 Recommended — Emerald green */
.mcap-req-type-recommended {
    background: #fff;
    border-color: #bbf7d0;
}
.mcap-req-type-recommended.mcap-req-linked:hover {
    border-color: #16a34a;
    box-shadow: 0 8px 24px rgba(22, 163, 74, 0.22);
    transform: translateY(-2px);
}

/* 🔵 Optional — Lapis Lazuli blue */
.mcap-req-type-optional {
    background: #fff;
    border-color: #bfdbfe;
}
.mcap-req-type-optional.mcap-req-linked:hover {
    border-color: #2563eb;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.22);
    transform: translateY(-2px);
}

/* ── Thumbnail (from featured image) ───────────────────────────────── */
.mcap-requires-section .mcap-req-thumb {
    position: relative;
    flex-shrink: 0;
    flex-grow: 0;
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* !important để đè theme rule `img { height: auto }` làm méo thumbnail mobile */
.mcap-requires-section .mcap-req-thumb img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: transform 0.4s ease;
}

.mcap-req-linked:hover .mcap-req-thumb img {
    transform: scale(1.08);
}

/* ── Info (name + badge) ───────────────────────────────────────────── */
.mcap-req-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1;
    position: relative;
}

.mcap-req-name {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: #0f172a;
    line-height: 1.3;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Badge (icon + label) ──────────────────────────────────────────── */
.mcap-req-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.mcap-req-badge svg {
    display: inline-block;
    vertical-align: middle;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    flex-shrink: 0;
}

.mcap-req-badge-required {
    color: #b91c1c;
}

.mcap-req-badge-recommended {
    color: #15803d;
}

.mcap-req-badge-optional {
    color: #1d4ed8;
}

/* ── Tablet ≤ 900px ────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .mcap-requires-section .mcap-req-grid {
        gap: 10px;
    }
}

/* ── Mobile ≤ 600px — card nhỏ hơn, wrap tự nhiên ──────────────────── */
@media (max-width: 600px) {
    .mcap-requires-section .mcap-req-grid {
        gap: 8px;
    }
    .mcap-req-card {
        padding: 6px 17px 6px 12px;
        gap: 10px;
        border-radius: 10px;
    }
    .mcap-requires-section .mcap-req-thumb {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        border-radius: 8px;
    }
    .mcap-req-name {
        font-size: 13px;
    }
    .mcap-req-badge {
        font-size: 10px;
        gap: 4px;
    }
    .mcap-req-badge svg {
        width: 11px;
        height: 11px;
    }
    .mcap-requires-section {
        margin: 24px 0;
    }
    .mcap-requires-section h3 {
        font-size: 18px;
        margin-bottom: 14px;
    }
}

/* ── Mobile ≤ 420px — thumbnail nhỏ hơn chút ───────────────────────── */
@media (max-width: 420px) {
    .mcap-requires-section .mcap-req-thumb {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
    }
    .mcap-req-name {
        font-size: 13px;
    }
}

/* ── Dark mode ─────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    .mcap-req-type-required,
    .mcap-req-type-recommended,
    .mcap-req-type-optional {
        background: #1e293b;
    }
    .mcap-req-type-required    { border-color: #7f1d1d; }
    .mcap-req-type-recommended { border-color: #166534; }
    .mcap-req-type-optional    { border-color: #1e3a8a; }
    .mcap-req-name { color: #f1f5f9; }
    .mcap-req-badge-required    { color: #fca5a5; }
    .mcap-req-badge-recommended { color: #86efac; }
    .mcap-req-badge-optional    { color: #93c5fd; }
    .mcap-requires-section h3   { color: #f1f5f9; }
}
