/* Support for the Ikara font properly displaying in browser */
@font-face {
    font-family: 'Ikara';
    src: url('/assets/okiikara.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* Handle default font size for Ikara */
.ikara {
    font-family: 'Ikara', sans-serif;
}

/* Fonts & Global Styles */
body {
    margin: 0;
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    background-color: #F5F1EB;
    color: #2E2E2E;
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    color: #2E2E2E;
    margin-bottom: 0.5em;
}

h1.ikara {
    font-size: 3.5rem;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.site-header {
    background-color: transparent;
    padding: 1em 0;
    border-bottom: 1px solid #D8D2CA;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Ikara', sans-serif;
    font-size: 2rem;
    background-color: #C2543D;
    color: white;
    padding: 0.25em 0.6em;
    padding-bottom: 0;
    border-radius: 0.3em;
    display: block;
    text-decoration: none;
    width: 40px;
    max-width: 30px;
}

.main-nav a {
    margin-left: 1.5em;
    text-decoration: none;
    color: #7B6F63;
    font-weight: 500;
}

.main-nav a:hover {
    color: #C2543D;
}

/* Hero */
.hero {
    text-align: center;
    padding: 6em 1em;
    background: #F5F1EB;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5em;
}

.hero h1.ikara {
    font-size: 4rem;
    margin-bottom: -4rem;
    color: #C2543D;
    margin-top: 0;
}

.hero p, main#learn > p {
    font-size: 1.2rem;
    margin-bottom: 2em;
    color: #7B6F63;
}

.cta-button {
    background-color: #C2543D;
    color: white;
    text-decoration: none;
    padding: 0.75em 1.5em;
    border-radius: 30px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.cta-button:hover {
    background-color: #A35C45;
}

/* About Section */
.about {
    padding: 4em 1em;
    background-color: #FAF8F5;
}

.two-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 2em;
    align-items: center;
}

.about-text {
    flex: 1;
}

.about-text .ikara {
    font-size: 1.1em;
}

.about-image {
    flex: 1;
}

.fake-image {
    background-color: #E5E0DA;
    padding: 2em;
    font-size: 2rem;
    text-align: center;
    border-radius: 8px;
    color: #8C3B2F;
}

.highlight {
    color: #C2543D;
    font-weight: 600;
}

/* How It Works Section */
.how-it-works {
    padding: 4em 1em;
    background-color: #F5F1EB;
}

.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 2em;
    margin-top: 2em;
}

.card {
    flex: 1;
    min-width: 250px;
    background-color: #EFEAE3;
    padding: 2em;
    border-radius: 10px;
    border: 1px solid #D8D2CA;
}

.card h3 {
    color: #8C3B2F;
}

/* Footer */
.site-footer {
    background-color: #E5E0DA;
    text-align: center;
    padding: 2em 1em;
    color: #7B6F63;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .two-columns, .cards {
        flex-direction: column;
    }

    .main-nav a {
        margin-left: 1em;
    }
}

/* Error 404 */
main.error404  {
    text-align: center;
    padding: 6em 1em;
    background: #F5F1EB;
    position: relative;
}

main.error404::after {
    content: "404";
    position: absolute;
    font-size: 13rem;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    opacity: 25%;
}

main.error404 h1 {
    font-size: 3rem;
    margin-bottom: 0.5em;
    z-index: 1;
    position: relative;
}

main.error404 h1.ikara {
    font-size: 4rem;
    color: #C2543D;
}

/* About Ikara */
section.hero.about-ikara {
    padding: 0em 1em;
}

section.about.about-ikara h2, section.about.about-ikara h4 {
    text-align: center;
}

section.about.about-ikara hr {
    text-align: center;
    max-width: 20rem;
	opacity: 0.25;
	margin-bottom: 3em;
}

section.about.about-ikara p span.float-left {
	float: left;
	font-size: 3rem;
	font-weight: bold;
	color: #C2543D;
	margin-right: 0.05em;
	line-height: 1;
}

