/**
 * WordPress Content Styles
 * 
 * Comprehensive styling for all content coming from WordPress editor (the_content())
 * Applied to single pages: single-beit_news, single-beit_media, single-beit_voice, etc.
 */

/* Main Content Container */
.wp-content,
.entry-content,
.prose {
    line-height: 1.8;
    color: #1e293b;
}

/* Headings */
.wp-content h1,
.entry-content h1,
.prose h1 {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    color: #0f172a;
}

.wp-content h2,
.entry-content h2,
.prose h2 {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #0f172a;
    border-bottom: 3px solid #CB0B29;
    padding-bottom: 0.5rem;
}

.wp-content h3,
.entry-content h3,
.prose h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    color: #1e293b;
}

.wp-content h4,
.entry-content h4,
.prose h4 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.5;
    margin-top: 1.5rem;
    margin-bottom: 0.625rem;
    color: #334155;
}

.wp-content h5,
.entry-content h5,
.prose h5 {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.6;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: #475569;
}

.wp-content h6,
.entry-content h6,
.prose h6 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.6;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* First heading has no top margin */
.wp-content>h1:first-child,
.wp-content>h2:first-child,
.wp-content>h3:first-child,
.wp-content>h4:first-child,
.wp-content>h5:first-child,
.wp-content>h6:first-child,
.entry-content>h1:first-child,
.entry-content>h2:first-child,
.entry-content>h3:first-child,
.entry-content>h4:first-child,
.entry-content>h5:first-child,
.entry-content>h6:first-child,
.prose>h1:first-child,
.prose>h2:first-child,
.prose>h3:first-child,
.prose>h4:first-child,
.prose>h5:first-child,
.prose>h6:first-child {
    margin-top: 0;
}

/* Paragraphs */
.wp-content p,
.entry-content p,
.prose p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
    color: #334155;
    font-size: 1rem;
}

.wp-content p:last-child,
.entry-content p:last-child,
.prose p:last-child {
    margin-bottom: 0;
}

/* Line Breaks - Important for br tags */
.wp-content br,
.entry-content br,
.prose br {
    display: block;
    content: "";
    margin-top: 0.75rem;
}

/* First p after heading */
.wp-content h1+p,
.wp-content h2+p,
.wp-content h3+p,
.wp-content h4+p,
.wp-content h5+p,
.wp-content h6+p,
.entry-content h1+p,
.entry-content h2+p,
.entry-content h3+p,
.entry-content h4+p,
.entry-content h5+p,
.entry-content h6+p,
.prose h1+p,
.prose h2+p,
.prose h3+p,
.prose h4+p,
.prose h5+p,
.prose h6+p {
    margin-top: 0.5rem;
}

/* Links */
.wp-content a,
.entry-content a,
.prose a {
    color: #CB0B29;
    text-decoration: underline;
    text-decoration-color: rgba(203, 11, 41, 0.3);
    text-underline-offset: 3px;
    transition: all 0.2s ease;
}

.wp-content a:hover,
.entry-content a:hover,
.prose a:hover {
    color: #a00921;
    text-decoration-color: #CB0B29;
}

/* Strong & Bold */
.wp-content strong,
.wp-content b,
.entry-content strong,
.entry-content b,
.prose strong,
.prose b {
    font-weight: 700;
    color: #0f172a;
}

/* Italic & Emphasis */
.wp-content em,
.wp-content i,
.entry-content em,
.entry-content i,
.prose em,
.prose i {
    font-style: italic;
}

/* Lists */
.wp-content ul,
.wp-content ol,
.entry-content ul,
.entry-content ol,
.prose ul,
.prose ol {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    padding-left: 1.75rem;
}

.wp-content ul,
.entry-content ul,
.prose ul {
    list-style-type: disc;
}

.wp-content ol,
.entry-content ol,
.prose ol {
    list-style-type: decimal;
}

.wp-content li,
.entry-content li,
.prose li {
    margin-bottom: 0.5rem;
    line-height: 1.75;
    color: #334155;
}

.wp-content li:last-child,
.entry-content li:last-child,
.prose li:last-child {
    margin-bottom: 0;
}

