*.modal,
*.modal::after,
*.modal::before {
	box-sizing: border-box;
}

.modal:root {
	font-size: 18px;
	--color-text: #fff;
	--color-text-alt: #767474;
	--color-bg: #0b0a0a;
	--color-link: #aaa;
	--color-link-hover: #fff;
}

html {
	scroll-behavior: initial;
}

/* html, body{
	width: 100%;
	min-height: 100%;
} */

.modal {
    margin: 0;
    color: var(--color-text);
    font-family: botanika-mono-web, monospace;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;  /* garante que z-index funcionaria */
    display: grid;
    grid-template-areas: 'frame' 'page';
    grid-template-rows: auto 1fr;  /* forçar frame + conteúdo */
    height: 100vh;
    overflow-y: auto;  /* Habilita o scroll no modal */
}

.modal.content-open {
    overflow: hidden;
    height: 100vh;
    padding-right: var(--scrollbar-compensation, 0px);
}

.oh {
    position: relative;
    overflow: hidden
}

.oh__inner {
    will-change: transform;
    display: inline-block;
}

.oh__inner.green {
    background-color: #1a2b35;
    color: #fff !important;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: "IBM Plex Mono", monospace !important;
    /* background-color: rgb(75, 144, 79); */
    padding: 10px;
    /* border: 1px solid #ccc; */
    cursor: pointer;
}

.oh__inner.green:hover {
    background-color: #111;
   /* border: 1px solid rgba(255, 255, 255, 1); */
}

.line {
	transform-origin: 0;
	white-space: nowrap;
	will-change: transform;
}


.modal a {
	text-decoration: none;
	color: var(--color-link);
	outline: none;
	cursor: pointer;
}

.modal a:hover {
	color: var(--color-link-hover);
	outline: none;
}

.modal a:focus {
	outline: none;
	background: lightgrey;
}

.modal a:focus:not(:focus-visible) {
	background: transparent;
}

.modal a:focus-visible {
	outline: 2px solid red;
	background: transparent;
}

.modal .unbutton {
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	fill: currentColor;
	cursor: pointer;
	color: inherit;
	display: flex;
	align-items: center;
}

.modal .unbutton:focus {
	outline: none;
}

.modal .unbutton span:first-child {
	margin-right: 1rem;
}

.modal .unbutton span:last-child {
	margin-left: 1rem;
}

main.modal {
	position: relative;
	display: grid;
	grid-template-areas: 'frame' 'page';
}



.modal .frame {
	position: fixed !important;
	top: 0;
	left: 0;
	width: 120px;
	height: 100vh;
	background: #666666;
	color: var(--color-text);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: center;
	padding: 2rem 0;
	z-index: 1000;
	text-transform: uppercase;
    font-family: "IBM Plex Mono", monospace !important;
}


.frame__title_modal {
	grid-area: title;
	display: flex;
}

.frame__title_modal-main {
	font-size: 1rem;
	margin: 0;
	font-weight: normal;
	line-height: 1;
	align-self: center;
	text-align: right;
}

.frame__title_modal-back {
	position: relative;
	display: flex;
	align-items: flex-end;
	margin-bottom: 0.15rem;
}

.frame__title_modal-back span {
	display: none;
}

.frame__title_modal-back svg {
	fill: currentColor;
}

.frame__prev {
	grid-area: prev;
}

.preview-wrap {
    position: relative;
    grid-area: page;
    padding: 0 2rem 3rem;
    z-index: 100;
    height: 100%; /* garante que ela tenha conteúdo para forçar scroll */
}

.content-open .preview-wrap {
	pointer-events: none;
}

.modal .preview {
    position: relative; /* ADICIONE */
    height: 400px;
    padding: 0; /* Remova o padding-top desnecessário */
    margin: 0 auto 3rem; /* aqui: uns dois dedos de distância (~48px) */
    display: grid;
    grid-template-columns: 100%;
    grid-template-rows: 100%;
    will-change: transform;
    
    /* firefox */
    /* height: 100vh; */

}

.preview__img-wrap {
	grid-area: 1 / 1 / -1 / -1;
	cursor: pointer;
    
}

.preview__img {
	width: 100%;
	height: 100%;
	overflow: hidden;
	position: relative;
}

.preview__img-inner {
	width: 100%;
	height: 100%;
	background-size: 150%;
	background-position: 0% 0%;
	background-repeat: no-repeat;
}

.content__meta {
	margin-bottom: 2rem;
	color: var(--color-text-alt);
}

.preview__title {
    /* grid-area: 1 / 1 / 1 / 1; */
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* ou center no caso do demo, você quer "em cima da imagem" */
    padding: 2rem;
    pointer-events: none;
    position: relative;
    top: -400px;
}


.preview__title-main {
	line-height: 1.2;
	margin: 0;
	font-weight: normal;
	font-size: clamp(2rem,10vw,8rem);
	font-family: scotch-display, sans-serif;
	font-weight: 300;
    position: relative;
    top: calc(100% - 4rem);
    text-align: center;

    /* padding-top: 200px; */
}

.preview__title-main > span {
	display: block;
}

