/* Preface Page - Royal Manuscript Styling */

/* Import Google Fonts for elegant typography */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

/* Body background for preface pages */
body {
    background: linear-gradient(135deg, 
        #f4f1e8 0%, 
        #f0ead6 25%, 
        #f4f1e8 50%, 
        #f0ead6 75%, 
        #f4f1e8 100%);
    background-attachment: fixed;
}

/* Main Container */
.preface-main {
    min-height: 100vh;
    background: linear-gradient(135deg, 
        #f4f1e8 0%, 
        #f0ead6 25%, 
        #f4f1e8 50%, 
        #f0ead6 75%, 
        #f4f1e8 100%);
    padding: 3rem 1rem;
    position: relative;
    margin-top: 2rem;
    padding-top: 3rem;
}

/* Subtle paper texture overlay */
.preface-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(139, 69, 19, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(139, 69, 19, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}
   

/* Manuscript Container */
.manuscript-container {
    max-width: 900px;
    margin: 0 auto;
    background: linear-gradient(145deg, #fefcf7 0%, #faf8f0 100%);
    border: 3px solid #d4af37;
    border-radius: 20px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

/* Decorative border pattern */
.manuscript-container::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 2px solid #c9a96e;
    border-radius: 15px;
    pointer-events: none;
}

/* Corner decorations - REMOVED */

/* Manuscript Header */
.manuscript-header {
    text-align: center;
    padding: 2rem 3rem 1.5rem;
    position: relative;
}

/* Royal Ornaments */
.royal-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
}

.ornament-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, 
        transparent 0%, 
        #d4af37 20%, 
        #c9a96e 50%, 
        #d4af37 80%, 
        transparent 100%);
    margin: 0 1rem;
}

.ornament-center {
    font-size: 2rem;
    color: #d4af37;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    padding: 0 1rem;
    font-family: 'Times New Roman', serif;
}

/* Manuscript Title */
.manuscript-title {
    font-family: 'Cinzel', serif;
    font-size: 4rem;
    font-weight: 700;
    color: #2d4a2b;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
    letter-spacing: 3px;
    position: relative;
}

.manuscript-title::before,
.manuscript-title::after {
    content: '❦';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: #d4af37;
}

.manuscript-title::before {
    left: -4rem;
}

.manuscript-title::after {
    right: -4rem;
}

.subtitle {
    font-family: 'Crimson Text', serif;
    font-size: 1.3rem;
    color: #5a6b3a;
    font-style: italic;
    margin-top: 1rem;
}

.arabic-subtitle {
    font-family: 'Amiri', 'Times New Roman', serif;
    font-size: 2rem;
    color: #2d4a2b;
    direction: rtl;
    line-height: 1.8;
    font-style: normal;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    margin-top: 1.5rem;
}

/* Manuscript Content */
.manuscript-content {
    padding: 1rem 4rem 2rem;
    position: relative;
}

/* RTL Language Support for Initial Letter */
[dir="rtl"] .initial-letter-container {
    float: right;
    margin: 0 0 0.5rem 1rem;
}

[dir="rtl"] .preface-text {
    text-align: justify;
    direction: rtl;
}

[dir="rtl"] .preface-text p {
    text-indent: 2rem;
    padding-right: 0;
    padding-left: 0;
}

[dir="rtl"] .preface-text p:first-child {
    padding-right: 0;
}

[dir="rtl"] .opening-paragraph {
    padding-right: 0;
}

[dir="rtl"] .sacred-quote {
    border-left: none;
    border-right: 4px solid #d4af37;
    border-radius: 15px 0 0 15px;
}

[dir="rtl"] .author-signature {
    text-align: left;
    padding-left: 2rem;
    padding-right: 0;
}

[dir="rtl"] .signature-ornament {
    justify-content: flex-start;
}

[dir="rtl"] .signature-text {
    text-align: left;
}

/* Urdu font styling for post pages */
[dir="rtl"] .preface-text {
    font-family: 'Times New Roman', serif;
}

[dir="rtl"] .quote-text {
    font-family: 'Times New Roman', serif;
}

/* Decorative Initial Letter */
.initial-letter-container {
    float: left;
    margin: 0 1rem 0.5rem 0;
    position: relative;
}

.initial-letter {
    font-family: 'Cinzel', serif;
    font-size: 6rem;
    font-weight: 700;
    color: #d4af37;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 0.8;
    display: block;
    position: relative;
    z-index: 2;
}

.initial-decoration {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(ellipse at center, 
        rgba(212, 175, 55, 0.1) 0%, 
        rgba(212, 175, 55, 0.05) 50%, 
        transparent 70%);
    border-radius: 50%;
    z-index: 1;
}

/* Preface Text */
.preface-text {
    font-family: 'Crimson Text', serif;
    font-size: 1.2rem;
    line-height: 1.8;
    color: #2c3e2a;
    text-align: justify;
}

.opening-paragraph {
    margin-top: 0;
    text-indent: 0;
}

.preface-text p {
    margin-bottom: 1.5rem;
    text-indent: 2rem;
}

.preface-text p:first-child {
    text-indent: 0;
}

/* Sacred Quote Styling */
.sacred-quote {
    margin: 2rem 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, 
        rgba(212, 175, 55, 0.08) 0%, 
        rgba(201, 169, 110, 0.05) 100%);
    border-left: 4px solid #d4af37;
    border-radius: 0 15px 15px 0;
    position: relative;
    font-style: normal;
}

