/* 1. Global Reset & Accessibility Foundations */
:root {
    --bg-primary: #fafafa;
    --text-primary: #1a1a1a;
    --text-muted: #5a5a5a;
    --border-color: #e5e5e5;
    --accent: #222222;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* 2. Responsive Core Container */
.memorial-container {
    width: 100%;
    max-width: 640px;
    padding: 2rem;
    box-sizing: border-box;
}

/* 3. Handling Dual-Script Scaling */
.native-name {
    font-family: 'Amiri', Georgia, Cambria, "Times New Roman", Times, serif;
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.75rem 0;
}


/* Ensure right-to-left scripts automatically adjust spacing and alignment */
.native-name[dir="rtl"] {
    letter-spacing: 0;
}

.translation-subtitle {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    color: var(--text-muted);
    font-weight: 400;
    margin: 0 0 2.5rem 0;
    min-height: 1.5em; /* Prevents layout shifting when JS injects translation */
}

/* 4. Metadata & Tags Grid */
.life-dates {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

.life-dates p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.tag {
    background-color: #f0f0f0;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.tag:hover {
    background-color: var(--border-color);
}


body { 
    font-family: "Segoe UI", Tahoma, sans-serif; 
    padding: 3rem; 
    line-height: 1.6; 
    max-width: 600px; 
    margin: auto; 
    text-align: center; 
    background-color: #fcfcfc;
}

.arabic { 
    font-family: "Amiri", serif;
    font-style: normal;
    font-size: 3em; 
    margin-bottom: 0.5em; 
    direction: rtl; 
    color: #1a1a1a;
}
.native-name.arabic { 
    font-family: "Amiri", "Traditional Arabic", "Sakkal Majalla", serif;
    font-style: normal;
    font-size: clamp(2.5rem, 7vw, 3.5rem);
    margin-bottom: 0.5rem; 
    direction: rtl; 
    color: #1a1a1a;
    line-height: 1.3;
}

.english { 
    font-size: 1.2rem; 
    color: #666; 
    margin-top: 0; 
    letter-spacing: 0.5px;
}
.meta { margin-top: 2rem; color: #888; font-size: 0.9rem; }

/* Homepage Layout Styling */
.index-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    font-family: sans-serif;
}
.index-header {
    text-align: center;
    margin-bottom: 3rem;
}
#search-bar {
    width: 100%;
    max-width: 500px;
    padding: 0.75rem 1.25rem;
    font-size: 1.1rem;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    margin-top: 1rem;
    outline: none;
}
#search-bar:focus {
    border-color: #222;
}
.index-grid {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.index-item {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.index-item:hover {
    transform: translateY(-2px);
    border-color: #222;
}
.index-link {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    text-decoration: none;
    color: #1a1a1a;
}
.ar-name {
    font-family: 'Amiri', serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.en-sub {
    font-size: 0.95rem;
    color: #666;
}

