/**
 * Hello Middleton — Market Rules / Guidelines Page
 * Modern redesign: hero band + 3-col card grid
 *
 * @since HM 3.2.0
 */

/* ── Hide BuddyX default page title & breadcrumbs (page has its own header) ─ */
.page-id-1283 .entry-title,
.page-id-1283 .buddyx-breadcrumbs,
.page-id-1283 .site-sub-header { display: none !important; }

/* ── Remove extra padding WP adds around entry-content on this page ── */
.page-id-1283 .entry-content { padding: 0 !important; }

/* ==========================================================================
   WRAPPER
   ========================================================================== */
.rules-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 64px;
}

/* ==========================================================================
   HERO BAND
   ========================================================================== */
.rules-hero {
    background: linear-gradient(135deg, #1C1917 0%, #292524 60%, #3d1f00 100%);
    padding: 52px 40px;
    margin: 0 -20px 48px;
    position: relative;
    overflow: hidden;
}

.rules-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 80% at 110% 50%, rgba(249,115,22,.18) 0%, transparent 70%);
    pointer-events: none;
}

.rules-hero__inner {
    max-width: 1060px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    z-index: 1;
}

.rules-hero__text {}

.rules-hero__badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #F97316;
    background: rgba(249,115,22,.15);
    border: 1px solid rgba(249,115,22,.3);
    padding: 3px 10px;
    border-radius: 99px;
    margin-bottom: 12px;
}

.rules-hero__title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px;
    line-height: 1.15;
}

.rules-hero__sub {
    font-size: .95rem;
    color: rgba(255,255,255,.55);
    margin: 0;
    line-height: 1.5;
}

.rules-hero__actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.rules-hero__actions a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .875rem;
    font-weight: 700;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    white-space: nowrap;
    transition: all .15s;
}

.rules-hero__actions a.primary {
    background: #F97316;
    color: #fff;
}
.rules-hero__actions a.primary:hover { background: #EA580C; }

.rules-hero__actions a.ghost {
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.8);
    border: 1px solid rgba(255,255,255,.15);
}
.rules-hero__actions a.ghost:hover {
    background: rgba(255,255,255,.14);
    color: #fff;
}

/* ==========================================================================
   GRID — 3 columns desktop, 2 tablet, 1 mobile
   ========================================================================== */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 40px;
}

/* ==========================================================================
   SECTION CARDS
   ========================================================================== */
.rules-section {
    background: #fff;
    border: 1px solid #e7e5e4;
    border-radius: 12px;
    padding: 24px;
    border-top: 4px solid #e7e5e4;
    transition: box-shadow .15s, transform .15s;
    display: flex;
    flex-direction: column;
}

.rules-section:hover {
    box-shadow: 0 4px 20px rgba(28,25,23,.08);
    transform: translateY(-2px);
}

.rules-section h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #1C1917;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.3;
}

.rules-section h2 .icon {
    font-size: 1.15em;
    flex-shrink: 0;
}

.rules-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}

.rules-section li {
    position: relative;
    padding: 7px 0 7px 18px;
    font-size: .875rem;
    color: #57534E;
    line-height: 1.5;
    border-bottom: 1px solid #f5f4f3;
}

.rules-section li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.rules-section li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #d6d3d1;
}

.rules-section li strong, .rules-section li .hl {
    color: #1C1917;
    font-weight: 600;
}

/* ── Per-section color accents ── */
.rules-section.allowed    { border-top-color: #22c55e; }
.rules-section.allowed h2 { color: #15803d; }
.rules-section.allowed li::before { background: #22c55e; }

.rules-section.forbidden    { border-top-color: #ef4444; }
.rules-section.forbidden h2 { color: #b91c1c; }
.rules-section.forbidden li::before { background: #ef4444; }

.rules-section.posting    { border-top-color: #F97316; }
.rules-section.posting h2 { color: #c2410c; }
.rules-section.posting li::before { background: #F97316; }

.rules-section.conduct    { border-top-color: #0ea5e9; }
.rules-section.conduct h2 { color: #0369a1; }
.rules-section.conduct li::before { background: #0ea5e9; }

.rules-section.safety    { border-top-color: #8b5cf6; }
.rules-section.safety h2 { color: #6d28d9; }
.rules-section.safety li::before { background: #8b5cf6; }

.rules-section.moderation    { border-top-color: #78716C; }
.rules-section.moderation h2 { color: #44403c; }
.rules-section.moderation li::before { background: #78716C; }

/* ==========================================================================
   FOOTER CTA
   ========================================================================== */
.rules-footer {
    background: linear-gradient(135deg, #fff7ed 0%, #fff 100%);
    border: 1px solid #fed7aa;
    border-radius: 14px;
    padding: 32px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.rules-footer-text {
    font-size: .95rem;
    color: #57534E;
    line-height: 1.6;
}

.rules-footer-text strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1C1917;
    margin-bottom: 4px;
}

.rules-footer-links {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.rules-footer-links a {
    display: inline-flex;
    align-items: center;
    font-size: .875rem;
    font-weight: 700;
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 8px;
    white-space: nowrap;
    transition: all .15s;
}

.rules-footer-links a:first-child {
    background: #F97316;
    color: #fff;
}
.rules-footer-links a:first-child:hover { background: #EA580C; }

.rules-footer-links a.secondary {
    background: #fff;
    color: #57534E;
    border: 1px solid #e7e5e4;
}
.rules-footer-links a.secondary:hover { background: #f5f4f3; color: #1C1917; }

/* ==========================================================================
   SUPPRESS BuddyX empty <p> tags WordPress injects
   ========================================================================== */
.rules-wrapper p:empty,
.rules-section p:empty,
.rules-footer p:empty { display: none; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
    .rules-grid { grid-template-columns: repeat(2, 1fr); }
    .rules-hero { padding: 40px 24px; }
    .rules-hero__inner { flex-direction: column; align-items: flex-start; gap: 20px; }
    .rules-footer { flex-direction: column; gap: 20px; text-align: center; padding: 28px 24px; }
    .rules-footer-links { justify-content: center; }
}

@media (max-width: 560px) {
    .rules-grid { grid-template-columns: 1fr; }
    .rules-hero { padding: 32px 16px; margin: 0 -20px 32px; }
    .rules-hero__actions { flex-direction: column; width: 100%; }
    .rules-hero__actions a { justify-content: center; }
    .rules-wrapper { padding-bottom: 40px; }
    .rules-footer-links { flex-direction: column; width: 100%; }
    .rules-footer-links a { justify-content: center; }
}
