@import url('https://fonts.googleapis.com/css2?family=Cardo:ital@0;1&family=Playfair+Display:wght@700&display=swap');

:root {
    --background-color: #000000;
    --text-color: #f0e9e9;
    --accent-color: #4a4a4a;
    --button-bg-color: #6d6d6d;
    --button-text-color: #ffffff;
}

* {
	box-sizing: border-box;
}

h1, h2 {
	font-family: 'Playfair Display', serif;
}

a {
	outline: none;
    color: var(--text-color);
    text-decoration: none;
}

body {
    font-family: 'Cardo', serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
	font-size: 20px;
}

main {
	position: relative;
	width: 100%;
	margin: auto;
	max-width: 1500px;
    display: flex;
    flex-direction: column;
    align-items: center;
	padding-bottom: 6rem;
}

button {
	border: none;
    margin: 0;
    padding: 0;
    width: auto;
    overflow: visible;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: normal;
    -webkit-font-smoothing: inherit;
    -moz-osx-font-smoothing: inherit;
    -webkit-appearance: none;

	border: 1px solid var(--text-color);
	padding: .5rem 1rem;
	color: var(--button-text-color);
	cursor: pointer;
	transition: all .3s ease-in-out;
}

button:hover {
	background-color: var(--text-color);
	color: var(--background-color);
}

button::-moz-focus-inner {
    border: 0;
    padding: 0;
}

main .poem-image {
	top: 2rem;
	width: 800px;
	max-width: 90vw;
	height: 70vh;
	max-height: 120vw;
	margin: auto;
	position: relative;
	filter: grayscale(100%);
    background-size: contain;
    background-position-x: center;
    background-repeat: no-repeat;
	animation: imageAppear 1s ease-in-out;
	box-shadow: inset;
}

main .poem-image::after {
	content: "";
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(transparent 0, black 70%, black 100%);
	/*max-width: 70%;
    left: 50%;
    transform: translateX(-50%);*/
}

nav.top-menu {
	position: sticky;
	top: 0;
	left: 0;
	width: 100%;
	padding: 0 2rem;
	z-index: 3;
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	transform: translateY(0);
	transition: transform 1s ease, opacity 1s ease-in-out;
	transform-origin: top;
	opacity: 1;
}

nav.top-menu.hide {
	transform: translateY(-100%);
	opacity: 0;
	pointer-events: none;
}

.container {
	z-index: 2;
    position: relative;
}

header {
    text-align: left;
	width: 0;
    white-space: nowrap;
    overflow: hidden;
	animation: headerAppear 1.5s cubic-bezier(0,.26,.44,.93) 1s;
	animation-fill-mode: forwards;
	cursor: pointer;
}

header h1 {
	margin-bottom: 0;
	font-size: 2rem;
}

header div {
	font-size: 1rem;
    font-style: italic;
    padding-left: 0.1rem;
}

section.hidden {
	display: none;
}

.poem {
    padding: 1rem;
    margin-bottom: 30px;
    border-radius: 5px;
}

#rant {
	max-width: 35.5rem;
	padding: 0 .5rem;
    margin: auto;
    text-align: justify;
	opacity: 0;
	animation: paragraphsAppear 1s ease-in-out;
	animation-fill-mode: forwards;
}

.main-card {
	width: 1000px;
	max-width: 90vw;
	margin-top: -5rem;
    border-radius: 10vw 10vw 0 0;
    overflow: hidden;
}

.poem-title {
	max-width: 400px;
	margin: auto;
    margin-top: 0;
	font-weight: bold;
	margin-top: -6rem;
    font-size: 3rem;
	text-align: center;
	text-shadow: 2px 2px 2px #000000;
	font-weight: bold;
	color: var(--text-color);
	padding-bottom: 1rem;
	opacity: 0;
	animation: titleAppear 1s ease-in-out;
	animation-fill-mode: forwards;
}

.poem-author {
	text-align: left;
    font-style: italic;
    font-size: 1.1em;
    font-family: 'Cardo', serif;
	margin: 3rem 0 2rem 0;
	width: 100%;
	max-width: 35rem;
	opacity: 0;
	animation: paragraphsAppear 1s ease-in-out;
	animation-fill-mode: forwards;
	text-decoration: underline;
    text-underline-offset: 0.3rem;
}

.poem-content {
    word-wrap: break-word;
	width: 100%;
	max-width: max-content;
	margin: auto;
}

