:root {
    --blue: #0062FB;
    --black: #131315;
    --black-rgb: 19, 19, 21;
    --neon-green: #D8FF00;
    --gray: #EDEDEB;
    --dark-grey: #cacaca;
    --darker-grey: #505050;
    --white: #FFFFFF;
    --white-rgb: 255, 255, 255;
}

/* -------------  Custom Font Styles ------------- */
@font-face {
    font-family: 'Aeonik-Regular';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/aeonik-regular.ttf') format('ttf');
    src: url('fonts/aeonik-regular.woff') format('woff');
}

@font-face {
    font-family: 'Aeonik-Medium';
    font-style: normal;
    font-weight: 600;
    src: url('fonts/aeonik-medium.ttf') format('ttf');
    src: url('fonts/aeonik-medium.woff') format('woff');
}

/* -------------  Globale Resets und Basis-Styles ------------- */
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
    display: block;
}

body {
    line-height: 1;
}

ol,
ul {
    list-style: none;
}

blockquote,
q {
    quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
    content: '';
    content: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    min-width: 220px;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    background: transparent;
    background-color: transparent;
}

body::-webkit-scrollbar {
    display: none;
}

body {
    font-family: 'Aeonik-Regular', sans-serif;
}

h1,
h2,
h3,
h4 {
    padding: 0;
    margin: 0;
}

h3 {
    color: var(--black);
    font-size: clamp(1.75rem, 4vw + 1rem, 2.75rem);
    font-weight: 500;
    line-height: 0.9;
}

p {
    color: var(--black);
    font-family: 'Aeonik-Regular', sans-serif;
    font-size: clamp(1rem, 1vw + 0.5rem, 1.3125rem);
}

a {
    color: var(--black);
    text-decoration: none;
}

a:-webkit-any-link {
    color: var(--black);
    text-decoration: none;
}

#iframe-container {
    padding: 40px 0;
    margin: 0 5vw;
}

.posts-grid-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 9px;
}

.post-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(var(--black-rgb), 0.1);
    aspect-ratio: 3 / 4;
    display: flex;
    flex-direction: column;
    color: var(--white);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-item:hover {
    transform: translateY(-3.5px);
    box-shadow: 0 12px 24px rgba(var(--black-rgb), 0.25);
}

.post-item-card {
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    overflow: hidden;
}

.post-item-content {
    position: relative;
    z-index: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    grid-column-start: 1;
    grid-column-end: 4;
    overflow: hidden;
}

.post-item-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--card-bg-image);
    background-size: cover;
    background-position: center;
    z-index: -3;
    transition: transform 0.6s cubic-bezier(0.2, 0.4, 0.4, 0.9);
}

.post-item-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(var(--white-rgb), 0);
    z-index: -2;
    transition: background-color 0.55s ease-in-out;
    pointer-events: none;
}

.post-item:hover .post-item-content::before {
    transform: scale(1.15) rotate(4deg);
}

.post-item:hover .post-item-content.has-details::after {
    background-color: rgba(var(--white-rgb), 0.85);
}

.post-item-content h3 {
    position: relative;
    display: block;
    padding-bottom: 5px;
    max-width: fit-content;
    font-size: clamp(1.75rem, 4vw + 1rem, 2.75rem);
    line-height: 1.2;
    color: var(--black);
}

.h3-title-large {
    font-size: clamp(1.25rem, 2vw + 0.7rem, 5rem) !important;
    line-height: 1.25 !important;
}

.h3-title-medium {
    font-size: clamp(1rem, 2vw + 0.6rem, 4rem) !important;
    line-height: 1.25 !important;
}

.h3-title-small {
    font-size: clamp(1rem, 2vw + 0.5rem, 4rem) !important;
    line-height: 1.3 !important;
}

.h3-title-xsmall {
    font-size: clamp(0.75rem, 2vw + 0.4rem, 4rem) !important;
    line-height: 1.35 !important;
}

