/* ====================================================================
   Creativelines — Utilities (Phase 1)
   Atomic helpers: spacing, flex/grid, text, display, hover effects.
   Naming kept short and readable rather than fully atomic.
   ==================================================================== */


/* ─── Spacing (margin/padding) ───────────────────────────── */
.m-0  { margin: 0; }
.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mt-10{ margin-top: var(--sp-10); }
.mt-12{ margin-top: var(--sp-12); }
.mt-16{ margin-top: var(--sp-16); }

.mb-1 { margin-bottom: var(--sp-1); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }
.mb-10{ margin-bottom: var(--sp-10); }
.mb-12{ margin-bottom: var(--sp-12); }
.mb-16{ margin-bottom: var(--sp-16); }

.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }

.p-0  { padding: 0; }
.p-3  { padding: var(--sp-3); }
.p-4  { padding: var(--sp-4); }
.p-5  { padding: var(--sp-5); }
.p-6  { padding: var(--sp-6); }
.p-8  { padding: var(--sp-8); }
.p-10 { padding: var(--sp-10); }


/* ─── Flexbox ────────────────────────────────────────────── */
.flex    { display: flex; }
.iflex   { display: inline-flex; }
.flex-col{ flex-direction: column; }
.flex-row{ flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }

.items-start   { align-items: flex-start; }
.items-center  { align-items: center; }
.items-end     { align-items: flex-end; }
.items-stretch { align-items: stretch; }

.justify-start   { justify-content: flex-start; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around  { justify-content: space-around; }

.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }
.gap-10{ gap: var(--sp-10); }

.flex-1 { flex: 1; }
.shrink-0 { flex-shrink: 0; }


/* ─── Display ────────────────────────────────────────────── */
.block  { display: block; }
.iblock { display: inline-block; }
.inline { display: inline; }
.hidden { display: none !important; }


/* ─── Width / Height ─────────────────────────────────────── */
.w-full { width: 100%; }
.h-full { height: 100%; }
.w-auto { width: auto; }
.h-auto { height: auto; }
.max-w-prose { max-width: 65ch; }
.min-h-screen { min-height: 100vh; }


/* ─── Text ───────────────────────────────────────────────── */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.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-md   { font-size: var(--fs-md); }
.text-lg   { font-size: var(--fs-lg); }
.text-xl   { font-size: var(--fs-xl); }
.text-2xl  { font-size: var(--fs-2xl); }
.text-3xl  { font-size: var(--fs-3xl); }

.font-display { font-family: var(--font-display); }
.font-body    { font-family: var(--font-body); }
.font-mono    { font-family: var(--font-mono); }

.font-light   { font-weight: 300; }
.font-regular { font-weight: 400; }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }
.italic       { font-style: italic; }

.uppercase    { text-transform: uppercase; letter-spacing: 0.05em; }
.tracking-wide{ letter-spacing: 0.1em; }
.tracking-tight{ letter-spacing: -0.02em; }


/* ─── Colors ─────────────────────────────────────────────── */
.text-fg       { color: var(--cl-fg); }
.text-muted    { color: var(--cl-fg-muted); }
.text-subtle   { color: var(--cl-fg-subtle); }
.text-yellow   { color: var(--cl-yellow); }
.text-red      { color: var(--cl-red); }
.text-success  { color: var(--status-success); }
.text-error    { color: var(--status-error); }

.bg-bg        { background: var(--cl-bg); }
.bg-bg-alt    { background: var(--cl-bg-alt); }
.bg-elevated  { background: var(--cl-bg-elevated); }
.bg-yellow    { background: var(--cl-yellow); color: var(--cl-black); }
.bg-red       { background: var(--cl-red); color: var(--cl-white); }
.bg-brand-grad{ background: var(--grad-brand); color: var(--cl-white); }


/* ─── Border / Radius ────────────────────────────────────── */
.border       { border: var(--border-thin); }
.border-strong{ border: var(--border-strong); }
.border-accent{ border: var(--border-accent); }
.no-border    { border: none !important; }

.rounded-sm  { border-radius: var(--r-sm); }
.rounded-md  { border-radius: var(--r-md); }
.rounded-lg  { border-radius: var(--r-lg); }
.rounded-xl  { border-radius: var(--r-xl); }
.rounded-full{ border-radius: var(--r-pill); }
.rounded-none{ border-radius: 0; }


/* ─── Shadow ─────────────────────────────────────────────── */
.shadow-none { box-shadow: none; }
.shadow-xs   { box-shadow: var(--shadow-xs); }
.shadow-sm   { box-shadow: var(--shadow-sm); }
.shadow-md   { box-shadow: var(--shadow-md); }
.shadow-lg   { box-shadow: var(--shadow-lg); }
.shadow-glow-y { box-shadow: var(--glow-yellow); }
.shadow-glow-r { box-shadow: var(--glow-red); }


/* ─── Position ───────────────────────────────────────────── */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }


/* ─── Overflow ───────────────────────────────────────────── */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }


/* ─── Cursor ─────────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }


/* ─── Hover Effects ──────────────────────────────────────── */
.hover-lift {
    transition: transform var(--t-base) var(--ease-out),
                box-shadow var(--t-base) var(--ease-out);
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.hover-scale {
    transition: transform var(--t-base) var(--ease-out);
}
.hover-scale:hover { transform: scale(1.04); }

.hover-glow {
    transition: box-shadow var(--t-base) var(--ease-out);
}
.hover-glow:hover { box-shadow: var(--glow-yellow); }

.hover-rotate {
    transition: transform var(--t-base) var(--ease-out);
}
.hover-rotate:hover { transform: rotate(-3deg); }


/* ─── Aspect Ratios ──────────────────────────────────────── */
.aspect-square { aspect-ratio: 1; }
.aspect-video  { aspect-ratio: 16 / 9; }
.aspect-photo  { aspect-ratio: 4 / 3; }
.aspect-portrait { aspect-ratio: 3 / 4; }


/* ─── Object Fit ─────────────────────────────────────────── */
.object-cover    { object-fit: cover; }
.object-contain  { object-fit: contain; }


/* ─── Responsive helpers ─────────────────────────────────── */
@media (max-width: 768px) {
    .md-hidden { display: none !important; }
    .md-text-center { text-align: center; }
}
@media (min-width: 769px) {
    .md-only { display: none !important; }
}
@media (max-width: 1024px) {
    .lg-hidden { display: none !important; }
}


/* ─── 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;
}


/* ─── Visually hidden / accessibility ────────────────────── */
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