.poem-content p {
	opacity: 0;
	animation: paragraphsAppear 1s ease-in-out;
	animation-fill-mode: forwards;
	line-height: 1.5714285;
	margin-block-start: 1.5em;
    margin-block-end: 1.5em;
}

.poem-content :nth-child(1) {animation-delay: 1s; }
.poem-content :nth-child(2) {animation-delay: 2s; }
.poem-content :nth-child(3) {animation-delay: 3s; }
.poem-content :nth-child(4) {animation-delay: 4s; }
.poem-content :nth-child(5) {animation-delay: 5s; }
.poem-content :nth-child(6) {animation-delay: 6s; }
.poem-content :nth-child(7) {animation-delay: 7s; }
.poem-content :nth-child(8) {animation-delay: 8s; }
.poem-content :nth-child(9) {animation-delay: 9s; }
.poem-content :nth-child(10) {animation-delay: 10s; }

.poem-content.loaded * {animation-delay: 0s !important; }

footer {
	width: 100%;
	position: fixed;
	bottom: 0;
	padding: 1rem 2rem;
	display: flex;
    justify-content: space-between;
	align-items: flex-end;
	z-index: 4;
}

.prev-poem {
	overflow: hidden;
    font-size: .9rem;
    width: 8rem;
    height: max-content;
    max-width: max-content;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
	transition: all .3s ease-in-out;
	border-bottom: 1px solid var(--text-color);
	background-color: black;
}

.prev-poem:hover {
	outline: 1px solid var(--text-color);
}

.prev-poem div.link-header {
	background: var(--text-color);
    width: 100%;
    color: black;
    text-align: left;
    padding: 0.2rem .5rem;
}

.prev-poem div.link-title {
	padding: .5rem;
}

.placehold {
	pointer-events: none;
}

.next-poem {
	text-align: right;
	overflow: hidden;
    font-size: .9rem;
    width: 8rem;
    height: max-content;
    max-width: max-content;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
	transition: all .3s ease-in-out;
	border-bottom: 1px solid var(--text-color);
	background-color: black;
}

.next-poem:hover {
	outline: 1px solid var(--text-color);
}

.next-poem div.link-header {
	background: var(--text-color);
    width: 100%;
    color: black;
    text-align: right;
    padding: 0.2rem .5rem;
}

.next-poem div.link-title {
	padding: .5rem;
}

.prev-poem div.link-title, .next-poem div.link-title {
	max-height: 0;
	padding: 0 .5rem;
	transition: max-height .250s ease, padding .250s ease;
}

.prev-poem.show div.link-title, .next-poem.show div.link-title {
	max-height: 100vh;
	padding: .5rem;
}

.prev-poem:hover div.link-title, .next-poem:hover div.link-title {
	max-height: 100vh;
	padding: .5rem;
}
#reveal {
	width: max-content;
	display: flex;
	flex-direction: column;
	align-items: center;
	z-index: 4;
	cursor: pointer;
	opacity: 0;
	animation: revealAppear 1s ease-in-out .5s;
	animation-fill-mode: forwards;
}
#reveal h2 {
	position: relative;
	overflow: hidden;
	font-size: 1rem;
	font-family: 'Cardo', serif;
	margin: 0;
	transition: all .3s ease-in-out;
	display: block;
    white-space: nowrap;
}
#reveal h2:after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	display: block;
	width: 100%;
	height: 2px;
	background: var(--text-color);
	transition: all .3s ease-in-out;
	transform: scaleX(0);
}
#reveal:hover h2:after {
	transform: scaleX(1);
}
#reveal svg {
	max-width: 3rem;
}

#reveal.open h2 {
	margin-top: -.5rem;
}

#editor {
	width: 100%;
	max-width: 52rem;
	padding: 1rem;
	margin-top: 1rem;
}

#editor h2.poem-title {
	margin-top: 2rem;
	margin-bottom: 2rem;
}

#editor .editorjs {
	margin-top: 2rem;
}

.edit-image {
	width: 100%;
	max-width: 100%;
	margin: auto;
	overflow: hidden;
	cursor: pointer;
	position: relative;
	border: 2px dashed white;
	animation: imageAppear 1s ease-in-out;
}

