/* shared css */
/* ===================================
1. RESET
=================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ===================================
2. BODY + PAGE CONTAINER BACKGROUNDS
=================================== */
body {
    background: #e8e6e1;  /* warm stone background */;
    font-family: "Noto Naskh Arabic", serif;
    line-height: 1.7;
}

.onmnew-container {
    max-width: 800px;
    margin: 1rem auto;
    padding: 20px;
    background: #ffffff;  /* white container for contrast */;
}

/* ===================================
3. FONT FACE DECLARATIONS
=================================== */
@charset "UTF-8";
@font-face {
    font-display: swap;
    src: url("/fonts/noto-naskh-arabic-v36-arabic_latin-regular.woff2");
    font-family: "noto naskh arabic";
    font-style: normal;
    font-weight: 400;
}

@font-face {
    font-display: swap;
    src: url("/fonts/noto-naskh-arabic-v36-arabic_latin-500.woff2");
    font-family: "noto naskh arabic";
    font-style: normal;
    font-weight: 500;
}

@font-face {
    font-display: swap;
    src: url("/fonts/noto-naskh-arabic-v36-arabic_latin-600.woff2");
    font-family: "noto naskh arabic";
    font-style: normal;
    font-weight: 600;
}

@font-face {
    font-display: swap;
    src: url("/fonts/noto-naskh-arabic-v36-arabic_latin-700.woff2");
    font-family: "noto naskh arabic";
    font-style: normal;
    font-weight: 700;
}

/* ===================================
4. HEADER (4 lines: h1 + additional info)
=================================== */
.mag-header {
    background: #e5e6eb;
}

.mag-header-inline {
    direction: ltr;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 2px solid #fff;
}

.logo-onmag {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
    padding-left: 3rem;
}

.logo-onmag img {
    display: block;
    width: auto;
    height: auto;
    max-height: 100px;
}

.mag-title-group {
    flex: 1;
    text-align: center;
}

/* Responsive: stack on small screens */
@media (max-width: 600px) {
    .mag-header-inline {
        flex-direction: column;
        text-align: center;
    }
    .logo-onmag img {
        max-width: 80px;
        max-height: 80px;
    }
}

.site-title {
    margin-top: 5px;
    margin-bottom: 5px;
    font-size: 3rem;
    font-weight: bold;
}

.site-description {
    margin-top: 4px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #3B3C36;
}

.site-issn {
    direction: ltr;
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #3B3C36;
}

.site-publisher {
    margin-top: 4px;
    margin-bottom: 15px;
    font-size: 1rem;
    font-weight: bold;
    color: #666;
}
/** author name, article title, article intro **/
/* Article author section - common styling */
.article-author {
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: bold;
    color: #661a15;
}

/* ===================================
5. USER TOOLS (search/login/sub - horizontal)
=================================== */
.user-tools {
    display: flex;
    justify-content: flex-start;
    gap: 15px;
    padding: 10px;
    background: #f8f8fa;
    border-bottom: 2px solid #fff;
}

.user-tools ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.spip-form,
.search-form {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.search,
.text {
    line-height: 25px;
}

.search-input {
    margin-right: 10px;
    margin-left: 10px;
    padding: 1px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.onmag-button {
    padding: 5px;
    background-color: #fff;
    cursor: pointer;
    border: 1px solid #666;
    border-radius: 4px;
    font-weight: bold;
    color: #fff;
}

/* ===================================
6. SEARCH RESULTS
=================================== */
.search-results {
    margin: 1rem;
    padding: 1rem;
    background: whitesmoke;
}

/* ===================================
7. MAIN NAVIGATION (6 links)
=================================== */
.main-nav {
    margin-bottom: 30px;
    padding: 12px 0;
    background: #f8f8fa;
    border-radius: 4px;
}

.main-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 10px;
    list-style: none;
}

.main-nav a {
    border-bottom: 4px solid #121212;
    padding: 5px 10px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
}

.main-nav a:hover {
    color: #000;
    text-decoration: underline;
}

/* ===================================
8. MAIN CONTENT + SECTION + .page-idinfo
=================================== */
.content-section {
    margin-bottom: 40px;
}

.page-idinfo {
    margin-bottom: 25px;
    padding: 8px 15px;
    background: #fbf9f5;
    border: 4px double #ddd;
    font-size: 1.25rem;
    color: #212121;
}

/* page-specific content area — no styles here, leave for page CSS */

/* ===================================
9. FOOTER + SECONDARY NAVIGATION (3-4 links)
=================================== */
footer {
    margin-top: 10px;
    margin-bottom: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
    background: #fbf7f5;
    font-size: 1rem;
    text-align: center;
}

.secondary-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin-bottom: 15px;
    list-style: none;
}