.post-item-content h3::after {
    content: '';
    position: absolute;
    height: 14px;
    background-color: var(--neon-green);
    bottom: 8px;
    left: 0;
    right: 0;
    z-index: -1;
    background: linear-gradient(to right, #D8FF00 0%, #D8FF00 100%);
    background-size: 0% 10px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: background-size 0.35s cubic-bezier(0.65, 0.05, 0.36, 1);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    display: inline;
}

.post-item:hover .post-item-content h3::after {
    background-size: 100% 10px;
}

.cta-button {
    position: relative;
    display: inline-block;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 400;
    font-size: 0.9em;
    text-align: center;
    margin-top: auto;
    align-self: flex-start;
    background-color: var(--neon-green);
    color: var(--black);
    transition: transform 0.4s ease-in-out, background-color 0.3s, box-shadow 0.3s ease, color 0.3s ease-in-out;
}

.cta-button p {
    color: var(--black);
    transition: color 0.3s ease-in-out;
}

.cta-button:hover {
    background-color: var(--black);
    box-shadow: 0 6px 12px rgba(var(--black-rgb), 0.12);
    transform: scale(1.05);
}

.cta-button:hover p {
    color: var(--neon-green);
}

.card-details-text {
    position: relative;
    font-size: clamp(0.85rem, 1.2vw + 0.4rem, 1rem);
    color: var(--darker-grey);
    line-height: 1.4;
    margin-top: 12px;
    margin-bottom: 18px;
    opacity: 0;
    transform: translateX(-16px);
    transition-delay: 0.6s;
    transition: opacity 0.4s ease-out 0.15s, transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.15s;
    overflow: hidden;
    max-height: 65%;
}

.post-item:hover .card-details-text {
    opacity: 1;
    transform: translateX(0);
}

/* ------------- Responsive Design ------------- */

@media (max-width: 767px) {
    .posts-grid-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .post-item {
        background-color: var(--white);
        aspect-ratio: 2 / 1;
    }

    .post-item-content {
        padding: 15px;
        position: relative;
        padding-right: calc(40% + 20px);
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 8px;
        margin-top: -1vw;
    }

    .post-item-content::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        left: auto;
        width: 40%;
        height: 100%;
        background-image: var(--card-bg-image);
        background-size: cover;
        background-position: center;
        z-index: 0;
    }

    .card-details-text {
        opacity: 1;
        transform: none;
        color: var(--darker-grey);
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
        white-space: normal;
        height: 100%;
        max-height: none;
        margin: 0px;
        font-size: min(2.7vw, 18px);
        line-height: min(2.85vw, 22px);
    }

    .h3-title-large,
    .h3-title-medium,
    .h3-title-small,
    .h3-title-xsmall {
        font-size: clamp(0.55rem, 1.75vw + 0.5em, 5rem) !important;
        line-height: 1.1 !important;
    }

    .post-item-content h3::after {
        height: calc(1.5vw + 2px);
        bottom: 2px;
    }
}

@media (max-width: calc(410px + 10vw)) {
    .post-item-content {
        padding-right: calc(45% + 20px);
    }

    .cta-button {
        padding: 6px 12px;
    }

    .cta-button p {
        font-size: 3.5vw;
    }
}


@media (max-width: 480px) {
    .post-item-content {
        padding: 10px calc(40% + 12px) 10px 10px ;
    }

    .post-item-content::before {
        padding: 0 0px;
    }
}

/* ------------- Loader Styles ------------- */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    grid-column: 1 / -1;
    min-height: 200px;
}

.loader-container p {
    margin-top: 10px;
    font-size: 1rem;
    color: var(--darker-grey);
}

.loader {
    border: 4px solid var(--gray);
    border-top: 4px solid var(--blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ------------- Error Message Styles ------------- */
.error-message {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--darker-grey);
    padding: 40px 20px;
    font-size: 1rem;
}