/**
 * Trésor Public Modules - Frontend Styles
 * Design fidèle à la maquette avec rouge/crimson
 */

:root {
    --tpm-primary: #de1e61;
    --tpm-primary-dark: #b8184f;
    --tpm-primary-light: rgba(222, 30, 97, 0.08);
    --tpm-text: #1a1a1a;
    --tpm-text-secondary: #555;
    --tpm-border: #e5e5e5;
    --tpm-bg: #f8f8f8;
    --tpm-white: #ffffff;
    --tpm-radius: 12px;
    --tpm-radius-sm: 8px;
    --tpm-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --tpm-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
    --tpm-transition: all 0.25s ease;
}

/* ========================================
   SECTION WRAPPER
   ======================================== */
.tpm-section {
    padding: 0;
    margin-bottom: 0;
}

.tpm-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.tpm-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--tpm-primary-light);
    border-radius: var(--tpm-radius-sm);
    color: var(--tpm-primary);
}

.tpm-section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--tpm-text);
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

/* ========================================
   GRID SYSTEM
   ======================================== */
.tpm-grid {
    display: grid;
    gap: 20px;
}

.tpm-grid-1 { grid-template-columns: 1fr; }
.tpm-grid-2 { grid-template-columns: repeat(2, 1fr); }
.tpm-grid-3 { grid-template-columns: repeat(3, 1fr); }
.tpm-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .tpm-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .tpm-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .tpm-grid-4,
    .tpm-grid-3,
    .tpm-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   CARDS - BASE
   ======================================== */
.tpm-card {
    background: var(--tpm-white);
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    padding: 22px;
    transition: var(--tpm-transition);
    text-decoration: none;
    color: inherit;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tpm-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.06);
    border-color: #d5d5d5;
    transform: translateY(-2px);
}

.tpm-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--tpm-text);
    margin: 0 0 8px 0;
    line-height: 1.35;
}

.tpm-card-title a {
    color: var(--tpm-primary);
    text-decoration: none;
    transition: var(--tpm-transition);
}

.tpm-card-title a:hover {
    color: var(--tpm-primary-dark);
}

.tpm-card-excerpt,
.tpm-card-description {
    font-size: 13px;
    color: var(--tpm-text-secondary);
    line-height: 1.55;
    margin: 0 0 12px 0;
}

/* ========================================
   PUBLICATIONS
   ======================================== */
.tpm-pub-card .tpm-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.tpm-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: var(--tpm-primary-light);
    border-radius: var(--tpm-radius-sm);
    color: var(--tpm-primary);
}

.tpm-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tpm-primary);
    text-decoration: none;
    transition: var(--tpm-transition);
    margin-top: auto;
}

.tpm-read-more:hover {
    color: var(--tpm-primary-dark);
    gap: 10px;
}

.tpm-read-more svg {
    transition: var(--tpm-transition);
}

.tpm-pub-card {
    display: flex;
    flex-direction: column;
}

/* ========================================
   AGENDA
   ======================================== */
.tpm-agenda-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
}

.tpm-agenda-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    width: 62px;
    padding: 8px 6px;
    background: var(--tpm-primary-light);
    border-radius: 14px;
    border: 1.5px solid var(--tpm-primary);
    gap: 1px;
}

.tpm-date-day {
    font-size: 20px;
    font-weight: 800;
    color: var(--tpm-primary);
    line-height: 1.1;
}

.tpm-date-month {
    font-size: 10px;
    font-weight: 700;
    color: var(--tpm-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

/* Year small in badge */
.tpm-date-year-small {
    font-size: 11px;
    font-weight: 700;
    color: var(--tpm-primary);
    line-height: 1.2;
}

.tpm-agenda-content {
    flex: 1;
    min-width: 0;
}

.tpm-agenda-content .tpm-card-title {
    margin-bottom: 4px;
}

.tpm-agenda-content .tpm-card-description {
    margin-bottom: 8px;
    font-size: 12.5px;
}

.tpm-agenda-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tpm-text-secondary);
}

.tpm-agenda-time svg {
    color: var(--tpm-text-secondary);
}

/* ========================================
   TUTORIELS
   ======================================== */
.tpm-tuto-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    text-decoration: none;
}

.tpm-tuto-card:hover {
    text-decoration: none;
    color: inherit;
}

.tpm-tuto-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    min-width: 58px;
    border-radius: 14px;
}

.tpm-tuto-icon-video {
    background: var(--tpm-primary-light);
    color: var(--tpm-primary);
}

.tpm-tuto-icon-pdf {
    background: var(--tpm-primary-light);
    color: var(--tpm-primary);
}

.tpm-tuto-content {
    flex: 1;
    min-width: 0;
}

.tpm-tuto-content .tpm-card-title {
    margin-bottom: 4px;
}

.tpm-tuto-content .tpm-card-description {
    font-size: 12.5px;
    margin-bottom: 10px;
}

