/**
 * RelaxModAPK - Custom Utilities CSS
 * Lightweight replacement for Bootstrap CSS (~4 KB vs ~227 KB)
 * Only includes utilities actually used by this theme.
 *
 * @package RelaxModAPK
 * @version 1.0.0
 */

/* ============================================
   CONTAINER
   ============================================ */
.container {
    width: 100%;
    padding-right: 16px;
    padding-left: 16px;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container { max-width: 540px; }
}
@media (min-width: 768px) {
    .container { max-width: 720px; }
}
@media (min-width: 992px) {
    .container { max-width: 960px; }
}
@media (min-width: 1200px) {
    .container { max-width: 1140px; }
}
@media (min-width: 1400px) {
    .container { max-width: 1320px; }
}

/* ============================================
   GRID SYSTEM
   ============================================ */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -12px;
    margin-left: -12px;
}

.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: 12px;
    padding-left: 12px;
}

/* Gutters */
.g-3 { --rm-gutter-x: 16px; --rm-gutter-y: 16px; }
.g-4 { --rm-gutter-x: 24px; --rm-gutter-y: 24px; }

.g-3, .g-4 {
    margin-right: calc(var(--rm-gutter-x) * -0.5);
    margin-left: calc(var(--rm-gutter-x) * -0.5);
}

.g-3 > *, .g-4 > * {
    padding-right: calc(var(--rm-gutter-x) * 0.5);
    padding-left: calc(var(--rm-gutter-x) * 0.5);
    margin-top: var(--rm-gutter-y);
}

.g-3, .g-4 {
    margin-top: calc(var(--rm-gutter-y) * -1);
}