.secondary-nav a {
    color: #121212;
    text-decoration: none;
    border-bottom: 3px solid #000000;
}

.secondary-nav a:hover {
    color: #000;
    text-decoration: underline;
}

.copyright {
    font-size: 1rem;
    color: #212121;
}

/* styling for misc pages (about, privacy, 404) */
.page-misc {
    margin-top: 2rem;
    padding: 1rem;
    background: #fff;
    font-size: 1.25rem;
    line-height: 1.7;
    color: #212121;
}

/** 404 page css **/
.onmag-search-wrapper {
    padding: 1.5rem;
    background: mintcream;
}
/** wrap long links urls to fit within their div container **/
a.url-link {
    word-break: break-all;
    overflow-wrap: break-word;
    display: inline-block;
    max-width: 100%;
padding: 5px;
}

/* ===================================
10. RESPONSIVE ADJUSTMENTS
=================================== */
@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.75rem; }
    h4 { font-size: 1.5rem; }
    h5 { font-size: 1.25rem; }
    h6 { font-size: 1.1rem; }

    .user-tools .spip-form.search-form .form-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .spip-form.search-form .form-group label {
        margin-right: 0;
        margin-bottom: 5px;
    }

    .spip-form.search-form .form-group input[type="text"] {
        width: 100%;
        margin-bottom: 10px;
    }

    .main-nav ul,
    .secondary-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}

/* ===================================
9. UTILITIES (optional extras)
=================================== */
.text-muted {
    color: #666;
}
.bg-subtle {
    background: #f5f5f0;
}
/** other styles
/** hide image titles **/
.spip_doc_titre,
.spip_soc_legende {
    display: none;
}
/** SPIP Document Styles **/
.spip_doc {
    margin-bottom: 1em;
}

/* ===================================
IMAGE ALIGNMENT FIX FOR RTL/LTR
=================================== */
/* 
   IMPORTANT: This file is used in an RTL context (Arabic language)
   The original alignment classes were inverted, causing left-aligned 
   images to appear on the right and vice versa.
   
   FIX: Swapped float values to correct the alignment.
   - .spip_doc--left now floats left (appears on left side)
   - .spip_doc--right now floats right (appears on right side)
*/

/* Left alignment - image should appear on left side of document */
.spip_doc--left,
.spip_documents_left {
    float: left !important;
    clear: left !important;
    margin: 0 1em 0.5em 0 !important;
}

/* Right alignment - image should appear on right side of document */
.spip_doc--right,
.spip_documents_right {
    float: right !important;
    clear: right !important;
    margin: 0 0 0.5em 1em !important;
}

/* Center alignment - Fixed version */
.spip_doc--center,
.spip_documents_center {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    float: none !important;
    clear: both !important;
    width: 100% !important;
    margin: 0.5em auto !important;
    text-align: center !important;
}

/* Target the image inside centered documents */
.spip_doc--center img,
.spip_documents_center img {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

/* Target the inner container if SPIP wraps images */
.spip_doc--center .spip_doc_inner,
.spip_documents_center .spip_doc_inner {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
}

/* Target the figure element that SPIP might use */
figure.spip_doc--center,
figure.spip_documents_center {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

/* Image styles */
.spip_documents_left img,
.spip_documents_right img,
.spip_documents_center img,
.spip_doc--left img,
.spip_doc--right img,
.spip_doc--center img {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
}

/* Caption styling */
.spip_doc_legende {
    width: 100% !important;
    margin-top: 0.25em !important;
    font-size: 0.9em !important;
    text-align: center !important;
}

/** Responsive adjustments **/
@media (max-width: 768px) {
    .spip_documents_right {
        float: none !important;
        max-width: 100% !important;
        margin: 1em auto !important;
    }
    .spip_documents_left {
        float: none !important;
        max-width: 100% !important;
        margin: 1em auto !important;
    }
}