/* Fix Astra Theme Constraints */
.site-content .ast-container { max-width: 100% !important; padding: 0 !important; display: block !important; }
#primary, .ast-primary-content-area { width: 100% !important; max-width: 100% !important; float: none !important; margin: 0 !important; }

/* Variables */
:root {
    --cn-red: #c1121f;
    --cn-green: #2ecc71; /* Green accent color from wireframe */
    --cn-dark: #1a202c;
    --cn-text-main: #333;
    --cn-text-muted: #666;
    --cn-border: #e2e8f0;
    --cn-bg-light: #f8fafc;
}

.cn-dossiers-page {
    width: 100%;
    overflow-x: hidden;
    font-family: inherit;
    background: #fff;
    padding-bottom: 80px;
}

.cn-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Typography Reset */
h1, h2, h3, h4, h5, h6 { margin: 0; color: var(--cn-text-main); font-family: inherit; }
a { text-decoration: none; color: inherit; }

/* 1. Hero Section */
.cn-dossiers-hero {
    background: url('../dossiers_hero_bg.jpg') center/cover no-repeat;
    height: 400px;
    display: flex;
    align-items: center;
    position: relative;
    border-bottom: 1px solid var(--cn-border);
}
.cn-hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    /* Gradient fading from dark right to transparent left */
    background: linear-gradient(to left, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.4) 60%, transparent 100%);
}
.cn-hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    text-align: right;
}
.cn-hero-content h1 {
    font-size: 48px;
    font-weight: 900;
    margin-bottom: 15px;
    color: #ffffff;
    text-shadow: 0 2px 15px rgba(0,0,0,0.5);
}
.cn-hero-content p {
    font-size: 20px;
    color: var(--cn-green); /* Green subtitle */
    font-weight: 700;
    margin: 0;
    text-shadow: 0 1px 5px rgba(0,0,0,0.5);
}

/* Breadcrumbs */
.cn-breadcrumbs {
    max-width: 1200px;
    margin: 20px auto 40px;
    padding: 0 20px;
    font-size: 13px;
    color: var(--cn-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.cn-breadcrumbs a {
    color: var(--cn-text-main);
    font-weight: 600;
    transition: 0.3s;
}
.cn-breadcrumbs a:hover {
    color: var(--cn-red);
}

/* 2. Section Titles */
.cn-section-title-center {
    text-align: center;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.cn-section-title-center i {
    font-size: 28px;
    color: var(--cn-green);
    margin-bottom: 10px;
}
.cn-section-title-center h2 {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 15px;
}
.cn-section-title-center .cn-title-line {
    width: 60px; height: 3px;
    background: var(--cn-border);
    position: relative;
}
.cn-section-title-center .cn-title-line::before {
    content: '';
    position: absolute;
    right: 50%; transform: translateX(50%);
    top: -1px; width: 30px; height: 5px;
    background: var(--cn-green);
    border-radius: 3px;
}

/* 3. Grid & Cards */
.cn-dossiers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}
.cn-dossiers-page-card {
    background: #fff;
    border: 1px solid var(--cn-border);
    border-radius: 12px;
    overflow: hidden;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}
.cn-dossiers-page-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border-color: #cbd5e1;
}

.cn-card-image {
    flex-shrink: 0;
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}
.cn-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}
.cn-dossiers-page-card:hover .cn-card-image img {
    transform: scale(1.05);
}
.cn-badge {
    position: absolute;
    top: 15px; left: 15px;
    background: rgba(46, 204, 113, 0.9); /* Green badge */
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    padding: 6px 10px;
    border-radius: 6px;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.cn-card-content {
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.cn-card-content h3 {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cn-card-content h3 i {
    color: var(--cn-green);
    font-size: 20px;
}
.cn-card-content p {
    font-size: 13px;
    color: var(--cn-text-muted);
    line-height: 1.8;
    margin: 0 0 15px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Buttons */
.cn-btn-outline-small {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    border: 1px solid var(--cn-border);
    color: var(--cn-text-main);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    transition: 0.3s;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}
.cn-btn-outline-small:hover {
    border-color: var(--cn-green);
    color: var(--cn-green);
    background: #f0fdf4;
}

.cn-link-text {
    margin-top: auto;
    font-size: 13px;
    font-weight: 700;
    color: var(--cn-text-main);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: 0.3s;
    align-self: flex-end; /* Align right since RTL */
}
.cn-link-text:hover {
    color: var(--cn-green);
}

/* Normal Grid Adjustments */
.cn-dossiers-grid.normal .cn-card-image {
    flex-shrink: 0;
    height: 150px;
}
.cn-dossiers-grid.normal .cn-card-content {
    padding: 20px;
}
.cn-dossiers-grid.normal .cn-card-content h3 {
    font-size: 16px;
}

/* 4. Archive Button */
.cn-archive-action {
    text-align: center;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--cn-border);
}
.cn-btn-archive {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 40px;
    background: #fff;
    border: 2px solid var(--cn-border);
    color: var(--cn-text-main);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 800;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.cn-btn-archive i {
    font-size: 22px;
    color: var(--cn-green);
}
.cn-btn-archive:hover {
    border-color: var(--cn-green);
    color: var(--cn-green);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.15);
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 1024px) {
    .cn-dossiers-grid { grid-template-columns: repeat(2, 1fr); }
    .cn-hero-content h1 { font-size: 36px; }
    .cn-hero-content p { font-size: 16px; }
}
@media (max-width: 600px) {
    .cn-dossiers-grid { grid-template-columns: 1fr; }
    .cn-hero-content { padding: 0 20px; text-align: center; }
    .cn-hero-overlay { background: rgba(15, 23, 42, 0.8); }
    .cn-btn-archive { width: 100%; box-sizing: border-box; }
}