.tpm-tuto-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tpm-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.tpm-badge-video {
    background: var(--tpm-primary-light);
    color: var(--tpm-primary);
    border: 1px solid rgba(222, 30, 97, 0.2);
}

.tpm-badge-pdf {
    background: var(--tpm-primary-light);
    color: var(--tpm-primary);
    border: 1px solid rgba(222, 30, 97, 0.2);
}

.tpm-badge-duration,
.tpm-badge-pages {
    background: var(--tpm-bg);
    color: var(--tpm-text-secondary);
    border: 1px solid var(--tpm-border);
}

/* ========================================
   PUBLICATION DATE
   ======================================== */
.tpm-pub-card .tpm-card-header {
    align-items: flex-start;
}

.tpm-card-header-text {
    flex: 1;
    min-width: 0;
}

.tpm-card-date {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--tpm-text-secondary);
    margin-bottom: 4px;
}

/* ========================================
   COMMUNIQUÉS & AVIS
   ======================================== */
.tpm-communique-card {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 20px 24px;
    text-decoration: none;
    color: inherit;
}

.tpm-communique-card:hover {
    text-decoration: none;
    color: inherit;
}

.tpm-communique-card:hover .tpm-card-title {
    color: var(--tpm-primary);
}

.tpm-communique-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    min-width: 58px;
    background: var(--tpm-primary-light);
    border-radius: 14px;
    color: var(--tpm-primary);
}

.tpm-communique-content {
    flex: 1;
    min-width: 0;
}

.tpm-communique-meta-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.tpm-communique-type {
    font-size: 13px;
    font-weight: 700;
    color: var(--tpm-primary);
}

.tpm-communique-separator {
    font-size: 13px;
    color: var(--tpm-primary);
    font-weight: 700;
}

.tpm-communique-date {
    font-size: 13px;
    font-weight: 700;
    color: var(--tpm-primary);
}

.tpm-communique-content .tpm-card-title {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 6px;
    transition: color 0.25s ease;
}

.tpm-communique-content .tpm-card-description {
    font-size: 13.5px;
    color: var(--tpm-text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* ========================================
   EMPTY STATE
   ======================================== */
.tpm-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--tpm-text-secondary);
    font-size: 14px;
    background: var(--tpm-bg);
    border-radius: var(--tpm-radius);
    border: 1px dashed var(--tpm-border);
}

/* ========================================
   CLICKABLE AGENDA CARDS
   ======================================== */
a.tpm-agenda-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a.tpm-agenda-card:hover {
    text-decoration: none;
    color: inherit;
}

a.tpm-agenda-card:hover .tpm-card-title {
    color: var(--tpm-primary);
}

/* ========================================
   SINGLE PAGES (toutes fonctionnalités)
   ======================================== */
.tpm-single-page {
    max-width: 820px;
    margin: 40px auto;
    padding: 0 20px;
}

.tpm-single-inner {
    background: var(--tpm-white);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid #e8e8e8;
}

/* Breadcrumb */
.tpm-single-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--tpm-text-secondary);
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.tpm-single-breadcrumb a {
    color: var(--tpm-primary);
    text-decoration: none;
    font-weight: 600;
}

.tpm-single-breadcrumb a:hover {
    color: var(--tpm-primary-dark);
}

.tpm-breadcrumb-sep {
    color: #ccc;
}

/* Header */
.tpm-single-head {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--tpm-border);
}

.tpm-single-head-agenda,
.tpm-single-head-comm {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.tpm-single-head-text {
    flex: 1;
    min-width: 0;
}

.tpm-single-meta-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.tpm-single-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--tpm-primary);
    background: var(--tpm-primary-light);
    padding: 3px 12px;
    border-radius: 20px;
    border: 1px solid rgba(222, 30, 97, 0.15);
}

.tpm-single-badge-secondary {
    font-size: 12px;
    font-weight: 600;
    color: var(--tpm-text-secondary);
}

.tpm-single-date-text {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tpm-text-secondary);
}

.tpm-single-main-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--tpm-text);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.tpm-single-excerpt {
    font-size: 15px;
    color: var(--tpm-text-secondary);
    margin: 0;
    line-height: 1.55;
}

/* Large date badge (agenda) */
.tpm-single-date-badge-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    width: 80px;
    padding: 12px 8px;
    background: var(--tpm-primary-light);
    border-radius: 16px;
    border: 2px solid var(--tpm-primary);
    gap: 1px;
}

.tpm-single-date-badge-large .tpm-date-day {
    font-size: 28px;
    font-weight: 800;
    color: var(--tpm-primary);
    line-height: 1.1;
}

.tpm-single-date-badge-large .tpm-date-month {
    font-size: 12px;
    font-weight: 700;
    color: var(--tpm-primary);
    text-transform: uppercase;
}

.tpm-single-date-badge-large .tpm-date-year-small {
    font-size: 12px;
    font-weight: 700;
    color: var(--tpm-primary);
}