section.about.about-ikara blockquote {
	background: #E5E0DA;
	border-left: 0.25em solid #C2543D;
	padding: 0.25em 0.25em 0.25em 2em;
	font-style: italic;
	margin-top: 3em;
	margin-bottom: 3em;
}

section.about.about-ikara p.ikara {
	font-size: 2em;
}

/* Responsive for larger viewports */
@media (width <= 768px) {
	section.about.about-ikara blockquote {
		margin-left: 0;
		margin-right: 0;
	}
}

@media (width > 769px) {
    .logo {
        width: auto;
    }

    section.about.about-ikara article.container {
        max-width: 768px;
    }
}

/* Learn Ikara */
main#learn > h1, main#learn > p {
    text-align: center;
}

section#learning {
    background: #FAF8F5;
    padding: 4em 1em;
}

.sticky-toc .toc-container .toc, .congratulations p {
    background: #E5E0DA;
    border-radius: 8px;
    color: #8C3B2F;
    padding: 1.5rem 2rem;
}

.sticky-toc .toc-container .toc h2 {
    margin-top: 0;
}

.sticky-toc .toc-container .toc ol {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.sticky-toc .toc-container .toc ol li a {
    text-decoration: none;
    color: #8C3B2F;
}

.sticky-toc .toc-container .toc ol li ol {
    margin-left: 2em;
}

.sticky-toc .toc-container .toc > ol li ol li {
    position: relative;
}

.sticky-toc .toc-container .toc > ol li ol li::before {
    content: "\2023";
    position: absolute;
    left: -15px;
}

.sticky-toc .toc-container .toc .cta-button {
    margin-top: 20px;
    display: block;
    text-align: center;
}

#three-tones {
    display: flex;
    flex-direction: column;
    gap: 4em;
    margin: 3em 0;
    text-align: center;
}

#three-tones .tone div.ikara {
    font-size: 2em;
}

#three-tones .tone div.name {
    font-weight: bold;
}

#three-tones .tone span.ikara {
    font-size: 1.1em;
}

div.vowels {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    margin: 2em 0;
}

div.vowels span.vowel {
    flex-basis: 50%;
    text-align: center;
    font-size: 1.1em;
}

div.vowels span.vowel span.ikara {
    font-size: 2em;
    position: relative;
    top: 13px;
}

div.vowels span.vowel:first-child {
    flex-basis: 100%;
    flex-shrink: 0;
}

div.vowels span.vowel.lv {
    display: none;
}

div.consonants {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 2em;
}

div.consonants span.consonant {
    flex-basis: 20%;
    text-align: center;
    margin-bottom: 2em;
    font-size: 1.1em;
}

div.consonants span.consonant span.ikara {
    display: block;
    font-size: 2em;
}

div.voice {
    display: flex;
    justify-content: center;
}

div.voice div.consonants {
    max-width: 20rem;
}

div.consonants .plus, div.consonants .yield {
    position: relative;
    top: 13px;
}

span.ikara.iguolu {
    font-size: 1.1em;
}

div.progressions div.progression {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin: 2em 0;
}

div.progressions div.progression span {
    flex-basis: 20%;
    text-align: center;
}

div.progressions div.progression span.ikara {
    display: block;
    font-size: 2em;
}

div.statements {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

div.statements div.statement {
    flex-basis: 100%;
    display: flex;
    margin: 2em 0;
}

div.statements div.statement span {
    flex-basis: 12%;
    text-align: center;
}

div.statements div.statement span:last-child {
    flex-basis: 40%;
}

div.statements div.statement span.ikara {
    display: block;
    font-size: 1.2em;
}

p.strung-statements {
    text-align: center;
}

p.strung-statements span.ikara {
    font-size: 1.3em;
}

div.diacritics div.diacritic {
    display: flex;
    flex-direction: row;
    justify-content: center;
    padding: 1.5em 0;
}

div.diacritics div.diacritic > * {
    flex-basis: 33.3%;
    text-align: center;
}

div.diacritics div.diacritic .ikara {
    font-size: 2em;
    display: block;
}

/* Numerals */
div.numerals {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    text-align: center;
}

div.numerals > span {
    flex-basis: 25%;
}

div.numerals span.ikara:first-child {
    font-size: 2em;
}

div.dating-system {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

div.dating-system > span {
    flex-basis: 100%;
    text-align: center;
    margin-bottom: 2em;
}

div.dating-system span.ikara {
    font-size: 2em;
    display: block;
}

section#all-learning section.contents-container section#start-practicing {
    margin: 4rem 1.5rem;
    text-align: center;
}

section#all-learning section.contents-container > * {
    margin-bottom: 4rem;
}

