/* ==========================================================================
   Theme CMA Guadeloupe - Mobile First & Performance Optimized
   ========================================================================== */

/* Variables CSS CMA */
:root {
    --cma-rouge: #a8131d;
    --cma-rouge-clair: #ea4b3c;
    --cma-bleu: #0f3250;
    --cma-bleu-clair: #b0d2d9;
    --cma-orange: #cd493d;
    
    /* Variables système */
    --font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --transition-fast: 0.2s ease-out;
    --shadow-card: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
}

/* Reset et base mobile */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-system);
}    line-height: 1.6;
    color: #333;
    background: #fff;
}

/* Typography mobile-first */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    line-height: 1.2;
    font-weight: 600;
}

h1, .h1 { font-size: 1.75rem; }
h2, .h2 { font-size: 1.5rem; }
h3, .h3 { font-size: 1.25rem; }
h4, .h4 { font-size: 1.125rem; }
h5, .h5 { font-size: 1rem; }
h6, .h6 { font-size: 0.875rem; }

/* Tablettes et plus */
@media screen and (min-width: 40em) {
    h1, .h1 { font-size: 2.5rem; }
    h2, .h2 { font-size: 2rem; }
    h3, .h3 { font-size: 1.5rem; }
    h4, .h4 { font-size: 1.25rem; }
}

/* Desktop */
@media screen and (min-width: 64em) {
    h1, .h1 { font-size: 3rem; }    h2, .h2 { font-size: 2.25rem; }
}

/* Composants Foundation surchargés */
.button {
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.button.primary {
    background-color: var(--cma-rouge);
    color: white;
}

.button.primary:hover,
.button.primary:focus {
    background-color: var(--cma-rouge-clair);
}

.button.hollow {
    border-color: var(--cma-bleu);
    color: var(--cma-bleu);
}

.button.hollow.white {
    border-color: white;
    color: white;
}

.button.hollow:hover,.button.hollow:focus {
    background-color: var(--cma-bleu);
    border-color: var(--cma-bleu);
    color: white;
}

/* Cards avec effets */
.card {
    border: none;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-fast);
    height: 100%;
}

.card.hover-lift {
    cursor: pointer;
}

.card.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