/* Bell icon (communiqués) */
.tpm-single-bell-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    min-width: 68px;
    background: var(--tpm-primary-light);
    border-radius: 16px;
    color: var(--tpm-primary);
}

/* Info grid (agenda) */
.tpm-single-info-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.tpm-single-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--tpm-bg);
    border-radius: 12px;
    padding: 14px 18px;
    flex: 1;
    min-width: 180px;
}

.tpm-single-info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: var(--tpm-primary-light);
    border-radius: 10px;
    color: var(--tpm-primary);
}

.tpm-single-info-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--tpm-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.tpm-single-info-value {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--tpm-text);
}

/* Thumbnail */
.tpm-single-thumbnail {
    margin-bottom: 28px;
    border-radius: 14px;
    overflow: hidden;
}

.tpm-single-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

/* Video embed */
.tpm-single-video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin-bottom: 28px;
    border-radius: 14px;
}

.tpm-single-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 14px;
}

/* Body content */
.tpm-single-body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--tpm-text);
    margin-bottom: 28px;
}

.tpm-single-body p {
    margin-bottom: 16px;
}

.tpm-single-body h2,
.tpm-single-body h3 {
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--tpm-text);
}

/* CTA Button */
.tpm-single-cta {
    margin-bottom: 28px;
}

.tpm-single-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: var(--tpm-primary);
    color: var(--tpm-white);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
}

.tpm-single-cta-btn:hover {
    background: var(--tpm-primary-dark);
    color: var(--tpm-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(222, 30, 97, 0.25);
}

/* Footer / Back */
.tpm-single-footer {
    padding-top: 20px;
    border-top: 1px solid var(--tpm-border);
}

.tpm-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--tpm-primary);
    text-decoration: none;
    transition: all 0.25s ease;
}

.tpm-back-link:hover {
    color: var(--tpm-primary-dark);
    gap: 12px;
}

/* Responsive single */
@media (max-width: 640px) {
    .tpm-single-inner {
        padding: 24px 18px;
    }

    .tpm-single-head-agenda,
    .tpm-single-head-comm {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .tpm-single-info-grid {
        flex-direction: column;
    }

    .tpm-single-main-title {
        font-size: 22px;
    }

    .tpm-single-page {
        margin: 20px auto;
    }
}

/* ========================================
   ARCHIVE PAGES
   ======================================== */
.tpm-archive-page {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}

.tpm-archive-inner {
    background: transparent;
}

.tpm-archive-header {
    margin-bottom: 32px;
    text-align: center;
}

.tpm-archive-title {
    font-size: 30px;
    font-weight: 800;
    color: var(--tpm-text);
    margin: 0 0 8px 0;
}

.tpm-archive-desc {
    font-size: 15px;
    color: var(--tpm-text-secondary);
    margin: 0;
}

/* ========================================
   PAGINATION
   ======================================== */
.tpm-pagination {
    margin-top: 40px !important;
    display: flex !important;
    justify-content: center !important;
}

.tpm-pagination > .page-numbers,
.tpm-pagination > ul.page-numbers {
    list-style: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
}

.tpm-pagination > ul.page-numbers > li,
.tpm-pagination > .page-numbers > li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.tpm-pagination > ul.page-numbers > li::before,
.tpm-pagination > .page-numbers > li::before,
.tpm-pagination > ul.page-numbers > li::marker,
.tpm-pagination > .page-numbers > li::marker {
    display: none !important;
    content: none !important;
}

.tpm-pagination li a,
.tpm-pagination li span,
.tpm-pagination a.page-numbers,
.tpm-pagination span.page-numbers {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
    height: 40px !important;
    padding: 0 14px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.25s ease !important;
    border: 1px solid var(--tpm-border) !important;
    background: var(--tpm-white) !important;
    color: var(--tpm-text) !important;
    line-height: 1 !important;
}

.tpm-pagination li a:hover,
.tpm-pagination a.page-numbers:hover {
    background: var(--tpm-primary-light) !important;
    border-color: var(--tpm-primary) !important;
    color: var(--tpm-primary) !important;
}

.tpm-pagination li span.current,
.tpm-pagination span.page-numbers.current {
    background: var(--tpm-primary) !important;
    border-color: var(--tpm-primary) !important;
    color: var(--tpm-white) !important;
}

.tpm-pagination li .prev,
.tpm-pagination li .next,
.tpm-pagination a.prev,
.tpm-pagination a.next {
    font-size: 13px !important;
    padding: 0 18px !important;
}

.tpm-pagination li .dots,
.tpm-pagination span.dots {
    border: none !important;
    background: transparent !important;
    color: var(--tpm-text-secondary) !important;
}

@media (max-width: 640px) {
    .tpm-pagination li a,
    .tpm-pagination li span,
    .tpm-pagination a.page-numbers,
    .tpm-pagination span.page-numbers {
        min-width: 36px !important;
        height: 36px !important;
        padding: 0 10px !important;
        font-size: 13px !important;
    }
}