.edit-image .placeholder {
	height: 70vh;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.edit-image img {
	width: 100%;
	height: auto;
	max-height: 70vh;
	object-fit: contain;
	margin: auto;
	overflow: hidden;
	filter: grayscale(100%);
}

.edit-image input {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.tabs-container {
	border-radius: 5px;
}

.tabs {
	display: flex;
	justify-content: space-between;
}
.tabs .tab {
	flex: 1;
	text-align: center;
	padding: 1rem;
	border-bottom: 1px solid var(--text-color);
	cursor: pointer;
}

.tabs .tab.active {
	background-color: var(--text-color);
	color: var(--background-color);
}

.tabs .tab:not(.active):hover {
	background-color: var(--accent-color);
}

.tabs-container .tab-content {
	display: none;
	padding: 1rem;
}

.tabs-container .tab-content.current {
	display: block;
}

.actions {
	margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.feed {
	padding: 4rem 2rem;
	width: 100%;
	max-width: 1500px;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 1rem;
	z-index: 4;
}

a.poem-item {
	display: block;
	padding: 1rem;
	border-radius: 5px;
    border: 1px solid;
	cursor: pointer;
	transition: all .125s ease-in-out;
	background: var(--background-color);
}

.poem-item:hover {
	background-color: var(--text-color);
	color: var(--background-color);
	transform: scale(1.05);
}

.poem-item h2 {
	font-size: 1.6rem;
	margin: 1rem 0;
}

.poem-item div.poem-author {
	font-size: 1rem;
	margin: 1rem 0;
}

.poem-item time {
	font-size: 1rem;
	opacity: .8;
}

.poem-item.new {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	border: none;
}

.poem-item.new svg {
	height: 5rem;
	width: auto;
	fill: var(--text-color);
}

.poem-item.new:hover svg {
	fill: var(--background-color);
}


@keyframes underlineAnimate {
	0% {
		underline-offset: 0;
	}
	100% {
		underline-offset: 2rem;
	}
}

@keyframes revealAppear {
	0% {
		opacity: 0;
		transform: translateY(-20px);
	}
	100% {
		opacity: 1;
		transform: translateY(0);
	}
	
}
@keyframes headerAppear {
	0% {
		width: 0;
	}
	100% {
		width: 20rem;
	}	
}
@keyframes paragraphsAppear {
	0% {
		opacity: 0;
		transform: translateY(20px);
	}
	100% {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes titleAppear {
	0% {
		opacity: 0;
		transform: translateY(20px);
	}
	100% {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes imageAppear {
	0% {
		opacity: 0;
		transform: translateY(-20px);
	}
	100% {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 800px) {
	.poem-title {
		margin-top: -6rem;
	}
}

/* Responsive design */
@media (max-width: 450px) {
	nav.top-menu {
		padding: 0 1rem;
		margin-bottom: 3rem;
		background-color: var(--background-color);
	}
	header h1 {
		margin-top: 1rem;
		font-size: 1.5rem;
	}
	header div {
		font-size: .8rem;
	}
	#reveal h2 {
		font-size: .8rem;
		height: auto !important;
	}
	#reveal svg {
		max-width: 2rem;
	}
	.main-card {
		width: 100%;
		max-width: 100%;
		padding: 0 .5rem;
	}
	.poem-title {
		margin-top: -8rem;
		font-size: 2.5rem;
		padding-bottom: .5rem;
	}
    .poem {
        padding: 0rem;
    }
	.poem-content p {
		font-size: 1.1rem;
	}
	footer {
		background: black;
		padding: 0;
	}
	footer .prev-poem, footer .next-poem {
		flex: 1;
    	max-width: unset;
		border-bottom: 0;
	}
	footer .prev-poem {
		align-items: flex-start;
	}
	footer .next-poem {
		align-items: flex-end;
	}
	footer .prev-poem div.link-header, footer .next-poem div.link-header {
		border-right: 2px solid black;
		font-size: 1rem;
		padding: .2rem 1rem;
	}
	footer .prev-poem div.link-title, footer .next-poem div.link-title {
		font-size: .9rem;
	}
	footer .prev-poem div.link-title, .prev-poem.show div.link-title {
		padding-left: 1rem;
	}
	footer .next-poem div.link-title, .next-poem.show div.link-title{
		padding-right: 1rem;
	}
}

/* Dark and light theme variables */
.dark {
    --background-color: #282828;
    --text-color: #f0e9e9;
    --accent-color: #4a4a4a;
    --button-bg-color: #6d6d6d;
    --button-text-color: #ffffff;
}

.light {
    --background-color: #f5f5f5;
    --text-color: #1a1a1a;
    --accent-color: #ecf0f1;
    --button-bg-color: #d1d1d1;
    --button-text-color: #333333;
}