/* View Transitions */
@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.3s;
}

/* Root Variables */
:root {
    --primary-bg: #fff;
    --primary-text: #353d49;
    --secondary-text: #353d49;
    --link-color: #879094;
    --shadow-color: rgba(0, 0, 0, 0.15);
    --borders: #555;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-bg: #252627;
        --primary-text: #fff;
        --secondary-text: #fefefe;
        --link-color: #9fb1b6;
    }

    img {
        opacity: 90%;
    }
}

/* Font Faces */
@font-face {
    font-family: 'OpenSauceOne';
    src: url('/fonts/open-sauce-one-latin-400-normal.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'OpenSauceOne';
    src: url('/fonts/open-sauce-one-latin-700-normal.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}

/* Base Elements Styles */
* {
    user-select: text !important
}

html {
    background-color: var(--primary-bg);
}

body {
    position: relative;
    font-family: 'OpenSauceOne', sans-serif;
    color: var(--secondary-text);
    min-height: 100vh;
    margin: 0 auto;
    line-height: 1.6;
}

a,
a:visited {
    color: var(--link-color);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

a:hover,
a:focus {
    color: var(--primary-text);
}

details {
    padding: 0.5rem 0;
}

ul {
    padding: 0;
}

.list-post {
    padding: 0;
    padding-left: 1rem;
    padding-right: 1rem;
}

img {
    max-width: 100%;
}

figure {
    display: flex;
    justify-content: center;
    align-items: center;
}

figcaption {
    text-align: center;
    font-size: 0.9rem;
}

.form-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

form {
    display: flex;
    flex-direction: column;
    background: var(--primary-bg);
    padding: 20px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
}

label {
    margin: 10px;
    font-size: 0.85rem;
    color: var(--primary-text);
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--shadow-color);
    border-radius: 4px;
    box-sizing: border-box;
    background-color: var(--link-color);
    box-shadow: 0 4px 8px var(--shadow-color);
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    border-color: var(--link-color);
    outline: none;
}

button {
    width: 100%;
    padding: 10px;
    margin: 15px auto;
    background-color: var(--primary-text);
    color: var(--primary-bg);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

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

a.button {
    display: block;
    width: fit-content;
    padding: 10px 24px;
    margin: 3em auto 15px;
    background-color: var(--primary-text);
    color: var(--primary-bg);
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
}

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

::placeholder {
    color: var(--primary-bg);
}

.hidden {
    display: none;
}


/* Navigation Styles */
.nav-link {
    color: lightgray !important;
}

.nav-link:hover {
    color: white !important;
}

nav ul {
    display: flex;
    margin: 0.5rem 0;
    padding: 0;
}

nav ul li {
    display: inline;
    list-style: none;
    margin: 0.2rem 0;
}

nav.menu ul li {
    margin: 0 0.5rem;
}

nav a {
    text-decoration: none;
}

.container {
    display: flex;
}

.row {
    flex-direction: row;
}

.col {
    flex-direction: column;
}

aside.tableOfContentContainer {
    position: webkit-sticky;
    position: sticky;
    top: 100px;
    align-self: start;
    min-width: 200px;
    font-size: 0.9rem;
}

nav#TableOfContents li.active::before {
    content: "\279c";
    display: inline-block;
    width: 20px;
    margin-left: -20px;
}

nav#TableOfContents ul {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.pages a.active {
    font-weight: 1000;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    gap: 1em;
}

header .logo img {
    height: 50px;
    vertical-align: middle;
}

header .lang-picker {
    align-self: center;
}

header .space {
    flex: 1;
}

/* Hero Section Styles */
.hero {
    background-size: cover;
    min-height: 30vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-placeholder {
    position: relative;
}

.hero-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--hero-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 0;
}

.hero-placeholder.hero-loaded::after {
    opacity: 1;
}

.hero-placeholder > div {
    position: relative;
    z-index: 1;
}

.hero div {
    padding: 0 1rem;
}

.hero h1,
.hero p,
.hero .subtitle {
    margin: 0;
}

.hero h1 {
    font-size: 2rem;
    color: var(--primary-text);
}

.hero-hue h1,
.hero-hue a,
.hero-placeholder h1,
.hero-placeholder a {
    color: white;
}

.hero-hue .nav-link,
.hero-placeholder .nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
}

.hero-hue .nav-link:hover,
.hero-placeholder .nav-link:hover {
    color: white !important;
}

.photo-credit {
    position: absolute;
    bottom: 0.75rem;
    right: 0.25rem;
    z-index: 1;
    color: white;
    font-size: 0.7rem;
    writing-mode: vertical-rl;
    opacity: 0.7;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

/* Search Styles */

.hero .search form {
    padding: 2rem;
}

.form-inline {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 5px;
}

.form-inline input[type="text"] {
    flex-grow: 1;
    padding: 8px 12px;
    border: 1px solid var(--primary-bg);
    border-radius: 4px;
    outline: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-inline input[type="text"]:focus {
    border-color: var(--shadow-color);
}

.form-inline button {
    min-height: 34px;
    padding: 8px 16px;
    background-color: var(--link-color);
    color: var(--primary-bg);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-inline button:hover {
    background-color: var(--link-color);
}

ul.search-results {
    list-style-type: none;
}

ul.search-results li {
    padding: 0.5rem 1rem;
}

ul.search-results li a {
    font-weight: bold;
}

/* Blog Cards Styles */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 3rem;
    padding: 20px;
}

.card {
    background-color: transparent;
    transition: transform 0.4s ease;
}

.card:hover {
    transform: scale(1.02);
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card .card-visual {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: 10px;
    box-shadow: 0 16px 48px var(--shadow-color);
    overflow: hidden;
}

.card .card-color {
    position: absolute;
    inset: 0;
}

.card .card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0);
    transition: background 0.4s ease;
}

.card:hover .card-overlay {
    background: rgba(255, 255, 255, 0.15);
}

.card .card-overlay h2 {
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.card .text {
    padding: 0 1rem;
}

.card .text .small {
    font-size: 0.9rem;
}

.cards-shortcode .text {
    padding: 0;
}

.card a {
    color: var(--primary-text);
}

.blog-link, .blog-link:visited {
    text-decoration: none !important;
    color: var(--primary-text);
    margin-bottom: 0
}

/* Contact Section */
.contact {
    text-align: center;
    margin: 5rem auto;
}

/* Post Styles */
.post .post {
    width: 800px;
    max-width: 100%;
    margin-left: 1rem;
    margin-right: 1rem;
}

.post ul {
    padding-left: 2rem;
}

.post-data {
    font-size: 0.9rem;
}

.tag-container {
    display: block;
    padding-top: 2rem;
}

.tag {
    display: inline-block;
    padding: 0px 10px;
    font-size: 14px;
    border-radius: 15px;
    /* border: 1px solid var(--link-color); */
    text-decoration: none;
    margin-right: 0.25rem;
    margin-top: 0.25rem;
    background-color: var(--link-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.tag, a:visited.tag {
    color: var(--primary-bg);
    text-decoration: none !important;
}

/* Footer Styles */
footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    color: var(--primary-text);
    font-size: 0.8rem;
}

footer div {
    min-width: 5rem;
}

@media (prefers-color-scheme: dark) {
    footer .social-media a,
    footer .social-media a img {
        filter: brightness(50%) invert(75%);
    }
}

footer .social-media a img {
    height: 20px;
    padding: 0.5rem;
}

footer .logo {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

footer .logo img {
    height: 50px;
}

footer .logo p {
    margin: 5px 0 0;
    font-size: 0.8rem;
}

/* Pagination Styles */
.pagination {
    min-width: 90%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}

.pagination .pages {
    a {
        padding: 0 1rem;
    }
}

/* Markdown Styles */

.post h2 {
    margin-top: 3rem;
}

.e-content > h2 {
    text-align: center;
    font-size: 1.8rem;
}

.cards-shortcode {
    margin-bottom: 3rem;
}

/* Download Cards */
.download-cards {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 600px) {
    .download-cards {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 400px) {
    .download-cards {
        grid-template-columns: 1fr;
    }
}

.download-card .card-visual {
    height: 320px;
}

.download-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.download-stack .download-card .card-visual {
    height: calc(160px - 0.5rem);
}

.download-card .download-overlay {
    background: rgba(0, 0, 0, 0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.download-card .download-text {
    text-align: center;
    width: 100%;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.download-card .download-text h2 {
    margin: 0;
    font-size: 1.1rem;
    color: white;
}

.download-card .download-text p {
    text-align: center;
}

.download-card .download-text .small {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

.download-card .download-icon {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.download-card .download-icon svg {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.download-card:hover .download-overlay {
    background: rgba(0, 0, 0, 0.35);
}

.download-card:hover .download-icon {
    opacity: 1;
    transform: translateY(0);
}

.cards-shortcode h2 {
    margin: 0.5rem 0;
}

figure {
    flex-direction: column;
}

.e-content p {
    margin: 0;
    text-align: justify;
}

.cards-shortcode p {
    margin: 0;
}

.e-content p ~ p {
    padding-top: 0.6em
}

.e-content hr {
    max-width: 100px;
    margin-top: 5rem;
    margin-bottom: 1rem;
}

.e-content .img-caption,
.e-content figcaption > p {
    text-align: center;
    font-style: italic;
    max-width: 800px;
    margin: 1em auto;
    font-size: .9em;
    color: var(--secondary-text);
}

blockquote {
    border-left: 3px solid var(--borders);
    width: 70%;
    margin: 0 auto
}

blockquote p {
    margin-left: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em auto
}

table th {
    font-size: .9em;
}

@media (max-width: 370px) {
    table th {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(auto, 1fr))
    }
}


@media (max-width: 420px) {
    table tr {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(auto, 1fr))
    }
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em auto
}

table th {
    font-size: .9em;
}

@media (max-width: 370px) {
    table th {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(auto, 1fr))
    }
}


@media (max-width: 420px) {
    table tr {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(auto, 1fr))
    }
}

table td,
table th {
    padding: 5px;
    text-align: left;
    border: 1px solid var(--borders)
}

table td,
table th {
    padding: 5px;
    text-align: left;
    border: 1px solid var(--borders)
}

li > code, p > code {
    font-size: 0.9rem;
}

h2 > code {
    font-size: inherit;
    padding: 0;
}

/* Responsive Styles */
@media (max-width: 600px) {
    footer {
        flex-direction: column;
        text-align: center;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    aside.tableOfContentContainer {
        display: none;
    }
}

.hero {
    margin-bottom: 1rem;
}

@media (min-width: 641px) {
    .hero {
        min-height: 300px;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .container {
        margin: 3rem auto;
        max-width: 800px;
    }

    .post {
        max-width: 800px;
    }

    nav ul {
        padding: 0 !important;
    }

    nav ul li {
        margin-left: 1rem;
    }
}

/* Base style for code blocks */
pre {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    border-radius: 8px;
    overflow-x: auto;
    padding: 1em;
    line-height: 1.4;
    margin-bottom: 20px;
    transition: all 0.3s ease-in-out;
}

code {
    padding: 0.2em 0.4em;
}

pre,
code {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
}

.p-name {
    text-align: center;
}


/* Calendar */
.fc-list-view tbody {
    display: flex;
    flex-direction: column-reverse;
}

.calendar-wrapper {
    margin-top: 0;
    width: 100%;
    text-align: center;
}

#calendar {
    width: 100%;
}

#calendar .fc-button-primary[aria-pressed=false] {
    background-color: rgba(175, 175, 175, 0.2);
    color: #b2b2b2;
    border-color: #b2b1b1;
}

#calendar table * {
    background-color: transparent !important;
}

#calendar .fc-list-table {
    margin: 0;
}

#calendar .fc-list-day-cushion {
    display: none;
}

#calendar .fc-event {
    cursor: default
}

#calendar .fc-list-event-title {
    border-top: none !important;
}


#calendar .fc-list-event-name {
    font-weight: bold;
}

#calendar .fc-list-event-graphic {
    display: none;
}

#calendar .fc-list-event-description {
    white-space: break-spaces;
}

#calendar .fc-list-event-description a,
#calendar .fc-list-event-description a:visited {
    color: var(--link-color);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

#calendar .fc-list-event-description a:hover,
#calendar .fc-list-event-description a:focus {
    color: var(--primary-text);
    /*cursor: pointer;*/
}

#calendar .fc-list-event-location {
    color: gray;
    font-style: italic;
}
