@import url('/css/interface_font.css');

/* Common content-page carousel styles. */

/* =========================
   CONFIG (change here only)
   ========================= */
:root {
	/* asymmetric carousel margins */
	--side-left: 20%;
	--side-right: 2%;
	--top: 2%;
	--bottom: 2%;

	/* button inset as % of CAROUSEL WIDTH */
	--btn-inset: 1%;
	--btn-opacity: 0.85;
	--tile-background: rgba(0, 0, 0, 0.2);
	--tile-hover-background: rgba(0, 0, 0, 0.9);

	/* HEADER OVERLAY INSETS (RELATIVE TO TILE) */
	--header-top: 2%;
	--header-bottom: 12%;

	/* text overlay insets RELATIVE TO TILE */
	--text-top: 5%;
	--text-side: 2%;
	--text-bottom: 2%;
	--text-size: 20px;
	--text-align: center;
	--text-opacity: .85;
	--text-color: #ffffff;
	--text-fade: 85%;



	/* OVERLAY (LEFT SPACE, PERCENT-BASED, NO CENTERING) */
	--overlay-top: var(--top);
	--overlay-left: var(--side-right);
	--overlay-width: calc(var(--side-left) - var(--side-right) - var(--side-right));
	--overlay-aspect: 3 / 4;
	--overlay-opacity: 0.8;
	--overlay-rotation: 0deg;

	/* SOCIAL OVERLAY */
	--social-bottom: calc(var(--bottom) + var(--bottom));
	--social-left:   var(--overlay-left);
	--social-width:  var(--overlay-width);
	--social-gap:    8%;
	--social-opacity: 0.9;
    /* Match the index text's combined colour alpha and parent opacities. */
    --index-foreground-opacity: calc(225 / 255 * 0.85 * 0.95);
}

/* baseline (match render.css) */
* { box-sizing: border-box; }

html { height: 100%; }
body {
	background-color: #000000;
	height: 100%;
	margin: 0;
	padding: 0;
	overflow: hidden;
}

/* full-page background */
#indexLanguage {
    order: -1;
    flex: 0 0 auto;
    transform: translateX(8px);
    padding: 0.6em 0.85em;
    border: 1px solid #ffffff40;
    border-radius: 5px;
    color: #fff;
    background: #0006;
    font: 12px var(--interface-font);
    cursor: pointer;
}

#indexLanguage:hover,
#indexLanguage:focus-visible { background: #000c; }
#indexLanguage:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
#indexLanguage:disabled { opacity: 0.5; cursor: wait; }

#index-bg {
	position: fixed;
	inset: 0;
	z-index: -1;
}

#index-bg canvas {
	display: block;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

/* =========================
   CAROUSEL BOUNDS
   ========================= */
#index-main {
	position: absolute;
	left: var(--side-left);
	right: var(--side-right);
	top: var(--top);
	bottom: var(--bottom);
	z-index: 1;
	display: flex;
}

/* carousel container */
#index-carousel {
	position: relative;
	width: 100%;
	height: 100%;
	padding: 8px;
}

/* =========================
   GLOBAL OVERLAY IMAGE
   ========================= */
#index-overlay {
	position: fixed;
	top: var(--overlay-top);
	bottom: var(--bottom);
	left: var(--overlay-left);
	width: var(--overlay-width);
	aspect-ratio: var(--overlay-aspect);
	height: auto;
	transform-origin: top left;
	transform: rotate(var(--overlay-rotation));
	opacity: var(--overlay-opacity);
	pointer-events: none;
	z-index: 10;
}

/* =========================
   CONTROLS OVERLAY
   ========================= */
.index-controls {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

/* buttons */
#indexPrev,
#indexNext {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: auto;
	padding: 8px 12px;
	border: 0;
	border-radius: 5px;
	margin: 0;
	color: #FFFFFF;
	background-color: #000000;
	font-family: var(--interface-font);
	font-size: 11px;
	cursor: pointer;
	text-transform: uppercase;
	opacity: var(--btn-opacity);
	z-index: 10;
}

#indexPrev:hover,
#indexNext:hover {
	background-color: #FFFFFF;
	color: #000000;
	opacity: 1;
}

#indexPrev { left: var(--btn-inset); }
#indexNext { right: var(--btn-inset); }

/* =========================
   TRACK + TILES
   ========================= */
#index-track {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	grid-template-rows: 1fr;
	gap: 12px;
	width: 100%;
	height: 100%;
}

.index-tile {
	position: relative;
	cursor: pointer;
	overflow: hidden;
	border-radius: 20px;
	background-color: var(--tile-background);
	opacity: 0.95;
	transition: transform 0.25s ease, background-color 0.25s ease;
	will-change: transform;
}

.index-tile:hover {
	transform: scale(1.02);
	background-color: var(--tile-hover-background);
}

/* =========================
   TILE HEADER (STATIC, NON-SCROLLING)
   ========================= */
.tile-header {
	position: absolute;
	top:    var(--header-top);
	bottom: var(--header-bottom);
	left:   var(--text-side);
	right:  var(--text-side);
	overflow: hidden;
	pointer-events: auto;
}

/* =========================
   TEXT OVERLAY
   ========================= */
.tile-overlay {
	position: absolute;
	top:    var(--text-top);
	bottom: var(--text-bottom);
	left:   var(--text-side);
	right:  var(--text-side);

	font-family: var(--interface-font);
	font-size: var(--text-size);
	font-style:  normal;
	font-weight: 400;
	font-synthesis: weight;
	line-height: normal;
	letter-spacing: normal;
	word-spacing: normal;
	text-transform: none;
	text-align: var(--text-align);

	color: var(--text-color);
	opacity: var(--text-opacity);       /* control strength here */

	text-shadow: none;

	user-select: auto;
	pointer-events: auto;

	white-space: pre-wrap;
	word-break: normal;
	text-overflow: clip;

	padding: 10px;
	overflow: hidden;
}