/* Nested lists */
.wp-content ul ul,
.wp-content ol ul,
.entry-content ul ul,
.entry-content ol ul,
.prose ul ul,
.prose ol ul {
    list-style-type: circle;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.wp-content ul ol,
.wp-content ol ol,
.entry-content ul ol,
.entry-content ol ol,
.prose ul ol,
.prose ol ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Blockquotes */
.wp-content blockquote,
.entry-content blockquote,
.prose blockquote {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    border-left: 4px solid #CB0B29;
    background: linear-gradient(to right, rgba(203, 11, 41, 0.05), transparent);
    font-style: italic;
    color: #475569;
    position: relative;
}

[dir="rtl"] .wp-content blockquote,
[dir="rtl"] .entry-content blockquote,
[dir="rtl"] .prose blockquote {
    border-left: none;
    border-right: 4px solid #CB0B29;
    background: linear-gradient(to left, rgba(203, 11, 41, 0.05), transparent);
}

.wp-content blockquote p,
.entry-content blockquote p,
.prose blockquote p {
    margin-bottom: 0.75rem;
}

.wp-content blockquote p:last-child,
.entry-content blockquote p:last-child,
.prose blockquote p:last-child {
    margin-bottom: 0;
}

.wp-content blockquote cite,
.entry-content blockquote cite,
.prose blockquote cite {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    font-style: normal;
    color: #64748b;
}

.wp-content blockquote cite::before,
.entry-content blockquote cite::before,
.prose blockquote cite::before {
    content: "— ";
}

/* Code */
.wp-content code,
.entry-content code,
.prose code {
    padding: 0.2rem 0.4rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875em;
    color: #CB0B29;
}

.wp-content pre,
.entry-content pre,
.prose pre {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: #1e293b;
    border-radius: 0.5rem;
    overflow-x: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.wp-content pre code,
.entry-content pre code,
.prose pre code {
    padding: 0;
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 0.875rem;
    line-height: 1.7;
}

/* Tables */
.wp-content table,
.entry-content table,
.prose table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wp-content thead,
.entry-content thead,
.prose thead {
    background: #CB0B29;
    color: white;
}

.wp-content th,
.entry-content th,
.prose th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

[dir="rtl"] .wp-content th,
[dir="rtl"] .entry-content th,
[dir="rtl"] .prose th {
    text-align: right;
}

.wp-content td,
.entry-content td,
.prose td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
}

.wp-content tbody tr:last-child td,
.entry-content tbody tr:last-child td,
.prose tbody tr:last-child td {
    border-bottom: none;
}

.wp-content tbody tr:hover,
.entry-content tbody tr:hover,
.prose tbody tr:hover {
    background: #f8fafc;
}

/* Horizontal Rule */
.wp-content hr,
.entry-content hr,
.prose hr {
    margin: 2.5rem 0;
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
}

/* Images */
.wp-content img,
.entry-content img,
.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.wp-content figure,
.entry-content figure,
.prose figure {
    margin: 2rem 0;
}

.wp-content figcaption,
.entry-content figcaption,
.prose figcaption {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    color: #64748b;
    font-style: italic;
}

/* WordPress alignment classes */
.wp-content .alignleft,
.entry-content .alignleft,
.prose .alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

[dir="rtl"] .wp-content .alignleft,
[dir="rtl"] .entry-content .alignleft,
[dir="rtl"] .prose .alignleft {
    float: right;
    margin-right: 0;
    margin-left: 1.5rem;
}

.wp-content .alignright,
.entry-content .alignright,
.prose .alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

[dir="rtl"] .wp-content .alignright,
[dir="rtl"] .entry-content .alignright,
[dir="rtl"] .prose .alignright {
    float: left;
    margin-left: 0;
    margin-right: 1.5rem;
}

.wp-content .aligncenter,
.entry-content .aligncenter,
.prose .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* WordPress Caption */
.wp-content .wp-caption,
.entry-content .wp-caption,
.prose .wp-caption {
    max-width: 100%;
}

.wp-content .wp-caption-text,
.entry-content .wp-caption-text,
.prose .wp-caption-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
    text-align: center;
}

