/* CAREP — Modern site design system */

:root {
    --carep: #C00D0E;
    --carep-dark: #6B0809;
    --carep-light: #fde8e8;
    --clay: #c9922e;
    --ink: #1e293b;
    --sand: #f6f7f9;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-body {
    font-family: Tajawal, sans-serif;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(192, 13, 14, 0.06), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(201, 146, 46, 0.04), transparent),
        var(--sand);
}

.site-container {
    width: 100%;
    max-width: 80rem;
    margin-inline: auto;
    padding-inline: 1rem;
}

@media (min-width: 768px) {
    .site-container {
        padding-inline: 1.5rem;
    }
}

/* Top bar */
.site-topbar {
    background: linear-gradient(90deg, #2D0404 0%, #4A0607 50%, #6B0809 100%);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.social-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transition: var(--transition);
}

.social-pill:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.lang-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    transition: var(--transition);
}

.lang-pill:hover,
.lang-pill.is-active {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(192, 13, 14, 0.08);
    transition: box-shadow var(--transition), background var(--transition);
}

.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 32px -12px rgba(15, 23, 42, 0.12);
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.site-brand-logo {
    height: 3.25rem;
    width: auto;
    transition: transform var(--transition);
}

.site-brand:hover .site-brand-logo {
    transform: scale(1.02);
}

.site-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(192, 13, 14, 0.15);
    color: #8A0A0B;
    background: #fff;
    transition: var(--transition);
}

.site-menu-toggle:hover {
    background: #fef7f7;
    border-color: rgba(192, 13, 14, 0.3);
}

.site-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.92rem;
    font-weight: 600;
    color: #334155;
    transition: var(--transition);
}

.site-nav-link:hover {
    background: #fef7f7;
    color: #8A0A0B;
}

.site-nav-link.is-active {
    background: linear-gradient(135deg, #fde8e8, #fff);
    color: #8A0A0B;
    box-shadow: inset 0 0 0 1px rgba(192, 13, 14, 0.12);
}

.site-dropdown {
    border-radius: var(--radius-xl);
    border: 1px solid rgba(192, 13, 14, 0.1);
    background: #fff;
    padding: 0.4rem;
    box-shadow: 0 20px 50px -20px rgba(15, 23, 42, 0.2);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    transform: translateY(6px);
}

.group:hover .site-dropdown {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.site-dropdown-link {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    transition: var(--transition);
}

.site-dropdown-link:hover,
.site-dropdown-link.is-active {
    background: #fef7f7;
    color: #8A0A0B;
}

.site-mobile-nav {
    padding: 0.5rem;
    border-radius: var(--radius-xl);
    background: #fff;
    border: 1px solid rgba(192, 13, 14, 0.08);
    box-shadow: 0 12px 40px -16px rgba(15, 23, 42, 0.15);
}

.site-mobile-link {
    display: block;
    padding: 0.65rem 0.85rem;
    border-radius: 0.65rem;
    font-weight: 600;
    color: #334155;
}

.site-mobile-link.is-active {
    background: #fef7f7;
    color: #8A0A0B;
}

.site-mobile-sub {
    margin-inline-end: 0.75rem;
    padding-inline-end: 0.75rem;
    border-inline-end: 2px solid #fde8e8;
}

.site-mobile-sublink {
    display: block;
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    border-radius: 0.5rem;
}

.site-mobile-sublink.is-active,
.site-mobile-sublink:hover {
    background: #fef7f7;
    color: #8A0A0B;
}

/* Sections & typography */
.section-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.section-title {
    position: relative;
    padding-bottom: 0.65rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 3.5rem;
    height: 3px;
    border-radius: 9999px;
    background: linear-gradient(90deg, var(--carep), var(--clay));
}

.section-title-text {
    font-family: Amiri, serif;
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 700;
    color: #8A0A0B;
    line-height: 1.2;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #C00D0E, #8A0A0B);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 8px 24px -8px rgba(192, 13, 14, 0.45);
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px -8px rgba(192, 13, 14, 0.55);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(192, 13, 14, 0.2);
    background: #fff;
    color: #8A0A0B;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-outline:hover {
    background: #fef7f7;
    border-color: rgba(192, 13, 14, 0.35);
}

/* Cards */
.carep-card {
    overflow: hidden;
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(192, 13, 14, 0.08);
    background: #fff;
    box-shadow: var(--shadow-card, 0 4px 24px -4px rgba(15, 23, 42, 0.08));
    transition: transform var(--transition), box-shadow var(--transition);
}

.carep-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px -20px rgba(192, 13, 14, 0.15);
}

.carep-card-media {
    display: block;
    overflow: hidden;
}

.carep-card-media img {
    width: 100%;
    height: 11rem;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.carep-card:hover .carep-card-media img {
    transform: scale(1.05);
}

.carep-card-body {
    padding: 1.15rem 1.25rem;
    text-align: right;
}

.carep-feature-card,
.org-member-card {
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(192, 13, 14, 0.1);
    background: #fff;
    box-shadow: 0 4px 24px -4px rgba(15, 23, 42, 0.08);
    transition: transform var(--transition), box-shadow var(--transition);
}

.carep-feature-card:hover,
.org-member-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px -20px rgba(192, 13, 14, 0.15);
}

.home-page .carep-card-body {
    text-align: center;
}

.carep-page-hero {
    background-size: cover;
    background-position: center;
}

.glass-panel {
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(192, 13, 14, 0.08);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 20px 50px -20px rgba(192, 13, 14, 0.12);
}

/* Hero */
.hero-wrap {
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.12) 0, transparent 40%),
        linear-gradient(125deg, #4A0607 0%, #8A0A0B 45%, #A00B0C 100%);
    padding: 2.5rem 0 3rem;
}