/* =========================
   INNER SCROLL CONTAINER
   ========================= */
.tile-text-scroll {
	width: 100%;
	height: 100%;
	overflow-y: auto;
	overflow-x: hidden;
	scrollbar-width: none;
	-webkit-mask-image: linear-gradient(
		to bottom,
		rgba(0,0,0,1) 0%,
		rgba(0,0,0,1) var(--text-fade),
		rgba(0,0,0,0) 100%
	);
	mask-image: linear-gradient(
		to bottom,
		rgba(0,0,0,1) 0%,
		rgba(0,0,0,1) var(--text-fade),
		rgba(0,0,0,0) 100%
	);
}

.tile-text-scroll::-webkit-scrollbar {
	display: none;
}

.tile-overlay p {
	margin: 0;
	line-height: 1.2;
	white-space: pre-wrap;
}

/* =========================
   SOCIAL MEDIA OVERLAY
   ========================= */
#index-social {
	position: fixed;
	left: var(--social-left);
	bottom: var(--social-bottom);
	width: var(--social-width);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--social-gap);
	pointer-events: auto;
	z-index: 11;
}

#index-social a {
	display: block;
	flex: 1 1 0;
	aspect-ratio: 1 / 1;
	opacity: var(--social-opacity);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

#index-social a:hover {
	opacity: 1;
	transform: scale(1.05);
}

#index-social img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	border: 0;
	padding: 0;
	margin: 0;
	pointer-events: none;
}

body[data-gallery]:not([data-gallery="page_00"]) {
    --text-top: 15%;
    --text-size: 16px;
    --text-align: left;
    --text-opacity: 1;
    --text-color: #ffffffe1;
    --text-fade: 95%;
}
.tile-header .header {
    font-family: var(--interface-font);
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    color: #ffffff;
}
.tile-text-scroll .body {
    font-family: var(--interface-font);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.3;
    color: #ffffffe1;
}
.index-tile { cursor: default; }
.index-tile[data-link] { cursor: pointer; }

/* Authored introduction paragraphs use normal HTML spacing inside the scrolling tile. */
.tile-text-scroll .oculus-introduction { white-space: normal; }
.tile-text-scroll .oculus-introduction p {
    white-space: normal;
    margin: 0 0 1em;
}
.tile-text-scroll .oculus-introduction p:last-child { margin-bottom: 0; }

.tile-text-scroll .oculus-introduction .webeditor-rendering-note {
    font-size: 14px;
    line-height: 1.4;
}

.tile-text-scroll .oculus-introduction .tile-call-to-action {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
}

.oculus-name { white-space: nowrap; }

.tutorial-description {
    display: grid;
    grid-template-columns: 2.5em minmax(0, 1fr);
    column-gap: 0.5em;
    row-gap: 0.4em;
    margin: 0 0 1em;
    text-align: left;
}

.tutorial-number {
    grid-column: 1;
    grid-row: 1;
    font-weight: 700;
}

.tutorial-description h3 {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    font-size: 1em;
    font-weight: 700;
    line-height: inherit;
}

.tile-text-scroll .tutorial-description p {
    grid-column: 2;
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.tutorial-video {
    display: block;
    width: 100%;
    max-width: 400px;
    height: auto;
    margin: 0 auto 1.5em;
    border-radius: 8px;
    background: #000;
}

.oculus-controls-picture {
    display: block;
    width: 50%;
    max-width: 100%;
    height: auto;
    margin: 1em auto;
}

/* Scale the compact specifications with the picture, independently of body text. */
.oculus-hardware-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    column-gap: 3%;
    margin: 1.5em 0;
    text-align: left;
    container-type: inline-size;
}

.oculus-hardware-overview .oculus-controls-picture {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.oculus-technical-data {
    min-width: 0;
    font-size: min(12px, 1.75cqi);
    line-height: 1.4;
}

.oculus-spec-list {
    display: grid;
    grid-template-columns: 4.5em minmax(0, 1fr);
    column-gap: 0.6em;
    row-gap: 1em;
    margin: 0;
}

.oculus-spec-list dt { font-weight: 700; }
.oculus-spec-list dd { margin: 0; }

/* Index controls sit at the right edge of the empty left sidebar. */
body[data-gallery="page_00"] #index-social {
    top: var(--top);
    bottom: auto;
    left: 0.75rem;
    width: calc(var(--social-left) + var(--social-width) - 0.75rem);
    justify-content: flex-end;
    gap: 12px;
}

body[data-gallery="page_00"] #indexLanguage {
    transform: none;
    margin-right: auto;
}

body[data-gallery="page_00"] #index-social a {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    opacity: var(--index-foreground-opacity);
}

body[data-gallery="page_00"] #index-social img { filter: invert(1); }


.project-logo {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin: 1.5em auto;
}

/* The source drawings remain unchanged: luminance removes their black backgrounds. */
.project-drawing {
    display: block;
    min-width: 0;
    aspect-ratio: 1;
    background: white;
    -webkit-mask-image: var(--drawing-mask);
    mask-image: var(--drawing-mask);
    mask-mode: luminance;
    mask-size: contain;
    mask-position: center;
    mask-repeat: no-repeat;
    opacity: var(--index-foreground-opacity);
}

.project-drawing img { display: none; }
.project-logo-placeholder { visibility: hidden; }

.project-logo-blend {
    position: fixed;
    margin: 0;
    z-index: 2;
    pointer-events: none;
    mix-blend-mode: difference;
}
