/* ============================================================
   UTILITIES — Margin, Padding, Text, Display, Flex, etc.
   ============================================================ */

/* ---- Spacing (1 unit = 8px) ---- */
/* Margin */
.m-0  { margin: 0; }           .m-1  { margin: 8px; }    .m-2  { margin: 16px; }
.m-3  { margin: 24px; }        .m-4  { margin: 32px; }   .m-5  { margin: 48px; }
.m-6  { margin: 64px; }        .m-auto { margin: auto; }

.mt-0 { margin-top: 0; }       .mt-1 { margin-top: 8px; }   .mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }    .mt-4 { margin-top: 32px; }  .mt-5 { margin-top: 48px; }
.mt-6 { margin-top: 64px; }    .mt-auto { margin-top: auto; }

.mb-0 { margin-bottom: 0; }    .mb-1 { margin-bottom: 8px; }   .mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }  .mb-5 { margin-bottom: 48px; }
.mb-6 { margin-bottom: 64px; }

.ml-0 { margin-left: 0; }      .ml-1 { margin-left: 8px; }   .ml-2 { margin-left: 16px; }
.ml-3 { margin-left: 24px; }   .ml-4 { margin-left: 32px; }  .ml-auto { margin-left: auto; }

.mr-0 { margin-right: 0; }     .mr-1 { margin-right: 8px; }  .mr-2 { margin-right: 16px; }
.mr-3 { margin-right: 24px; }  .mr-4 { margin-right: 32px; } .mr-auto { margin-right: auto; }

.mx-0 { margin-left: 0; margin-right: 0; }
.mx-1 { margin-left: 8px; margin-right: 8px; }
.mx-2 { margin-left: 16px; margin-right: 16px; }
.mx-3 { margin-left: 24px; margin-right: 24px; }
.mx-auto { margin-left: auto; margin-right: auto; }

.my-0 { margin-top: 0; margin-bottom: 0; }
.my-1 { margin-top: 8px; margin-bottom: 8px; }
.my-2 { margin-top: 16px; margin-bottom: 16px; }
.my-3 { margin-top: 24px; margin-bottom: 24px; }
.my-4 { margin-top: 32px; margin-bottom: 32px; }
.my-5 { margin-top: 48px; margin-bottom: 48px; }

/* Padding */
.p-0  { padding: 0; }          .p-1  { padding: 8px; }   .p-2  { padding: 16px; }
.p-3  { padding: 24px; }       .p-4  { padding: 32px; }  .p-5  { padding: 48px; }
.p-6  { padding: 64px; }

.pt-0 { padding-top: 0; }      .pt-1 { padding-top: 8px; }   .pt-2 { padding-top: 16px; }
.pt-3 { padding-top: 24px; }   .pt-4 { padding-top: 32px; }  .pt-5 { padding-top: 48px; }
.pt-6 { padding-top: 64px; }

.pb-0 { padding-bottom: 0; }   .pb-1 { padding-bottom: 8px; }   .pb-2 { padding-bottom: 16px; }
.pb-3 { padding-bottom: 24px; }.pb-4 { padding-bottom: 32px; }  .pb-5 { padding-bottom: 48px; }
.pb-6 { padding-bottom: 64px; }

.pl-0 { padding-left: 0; }     .pl-1 { padding-left: 8px; }  .pl-2 { padding-left: 16px; }
.pl-3 { padding-left: 24px; }  .pl-4 { padding-left: 32px; }

.pr-0 { padding-right: 0; }    .pr-1 { padding-right: 8px; } .pr-2 { padding-right: 16px; }
.pr-3 { padding-right: 24px; } .pr-4 { padding-right: 32px; }

