/*
 * Art collection: /art-collection/ (templates/page-art-collection.php) and /art-piece/<slug>/ (single-sg_art.php).
 * All values measured on live (Elementor page 9042, loop item 9124, piece pages = "Art Detail" 9409, pop-up 9266,
 * Customizer CSS "Art Pieces"). Breakpoints as live: ≤1440 · ≤1280 · ≤1024 · ≤880 · ≤767 (sold ribbon: ≤768, ≤415).
 */

/* ------------------------------------------------------------------------------------------------------------
 * Collection page: intro.
 * ---------------------------------------------------------------------------------------------------------- */
.sg-art-intro { position: relative; z-index: 0; padding: 200px 0 65px; background: var(--c-bg); }
.sg-art-intro__graphic { position: relative; z-index: -1; max-width: 1440px; margin: 0 auto -33px; padding: 0 20px; line-height: 0; }
.sg-art-intro__graphic img { width: auto; max-width: 100%; height: auto; }
.sg-art-intro__box { width: min(1050px, 100% - 40px); margin-inline: auto; }
.sg-art-intro__head { margin-bottom: 34px; }
.sg-art-intro__heading { padding-right: 50px; color: var(--c-white); font-size: 50px; font-weight: 500; line-height: 1.2; }
.sg-art-intro__cols { display: flex; }
.sg-art-intro__col { flex: 0 0 49.891%; min-width: 0; padding: 5px 50px 0 0; color: var(--c-white); font-size: 16px; }
.sg-art-intro__col + .sg-art-intro__col { flex-basis: 50%; padding: 5px 0 0 50px; }
.sg-art-intro__col p { line-height: 36px; }

/* ------------------------------------------------------------------------------------------------------------
 * Collection page: grid of cards.
 * ---------------------------------------------------------------------------------------------------------- */
.sg-art-collection { position: relative; z-index: 1; padding: 0 20px 180px; }
.sg-art-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px; max-width: 1448px; margin: 0 auto; }

.sg-art-card { position: relative; }
.sg-art-card__link { display: block; height: 100%; color: var(--c-white); }
.sg-art-card__frame { position: relative; display: block; aspect-ratio: 1; padding: 5%; background: var(--c-art); }
.sg-art-card__img { width: 100%; height: 100%; object-fit: contain; }
.sg-art-card__view {
	position: absolute; inset: 0; z-index: 10;
	display: flex; align-items: center; justify-content: center; padding: 0 10px;
	background: rgba(0, 0, 0, .6); color: var(--c-white); font-size: 18px; line-height: 28.56px; text-align: center;
	opacity: 0; visibility: hidden; transition: all .5s;
}
.sg-art-card__link:hover .sg-art-card__view,
.sg-art-card__link:focus-visible .sg-art-card__view { opacity: 1; visibility: visible; }
.sg-art-card__link:focus-visible { outline: 1px solid var(--c-light); outline-offset: 3px; }
.sg-art-card__title { display: block; padding: 2% 0 1%; }
.sg-art-card__name { display: block; margin-top: 10px; color: var(--c-white); font-size: 18px; font-weight: 400; line-height: 26px; overflow-wrap: break-word; }

/* Sold: red corner + "SOLD" (Customizer CSS .art_categories-sold). The label is positioned on the whole card. */
.sg-art-card__sold {
	position: absolute; top: 6%; left: 7%; z-index: 10;
	color: var(--c-white); font-size: 14px; font-weight: 600; line-height: 28.56px;
	transform: rotate(-45deg); transform-origin: left bottom; pointer-events: none;
}
.sg-art-card.is-sold .sg-art-card__frame::before {
	content: ""; position: absolute; top: 0; left: 0; z-index: 9;
	width: 80px; height: 80px; background: #D40000; clip-path: polygon(0 0, 100% 0, 0 100%);
}