@media (min-width: 768px) {
    .hero-wrap {
        padding: 3rem 0 3.5rem;
    }
}

#hero-slider {
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
    box-shadow: 0 25px 60px -20px rgba(0, 0, 0, 0.45);
}

.hero-slide img {
    transition: transform 8s ease;
}

.hero-slide.is-active img {
    transform: scale(1.04);
}

/* News ticker */
.news-ticker {
    border-radius: var(--radius-xl);
    border: 1px solid rgba(192, 13, 14, 0.1);
    background: linear-gradient(90deg, #fff 0%, #fef7f7 100%);
    overflow: hidden;
}

.news-ticker-label {
    background: linear-gradient(135deg, #C00D0E, #6B0809);
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.85rem 1.25rem;
    white-space: nowrap;
}

.news-ticker-track {
    animation: ticker-scroll 36s linear infinite;
    will-change: transform;
}

.news-ticker:hover .news-ticker-track {
    animation-play-state: paused;
}

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* Page hero */
.page-hero {
    position: relative;
    overflow: hidden;
    padding: 3.5rem 0;
    color: #fff;
    background: linear-gradient(125deg, #2D0404 0%, #6B0809 40%, #8A0A0B 100%);
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 20%, rgba(201, 146, 46, 0.15), transparent 45%),
        radial-gradient(circle at 10% 80%, rgba(255, 255, 255, 0.06), transparent 40%);
    pointer-events: none;
}

.page-hero .site-container {
    position: relative;
    z-index: 1;
}

.page-hero-title {
    font-family: Amiri, serif;
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.15;
}

.page-hero-sub {
    margin-top: 0.85rem;
    max-width: 42rem;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
}

/* Article */
.article-shell {
    margin-inline: auto;
    max-width: 52rem;
    padding: 2.5rem 1rem 3rem;
}

.article-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.article-prose {
    margin-top: 1.5rem;
    border-radius: var(--radius-2xl);
    background: #fff;
    padding: 1.75rem 2rem;
    line-height: 1.9;
    box-shadow: 0 20px 50px -20px rgba(15, 23, 42, 0.1);
    border: 1px solid rgba(192, 13, 14, 0.06);
}

.article-prose h2,
.article-prose h3 {
    font-family: Amiri, serif;
    color: #8A0A0B;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.article-prose p {
    margin-bottom: 1rem;
    color: #334155;
}

.article-prose a {
    color: #C00D0E;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-featured-img {
    margin-top: 1.25rem;
    width: 100%;
    height: 20rem;
    object-fit: cover;
    border-radius: var(--radius-2xl);
    box-shadow: 0 20px 50px -20px rgba(15, 23, 42, 0.2);
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Topbar mobile */
@media (max-width: 639px) {
    .site-topbar-text {
        display: none;
    }

    .site-topbar .site-container {
        justify-content: flex-end;
    }
}

/* Footer */
.site-footer {
    background: linear-gradient(160deg, #2D0404 0%, #4A0607 40%, #6B0809 100%);
    color: #fff;
    margin-top: 2rem;
}

.site-footer-inner {
    display: grid;
    gap: 2rem;
    padding-block: 2.5rem 1.5rem;
}

@media (min-width: 640px) {
    .site-footer-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem 1.5rem;
    }
}

@media (min-width: 1024px) {
    .site-footer-inner {
        grid-template-columns: 1.35fr 0.95fr 1.1fr;
        gap: 2rem 1.75rem;
        padding-block: 3rem 1.75rem;
    }
}

.footer-brand-col {
    grid-column: 1 / -1;
}

@media (min-width: 1024px) {
    .footer-brand-col {
        grid-column: auto;
    }
}

.footer-sitemap-row {
    grid-column: 1 / -1;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-sitemap-row .site-footer-title {
    margin-bottom: 1rem;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
}

.footer-logo {
    height: 3.5rem;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

.footer-brand-name {
    font-family: Amiri, serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.footer-about {
    margin-top: 1rem;
    max-width: 28rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.92rem;
}

.footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.15rem;
}

.footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: var(--transition);
}

.footer-social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.footer-col {
    min-width: 0;
}

.site-footer-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(201, 146, 46, 0.45);
}

.site-footer-link {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.45rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.88rem;
    line-height: 1.5;
    transition: var(--transition);
}

.site-footer-link-strong {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
}

.site-footer-link:hover {
    color: #fff;
}

.footer-sitemap-columns {
    display: grid;
    gap: 1.25rem 1.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .footer-sitemap-columns {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .footer-sitemap-columns {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1rem 2rem;
    }
}

.footer-sitemap-list {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
}

.footer-sitemap-sub {
    margin-top: 0.35rem;
    padding-inline-start: 0.85rem;
    border-inline-start: 1px solid rgba(255, 255, 255, 0.15);
    display: grid;
    gap: 0.3rem;
}

.footer-sitemap-sub .site-footer-link {
    font-size: 0.82rem;
}

.footer-contact-list {
    display: grid;
    gap: 0.65rem;
}

.footer-newsletter-lead {
    font-size: 0.86rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.85rem;
}

.footer-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

@media (min-width: 480px) {
    .footer-newsletter-form {
        flex-direction: row;
        align-items: stretch;
    }
}

.footer-newsletter-input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-radius: 0.75rem;
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.footer-newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.footer-newsletter-input:focus {
    border-color: rgba(201, 146, 46, 0.65);
    background: rgba(255, 255, 255, 0.12);
}

.footer-newsletter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: none;
    border-radius: 0.75rem;
    padding: 0.7rem 1rem;
    background: linear-gradient(135deg, #c9922e, #a6741f);
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.footer-newsletter-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.footer-newsletter-msg {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.84rem;
    margin-bottom: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.65rem;
}

.footer-newsletter-msg.is-success {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
}

.footer-newsletter-msg.is-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
}

.site-footer-bottom {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

@media (min-width: 768px) {
    .site-footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        text-align: start;
    }
}

.site-footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1rem;
}

.site-footer-legal-link {
    color: rgba(255, 255, 255, 0.72);
    transition: var(--transition);
}

.site-footer-legal-link:hover {
    color: #fff;
}

/* Mobile header touch targets */
@media (max-width: 767px) {
    .site-nav-link,
    .site-mobile-link,
    .site-mobile-sublink {
        min-height: 2.75rem;
        display: flex;
        align-items: center;
    }
}

.site-back-top {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 40;
    align-items: center;
    justify-content: center;
    width: 2.85rem;
    height: 2.85rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #C00D0E, #6B0809);
    color: #fff;
    box-shadow: 0 12px 32px -8px rgba(192, 13, 14, 0.5);
    transition: var(--transition);
}

.site-back-top:hover {
    transform: translateY(-2px);
}

/* Reveal animation */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stats (page.php) */
.carep-stat-card {
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.carep-stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 36px rgba(192, 13, 14, 0.12);
}

.carep-stat-icon {
    background: linear-gradient(135deg, #C00D0E 0%, #6B0809 100%);
}

.carep-stat-value {
    background: linear-gradient(135deg, #C00D0E, #8A0A0B);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Calendar widget */
.cal-widget-header {
    background: linear-gradient(125deg, #6B0809, #C00D0E);
    color: #fff;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
}

/* Objective band */
.objective-band {
    background: linear-gradient(90deg, rgba(253, 232, 232, 0.7), rgba(255, 255, 255, 0.9), rgba(253, 232, 232, 0.5));
    border-block: 1px solid rgba(192, 13, 14, 0.08);
}