.px-0 { padding-left: 0; padding-right: 0; }
.px-1 { padding-left: 8px; padding-right: 8px; }
.px-2 { padding-left: 16px; padding-right: 16px; }
.px-3 { padding-left: 24px; padding-right: 24px; }
.px-4 { padding-left: 32px; padding-right: 32px; }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: 8px; padding-bottom: 8px; }
.py-2 { padding-top: 16px; padding-bottom: 16px; }
.py-3 { padding-top: 24px; padding-bottom: 24px; }
.py-4 { padding-top: 32px; padding-bottom: 32px; }
.py-5 { padding-top: 48px; padding-bottom: 48px; }

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

.text-xs  { font-size: .75rem; }
.text-sm  { font-size: .875rem; }
.text-base{ font-size: 1rem; }
.text-lg  { font-size: 1.125rem; }
.text-xl  { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }

.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; }

.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize{ text-transform: capitalize; }
.tracking-wide  { letter-spacing: .05em; }
.tracking-wider { letter-spacing: .1em; }

/* Color utilities */
.text-white    { color: var(--white) !important; }
.text-dark     { color: var(--dark) !important; }
.text-charcoal { color: var(--charcoal) !important; }
.text-gray     { color: var(--mid-gray) !important; }
.text-emerald  { color: var(--emerald-primary) !important; }
.text-emerald-dark { color: var(--emerald-dark) !important; }
.text-gold     { color: var(--gold-primary) !important; }
.text-error    { color: var(--error) !important; }
.text-success  { color: var(--success) !important; }
.text-muted    { color: var(--mid-gray) !important; }

/* Background utilities */
.bg-white    { background-color: var(--white); }
.bg-light    { background-color: var(--light-gray); }
.bg-off-white{ background-color: var(--off-white); }
.bg-dark     { background-color: var(--dark); }
.bg-emerald  { background-color: var(--emerald-primary); }
.bg-emerald-light { background-color: var(--emerald-muted); }
.bg-gold     { background-color: var(--gold-primary); }
.bg-gold-light { background-color: var(--gold-muted); }

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

/* ---- Flexbox ---- */
.flex-row      { flex-direction: row; }
.flex-col      { flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.flex-nowrap   { flex-wrap: nowrap; }
.flex-1        { flex: 1 1 0%; }
.flex-auto     { flex: 1 1 auto; }
.flex-none     { flex: none; }

.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; }
.justify-evenly  { justify-content: space-evenly; }

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.gap-4 { gap: 32px; }

/* ---- Position ---- */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; top: 0; }

/* ---- Sizing ---- */
.w-full    { width: 100%; }
.w-auto    { width: auto; }
.h-full    { height: 100%; }
.h-screen  { height: 100vh; }
.max-w-sm  { max-width: 480px; }
.max-w-md  { max-width: 768px; }
.max-w-lg  { max-width: 960px; }
.max-w-xl  { max-width: 1200px; }

/* ---- Borders & Radius ---- */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded    { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }
.border     { border: 1px solid var(--border-color); }
.border-gold{ border: 1px solid var(--gold-primary); }

/* ---- Shadows ---- */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow    { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-none { box-shadow: none; }

/* ---- Overflow ---- */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Responsive Visibility ---- */
@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 641px) and (max-width: 1024px) {
  .hide-tablet { display: none !important; }
}
@media (min-width: 1025px) {
  .hide-desktop { display: none !important; }
}
.show-mobile  { display: none; }
@media (max-width: 640px) {
  .show-mobile { display: block !important; }
}

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

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

/* ---- Gold accent bar ---- */
.gold-bar {
  display: block;
  width: 48px;
  height: 3px;
  background: var(--gold-primary);
  border-radius: var(--radius-full);
  margin: var(--sp-sm) 0;
}
.gold-bar-center { margin-left: auto; margin-right: auto; }

/* ---- Cursor ---- */
.cursor-pointer { cursor: pointer; }

/* ---- Opacity ---- */
.opacity-0   { opacity: 0; }
.opacity-50  { opacity: .5; }
.opacity-75  { opacity: .75; }
.opacity-100 { opacity: 1; }

/* ---- Transition ---- */
.transition      { transition: all var(--transition-base); }
.transition-fast { transition: all var(--transition-fast); }

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