/* Embedded Videos */
.wp-content iframe,
.wp-content video,
.entry-content iframe,
.entry-content video,
.prose iframe,
.prose video {
    max-width: 100%;
    margin: 2rem 0;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* WordPress Gallery */
.wp-content .gallery,
.entry-content .gallery,
.prose .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.wp-content .gallery-item,
.entry-content .gallery-item,
.prose .gallery-item {
    margin: 0;
}

.wp-content .gallery-item img,
.entry-content .gallery-item img,
.prose .gallery-item img {
    margin: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wp-content .gallery-item img:hover,
.entry-content .gallery-item img:hover,
.prose .gallery-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* WordPress Blocks - Additional Support */
.wp-content .wp-block-image,
.entry-content .wp-block-image,
.prose .wp-block-image {
    margin: 2rem 0;
}

.wp-content .wp-block-quote,
.entry-content .wp-block-quote,
.prose .wp-block-quote {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    border-left: 4px solid #CB0B29;
    background: linear-gradient(to right, rgba(203, 11, 41, 0.05), transparent);
}

[dir="rtl"] .wp-content .wp-block-quote,
[dir="rtl"] .entry-content .wp-block-quote,
[dir="rtl"] .prose .wp-block-quote {
    border-left: none;
    border-right: 4px solid #CB0B29;
    background: linear-gradient(to left, rgba(203, 11, 41, 0.05), transparent);
}

/* Forms inside content */
.wp-content input[type="text"],
.wp-content input[type="email"],
.wp-content input[type="url"],
.wp-content input[type="password"],
.wp-content input[type="search"],
.wp-content input[type="tel"],
.wp-content textarea,
.entry-content input[type="text"],
.entry-content input[type="email"],
.entry-content input[type="url"],
.entry-content input[type="password"],
.entry-content input[type="search"],
.entry-content input[type="tel"],
.entry-content textarea,
.prose input[type="text"],
.prose input[type="email"],
.prose input[type="url"],
.prose input[type="password"],
.prose input[type="search"],
.prose input[type="tel"],
.prose textarea {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wp-content input[type="text"]:focus,
.wp-content input[type="email"]:focus,
.wp-content input[type="url"]:focus,
.wp-content input[type="password"]:focus,
.wp-content input[type="search"]:focus,
.wp-content input[type="tel"]:focus,
.wp-content textarea:focus,
.entry-content input[type="text"]:focus,
.entry-content input[type="email"]:focus,
.entry-content input[type="url"]:focus,
.entry-content input[type="password"]:focus,
.entry-content input[type="search"]:focus,
.entry-content input[type="tel"]:focus,
.entry-content textarea:focus,
.prose input[type="text"]:focus,
.prose input[type="email"]:focus,
.prose input[type="url"]:focus,
.prose input[type="password"]:focus,
.prose input[type="search"]:focus,
.prose input[type="tel"]:focus,
.prose textarea:focus {
    outline: none;
    border-color: #CB0B29;
    box-shadow: 0 0 0 3px rgba(203, 11, 41, 0.1);
}

/* Buttons inside content */
.wp-content button,
.wp-content input[type="submit"],
.wp-content input[type="button"],
.entry-content button,
.entry-content input[type="submit"],
.entry-content input[type="button"],
.prose button,
.prose input[type="submit"],
.prose input[type="button"] {
    padding: 0.625rem 1.5rem;
    background: #CB0B29;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.wp-content button:hover,
.wp-content input[type="submit"]:hover,
.wp-content input[type="button"]:hover,
.entry-content button:hover,
.entry-content input[type="submit"]:hover,
.entry-content input[type="button"]:hover,
.prose button:hover,
.prose input[type="submit"]:hover,
.prose input[type="button"]:hover {
    background: #a00921;
    transform: translateY(-1px);
}

/* Definition Lists */
.wp-content dl,
.entry-content dl,
.prose dl {
    margin: 1.5rem 0;
}

.wp-content dt,
.entry-content dt,
.prose dt {
    font-weight: 700;
    color: #0f172a;
    margin-top: 1rem;
}

.wp-content dd,
.entry-content dd,
.prose dd {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: #334155;
}

[dir="rtl"] .wp-content dd,
[dir="rtl"] .entry-content dd,
[dir="rtl"] .prose dd {
    margin-left: 0;
    margin-right: 1.5rem;
}

/* Abbreviations */
.wp-content abbr[title],
.entry-content abbr[title],
.prose abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
}

/* Mark/Highlight */
.wp-content mark,
.entry-content mark,
.prose mark {
    background: #fef9c3;
    padding: 0.125rem 0.25rem;
    border-radius: 0.125rem;
}

/* Small text */
.wp-content small,
.entry-content small,
.prose small {
    font-size: 0.875em;
    color: #64748b;
}

/* Subscript & Superscript */
.wp-content sub,
.wp-content sup,
.entry-content sub,
.entry-content sup,
.prose sub,
.prose sup {
    font-size: 0.75em;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

.wp-content sup,
.entry-content sup,
.prose sup {
    top: -0.5em;
}

.wp-content sub,
.entry-content sub,
.prose sub {
    bottom: -0.25em;
}

/* Clearfix for floated elements */
.wp-content::after,
.entry-content::after,
.prose::after {
    content: "";
    display: table;
    clear: both;
}

/* Responsive adjustments */
@media (max-width: 640px) {

    .wp-content h1,
    .entry-content h1,
    .prose h1 {
        font-size: 1.875rem;
    }

    .wp-content h2,
    .entry-content h2,
    .prose h2 {
        font-size: 1.5rem;
    }

    .wp-content h3,
    .entry-content h3,
    .prose h3 {
        font-size: 1.25rem;
    }

    .wp-content .alignleft,
    .wp-content .alignright,
    .entry-content .alignleft,
    .entry-content .alignright,
    .prose .alignleft,
    .prose .alignright {
        float: none;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }

    .wp-content table,
    .entry-content table,
    .prose table {
        font-size: 0.875rem;
    }

    .wp-content th,
    .wp-content td,
    .entry-content th,
    .entry-content td,
    .prose th,
    .prose td {
        padding: 0.625rem 0.75rem;
    }
}