/* Self Quiz */
#flashcard {
    background-color: #EFEAE3;
    border: 1px solid #D8D2CA;
    border-radius: 12px;
    padding: 2em;
    max-width: 500px;
    margin: 2em auto;
    text-align: center;
}

#question {
    font-size: 3rem;
    font-family: 'Noto Sans KR', sans-serif;
    color: #8C3B2F;
    margin-bottom: 1em;
}

#options {
    display: flex;
    flex-direction: column;
    gap: 1em;
    margin-bottom: 1em;
}

.option {
    background-color: #F5F1EB;
    color: #2E2E2E;
    border: 2px solid #D8D2CA;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.option:hover {
    background-color: #C2543D;
    color: white;
    border-color: #C2543D;
}

#feedback {
    font-weight: bold;
    margin-bottom: 1em;
    color: #C2543D;
}

#nextBtn {
    background-color: #C2543D;
    color: white;
    border: none;
    padding: 0.7em 1.5em;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    display: none;
    margin-top: 1em;
}

#nextBtn:hover {
    background-color: #A35C45;
}


.tab-buttons {
    display: flex;
    justify-content: center;
    gap: 1em;
    margin-top: 2em;
    margin-bottom: 2em;
    flex-wrap: wrap;
}

.tab {
    background-color: #EFEAE3;
    border: 1px solid #D8D2CA;
    padding: 0.5em 1.2em;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    color: #7B6F63;
    transition: 0.3s;
}

.tab:hover {
    background-color: #C2543D;
    color: white;
    border-color: #C2543D;
}

.tab.active {
    background-color: #C2543D;
    color: white;
    border-color: #C2543D;
}

/* Responsiveness for larger screens */
@media (width > 769px) {
    .sticky-toc {
        display: flex;
        flex-direction: row;
        gap: 3rem;
    }

    .sticky-toc .toc-container {
        flex-shrink: 0;
        width: 300px;
    }

    .sticky-toc .toc-container .toc {
        position: sticky;
        top: 50px;
    }

    #three-tones {
        margin: 2em 0;
        flex-direction: row;
        justify-content: space-evenly;
    }

    div.vowels span.vowel {
        flex-basis: 20%;
    }

    div.vowels span.vowel.sv {
        display: none;
    }

    div.vowels span.vowel.lv {
        display: inline;
    }

    div.numerals > span {
        flex-basis: 20%;
    }

    section#all-learning section.contents-container section#start-practicing {
        display: none;
    }
}

/* Practice page */
main#practice > h1, main#practice > p {
    text-align: center;
}

main#practice > p {
    font-size: 1.2rem;
    margin-bottom: 2em;
    color: #7B6F63;
}

section#practicing {
    background: #FAF8F5;
    padding: 4em 1em;
}

div#editor {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    background: #E5E0DA;
    border: 1px solid #D8D2CA;
    border-top: none;
}

div#editor div.ikara {
    position: relative;
    box-sizing: border-box;
    padding-top: 10px;
    padding-left: 5px;
    padding-right: 5px;
}

div#editor div, div#editor textarea {
    width: 100%;
    background: none;
    border: none;
    border-bottom: 2px solid #ccc;
    resize: none;
    text-decoration: none;
    outline: none;
    font-size: 1.5em;
    min-height: 55px;
}

div#editor textarea {
    display: none;
}

div#editor div span.textcursor {
    line-height: inherit;
    background: #ccc;
    display: inline-block;
    width: 2px;
    height: 1.5em;
    position: absolute;
    top: 10px;
    left: 3px;
}

