/**
 * Additional styles for CGTG-CGSS theme
 * Main styles are in style.css
 */

/* ---------------------------------------------------------------
 * Navigation : 8 entrées tiennent entre 969 px et 1300 px
 * ------------------------------------------------------------- */
@media (min-width: 969px) and (max-width: 1300px) {
    .nav-links { gap: 1.25rem; }
    .nav-links a { font-size: 0.95rem; }
}

/* ---------------------------------------------------------------
 * Logo personnalisé (Apparence > Personnaliser > Identité du site)
 * the_custom_logo() produit .custom-logo-link > img.custom-logo :
 * sans cette règle, l'image s'affiche à sa taille réelle.
 * ------------------------------------------------------------- */
.custom-logo-link { display: flex; align-items: center; }
.logo.logo-with-image::before { content: none; }
.logo.logo-with-image { gap: 0.75rem; }
.custom-logo-link img,
img.custom-logo { height: 56px; width: auto; max-width: 220px; object-fit: contain; display: block; }
@media (max-width: 640px) {
    .custom-logo-link img, img.custom-logo { height: 44px; }
}

/* ---------------------------------------------------------------
 * Boutons pour fonds clairs (.btn-secondary est blanc sur transparent)
 * ------------------------------------------------------------- */
.btn-red {
    background: var(--red-primary);
    color: #fff;
}
.btn-red:hover {
    background: var(--red-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(230, 57, 70, 0.3);
}
.btn-outline {
    background: transparent;
    color: var(--blue-accent);
    border: 2px solid var(--blue-accent);
}
.btn-outline:hover {
    background: var(--blue-accent);
    color: #fff;
}
.btn small { font-weight: 400; opacity: 0.85; }

/* ---------------------------------------------------------------
 * Rubrique Communication
 * ------------------------------------------------------------- */
.comm-page {
    margin-top: 80px;
    padding: 4rem 2rem 5rem;
    background: var(--cream);
    min-height: 60vh;
}
.comm-archive-header { text-align: center; margin-bottom: 3rem; }
.comm-archive-header .section-subtitle { margin-bottom: 2rem; }

.comm-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}
.comm-filters a {
    padding: 0.45rem 1.1rem;
    border-radius: 50px;
    border: 2px solid var(--blue-accent);
    color: var(--blue-accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}
.comm-filters a:hover,
.comm-filters a.is-active { background: var(--blue-accent); color: #fff; }

.comm-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
}
.comm-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(29, 53, 87, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s, box-shadow 0.25s;
}
.comm-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(29, 53, 87, 0.15); }
.comm-card-visual { display: block; text-decoration: none; aspect-ratio: 2 / 3; background: var(--light-gray); overflow: hidden; }
.comm-card-visual img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.comm-card-placeholder {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, var(--blue-accent), var(--red-primary));
    color: #fff; font-family: 'Bebas Neue', sans-serif; font-size: 2.2rem; letter-spacing: 2px;
}
.comm-card-body { padding: 1.25rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.comm-card-body h3 { font-size: 1.15rem; line-height: 1.35; }
.comm-card-body h3 a { color: var(--dark); text-decoration: none; }
.comm-card-body h3 a:hover { color: var(--red-primary); }
.comm-card-body p { color: var(--gray); font-size: 0.95rem; }
.comm-card-body .read-more { margin-top: auto; }

.comm-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; font-size: 0.9rem; color: var(--gray); }
.comm-badge {
    background: var(--red-primary);
    color: #fff;
    padding: 0.2rem 0.7rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-decoration: none;
}
.comm-empty, .comm-pagination { text-align: center; margin-top: 3rem; color: var(--gray); }

/* Page d'une communication */
.comm-single { max-width: 1100px; margin: 0 auto; }
.comm-single-header { margin-bottom: 2.5rem; }
.comm-back { display: inline-block; color: var(--blue-accent); text-decoration: none; font-weight: 600; margin-bottom: 1.5rem; }
.comm-back:hover { color: var(--red-primary); }
.comm-single-header h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.4rem, 6vw, 4rem);
    line-height: 1.05;
    letter-spacing: 1px;
    color: var(--blue-accent);
    margin-top: 0.75rem;
}
.comm-lead { font-size: 1.2rem; color: var(--dark); max-width: 760px; margin-top: 1rem; line-height: 1.6; }

.comm-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr);
    gap: 2.5rem;
    align-items: start;
}
.comm-visual { margin: 0; }
.comm-visual img {
    width: 100%; height: auto; display: block;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(29, 53, 87, 0.18);
}
.comm-visual figcaption { text-align: center; font-size: 0.85rem; color: var(--gray); margin-top: 0.75rem; }