/* Columns - Mobile First (xs) */
.col { flex: 1 0 0%; }
.col-4 { flex: 0 0 auto; width: 33.333333%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-12 { flex: 0 0 auto; width: 100%; }

/* Row Cols */
.row-cols-2 > * { flex: 0 0 auto; width: 50%; }

/* md breakpoint (768px) */
@media (min-width: 768px) {
    .col-md-3 { flex: 0 0 auto; width: 25%; }
    .col-md-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-md-5 { flex: 0 0 auto; width: 41.666667%; }
    .row-cols-md-5 > * { flex: 0 0 auto; width: 20%; }
}

/* lg breakpoint (992px) */
@media (min-width: 992px) {
    .col-lg-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-lg-3 { flex: 0 0 auto; width: 25%; }
    .col-lg-9 { flex: 0 0 auto; width: 75%; }
}

/* ============================================
   DISPLAY UTILITIES
   ============================================ */
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.d-inline-block { display: inline-block !important; }
.d-block { display: block !important; }

@media (min-width: 768px) {
    .d-md-none { display: none !important; }
}

/* ============================================
   FLEXBOX & TEXT UTILITIES
   ============================================ */
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.flex-column { flex-direction: column !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-start { justify-content: flex-start !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.gap-1 { gap: 4px !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 16px !important; }
.gap-4 { gap: 24px !important; }

.text-truncate {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* ============================================
   SPACING UTILITIES
   ============================================ */
/* Margin Bottom */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 16px !important; }
.mb-4 { margin-bottom: 24px !important; }
.mb-5 { margin-bottom: 48px !important; }

/* Margin Top */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; }
.mt-5 { margin-top: 48px !important; }

/* Margin End (Right in LTR) */
.me-1 { margin-right: 4px !important; }
.me-2 { margin-right: 8px !important; }

/* Margin Start (Left in LTR) */
.ms-2 { margin-left: 8px !important; }

/* Margin X (Horizontal) */
.mx-auto { margin-right: auto !important; margin-left: auto !important; }

/* Margin Y (Vertical) */
.my-4 { margin-top: 24px !important; margin-bottom: 24px !important; }

/* Padding */
.p-0 { padding: 0 !important; }
.p-1 { padding: 4px !important; }
.p-2 { padding: 8px !important; }
.p-3 { padding: 16px !important; }
.p-4 { padding: 24px !important; }

/* Padding X (Horizontal) */
.px-3 { padding-right: 16px !important; padding-left: 16px !important; }
.px-4 { padding-right: 24px !important; padding-left: 24px !important; }

/* Padding Y (Vertical) */
.py-1\.5, .py-1-5 { padding-top: 6px !important; padding-bottom: 6px !important; }
.py-2 { padding-top: 8px !important; padding-bottom: 8px !important; }
.py-4 { padding-top: 24px !important; padding-bottom: 24px !important; }
.py-5 { padding-top: 48px !important; padding-bottom: 48px !important; }

/* Padding Top */
.pt-5 { padding-top: 48px !important; }

/* ============================================
   TYPOGRAPHY UTILITIES
   ============================================ */
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-medium { font-weight: 500 !important; }
.small { font-size: 0.875em !important; }
.h5 { font-size: 1.25rem; font-weight: 700; line-height: 1.2; margin-bottom: 8px; }
.h6 { font-size: 1rem; font-weight: 700; line-height: 1.2; margin-bottom: 8px; }

/* Text Alignment */
.text-center { text-align: center !important; }

/* Text Colors */
.text-white { color: #ffffff !important; }
.text-dark { color: #212529 !important; }
.text-muted { color: #6c757d !important; }
.text-success { color: #198754 !important; }
.text-danger { color: #dc3545 !important; }
.text-secondary { color: #6c757d !important; }
.text-orange { color: #fd7e14 !important; }

/* Text Decoration */
.text-decoration-none { text-decoration: none !important; }

/* ============================================
   BACKGROUND UTILITIES
   ============================================ */
.bg-white { background-color: #ffffff !important; }
.bg-light { background-color: #f8f9fa !important; }

/* ============================================
   BORDER UTILITIES
   ============================================ */
.border { border: 1px solid #dee2e6 !important; }
.border-bottom { border-bottom: 1px solid #dee2e6 !important; }
.rounded-pill { border-radius: 50rem !important; }
.rounded-4 { border-radius: 16px !important; }
.overflow-hidden { overflow: hidden !important; }

/* ============================================
   SHADOW UTILITIES
   ============================================ */
.shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important; }
.shadow-lg { box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important; }

/* ============================================
   SIZING UTILITIES
   ============================================ */
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }

/* ============================================
   OBJECT FIT
   ============================================ */
.object-fit-cover { object-fit: cover !important; }

/* ============================================
   BADGE COMPONENT
   ============================================ */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 6px;
    color: #fff;
    background-color: var(--rm-accent, #00d68f);
}

/* ============================================
   BUTTON COMPONENTS
   ============================================ */
.btn {
    display: inline-block;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    padding: 6px 12px;
    font-size: 1rem;
    border-radius: 6px;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn-primary {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    color: #fff;
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-lg {
    padding: 8px 16px;
    font-size: 1.25rem;
    border-radius: 8px;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.visually-hidden,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ============================================
   MISC UTILITIES USED BY THEME
   ============================================ */
.x-small { font-size: 0.75rem !important; }

/* ============================================
   TABS & TAB PANES (Vanilla replacement for Bootstrap tabs)
   ============================================ */
.tab-pane {
    display: none;
}

.tab-pane.active,
.tab-pane.show.active {
    display: block;
}

.tab-pane.fade {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.tab-pane.fade.active,
.tab-pane.fade.show.active {
    opacity: 1;
}

/* Standard Nav Tabs (for single.php etc) */
.nav-tabs {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
    border-bottom: 1px solid #dee2e6;
    gap: 4px;
}

.nav-tabs .nav-link {
    display: block;
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
    text-decoration: none;
    background: transparent;
    border: 1px solid transparent;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    cursor: pointer;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.nav-tabs .nav-link:hover {
    color: #2e7d32;
    border-color: #e9ecef #e9ecef #dee2e6;
}

.nav-tabs .nav-link.active {
    color: #2e7d32;
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
    font-weight: 700;
}