/* Hero section mobile */
.hero-section {
    background: var(--cma-bleu);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.hero-section .lead {
    font-size: 1.125rem;    opacity: 0.9;
    margin-bottom: 2rem;
}

@media screen and (min-width: 40em) {
    .hero-section {
        padding: 4rem 0;
    }
    
    .hero-section .lead {
        font-size: 1.25rem;
    }
}

/* Quick access section */
.quick-access {
    padding: 3rem 0;
    background: #f8f9fa;
}

.quick-access h2 {
    color: var(--cma-bleu);
    margin-bottom: 2rem;
}

/* Icons Foundation */
.fi-torso-business,
.fi-lightbulb,
.fi-pencil,
.fi-flag {
    color: var(--cma-rouge);
}

.size-48 {    font-size: 48px;
}

/* News section */
.news-section {
    padding: 3rem 0;
}

.news-section article img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* Events section */
.events-section {
    padding: 3rem 0;
    background: #f8f9fa;
}

.event-card {
    display: flex;
    align-items: center;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    margin-bottom: 1rem;
}

.event-date {
    background: var(--cma-rouge);
    color: white;
    padding: 0.75rem;    border-radius: 4px;
    text-align: center;
    margin-right: 1rem;
    min-width: 60px;
}

.event-date .day {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
}

.event-date .month {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* Contact section */
.contact-section {
    padding: 3rem 0;
}

.location-item {
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.location-item:hover {
    background: #f8f9fa;
    padding-left: 1rem;}

/* Map responsive */
.gis-map {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

/* Header sticky mobile */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--cma-bleu);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.site-header .logo-link {
    display: inline-block;
    padding: 0.5rem 0;
}

.site-header .logo-text {
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
}

/* Navigation principale */
.main-nav .dropdown.menu {
    background: transparent;
}

.main-nav .dropdown.menu > li > a {    color: white;
    padding: 0.5rem 1rem;
    transition: all var(--transition-fast);
}

.main-nav .dropdown.menu > li > a:hover {
    background: rgba(255,255,255,0.1);
}

/* Off-canvas mobile */
.off-canvas {
    background: var(--cma-bleu);
    color: white;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-nav-header h2 {
    margin: 0;
    color: white;
}

.mobile-search {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-search input {    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
    color: white;
}

.mobile-search input::placeholder {
    color: rgba(255,255,255,0.7);
}

.off-canvas a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.off-canvas a:hover {
    background: rgba(255,255,255,0.1);
}

.mobile-contact-info {
    padding: 1rem;
    margin-top: 2rem;
}

/* Footer */
.site-footer {
    background: var(--cma-bleu);
    color: white;
    margin-top: 4rem;
}

.footer-main {    padding: 3rem 0;
}

.footer-main h3 {
    color: white;
    margin-bottom: 1rem;
}

.footer-main a {
    color: rgba(255,255,255,0.8);
    transition: color var(--transition-fast);
}

.footer-main a:hover {
    color: white;
}

.footer-main ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-main li {
    margin-bottom: 0.5rem;
}

.social-links {
    margin-top: 1rem;
}

.social-links a {
    display: inline-block;
    margin-right: 0.75rem;    font-size: 1.5rem;
}

.footer-bottom {
    background: rgba(0,0,0,0.2);
    padding: 1.5rem 0;
}

.footer-bottom a {
    color: rgba(255,255,255,0.8);
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--cma-rouge);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 99;
    box-shadow: var(--shadow-hover);
}

.back-to-top.show {    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--cma-rouge-clair);
    transform: translateY(-2px);
}

/* HTMX loading */
.htmx-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast);
}

.htmx-request .htmx-indicator {
    opacity: 1;
    visibility: visible;
}

.loader {
    background: white;
    padding: 2rem;    border-radius: 8px;
    box-shadow: var(--shadow-hover);
}

/* Lazy loading animation */
.lazy-section {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.lazy-section.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Utilities */
.color-primary { color: var(--cma-rouge); }
.bg-primary { background-color: var(--cma-rouge); }
.text-small { font-size: 0.875rem; }
.text-muted { color: #6c757d; }
.no-margin { margin: 0; }
.no-bullet { list-style: none; padding-left: 0; }

/* Formulaires SPIP adaptés */
.formulaire_spip input[type="text"],
.formulaire_spip input[type="email"],
.formulaire_spip input[type="tel"],
.formulaire_spip textarea {
    width: 100%;
    margin-bottom: 1rem;
}

/* Print styles */@media print {
    .no-print,
    .off-canvas,
    .site-header,
    .button,
    .htmx-indicator,
    .back-to-top,
    .mobile-nav-header {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
    }
    
    a {
        text-decoration: underline;
    }
    
    .site-footer {
        background: none;
        color: black;
    }
}

/* Accessibility */
.show-on-focus {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.show-on-focus:focus {    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    background: var(--cma-bleu);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    display: inline-block;
}

/* Focus visible pour navigation clavier */
.keyboard-nav *:focus {
    outline: 3px solid var(--cma-orange);
    outline-offset: 2px;
}

/* Performance: conteneur des images lazy */
img[loading="lazy"] {
    background: #f0f0f0;
}

/* Conteneur principal responsive */
@media screen and (min-width: 1200px) {
    .grid-container {
        max-width: 1200px;
    }
}

/* Menu icon Foundation override */
.menu-icon {
    width: auto;
    height: auto;
    background: transparent;
}

.menu-icon::after {
    display: none;
}/* Styles spécifiques page d'accueil (sommaire) */

/* Hero avec recherche */
.hero-search .input-group {
    margin-top: 2rem;
}

.hero-search input {
    height: 3rem;
    font-size: 1.125rem;
}

.hero-search .button {
    height: 3rem;
    padding: 0 1.5rem;
}

/* Profile cards */
.profile-card {
    text-decoration: none;
    color: inherit;
    display: block;
}

.profile-card .card {
    min-height: 280px;
    display: flex;
    align-items: center;
}

.profile-card i {
    color: var(--cma-rouge);
    margin-bottom: 1rem;
}

.size-72 {
    font-size: 72px;
}

/* Service boxes */.service-box {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    text-align: center;
    height: 100%;
}

.service-box i {
    color: var(--cma-orange);
    margin-bottom: 1rem;
}

.service-box h3 {
    color: var(--cma-bleu);
    margin-bottom: 1.5rem;
}

.service-box ul {
    text-align: left;
}

.service-box li {
    padding: 0.25rem 0;
}

/* News cards */
.news-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-card .news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-card .card-section {    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card h3 {
    flex: 1;
}

.read-more {
    color: var(--cma-rouge);
    font-weight: 500;
}

/* Event items */
.event-item {
    background: white;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.event-item:hover {
    box-shadow: var(--shadow-hover);
}

.event-item a {
    padding: 1rem;
    text-decoration: none;
    color: inherit;
}

.event-info {
    padding-left: 1rem;
}

/* Key numbers */
.key-numbers {
    background: var(--cma-bleu);
    color: white;    padding: 4rem 0;
}

.key-numbers h2 {
    color: white;
    margin-bottom: 3rem;
}

.stat-box {
    margin: 2rem 0;
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    display: block;
    font-size: 1rem;
    opacity: 0.9;
}

/* Location cards */
.location-card {
    background: white;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-fast);
}

.location-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
}

/* Final CTA */.final-cta {
    background: linear-gradient(135deg, var(--cma-rouge) 0%, var(--cma-rouge-clair) 100%);
    color: white;
    padding: 4rem 0;
    margin-top: 4rem;
}

.final-cta h2 {
    color: white;
}

.final-cta .button.hollow.white:hover {
    background: white;
    color: var(--cma-rouge);
}

/* Responsive adjustments */
@media screen and (max-width: 39.9375em) {
    .stat-number {
        font-size: 2rem;
    }
    
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .service-box {
        margin-bottom: 1rem;
    }
}
/* ==========================================================================
   Styles spécifiques Articles
   ========================================================================== */

.article-header {
    margin-bottom: 2rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.875rem;
}

.article-chapo {
    font-size: 1.25rem;
    margin: 2rem 0;
    color: #495057;
}

.article-image {
    width: 100%;
    margin: 2rem 0;
    border-radius: 8px;
}

.article-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.article-content h2 {    margin-top: 3rem;
    margin-bottom: 1rem;
}

.article-documents {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    margin: 3rem 0;
}

.document-item {
    padding: 0.5rem 0;
}

.document-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.article-share {
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid #e9ecef;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.related-articles {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid #e9ecef;
}

/* Sidebar */
.sidebar-box {
    background: white;
    padding: 1.5rem;
    margin-bottom: 2rem;    border-radius: 8px;
    box-shadow: var(--shadow-card);
}

.contact-box {
    background: var(--cma-bleu);
    color: white;
}

.contact-box h3 {
    color: white;
}

/* ==========================================================================
   Styles spécifiques Rubriques
   ========================================================================== */

.rubrique-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e9ecef;
}

.sous-rubriques {
    margin-bottom: 3rem;
}

.filters-bar {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.article-card {
    height: 100%;
    transition: all var(--transition-fast);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.empty-state {    padding: 4rem 2rem;
}

/* ==========================================================================
   Styles spécifiques Événements
   ========================================================================== */

.event-datetime {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
}

.date-box {
    background: var(--cma-rouge);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    min-width: 100px;
}

.date-box.large {
    padding: 1.5rem;
    min-width: 120px;
}

.date-box .day {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    line-height: 1;
}

.date-box .month {
    display: block;
    font-size: 1rem;
    text-transform: uppercase;
    margin: 0.25rem 0;
}

.date-box .year {
    display: block;
    font-size: 0.875rem;    opacity: 0.8;
}

.event-info-box {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.event-actions {
    margin: 3rem 0;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.event-item.past {
    opacity: 0.7;
}

.calendar-widget {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    margin-bottom: 2rem;
}

/* ==========================================================================
   Pagination Foundation
   ========================================================================== */

.pagination-wrapper {
    margin: 3rem 0;
    display: flex;
    justify-content: center;
}

.pagination {
    margin-bottom: 0;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.breadcrumb {    margin: 1rem 0 2rem;
}

.breadcrumbs {
    font-size: 0.875rem;
}

/* ==========================================================================
   Utilitaires additionnels
   ========================================================================== */

.margin-top-1 { margin-top: 1rem; }
.margin-top-2 { margin-top: 2rem; }
.margin-right-1 { margin-right: 1rem; }
.margin-bottom-1 { margin-bottom: 1rem; }
.margin-bottom-2 { margin-bottom: 2rem; }

.tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 0.875rem;
}

.hide {
    display: none !important;
}

/* ==========================================================================
   Media Queries Responsive
   ========================================================================== */

/* Tablettes */
@media screen and (min-width: 40em) and (max-width: 63.9375em) {
    .event-datetime {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .share-buttons .button {
        min-width: 120px;
    }
}

/* Mobile uniquement */
@media screen and (max-width: 39.9375em) {
    .article-content {
        font-size: 1rem;
    }
    
    .event-datetime {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .date-box.large {
        margin: 0 auto;
    }
    
    .filters-form select {
        width: 100%;
    }
    
    .sidebar-box {
        margin-top: 3rem;
    }
}