.comm-actions {
    position: sticky;
    top: 110px;
    background: #fff;
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: 0 4px 18px rgba(29, 53, 87, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.comm-download { text-align: center; padding: 1rem 1.5rem; }
.comm-open-pdf { text-align: center; color: var(--blue-accent); font-size: 0.95rem; }
.comm-share-label { margin-top: 1rem; font-weight: 700; color: var(--dark); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; }
.comm-share { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.comm-share a, .comm-share button {
    display: block; text-align: center;
    padding: 0.65rem 0.5rem;
    border-radius: 8px;
    font: 600 0.92rem 'Work Sans', sans-serif;
    text-decoration: none;
    border: none; cursor: pointer;
    color: #fff;
}
.share-whatsapp { background: #1f8f4e; }
.share-facebook { background: #1b5fc1; }
.share-email { background: var(--blue-accent); }
.share-copy { background: var(--light-gray); color: var(--dark) !important; }
.comm-share a:hover, .comm-share button:hover { filter: brightness(1.1); }
.comm-signature { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--light-gray); color: var(--gray); line-height: 1.5; }
.comm-signature strong { color: var(--dark); }

.comm-text {
    margin-top: 4rem;
    background: #fff;
    border-radius: 12px;
    padding: 3rem clamp(1.25rem, 5vw, 4rem);
    box-shadow: 0 4px 18px rgba(29, 53, 87, 0.06);
}
.comm-text > h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem; letter-spacing: 1px;
    color: var(--red-primary);
    margin-bottom: 1.5rem;
}
.comm-text-body { max-width: 72ch; font-size: 1.08rem; line-height: 1.75; color: var(--dark); }
.comm-text-body h2, .comm-text-body h3 { color: var(--blue-accent); margin: 2rem 0 0.75rem; line-height: 1.3; }
.comm-text-body h2 { font-size: 1.45rem; }
.comm-text-body h3 { font-size: 1.2rem; }
.comm-text-body p, .comm-text-body ul { margin-bottom: 1rem; }
.comm-text-body ul { padding-left: 1.25rem; }
.comm-text-body li { margin-bottom: 0.35rem; }
.comm-text-body blockquote {
    border-left: 4px solid var(--yellow-highlight);
    background: var(--cream);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    font-style: italic;
}
.comm-text-body .creole { font-style: italic; color: var(--blue-accent); }

.comm-nav {
    margin-top: 3rem;
    display: flex; justify-content: space-between; gap: 2rem;
}
.comm-nav a { flex: 1; text-decoration: none; color: var(--dark); font-weight: 600; }
.comm-nav a span { display: block; font-size: 0.85rem; font-weight: 400; color: var(--gray); margin-bottom: 0.25rem; }
.comm-nav a.is-next { text-align: right; }

/* Bloc « À la une » sur l'accueil */
.comm-une { background: var(--blue-accent); color: #fff; padding: 3rem 2rem; }
.comm-une-inner {
    max-width: 1100px; margin: 0 auto;
    display: grid; grid-template-columns: 180px 1fr; gap: 2.5rem; align-items: center;
}
.comm-une-visual img { width: 100%; height: auto; display: block; border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); transform: rotate(-2deg); }
.comm-une-kicker { color: var(--yellow-highlight); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: 0.85rem; }
.comm-une h2 { font-family: 'Bebas Neue', sans-serif; font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: 1px; line-height: 1.1; margin: 0.4rem 0 0.75rem; }
.comm-une h2 a { color: #fff; text-decoration: none; }
.comm-une p { opacity: 0.9; max-width: 60ch; }
.comm-une-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-top: 1.5rem; }
.comm-une-actions .btn { padding: 0.75rem 1.75rem; font-size: 1rem; }
.comm-une .btn-outline { color: #fff; border-color: #fff; }
.comm-une .btn-outline:hover { background: #fff; color: var(--blue-accent); }
.comm-une-all { color: #fff; font-weight: 600; }

@media (max-width: 860px) {
    .comm-layout { grid-template-columns: 1fr; }
    .comm-actions { position: static; order: -1; }
    .comm-une-inner { grid-template-columns: 110px 1fr; gap: 1.25rem; }
}
@media (max-width: 640px) {
    .comm-page { padding: 2.5rem 1rem 4rem; }
    .comm-une { padding: 2rem 1rem; }
    .comm-une-inner { grid-template-columns: 1fr; }
    .comm-une-visual { max-width: 140px; }
    .comm-une-actions .btn { width: auto; }
    .comm-nav { flex-direction: column; gap: 1rem; }
    .comm-nav a.is-next { text-align: left; }
}

/* ---------------------------------------------------------------
 * Formulaires : erreurs, consentement, mention RGPD, anti-spam
 * ------------------------------------------------------------- */
.cgtg-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-group .optional { font-weight: 400; color: var(--gray); font-size: 0.9em; }
.field-error { color: #b42318; font-size: 0.9rem; font-weight: 600; margin-top: 0.35rem; }
.cgtg-form [aria-invalid="true"] { border-color: #b42318 !important; background: #fff6f5; }
.form-consent .consent-label { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 500; cursor: pointer; line-height: 1.45; }
.form-consent input[type="checkbox"] { width: 1.15rem; height: 1.15rem; margin-top: 0.15rem; flex-shrink: 0; accent-color: var(--red-primary); }
.form-rgpd { font-size: 0.85rem; color: var(--gray); line-height: 1.5; margin: 0 0 1.25rem; }
.form-rgpd a { color: var(--blue-accent); }
.form-status:empty { display: none; }
.form-status { margin-top: 1rem; padding: 0.9rem 1rem; border-radius: 8px; font-weight: 600; line-height: 1.45; }
.form-status.is-info { background: var(--light-gray); color: var(--dark); }
.form-status.is-success { background: #e3f4e8; color: #14532d; }
.form-status.is-error { background: #fde8e7; color: #8a1c13; }
/* Le champ en erreur ne doit pas passer sous le bandeau fixe */
.cgtg-form input, .cgtg-form select, .cgtg-form textarea { scroll-margin-top: 120px; }
