/* =========================================================
   AGAINST THE GRAIN — GLOBAL DESIGN SYSTEM v1
   Shared tokens/components only. Page composition stays in page CSS.
========================================================= */

:root {
    --atg-black: #050505;
    --atg-black-soft: #090909;
    --atg-cream: #f4efe6;
    --atg-gold: #b48a43;
    --atg-muted: #bbb4aa;
    --atg-neon-blue: #00e5ff;
    --atg-neon-purple: #8a2be2;
    --atg-neon-pink: #ff2d95;
    --atg-neon-orange: #ffb800;
    --atg-line: rgba(244, 239, 230, .14);
    --atg-gold-line: rgba(180, 138, 67, .28);
    --atg-container: 1450px;
    --atg-gutter: 40px;
    --atg-ease: cubic-bezier(.2, .7, .2, 1);
}

.atg-site,
.atg-site *,
.atg-site *::before,
.atg-site *::after {
    box-sizing: border-box;
}

.atg-site {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    background: var(--atg-black);
    color: var(--atg-cream);
}

.atg-container {
    width: 100%;
    max-width: var(--atg-container);
    margin: 0 auto;
    padding-right: var(--atg-gutter);
    padding-left: var(--atg-gutter);
}

/* ---------- Shared buttons ---------- */
.atg-button,
.atg-gallery__button,
.atg-reviews__button,
.atg-contact__button {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 15px 27px;
    color: var(--atg-cream);
    background: transparent;
    border: 1px solid var(--atg-gold);
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    text-transform: uppercase;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .12em;
    cursor: pointer;
    transition: color .3s ease, border-color .3s ease, transform .3s ease, box-shadow .3s ease, background-color .3s ease;
}

.atg-button--primary::before,
.atg-gallery__button::before,
.atg-reviews__button::before,
.atg-contact__button::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, var(--atg-neon-blue), var(--atg-neon-purple), var(--atg-neon-pink), var(--atg-neon-orange), var(--atg-neon-blue));
    background-size: 300% 100%;
    opacity: 0;
    transition: opacity .3s ease;
}

.atg-button--primary:hover,
.atg-button--primary:focus-visible,
.atg-gallery__button:hover,
.atg-gallery__button:focus-visible,
.atg-reviews__button:hover,
.atg-reviews__button:focus-visible,
.atg-contact__button:hover,
.atg-contact__button:focus-visible {
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(138, 43, 226, .22), 0 0 20px rgba(255, 45, 149, .16);
}

.atg-button--primary:hover::before,
.atg-button--primary:focus-visible::before,
.atg-gallery__button:hover::before,
.atg-gallery__button:focus-visible::before,
.atg-reviews__button:hover::before,
.atg-reviews__button:focus-visible::before,
.atg-contact__button:hover::before,
.atg-contact__button:focus-visible::before {
    opacity: 1;
    animation: atgGlobalGradient 2.5s linear infinite;
}

.atg-button--secondary {
    color: var(--atg-cream);
    border-color: rgba(244, 239, 230, .72);
}

.atg-button--secondary:hover,
.atg-button--secondary:focus-visible {
    color: var(--atg-black);
    background: var(--atg-cream);
    border-color: var(--atg-cream);
    transform: translateY(-2px);
}

.atg-button:focus-visible,
.atg-gallery__button:focus-visible,
.atg-reviews__button:focus-visible,
.atg-contact__button:focus-visible {
    outline: 2px solid var(--atg-neon-blue);
    outline-offset: 5px;
}

@keyframes atgGlobalGradient {
    from { background-position: 0% 50%; }
    to { background-position: 300% 50%; }
}

/* ---------- Shared natural media masonry ---------- */
.atg-media-grid {
    width: 100%;
    columns: 3;
    column-gap: 12px;
}

.atg-media-item {
    position: relative;
    isolation: isolate;
    display: inline-block;
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    margin: 0 0 12px;
    padding: 0;
    vertical-align: top;
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
}

.atg-media-item img,
.atg-media-item video {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: initial;
}

.atg-media-item__play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    padding-left: 4px;
    color: var(--atg-cream);
    background: rgba(5, 5, 5, .76);
    border: 1px solid rgba(244, 239, 230, .5);
    border-radius: 50%;
    box-shadow: 0 14px 38px rgba(0, 0, 0, .38), 0 0 22px rgba(138, 43, 226, .12);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* ---------- Universal media lightbox ---------- */
html.atg-media-lightbox-locked,
body.atg-media-lightbox-locked {
    overflow: hidden;
}

.atg-media-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    place-items: center;
    padding: clamp(18px, 4vw, 56px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .24s ease, visibility .24s ease;
}

.atg-media-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.atg-media-lightbox__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(0, 0, 0, .96);
    border: 0;
    cursor: zoom-out;
}