.preview__title-main > span:last-child {
	display: block;
	padding: 0 1rem;
	transform: translateY(-33%);
	font-family: scotch-display, sans-serif;
	font-weight: 500;
	font-style: italic;
    font-size: 0.4em;
}

.preview__desc {
	margin: 0 auto;
	max-width: 400px;
	text-transform: uppercase;
	line-height: 1.2;
    position: relative;
    top: calc(100% - 2rem);
}

.content-wrap {
	position: -webkit-sticky; /* Safari */
	position: sticky;
	top: 0;
	grid-area: page;
	height: 100vh;
	overflow: hidden;
	display: grid;
	grid-template-areas: 
	'back back'
	'content content';
	grid-template-rows: auto 1fr;
	pointer-events: none;
	padding: 0rem;
}

/* .modal .action {
	visibility: hidden;
	pointer-events: none;
	opacity: 0;
} */

.content-open .action {
	visibility: visible;
	pointer-events: auto;
}

.modal .action svg {
	width: 2em;
	height: 2em;
}

.modal .action--back {
	justify-self: end;
	grid-area: back;
	padding: 1rem 0;
    margin-right: 2em;
}

.modal .action span {
	text-transform: uppercase;
}

.content {
	grid-area: content;
	grid-row: 2 / span 2;
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	pointer-events: none;
	opacity: 0;
	display: grid;
	grid-gap: 2vw;
	grid-template-columns: 100%;
	grid-template-areas:
	'img' 
	'thumbs'
	'text';
	grid-template-rows: 20vh min-content auto;
}

.content--current {
	position: relative;
	pointer-events: auto;
	opacity: 1;
}

.content__group {
	grid-area: text;
}

.content__title {
	font-family: scotch-display, sans-serif;
	font-weight: 400;
	font-size: clamp(3rem,4.5vw,3.5rem);
	/* font-size: clamp(3rem,6.5vw,5.5rem); */
}

.content__title span {
	display: block;
    margin-bottom: 7px;
}

.content__title > span:last-child {
	transform: translateY(-25%);
	font-family: scotch-display, sans-serif;
	font-weight: 500;
	font-style: italic;
	padding: 0 0 0 0.75rem;
}

.content .preview__img {
	grid-area: img;
}

.content__thumbs {
	grid-area: thumbs;
	display: grid;
    grid-auto-columns: auto;
    grid-auto-flow: column;
    grid-gap: 2vw;
    justify-content: start;
}

.content__thumbs-item {
	width: 50px;
	aspect-ratio: 1.5;
}

.content__thumbs-item:hover {
	cursor: not-allowed;
}

.hidden {
	opacity: 0;
	pointer-events: none;
}



@media screen and (min-width: 53em) {
	main.modal {
		grid-template-areas: 'frame page';
		grid-template-columns: auto 1fr;
	}
.frame {
    position: sticky;
    top: 0;
    background: var(--color-bg);
    z-index: 10;
    padding: 2rem;
    /* Remover height: 100vh */
}
	.frame__title_modal, 
	.frame__prev,
	#cdawrap {
		justify-self: start;
		-webkit-writing-mode: vertical-rl;
		writing-mode: vertical-rl;
		transform: rotate(180deg);
	}

	body #cdawrap {
		justify-self: start;
	}

	.frame__prev {
		margin: 1rem 0 0;
	}

	.frame__title_modal-back {
		transform: scale3d(1,-1,1);
	}
	.modal .preview {
		height: 90vh;
        margin-left: 100px
	}
	.preview__desc {
		margin: -2.5rem auto 0;
	}
	.content {
    grid-template-columns: 60% 40%;
		grid-template-areas:
		'... ...' 
		'img text'
		'thumbs text'
		'... ...';
		grid-template-rows: 0rem 1fr auto 4rem;
        width: 100%;
        padding-left: 200px;
	}
	.content__thumbs-item {
		width: 100px;
	}
	.content__text {
		max-width: 400px;
        letter-spacing: 1px;
        text-transform: uppercase;
	}
}

/* .frame.frame--view-open {
    position: fixed;
    top: 0;
    left: 0;
    width: auto; 
    height: 100vh;
    background: var(--color-bg);
    z-index: 2000;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
} */

frame frame--view-open{
    position: fixed;
}

.preview__desc{
    color: #fff;
}

.modal .oh__inner, .modal .preview__desc {
    will-change: transform, color;
    display: inline-block;
    transition: color 1.6s cubic-bezier(0.65, 0, 0.35, 1); /* comece bem devagar e termine rápido (refinado) */
}

.modal.done .oh__inner, .modal.done .preview__desc {
    color: #000;
    transition-duration: 1.6s;
    transition-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
}

.modal:not(.done) .oh__inner, .modal:not(.done) .preview__desc {
    color: #fff;
    transition-duration: 0.4s;
    transition-timing-function: ease-in;
}

/* --- */

.footer-seo-text {
	background: #111;
	/* background: #12161e; */
	color: rgba(255, 255, 255, 0.85);
	font-size: 1rem;
	line-height: 1.5;
	text-align: center;
	width: 100%;
	margin: 0 auto;
	padding: 20px;
	text-align: left;
    border-top: 4px solid rgba(255, 255, 255, 0.8);
}

.footer-seo-text a{
    color: #fff;
}