html {
    scroll-behavior: smooth;
}

.md-stories-archive,
.md-story {
    --md-primary: #E6C9C0;
    --md-primary-hover: #D5B4AA;
    --md-bg-light: #FDFBF7;
    --md-bg-dark: #1F1D1B;
    --md-surface-light: #FFFFFF;
    --md-surface-dark: #262626;
    --md-text-main: #333333;
    --md-text-light: #FDFBF7;
    --md-accent-pink: #EBC8C8;
}

.md-stories-archive .font-display,
.md-story .font-display {
    font-family: 'Playfair Display', serif;
}

.md-stories-archive .font-body,
.md-story .font-body {
    font-family: 'Lato', sans-serif;
}

.md-stories-archive .bg-background-light,
.md-story .bg-background-light {
    background-color: var(--md-bg-light) !important;
}

.md-stories-archive .bg-background-light\/95,
.md-story .bg-background-light\/95 {
    background-color: rgba(253, 251, 247, 0.95) !important;
}

.md-stories-archive .bg-surface-light,
.md-story .bg-surface-light {
    background-color: var(--md-surface-light) !important;
}

.md-stories-archive .bg-surface-dark,
.md-story .bg-surface-dark {
    background-color: var(--md-surface-dark) !important;
}

.md-stories-archive .bg-primary,
.md-story .bg-primary {
    background-color: var(--md-primary) !important;
}

.md-stories-archive .bg-primary-hover,
.md-story .bg-primary-hover {
    background-color: var(--md-primary-hover) !important;
}

.md-stories-archive .bg-primary\/20,
.md-story .bg-primary\/20 {
    background-color: rgba(230, 201, 192, 0.2) !important;
}

.md-stories-archive .bg-primary\/90,
.md-story .bg-primary\/90 {
    background-color: rgba(230, 201, 192, 0.9) !important;
}

.md-stories-archive .bg-accent-pink\/20,
.md-story .bg-accent-pink\/20 {
    background-color: rgba(235, 200, 200, 0.2) !important;
}

.md-card-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(230, 201, 192, 0.9);
    color: #ffffff;
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    z-index: 2;
}

.md-card-badge--article {
    background: rgba(230, 201, 192, 0.9);
}

.md-card-badge--story {
    background: rgba(230, 201, 192, 0.9);
}

.md-stories-archive .text-text-main,
.md-story .text-text-main {
    color: var(--md-text-main) !important;
}

.md-stories-archive .text-text-light,
.md-story .text-text-light {
    color: var(--md-text-light) !important;
}

.md-stories-archive .text-primary,
.md-story .text-primary {
    color: var(--md-primary) !important;
}

.md-stories-archive .text-primary-hover,
.md-story .text-primary-hover {
    color: var(--md-primary-hover) !important;
}

.md-stories-archive .text-primary\/60,
.md-story .text-primary\/60 {
    color: rgba(230, 201, 192, 0.6) !important;
}

.md-stories-archive .border-primary\/10,
.md-story .border-primary\/10 {
    border-color: rgba(230, 201, 192, 0.1) !important;
}

.md-stories-archive .border-primary\/20,
.md-story .border-primary\/20 {
    border-color: rgba(230, 201, 192, 0.2) !important;
}

.md-stories-archive .hover\:bg-primary-hover:hover,
.md-story .hover\:bg-primary-hover:hover {
    background-color: var(--md-primary-hover) !important;
}

.md-stories-archive .hover\:text-primary:hover,
.md-story .hover\:text-primary:hover {
    color: var(--md-primary) !important;
}

.md-stories-archive .hover\:text-primary-hover:hover,
.md-story .hover\:text-primary-hover:hover {
    color: var(--md-primary-hover) !important;
}

.md-stories-archive .hover\:border-primary:hover,
.md-story .hover\:border-primary:hover {
    border-color: var(--md-primary) !important;
}

.md-stories-archive .focus\:border-primary:focus,
.md-story .focus\:border-primary:focus {
    border-color: var(--md-primary) !important;
}

.md-stories-archive .focus\:ring-primary:focus,
.md-story .focus\:ring-primary:focus {
    box-shadow: 0 0 0 2px rgba(230, 201, 192, 0.4);
}

.md-stories-archive .focus\:ring-primary\/20:focus,
.md-story .focus\:ring-primary\/20:focus {
    box-shadow: 0 0 0 2px rgba(230, 201, 192, 0.2);
}