.atg-media-lightbox__stage {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: min(1500px, 100%);
    height: min(92dvh, 980px);
    pointer-events: none;
}

.atg-media-lightbox__media {
    display: grid;
    place-items: center;
    max-width: 100%;
    max-height: 100%;
    pointer-events: auto;
}

.atg-media-lightbox__media img,
.atg-media-lightbox__media video {
    display: block;
    width: auto;
    height: auto;
    max-width: min(1320px, calc(100vw - 150px));
    max-height: calc(100dvh - 110px);
    object-fit: contain;
    background: #050505;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .48);
}

.atg-media-lightbox__media video {
    width: min(1320px, calc(100vw - 150px));
}

.atg-media-lightbox__close,
.atg-media-lightbox__prev,
.atg-media-lightbox__next {
    position: fixed;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    color: var(--atg-cream);
    background: rgba(5, 5, 5, .72);
    border: 1px solid rgba(244, 239, 230, .24);
    border-radius: 50%;
    font: inherit;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color .25s ease, background-color .25s ease, transform .25s ease;
}

.atg-media-lightbox__close:hover,
.atg-media-lightbox__prev:hover,
.atg-media-lightbox__next:hover,
.atg-media-lightbox__close:focus-visible,
.atg-media-lightbox__prev:focus-visible,
.atg-media-lightbox__next:focus-visible {
    border-color: rgba(0, 229, 255, .7);
    background: rgba(5, 5, 5, .92);
}

.atg-media-lightbox__close:focus-visible,
.atg-media-lightbox__prev:focus-visible,
.atg-media-lightbox__next:focus-visible {
    outline: 2px solid var(--atg-neon-blue);
    outline-offset: 4px;
}

.atg-media-lightbox__close { top: 22px; right: 22px; }
.atg-media-lightbox__prev { top: 50%; left: 20px; transform: translateY(-50%); }
.atg-media-lightbox__next { top: 50%; right: 20px; transform: translateY(-50%); }
.atg-media-lightbox__prev:hover { transform: translate(-2px, -50%); }
.atg-media-lightbox__next:hover { transform: translate(2px, -50%); }

.atg-media-lightbox__caption {
    position: fixed;
    right: 88px;
    bottom: 22px;
    left: 88px;
    z-index: 3;
    margin: 0;
    color: rgba(244, 239, 230, .72);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    pointer-events: none;
}

@media (max-width: 900px) {
    :root { --atg-gutter: 28px; }
    .atg-media-grid { columns: 2; }
    .atg-media-lightbox__media img,
    .atg-media-lightbox__media video { max-width: calc(100vw - 88px); max-height: calc(100dvh - 100px); }
    .atg-media-lightbox__prev { left: 10px; }
    .atg-media-lightbox__next { right: 10px; }
}

@media (max-width: 650px) {
    :root { --atg-gutter: 18px; }
    .atg-media-grid { columns: 1; column-gap: 0; }
    .atg-media-item { margin-bottom: 10px; }
    .atg-button,
    .atg-gallery__button,
    .atg-reviews__button,
    .atg-contact__button { width: 100%; white-space: normal; }
    .atg-media-lightbox { padding: 12px; }
    .atg-media-lightbox__stage { width: 100%; height: 100dvh; }
    .atg-media-lightbox__media img,
    .atg-media-lightbox__media video { max-width: calc(100vw - 24px); max-height: calc(100dvh - 100px); }
    .atg-media-lightbox__close { top: 12px; right: 12px; }
    .atg-media-lightbox__prev,
    .atg-media-lightbox__next { top: auto; bottom: 14px; transform: none; }
    .atg-media-lightbox__prev { left: 14px; }
    .atg-media-lightbox__next { right: 14px; }
    .atg-media-lightbox__prev:hover,
    .atg-media-lightbox__next:hover { transform: none; }
    .atg-media-lightbox__caption { right: 74px; bottom: 24px; left: 74px; }
}

@media (prefers-reduced-motion: reduce) {
    .atg-button,
    .atg-button::before,
    .atg-gallery__button,
    .atg-gallery__button::before,
    .atg-reviews__button,
    .atg-reviews__button::before,
    .atg-contact__button,
    .atg-contact__button::before,
    .atg-media-lightbox,
    .atg-media-lightbox__close,
    .atg-media-lightbox__prev,
    .atg-media-lightbox__next {
        animation: none !important;
        transition: none !important;
    }
}

/* Portfolio videos uploaded through Studio Manager. */
.atg-portfolio-video {
    position: relative;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    color: inherit;
    font: inherit;
    text-align: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.atg-portfolio-video > video,
.atg-portfolio-video > img,
.atg-tattoos-gallery [data-atg-media-type="video"] > video,
.atg-piercings-gallery [data-atg-media-type="video"] > video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.atg-portfolio-video .atg-media-item__play {
    z-index: 4;
}
