/* ============================================================================
 * Arcpoly Theme — Utility classes
 * Atomic helpers. Tránh dùng inline style; dùng utility class trong template.
 * ========================================================================== */

@layer utilities {

/* ----- Display ----- */
.d-none   { display: none !important; }
.d-block  { display: block !important; }
.d-flex   { display: flex !important; }
.d-grid   { display: grid !important; }
.d-iflex  { display: inline-flex !important; }
.d-iblock { display: inline-block !important; }

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

/* ----- Flex ----- */
.flex-row     { flex-direction: row; }
.flex-col     { flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.flex-1       { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* ----- Gap ----- */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }

/* ----- Margin ----- */
.m-0 { margin: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mx-auto { margin-inline: auto; }

/* ----- Padding ----- */
.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }

/* ----- Text ----- */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.text-xs   { font-size: var(--fs-xs); }
.text-sm   { font-size: var(--fs-sm); }
.text-base { font-size: var(--fs-base); }
.text-lg   { font-size: var(--fs-lg); }
.text-xl   { font-size: var(--fs-xl); }

.font-medium   { font-weight: var(--fw-medium); }
.font-semibold { font-weight: var(--fw-semibold); }
.font-bold     { font-weight: var(--fw-bold); }

.text-brand   { color: var(--c-brand); }
.text-dim     { color: var(--c-text-dim); }
.text-muted   { color: var(--c-text-muted); }
.text-success { color: var(--c-success); }
.text-warning { color: var(--c-warning); }
.text-danger  { color: var(--c-danger); }

/* ----- Background ----- */
.bg-0 { background: var(--c-bg-0); }
.bg-1 { background: var(--c-bg-1); }
.bg-2 { background: var(--c-bg-2); }
.bg-brand-soft { background: var(--c-brand-soft); }

/* ----- Border ----- */
.border       { border: 1px solid var(--c-border); }
.border-top   { border-top: 1px solid var(--c-border); }
.border-bot   { border-bottom: 1px solid var(--c-border); }

.rounded     { border-radius: var(--r); }
.rounded-sm  { border-radius: var(--r-sm); }
.rounded-lg  { border-radius: var(--r-lg); }
.rounded-pill { border-radius: var(--r-pill); }

/* ----- Misc ----- */
.shadow    { box-shadow: var(--sh); }
.shadow-lg { box-shadow: var(--sh-lg); }
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* ----- Screen-reader-only ----- */
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ----- Truncate ----- */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ----- Aspect ratio ----- */
.aspect-square { aspect-ratio: 1; }
.aspect-video  { aspect-ratio: 16 / 9; }
.aspect-card   { aspect-ratio: 4 / 3; }

} /* /@layer utilities */