.md-stories-archive .from-primary,
.md-story .from-primary {
    --tw-gradient-from: #E6C9C0 var(--tw-gradient-from-position);
    --tw-gradient-to: rgba(230, 201, 192, 0) var(--tw-gradient-to-position);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.md-stories-archive .to-accent-pink,
.md-story .to-accent-pink {
    --tw-gradient-to: #EBC8C8 var(--tw-gradient-to-position);
}

.dark .md-stories-archive .dark\:bg-background-dark,
.dark .md-story .dark\:bg-background-dark {
    background-color: var(--md-bg-dark) !important;
}

.dark .md-stories-archive .dark\:bg-background-dark\/95,
.dark .md-story .dark\:bg-background-dark\/95 {
    background-color: rgba(31, 29, 27, 0.95) !important;
}

.dark .md-stories-archive .dark\:bg-surface-dark,
.dark .md-story .dark\:bg-surface-dark {
    background-color: var(--md-surface-dark) !important;
}

.dark .md-stories-archive .dark\:bg-surface-dark\/60,
.dark .md-story .dark\:bg-surface-dark\/60 {
    background-color: rgba(38, 38, 38, 0.6) !important;
}

/* Single story layout */
.md-story {
    background: var(--md-bg-light);
}

.md-story .story-hero-image {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(31, 17, 11, 0.12);
    background: #f4e7df;
}

.md-story .story-body {
    max-width: 760px;
    margin: 2.5rem auto 0;
    padding: 0 1.5rem 2rem;
    color: #5d5650;
    font-size: 1rem;
}

.md-story .story-body p,
.md-story .story-body .story-p {
    margin-bottom: 1.5rem;
    line-height: 1.9;
}

.md-story .story-body p:first-of-type::first-letter,
.md-story .story-body .story-p:first-of-type::first-letter {
    float: left;
    font-family: 'Playfair Display', serif;
    font-size: 3.2rem;
    line-height: 1;
    margin-right: 0.6rem;
    margin-top: 0.2rem;
    color: var(--md-primary-hover);
}

.md-story .story-body h2,
.md-story .story-body h3 {
    /*color: var(--md-text-main);*/
    margin: 2.5rem 0 1rem;
    font-family: 'Playfair Display', serif;
}

.md-story .story-body h2 {
    font-size: 1.7rem;
}

.md-story .story-body h3 {
    font-size: 1.35rem;
}

.md-story .story-body img,
.md-story .story-body .story-image {
    width: 100%;
    border-radius: 18px;
    margin: 2rem 0;
    box-shadow: 0 12px 24px rgba(31, 17, 11, 0.08);
}

.md-story .story-body blockquote {
    border-left: 4px solid var(--md-primary);
    background: #fff7f2;
    padding: 1.5rem 1.8rem;
    border-radius: 14px;
    margin: 2rem 0;
    font-style: italic;
    color: #584f49;
}

.md-story .story-body blockquote .quote-cite {
    display: block;
    margin-top: 0.75rem;
    font-style: normal;
    font-weight: 600;
    color: var(--md-primary-hover);
}

.md-story .story-body ul,
.md-story .story-body ol {
    padding-left: 1.5rem;
    margin: 1.5rem 0 2rem;
    list-style-position: outside;
}

.md-story .story-body ul {
    list-style-type: disc;
}

.md-story .story-body ol {
    list-style-type: decimal;
}

.md-story .story-body li {
    margin-bottom: 0.75rem;
}

.md-story .author-card {
    max-width: 760px;
    margin: 2.5rem auto 0;
    padding: 0 1.5rem;
}

.md-story .author-card-inner {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    background: #fff;
    border-radius: 18px;
    padding: 1.5rem 1.8rem;
    border: 1px solid rgba(230, 201, 192, 0.4);
    box-shadow: 0 12px 24px rgba(31, 17, 11, 0.06);
}

.md-story .author-card-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
}

.md-story .author-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--md-primary-hover);
    margin-bottom: 0.5rem;
}

.md-story .author-card-text {
    color: #6c6460;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.md-story .author-card-link {
    font-size: 0.85rem;
    color: var(--md-primary-hover);
    font-weight: 600;
    text-decoration: none;
}

.md-story .related-stories {
    max-width: 1100px;
    margin: 3.5rem auto 5rem;
    padding: 0 1.5rem;
}

.md-story .related-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.md-story .related-eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(93, 86, 80, 0.6);
}

.md-story .related-title {
    font-size: 2rem;
    margin-top: 0.4rem;
}

.md-story .related-link {
    font-size: 0.85rem;
    color: var(--md-primary-hover);
    text-decoration: none;
    font-weight: 600;
}

.md-story .related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.75rem;
}

.md-story .related-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(230, 201, 192, 0.3);
    box-shadow: 0 10px 20px rgba(31, 17, 11, 0.05);
    display: flex;
    flex-direction: column;
}

.md-story .related-image {
    position: relative;
    display: block;
    height: 190px;
    overflow: hidden;
}

.md-story .related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.md-story .related-card:hover img {
    transform: scale(1.05);
}

.md-story .related-image span {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(230, 201, 192, 0.9);
    color: #fff;
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.md-story .related-content {
    padding: 1.2rem 1.3rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
}

.md-story .related-meta {
    font-size: 0.75rem;
    color: #8a8079;
}

.md-story .related-content h3 {
    font-size: 1.05rem;
    color: var(--md-text-main);
}

.md-story .related-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #8a8079;
    margin-top: auto;
    border-top: 1px solid rgba(230, 201, 192, 0.25);
    padding-top: 0.85rem;
}

.md-story .related-footer a {
    color: var(--md-primary-hover);
    text-decoration: none;
    font-weight: 600;
}

.dark .md-story .story-body,
.dark .md-story .author-card-inner,
.dark .md-story .related-card {
    background: var(--md-surface-dark);
    color: #d5cdc6;
}

.dark .md-story .story-body blockquote {
    background: rgba(38, 38, 38, 0.7);
    color: #d5cdc6;
}

.dark .md-story .author-card-text,
.dark .md-story .related-meta,
.dark .md-story .related-footer {
    color: #b2aaa4;
}

@media (max-width: 768px) {
    .md-story .story-body {
        padding: 0 1.25rem 2rem;
    }

    .md-story .story-hero-image img,
    .md-story .story-body img,
    .md-story .story-body .story-image,
    .md-story-single-v2 .story-body img,
    .md-story-single-v2 .story-body .story-image {
        height: auto !important;
        max-width: 100%;
    }

    .md-story .author-card-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .md-story .related-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
    background: #262626;
}

::-webkit-scrollbar-thumb {
    background: #E6C9C0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #D5B4AA;
}
