/* =============================================================================
   Mechanical Studio Limited — utilities.css
   Accessibility helpers, skip link, visually hidden, text utilities
   ============================================================================= */

/* Skip to main content */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-3);
    z-index: 9999;
    padding: var(--space-2) var(--space-3);
    background: var(--color-primary);
    color: var(--color-white);
    font-size: var(--text-body);
    font-weight: 600;
    border-radius: var(--radius);
    text-decoration: none;
    transition: top 0ms;
}

.skip-link:focus {
    top: var(--space-3);
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
}

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

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

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--color-muted);
}

.text-primary {
    color: var(--color-primary);
}

.text-white {
    color: var(--color-white);
}

.text-small {
    font-size: var(--text-body-sm);
}

/* Spacing utilities */
.mt-auto {
    margin-top: auto;
}

.mb-0 {
    margin-bottom: 0;
}

/* Max-width for prose */
.prose {
    max-width: 68ch;
}

/* Divider */
.divider {
    border: none;
    border-top: 1px solid var(--color-card);
    margin-block: var(--space-5);
}

/* Aspect ratios */
.ratio-16-9 {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.ratio-16-9>* {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Page hero spacing for inner pages */
.page-hero {
    padding-top: calc(80px + var(--space-7));
    padding-bottom: var(--space-7);
    background: var(--color-charcoal);
    position: relative;
    overflow: hidden;
}

.page-hero__bg {
    position: absolute;
    inset: 0;
    opacity: 0.25;
}

.page-hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(11, 15, 20, 0.6) 0%, rgba(26, 35, 50, 0.95) 100%);
}

.page-hero__content {
    position: relative;
    z-index: 1;
}

.page-hero__eyebrow {
    display: inline-block;
    background: rgba(0, 153, 153, 0.20);
    color: var(--color-primary-mid);
    font-size: var(--text-label);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(0, 153, 153, 0.30);
    margin-bottom: var(--space-3);
}

.page-hero__title {
    font-size: var(--text-h1);
    font-weight: 700;
    color: var(--color-white);
    line-height: 1.1;
    margin-bottom: var(--space-3);
    max-width: 20ch;
}

.page-hero__desc {
    font-size: var(--text-body-lg);
    color: rgba(255, 255, 255, 0.70);
    max-width: 56ch;
    line-height: 1.65;
}

/* =============================================================================
   PROJECT GALLERY
   ============================================================================= */
.proj-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

/* Images grid — 3 up on wide screens */
.proj-gallery--images {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* Videos — 2 up, larger */
.proj-gallery--videos {
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
}

@media (max-width: 640px) {
  .proj-gallery--videos {
    grid-template-columns: 1fr;
  }
}

.proj-gallery__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.proj-gallery__item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card);
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
  cursor: zoom-in;
}

.proj-gallery__item img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.proj-gallery__item--video video {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card);
}

.proj-gallery__caption {
  font-size: var(--text-body-sm);
  color: var(--color-muted);
  line-height: 1.4;
}

/* Lightbox for gallery images */
.proj-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(11, 15, 20, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  backdrop-filter: blur(6px);
}

.proj-lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}

.proj-lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--color-white);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.proj-lightbox__close:hover {
  background: rgba(255,255,255,0.2);
}