/* Cards rise 400px into place one after another, 250ms apart, on tablet and desktop (live custom code). */
@keyframes sgArtFadeUp { from { opacity: 0; transform: translateY(400px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 768px) {
	.js .sg-art-grid[data-sg-art-grid] > .sg-art-card { opacity: 0; transform: translateY(400px); }
	.js .sg-art-grid[data-sg-art-grid] > .sg-art-card.is-up { animation: sgArtFadeUp 1s ease-out forwards; }
}

/* Numbered pages (Customizer CSS .art-collect-section .page-numbers). */
.sg-art-pages { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 15px; margin-top: 50px; font-size: 16px; }
.sg-art-pages .page-numbers {
	display: flex; align-items: center; justify-content: center;
	min-width: 45px; min-height: 45px; padding: 5px;
	border: 1px solid var(--c-white); color: var(--c-white); line-height: 33px;
}
.sg-art-pages .page-numbers.current,
.sg-art-pages a.page-numbers:hover { background: var(--c-white); color: #000; }
.sg-art-pages .page-numbers.current { font-weight: 600; }
.sg-art-pages .page-numbers.dots { min-width: 0; min-height: 0; border: 0; background: transparent; color: var(--c-white); }

/* ------------------------------------------------------------------------------------------------------------
 * Art piece page.
 * Live sits in Convex's content box: 1290px (≥1440), 1100px (1280–1439), page − 40px (768–1279),
 * page − 50px (≤767); the Elementor section is 30px wider than that box.
 * ---------------------------------------------------------------------------------------------------------- */
.sg-art-piece { width: 1320px; max-width: calc(100% - 10px); margin: 0 auto; padding: 200px 0 91px; color: var(--c-white); }

.sg-art-piece__top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sg-art-piece__top-back { display: flex; flex-direction: column; justify-content: flex-end; position: relative; z-index: 1; padding-bottom: 26px; }
.sg-art-piece__top-graphic { position: relative; z-index: 0; }
.sg-art-piece__graphic { margin: 0 0 -38px 154px; line-height: 0; }
.sg-art-piece__graphic img { width: auto; max-width: 100%; height: auto; }

/* Back link (Elementor button: 16px 500, Font Awesome angle-left, line box of the body text). */
.sg-art-back { padding: 4px 0 6.9px; line-height: 0; }
.sg-art-back__link { display: inline-flex; align-items: center; gap: 5px; margin: -14px 0; padding: 14px 0; color: var(--c-white); font-size: 16px; font-weight: 500; line-height: 16px; } /* 44px hit area, same look */
.sg-art-back__link:hover, .sg-art-back__link:focus-visible { color: rgb(150, 153, 159); }
.sg-art-back__icon { width: 8px; height: 16px; }
.sg-art-back--bottom { display: none; }

.sg-art-piece__main { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 34px; }
.sg-art-piece__media { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; padding-right: 50px; }
.sg-art-piece__info { min-width: 0; padding-left: 50px; }

/* Frame: #E1E0DD, 4% padding, artwork contained. The inner area is square on desktop; live's spacer image
 * makes it 30px shorter on tablet and 50px taller on phones. */
.sg-art-piece__box { position: relative; container-type: inline-size; margin-bottom: 38px; padding: 4%; background: var(--c-art); }
.sg-art-piece__frame { display: block; width: 100%; aspect-ratio: 1; height: 100cqw; cursor: pointer; }
.sg-art-piece__img { width: 100%; height: 100%; object-fit: contain; }
.sg-art-piece__frame:focus-visible { outline: 1px solid #000; outline-offset: -1px; }

/* Sold: red corner grows in after 2s (Customizer CSS .sold-piece). */
@keyframes sgArtScaleUp { from { transform: scale(0); } to { transform: scale(1); } }
.sg-art-piece.is-sold .sg-art-piece__box::after {
	content: ""; position: absolute; top: 0; left: 0; z-index: 9;
	width: 100px; height: 100px; background: #D40000; clip-path: polygon(0 0, 100% 0, 0 100%);
	transform: scale(0); animation: sgArtScaleUp 1s linear 2s forwards;
}
.sg-art-piece__sold {
	position: absolute; top: 32px; left: 28px; z-index: 10;
	color: var(--c-white); font-size: 16px; font-weight: 600; line-height: 26.88px;
	transform: rotate(-45deg); transform-origin: left bottom; pointer-events: none;
}

/* Thumbnails (Elementor gallery, 1:1, image contained). */
.sg-art-piece__thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.sg-art-piece__thumb { display: block; aspect-ratio: 1; cursor: pointer; }
.sg-art-piece__thumb img { width: 100%; height: 100%; object-fit: contain; }

.sg-art-piece__title { color: var(--c-white); font-size: 50px; font-weight: 400; line-height: 1; }
.sg-art-piece__details { padding: 37px 0 64px; color: var(--c-white); font-size: 16px; }
.sg-art-piece__details p { line-height: 36px; }
.sg-art-piece__details strong { font-weight: 700; }
.sg-art-piece__desc { margin-top: 1.1em; }
.sg-art-piece__desc p { line-height: 36px; }
.sg-art-piece__enquire {
	display: inline-block; padding: 16px 60px;
	border: 1px solid var(--c-white); border-radius: 0; background: transparent;
	color: var(--c-white); font-size: 16px; font-weight: 400; line-height: 16px;
	transition: all .3s;
}
.sg-art-piece__enquire { position: relative; }
.sg-art-piece__enquire::after { content: ""; position: absolute; inset: -2px -1px; } /* ≥44px hit area on phones */
.sg-art-piece__enquire:hover, .sg-art-piece__enquire:focus-visible { background: var(--c-white); color: #000; }

/* ------------------------------------------------------------------------------------------------------------
 * Enquiry pop-up (Elementor pop-up 9266).
 * ---------------------------------------------------------------------------------------------------------- */
.sg-art-modal { background: rgba(0, 0, 0, .75); transition-duration: .5s; }
.sg-art-modal__dialog {
	display: flex; flex-direction: column; justify-content: center;
	max-width: 950px; padding: 60px 30px;
	background: #000; box-shadow: 0 0 50px 15px rgba(255, 255, 255, .15);
}
.sg-modal__close.sg-art-modal__close { position: absolute; top: 4px; right: 11px; width: 44px; height: 44px; }
.sg-art-modal__scroll {
	max-height: 82vh; margin: 0 15px; padding: 0 15px;
	overflow-x: hidden; overflow-y: auto;
	scrollbar-width: thin; scrollbar-color: #fff #777;
}
.sg-art-modal__scroll::-webkit-scrollbar { width: 7px; }
.sg-art-modal__scroll::-webkit-scrollbar-track { background: #777; border-radius: 10px; }
.sg-art-modal__scroll::-webkit-scrollbar-thumb { background: #fff; border-radius: 10px; }
.sg-art-modal__title { margin: 0 0 10px -4px; color: var(--c-white); font-size: 50px; font-weight: 500; line-height: 1.2; }
.sg-art-modal__text { padding: 10px 0 20px; color: var(--c-white); font-size: 17px; line-height: 2.25em; }

/* ------------------------------------------------------------------------------------------------------------
 * Breakpoints.
 * ---------------------------------------------------------------------------------------------------------- */
@media (max-width: 1440px) {
	.sg-art-piece__graphic { margin-left: 100px; }
	.sg-art-modal__dialog { padding: 45px 35px; }
	.sg-art-modal__title { font-size: 40px; }
}
@media (max-width: 1439px) {
	.sg-art-piece { width: 1130px; }
	.sg-art-piece__thumbs { gap: 5px; }
}
@media (max-width: 1280px) {
	.sg-art-intro__graphic-col { width: 50%; padding-right: 30px; }
	.sg-art-intro__head .sg-art-intro__heading { width: 50%; padding-right: 30px; font-size: 40px; }
	.sg-art-intro__col { flex-basis: 50%; padding-right: 30px; }
	.sg-art-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

	.sg-art-piece__top-back { padding: 0 30px 0 0; }
	.sg-art-piece__top-back .sg-art-back { margin: 0 0 15px 32px; }
	.sg-art-piece__top-graphic { padding-right: 30px; }
	.sg-art-piece__media { padding: 0 30px; }
	.sg-art-piece__info { padding: 0 30px; }
	.sg-art-piece__title { font-size: 40px; }
	.sg-art-modal__dialog { padding: 40px 30px; }
	.sg-art-modal__title { font-size: 36px; }
}
@media (max-width: 1279px) {
	.sg-art-piece { width: auto; max-width: none; margin-inline: 5px; }
}
@media (max-width: 1024px) {
	.sg-art-intro { padding: 220px 0 50px; }
	.sg-art-intro__graphic { margin-bottom: -20px; }
	.sg-art-intro__heading { font-size: 35px; }
	.sg-art-intro__head .sg-art-intro__heading { font-size: 35px; }
	.sg-art-intro__col { font-size: 14px; }
	.sg-art-intro__col p { line-height: 31.5px; }
	.sg-art-intro__col + .sg-art-intro__col { padding-left: 30px; }
	.sg-art-collection { padding-bottom: 80px; }
	.sg-art-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

	.sg-art-piece { padding: 140px 0 50px; }
	.sg-art-piece__top-back .sg-art-back { margin-left: 30px; }
	.sg-art-piece__graphic { margin-bottom: -20px; }
	.sg-art-piece__frame { height: calc(100cqw - 30px); }
	.sg-art-piece__thumbs { margin-top: -20px; }
	.sg-art-piece__title { font-size: 35px; }
	.sg-art-piece__details { font-size: 14px; }
	.sg-art-piece__details p, .sg-art-piece__desc p { line-height: 31.5px; }
	.sg-art-piece__cta { margin-top: 30px; }

	.sg-art-modal__dialog { max-width: 715px; }
	.sg-modal__close.sg-art-modal__close { top: 5px; right: 5px; }
	.sg-art-modal__close svg { width: 18px; height: 18px; }
	.sg-art-modal__text { font-size: 16px; line-height: 36px; }
	.sg-art-modal__title { font-size: 35px; }
}
@media (max-width: 1023px) {
	.sg-art-piece__thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
	.sg-art-piece__top-back .sg-art-back { margin-left: 22px; }
	.sg-art-piece__media { padding: 0 20px; }
	.sg-art-piece__info { padding: 0 20px; }
}
@media (max-width: 768px) {
	.sg-art-card__sold { top: 6%; left: 6%; font-size: 16px; }
	.sg-art-card.is-sold .sg-art-card__frame::before { width: 20%; height: 20%; }
	.sg-art-piece__sold { font-size: 15px; }
	.sg-art-modal__scroll::-webkit-scrollbar { width: 4px; }
}
@media (max-width: 767px) {
	.sg-art-intro { padding: 120px 0 50px; }
	.sg-art-intro__graphic { margin-bottom: -10px; }
	.sg-art-intro__graphic-col { width: 100%; padding-right: 0; }
	.sg-art-intro__graphic img { width: 260px; }
	.sg-art-intro__head { margin-bottom: 10px; }
	.sg-art-intro__head .sg-art-intro__heading { width: 100%; padding: 0 0 16px; font-size: 36px; }
	.sg-art-intro__cols { flex-direction: column; }
	.sg-art-intro__col, .sg-art-intro__col + .sg-art-intro__col { padding: 5px 0 0; }
	.sg-art-intro__col p { line-height: 2.57em; }
	.sg-art-collection { padding: 0 25px 80px; }
	.sg-art-grid { grid-template-columns: minmax(0, 1fr); }

	.sg-art-piece { margin-inline: 10px; padding: 100px 20px 50px; }
	.sg-art-piece__top { grid-template-columns: minmax(0, 1fr); padding-top: 1px; }
	.sg-art-piece__top-back { display: none; }
	.sg-art-piece__top-graphic { padding-right: 0; }
	.sg-art-piece__graphic { width: 260px; margin: 0 0 -19px; }
	.sg-art-piece__graphic img { width: 82%; }
	.sg-art-piece__main { grid-template-columns: minmax(0, 1fr); margin-bottom: 10px; }
	.sg-art-piece__media { order: 2; padding: 0; }
	.sg-art-piece__info { order: 1; padding: 0; }
	.sg-art-piece__frame { height: calc(100cqw + 50px); }
	.sg-art-piece__thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sg-art-back--bottom { display: block; margin-top: 20px; }
	.sg-art-piece__title { margin-bottom: 16px; font-size: 30px; }
	.sg-art-piece__details { padding: 0; }
	.sg-art-piece__details p, .sg-art-piece__desc p { line-height: 2.57em; }
	.sg-art-piece__cta { margin: 20px 0; }
	.sg-art-piece__enquire { padding: 13px 52px; font-size: 14px; line-height: 14px; }

	.sg-art-modal { padding-inline: 0; }
	.sg-art-modal__dialog { width: 90vw; max-width: none; padding: 50px 15px 40px; }
	.sg-art-modal__scroll { margin: 0; padding: 0 10px; }
	.sg-art-modal__title { margin: 0 0 16px; font-size: 19px; }
	.sg-art-modal__text { line-height: 2.57em; }
}
@media (max-width: 415px) {
	.sg-art-card__sold { top: 4%; left: 6%; font-size: 12px; }
	.sg-art-piece__sold { top: 20px; left: 22px; font-size: 12px; }
	.sg-art-piece.is-sold .sg-art-piece__box::after { width: 70px; height: 70px; }
}