div#keyboard-desktop, div#keyboard-mobile {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 1000px;
    margin: auto;
}

div#keyboard-desktop {
    display: none;
}

div#keyboard-mobile {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    max-width: 340px;
}

div#keyboard-desktop div.row, div#keyboard-mobile div.column {
    display: flex;
    justify-content: center;
    gap: 5px;
}

div#keyboard-mobile div.column {
    flex-direction: column;
    justify-content: flex-start;
}

.key, .key .options {
    position: relative;
    width: 60px;
    height: 60px;
    background: white;
    border: 2px solid #ccc;
    border-radius: 6px;
    text-align: center;
    font-size: 1.5rem;
    line-height: 60px;
    box-sizing: border-box;
    padding-top: 5px;
    user-select: none;
}

.key .options {
    position: absolute;
    top: -2px;
    left: 0px;
    width: 100px;
    transform: translateX(-25%);
    z-index: 10000;
}

div#keyboard-mobile .key {
    width: 60px;
}

div#keyboard-mobile div.column.controls .Space,
div#keyboard-mobile div.column.controls .Tab,
div#keyboard-mobile div.column.toggles .Numbers,
div#keyboard-mobile div.column.toggles .Vowels,
div#keyboard-mobile div.column.toggles .Numbers-alt,
div#keyboard-mobile div.column.toggles .Vowels-alt.finals {
    flex-basis: 100%;
    flex-grow: 4;
}

div#keyboard-mobile div.column.toggles .Vowels:not(.toggle) {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
}

.key.wide {
    width: 97px;
}

.key.wider {
    width: 120px;
}

.key.widerer {
    width: 160px;
}

.key.widererer {
    width: 800px;
}

.key .eng {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 0.40em;
    line-height: 12px;
}

div#keyboard-mobile div.column.toggles .Numbers .ikara,
div#keyboard-mobile div.column.toggles .Vowels:is(.toggle) .ikara {
    line-height: 1.5;
    padding-top: 0;
    display: block;
    font-size: 0.7em;
}

div#keyboard-mobile div.column.toggles .Vowels:not(.toggle) .ikara {
    flex-basis: 50%;
    padding-top: 0;
    line-height: 0.75;
}

div#keyboard-mobile div.column .Numbers-alt.dates .ikara {
    font-size: 0.7em;
    line-height: 0;
}

.display-none, .numbers-display-none {
    display: none !important;
}

.pressed {
    background: #ccc;
}

div#practice-toggle {
    margin-top: 40px;
    margin-bottom: 10px;
    display: flex;
}

div#practice-toggle i {
    font-size: 2em;
    color: #7B6F63;
}

div#practice-toggle i.fa-toggle-on {
    color: #C2543D;
}

div#practice-toggle span {
    font-size: 1em;
    padding-top: 3px;
    padding-left: 10px;
    font-weight: bold;
}

div#practice-statements {
    background: #EFEAE3;
    border-radius: 10px 10px 0 0;
    border: 1px solid #D8D2CA;
    border-bottom: none;
    padding: 0.5em;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #7B6F63;
    overflow: hidden;
    height: 100px;
    transition: all 1s;
}

div#practice-statements.collapse {
    height: 0px;
    padding: 0px;
}

div#practice-statements span.highlight,
div#practice-statements span.romanization {
    padding-left: 5px;
}

div#practice-statements span.ikara {
    font-size: 1.5em;
    margin-top: 10px;
}

.keyhighlight {
    background: #C2543D;
    color: #EFEAE3;
}

/* Responsiveness */
@media (width > 769px) {
    section#practicing section.container {
        max-width: 768px;
    }

    div#practice-statements {
        height: 60px;
    }

    div#editor div {
        display: none;
    }

    div#editor textarea {
        display: block;
        width: 100%;
        max-width: auto;
        padding-left: 5px;
        padding-right: 5px;
    }

    div#keyboard-desktop {
        display: flex;
    }

    div#keyboard-mobile {
        display: none;
    }

    .key .eng {
        font-size: 0.5em;
    }

    .key .ikara {
        padding-top: 40px;
    }
}
