@font-face {
    font-family: 'Kidnapped At Old Times';
    src: url('kidnapped-at-old-times-free.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    /* Text sizing variables - adjust these to change text sizes globally */
    --text-size-base: clamp(1.1rem, 2.5vw, 1.5rem);
    --text-size-title: clamp(2.5rem, 6vw, 4rem);
    --text-size-subtitle: clamp(1.3rem, 3vw, 1.8rem);
    --text-size-nav: clamp(1.3rem, 2.5vw, 1.6rem);
    --text-line-height: 1.8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cormorant Garamond', serif;
    background: linear-gradient(135deg, #5d4037 0%, #3e2723 50%, #1b0000 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
}

.manuscript-container {
    max-width: 100%;
    width: 100%;
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.manuscript-content {
    background-image: url('background.png');
    background-size: 100% auto;
    background-position: center top;
    background-repeat: no-repeat;
    background-attachment: scroll;
    background-color: rgb(245, 230, 211);
    border-radius: 4px;
    padding: 0;
    position: relative;
    overflow: visible;
    width: 100%;
    max-width: 100vw;
    /* Calculate height to show full image - adjust percentage based on your image's aspect ratio */
    /* For a portrait-oriented manuscript, typically 1.4:1 or taller */
    min-height: calc(100vw * 1.4); /* Adjust 1.4 multiplier based on your image's height/width ratio */
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* Ornate Border Frame */
.ornate-border-frame {
    position: relative;
    width: 100%;
    min-height: calc(100vw * 1.4);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    padding-top: 2rem;
}

/* Border Sections - Hidden since background image has borders */
.border-top,
.border-bottom,
.border-left,
.border-right {
    display: none;
}

/* Simplified Border Patterns - Hidden */
.border-foliage,
.border-foliage-top,
.border-foliage-bottom,
.border-foliage-left,
.border-foliage-right {
    display: none;
}

.gold-bezants,
.bezants-left,
.bezants-right {
    display: none;
}

/* Main Content Area - Positioned in center of manuscript */
/* Size will be set dynamically by JavaScript based on image dimensions */
.manuscript-inner {
    position: relative;
    z-index: 5;
    background: rgb(245, 230, 211); /* 100% opaque parchment background */
    padding: 0.5rem 1rem 1rem 1rem;
    border-radius: 2px;
    /* Default fallback values - will be overridden by JavaScript */
    width: 75%;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0;
    /* Internal scrolling - fixed height with scroll */
    overflow-y: auto;
    overflow-x: hidden;
    /* Center the content in the center area of the background image */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Ensure content is always visible */
    opacity: 1 !important;
    visibility: visible !important;
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: #8d6e63 #f5e6d3;
}

.manuscript-inner::-webkit-scrollbar {
    width: 8px;
}

.manuscript-inner::-webkit-scrollbar-track {
    background: #f5e6d3;
    border-radius: 4px;
}

.manuscript-inner::-webkit-scrollbar-thumb {
    background: #8d6e63;
    border-radius: 4px;
}

.manuscript-inner::-webkit-scrollbar-thumb:hover {
    background: #6d4c41;
}

/* Illustration Area */
.illustration-area {
    margin-bottom: 3rem;
}

.illustration-frame {
    border: 4px solid #1a237e;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 10px,
            rgba(212, 175, 55, 0.1) 10px,
            rgba(212, 175, 55, 0.1) 12px
        ),
        linear-gradient(to bottom, #f5e6d3, #f0dfc8);
    padding: 8px;
    position: relative;
    box-shadow: 
        inset 0 0 0 2px #D4AF37,
        inset 0 0 0 6px #c62828,
        0 4px 8px rgba(0, 0, 0, 0.2);
}

.illustration-frame::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: 
        radial-gradient(circle at 2% 2%, #D4AF37 3px, transparent 3px),
        radial-gradient(circle at 98% 2%, #D4AF37 3px, transparent 3px),
        radial-gradient(circle at 2% 98%, #D4AF37 3px, transparent 3px),
        radial-gradient(circle at 98% 98%, #D4AF37 3px, transparent 3px);
    pointer-events: none;
}

.illustration-placeholder {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, rgba(245, 230, 211, 0.8), rgba(240, 223, 200, 0.8));
    border: 2px dashed #8d6e63;
}

.illustration-text {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: #4a3428;
    margin-bottom: 0.5rem;
}

.illustration-subtext {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: #6d4c41;
    font-style: italic;
}

/* Text Content - 2 columns with adjustable text size */
.manuscript-text {
    font-size: var(--text-size-base);
    line-height: var(--text-line-height);
    color: #2a1810;
    text-align: justify;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    /* 2 column layout */
    column-count: 2;
    column-gap: 2.5rem;
    column-rule: 1px solid rgba(139, 111, 71, 0.2);
    /* Prevent breaking across columns */
    break-inside: avoid;
}

/* Ornate Initial Letters Wrapper */
.initial-wrapper {
    float: left;
    position: relative;
    margin-right: 0.8rem;
    margin-top: 0.2rem;
    padding: 0.3rem;
    display: inline-block;
    break-inside: avoid;
}

.initial-blue-wrapper {
    background: transparent;
    border: none;
    padding: 0.5rem;
}

.initial-red-wrapper {
    background: transparent;
    border: none;
    padding: 0.5rem;
}

/* Attribution for background image - removed, moved to footer */

/* Initial Decoration - removed */
.initial-decoration {
    display: none;
}

/* Ornate Initial Letters */
.initial-letter {
    position: relative;
    font-family: 'Kidnapped At Old Times', 'Cinzel', serif;
    font-weight: normal;
    line-height: 0.85;
    z-index: 2;
    display: block;
}

.initial-blue {
    font-size: clamp(4.5rem, 8vw, 6.5rem);
    color: #1a237e;
    text-align: center;
    min-width: 80px;
}

.initial-red {
    font-size: clamp(4rem, 7.5vw, 6rem);
    color: #b71c1c;
    text-align: center;
    min-width: 75px;
}

/* Rubrics (red text) */
.rubric {
    color: #b71c1c;
    font-weight: 600;
    font-size: 1.1em;
}

/* Paragraphs */
.manuscript-text p {
    margin-bottom: 2rem;
    text-indent: 2rem;
    break-inside: avoid;
    page-break-inside: avoid;
}

.manuscript-text p:first-of-type {
    text-indent: 0;
}

.drop-cap {
    margin-top: 0;
    padding-left: 0;
    text-indent: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .manuscript-inner {
        padding: 2rem 3rem;
        width: 50%;
        margin-left: 8%;
        max-height: 75vh;
    }
    
    .manuscript-text {
        column-count: 2;
        column-gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .manuscript-content {
        background-size: contain;
        background-position: center top;
    }

    .manuscript-inner {
        padding: 1.5rem;
        width: 75%;
        margin-left: 5%;
        max-height: 70vh;
    }

    .manuscript-text {
        font-size: clamp(0.8rem, 2.5vw, 0.95rem);
        line-height: 1.5;
        column-count: 1; /* Single column on mobile */
        column-gap: 0;
    }

    .initial-blue {
        font-size: 4.5rem;
        min-width: 70px;
    }

    .initial-red {
        font-size: 4rem;
        min-width: 60px;
    }

    .illustration-placeholder {
        min-height: 200px;
    }

}

/* Additional decorative elements - removed since we're using the actual background image */
.manuscript-content::before {
    display: none;
}

/* Hover effects */
.initial-wrapper:hover {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

/* Navigation */
.manuscript-nav {
    text-align: center;
    margin-bottom: 1.5rem;
    margin-top: 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(139, 111, 71, 0.3);
    /* Prevent breaking across columns */
    break-inside: avoid;
    column-span: all;
}

.nav-link {
    display: inline-block;
    margin: 0 1.5rem;
    font-family: 'Cinzel', serif;
    font-size: var(--text-size-nav);
    color: #4a3428;
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #b71c1c;
    text-decoration: underline;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
    margin-top: 0;
    /* Prevent breaking across columns */
    break-inside: avoid;
    column-span: all;
}

.page-title {
    font-family: 'Cinzel', serif;
    font-size: var(--text-size-title);
    color: #4a3428;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-family: 'Cormorant Garamond', serif;
    font-size: var(--text-size-subtitle);
    color: #6d4c41;
    font-style: italic;
}

/* Publications */
.publications-list {
    max-width: 900px;
    margin: 0 auto;
}

.publication-item {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(139, 111, 71, 0.2);
}

.publication-item:last-child {
    border-bottom: none;
}

.publication-title {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: #4a3428;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.publication-details {
    font-size: 1rem;
    color: #6d4c41;
    margin-bottom: 1rem;
    font-style: italic;
}

.publication-journal {
    color: #b71c1c;
    font-weight: 600;
}

.publication-year {
    color: #1a237e;
}

.publication-abstract {
    font-size: 1rem;
    line-height: 1.6;
    color: #3a2a1f;
    margin-bottom: 1rem;
    text-align: justify;
}

.publication-links {
    margin-top: 1rem;
}

.pub-link {
    display: inline-block;
    margin-right: 1rem;
    padding: 0.3rem 0.8rem;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid #D4AF37;
    color: #1a237e;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.pub-link:hover {
    background: rgba(212, 175, 55, 0.2);
}

/* CV Page */
.cv-container {
    max-width: 900px;
    margin: 0 auto;
}

.cv-download {
    text-align: center;
    margin-bottom: 2rem;
}

.cv-download-link {
    display: inline-block;
    padding: 1rem 2rem;
    background: rgba(212, 175, 55, 0.15);
    border: 2px solid #D4AF37;
    color: #1a237e;
    text-decoration: none;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.cv-download-link:hover {
    background: rgba(212, 175, 55, 0.25);
    transform: scale(1.05);
}

.cv-embed {
    margin-top: 2rem;
}

.cv-pdf {
    width: 100%;
    height: 800px;
    border: 2px solid #8d6e63;
    background: #f5e6d3;
}

.cv-note {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #6d4c41;
    font-style: italic;
}

.cv-link {
    color: #b71c1c;
    text-decoration: underline;
}

/* CV page - single column layout */
.manuscript-text.cv-page {
    column-count: 1;
    column-gap: 0;
}

/* Footer - Professional and clear design */
.manuscript-footer {
    width: 100%;
    margin-top: 2rem;
    padding: 3rem 2rem;
    background: #2c1810;
    flex: 0 0 auto;
    position: relative;
    z-index: 10;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
    text-align: left;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-section-title {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #f5e6d3;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-link {
    display: inline-block;
    color: rgba(245, 230, 211, 0.9);
    text-decoration: none;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 400;
    transition: color 0.3s ease;
    line-height: 1.6;
}

.footer-link:hover {
    color: #f5e6d3;
    text-decoration: underline;
}

.footer-text {
    color: rgba(245, 230, 211, 0.8);
    font-size: 0.9rem;
    line-height: 1.6;
    font-family: 'Cormorant Garamond', serif;
}

.footer-attribution {
    color: rgba(245, 230, 211, 0.7);
    font-size: 0.85rem;
    line-height: 1.6;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    margin-top: 0.5rem;
}

.footer-attribution-link {
    color: rgba(245, 230, 211, 0.9);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.footer-attribution-link:hover {
    color: #f5e6d3;
}

/* Mobile responsive footer */
@media (max-width: 768px) {
    .manuscript-footer {
        padding: 2rem 1.5rem;
        margin-top: 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-section {
        align-items: center;
    }
    
    .footer-section-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .footer-links {
        align-items: center;
        gap: 0.5rem;
    }
    
    .footer-link {
        font-size: 0.9rem;
    }
    
    .footer-text {
        font-size: 0.85rem;
        text-align: center;
    }
    
    .footer-attribution {
        font-size: 0.75rem;
        text-align: center;
        line-height: 1.5;
    }
}

@media (max-width: 480px) {
    .manuscript-footer {
        padding: 1.5rem 1rem;
    }
    
    .footer-content {
        gap: 1.5rem;
    }
    
    .footer-section-title {
        font-size: 0.9rem;
    }
    
    .footer-link {
        font-size: 0.85rem;
    }
    
    .footer-attribution {
        font-size: 0.7rem;
    }
}

.illustration-frame:hover {
    box-shadow: 
        inset 0 0 0 2px #D4AF37,
        inset 0 0 0 6px #c62828,
        0 6px 12px rgba(0, 0, 0, 0.3);
    transition: box-shadow 0.3s ease;
}