.quote-ornament {
    font-size: 2rem;
    color: #d4af37;
    font-family: 'Times New Roman', serif;
    position: absolute;
}

.quote-ornament:first-child {
    top: -5px;
    left: 10px;
}

.quote-ornament.closing {
    bottom: -10px;
    right: 10px;
}

.quote-text {
    font-family: 'Crimson Text', serif;
    font-size: 1.4rem;
    font-style: italic;
    color: var(--primary-green);
    margin: 0.5rem 1.5rem;
    text-align: center;
    line-height: 1.5;
}

.quote-reference {
    display: block;
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    color: var(--primary-green);
    margin-top: 0.5rem;
    font-weight: 600;
}

/* Author Signature */
.author-signature {
    margin-top: 4rem;
    text-align: right;
    padding-right: 2rem;
}

.signature-ornament {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 2rem;
}

.signature-line {
    flex: 1;
    max-width: 100px;
    height: 1px;
    background: linear-gradient(to right, 
        transparent 0%, 
        #d4af37 50%, 
        transparent 100%);
    margin: 0 1rem;
}

.signature-symbol {
    font-size: 1.5rem;
    color: #d4af37;
}

.signature-text {
    font-family: 'Crimson Text', serif;
    text-align: right;
}

.signature-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2d4a2b;
    margin-bottom: 0.5rem;
}

.signature-date,
.signature-location {
    font-size: 1.1rem;
    color: #5a6b3a;
    font-style: italic;
    margin-bottom: 0.3rem;
}

/* Manuscript Footer */
.manuscript-footer {
    padding: 1rem 3rem 2rem;
    text-align: center;
}

.final-ornament .ornament-center {
    font-size: 1.5rem;
    letter-spacing: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .preface-main {
        padding: 2rem 0.5rem;
    }
    
    .manuscript-container {
        margin: 0 0.5rem;
        border-radius: 15px;
    }
    
    .manuscript-header {
        padding: 3rem 2rem 2rem;
    }
    
    .manuscript-title {
        font-size: 2.5rem;
        letter-spacing: 1px;
    }
    
    .manuscript-title::before,
    .manuscript-title::after {
        display: none;
    }
    
    .manuscript-content {
        padding: 1.5rem 2rem 3rem;
    }
    
    .initial-letter {
        font-size: 4rem;
    }
    
    .preface-text {
        font-size: 1.1rem;
    }
    
    .sacred-quote {
        margin: 2rem 0;
        padding: 1.5rem;
    }
    
    .quote-text {
        font-size: 1.2rem;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .manuscript-title {
        font-size: 2rem;
    }
    
    .manuscript-content {
        padding: 1rem 1.5rem 2rem;
    }
    
    .preface-text {
        font-size: 1rem;
        text-align: left;
    }
    
    .preface-text p {
        text-indent: 1rem;
    }
}

/* Print Styles */
@media print {
    .preface-main {
        background: white;
        padding: 0;
    }
    
    .manuscript-container {
        box-shadow: none;
        border: 2px solid #333;
    }
    
    .manuscript-title,
    .preface-text,
    .quote-text {
        color: #000 !important;
    }
    
    .ornament-center,
    .initial-letter,
    .quote-ornament {
        color: #333 !important;
    }
}