/* ============================================
   Al-Tajhiz School - Custom Styles
   Additional styling for school-specific elements
   ============================================ */

/* School News Module */
.school-news .news-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.school-news .news-item:last-child {
    border-bottom: none;
}

.news-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 55px;
    height: 55px;
    background: var(--primary-color, #1a365d);
    color: white;
    border-radius: 6px;
    font-weight: 700;
    line-height: 1.2;
}

.news-date .day {
    font-size: 1.2rem;
}

.news-date .month {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.news-content h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--primary-color, #1a365d);
}

.news-content p {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

/* Events Module */
.school-events .event-item {
    position: relative;
    padding-left: 1.5rem;
    padding-bottom: 1.5rem;
    border-left: 2px solid var(--accent-color, #c9a227);
}

.rtl .school-events .event-item {
    padding-left: 0;
    padding-right: 1.5rem;
    border-left: none;
    border-right: 2px solid var(--accent-color, #c9a227);
}

.school-events .event-item:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.rtl .school-events .event-item:last-child {
    border-right-color: transparent;
}

.event-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    background: var(--accent-color, #c9a227);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--accent-color, #c9a227);
}

.rtl .event-item::before {
    left: auto;
    right: -6px;
}

.event-date {
    font-size: 0.8rem;
    color: var(--accent-color, #c9a227);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.event-title {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color, #1a365d);
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.event-location {
    font-size: 0.8rem;
    color: #888;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 4/3;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 41, 0.8), transparent);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay span {
    color: white;
    font-weight: 600;
}

/* Faculty Cards */
.faculty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
}

.faculty-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.3s ease;
}

.faculty-card:hover {
    transform: translateY(-5px);
}

.faculty-photo {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: var(--building-cream, #f5f0e8);
}

.faculty-info {
    padding: 1.5rem;
}

.faculty-name {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color, #1a365d);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.faculty-role {
    color: var(--accent-color, #c9a227);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Testimonials / Alumni Quotes */
.testimonial-block {
    background: var(--primary-color, #1a365d);
    color: white;
    padding: 3rem;
    border-radius: 8px;
    position: relative;
    margin: 2rem 0;
}

.testimonial-block::before {
    content: '"';
    font-family: 'Playfair Display', serif;
    font-size: 6rem;
    color: var(--accent-color, #c9a227);
    line-height: 1;
    position: absolute;
    top: 1rem;
    left: 2rem;
    opacity: 0.3;
}

.testimonial-text {
    font-size: 1.2rem;
    font-style: italic;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.testimonial-author {
    font-weight: 600;
    color: var(--accent-color, #c9a227);
}

.testimonial-year {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}

/* History Timeline */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-color, #c9a227), var(--primary-color, #1a365d));
    transform: translateX(-50%);
}

.timeline-item {
    display: flex;
    justify-content: flex-end;
    padding-right: 2rem;
    position: relative;
    width: 50%;
    margin-bottom: 2rem;
}

.timeline-item:nth-child(even) {
    justify-content: flex-start;
    padding-right: 0;
    padding-left: 2rem;
    margin-left: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    background: var(--accent-color, #c9a227);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--accent-color, #c9a227);
}

.timeline-item:nth-child(even)::after {
    right: auto;
    left: -6px;
}

.timeline-content {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    max-width: 350px;
}

.timeline-year {
    font-family: 'Playfair Display', serif;
    color: var(--accent-color, #c9a227);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.timeline-title {
    color: var(--primary-color, #1a365d);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-desc {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* RTL Timeline adjustments */
.rtl .timeline::before {
    left: 50%;
    right: auto;
}

.rtl .timeline-item {
    padding-right: 0;
    padding-left: 2rem;
}

.rtl .timeline-item:nth-child(even) {
    padding-left: 0;
    padding-right: 2rem;
    margin-left: 0;
    margin-right: 50%;
}

/* Mobile Timeline */
@media (max-width: 768px) {
    .timeline::before {
        left: 1rem;
    }

    .timeline-item,
    .timeline-item:nth-child(even) {
        width: 100%;
        margin-left: 0;
        padding-left: 2.5rem;
        padding-right: 0;
        justify-content: flex-start;
    }

    .timeline-item::after,
    .timeline-item:nth-child(even)::after {
        left: -6px;
        right: auto;
    }

    .rtl .timeline::before {
        left: auto;
        right: 1rem;
    }

    .rtl .timeline-item,
    .rtl .timeline-item:nth-child(even) {
        padding-right: 2.5rem;
        padding-left: 0;
    }

    .rtl .timeline-item::after,
    .rtl .timeline-item:nth-child(even)::after {
        left: auto;
        right: -6px;
    }
}

/* Contact Page Styles */
.contact-info-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
    border-left: 4px solid var(--accent-color, #c9a227);
}

.rtl .contact-info-box {
    border-left: none;
    border-right: 4px solid var(--accent-color, #c9a227);
}

.contact-info-box h3 {
    color: var(--primary-color, #1a365d);
    margin-bottom: 1rem;
}

.contact-detail {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.contact-icon {
    width: 40px;
    height: 40px;
    background: rgba(26, 54, 93, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color, #1a365d);
    flex-shrink: 0;
}

/* Form Styles */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color, #c9a227);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color, #1a365d);
    font-size: 0.9rem;
}

/* Button Styles */
.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1rem;
}

.btn-small {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

/* Alert Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-success {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #166534;
}

.alert-info {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

.alert-warning {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.alert-error {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(201, 162, 39, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color, #c9a227);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--stone-gray, #8a8278);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color, #1a365d);
}
.mg-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}
#mg-iframe {
    min-height: 800px; /* fallback before JS kicks in */
    background: #faf8f4;
    border-radius: 8px;
}
@media (max-width: 768px) {
    #mg-iframe { min-height: 600px; }
}