body {
    font-family: 'Segoe UI', 'Georgia', 'Times New Roman', serif;
    font-size: 18px;
    line-height: 1.6;
    color: #333;
    background-color: #fcfcfc; /* Just slightly off-white for reading comfort */
    margin: 0;
    padding: 20px;
    max-width: 100%;
    /* Remove any fixed width constraints from legacy */
    width: auto !important; 
    box-sizing: border-box;
    text-align: justify; /* Justified text for standalone content */
}

/* Common container classes usually found in your content */
.container, 
.wrapper, 
.content, 
.Text, 
.Narrative, 
.Poem, 
.Article, 
.Article3, 
.Article5, 
.Biography, 
.Biography5 {
    width: 100% !important;
    max-width: 800px !important; /* Cap width for reading comfort */
    margin: 30px auto !important;   /* Center the reading block inside the iframe */
    padding: 0 20px !important;
    box-sizing: border-box;
    float: none !important;      
    text-align: justify !important; 
}

/* Specifically for narrative stories */
.Narrative {
    text-align: justify !important;
}

/* Typography styles internally */
.Narrative i, .Poem i {
    display: block;
    font-size: 1.5em;
    font-style: normal;
    font-weight: bold;
    font-family: 'PT Serif', 'Times New Roman', serif;
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

/* Headings */
h1, h2, h3, h4, 
.Author, 
.Title {
    font-family: 'Arial', sans-serif;
    color: #2c3e50;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.2;
    text-align: center; /* Titles look good centered */
    width: 100% !important;
}

h1 { font-size: 2em; }
h2 { font-size: 1.5em; }

/* Paragraphs */
p {
    margin-bottom: 1.5em;
    text-align: justify; /* Justified text often looks cleaner for long form */
}

/* Poems - specific handling for pre/samp tags */
pre, samp {
    white-space: pre-wrap !important;       
    word-wrap: break-word !important;       
    font-family: 'Segoe UI', 'Georgia', 'Times New Roman', serif !important; 
    font-size: 1.1em !important;             
    line-height: 1.8 !important;            
    display: block;
    margin: 30px auto !important; /* Center the poem block in the iframe */
    padding: 0 20px;
    background: transparent;
    border: none;
    overflow-x: hidden; 
    max-width: 100% !important; /* Cap width */
    width: fit-content !important; /* Shrink to fit the text naturally */
    text-align: left !important; /* Poetry usually needs left horizontal alignment */
    box-sizing: border-box;
}

.Poem {
    width: 100% !important;
    text-align: center !important; 
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Links */
a {
    color: #0056b3;
    text-decoration: underline;
}

a:hover {
    color: #003d82;
    text-decoration: none;
}

/* Horizontal Rule */
hr {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
    margin: 30px 0;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    body {
        padding: 15px;
        font-size: 16px;
    }
    
    pre, samp {
        font-size: 16px !important;
    }
}
