/*
 * La Compassion - Custom CSS
 * Tailwind CSS loaded via CDN in header.php
 * This file contains custom utilities, animations, and overrides
 */

/* ========================================
   CSS Variables (Design Tokens)
   ======================================== */
:root {
    --primary: #E94C13;
    --secondary: #385A91;
    --background: #ffffff;
    --foreground: #1a1a1a;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

/* ========================================
   Base
   ======================================== */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--background);
    color: var(--foreground);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   WordPress admin bar fix for fixed header
   ======================================== */
.admin-bar header.fixed {
    top: 32px !important;
}

@media screen and (max-width: 782px) {
    .admin-bar header.fixed {
        top: 46px !important;
    }
}

/* ========================================
   Custom Utilities
   ======================================== */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.overlay-gradient {
    background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0.6));
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(233, 76, 19, 0.4);
    color: white;
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

.btn-secondary:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(56, 90, 145, 0.4);
    color: white;
}

/* Card hover */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-0.25rem);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Animations / Keyframes
   ======================================== */

/* Marquee banner */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.animate-marquee {
    animation: marquee 20s linear infinite;
}

/* Dropdown fade-in */
@keyframes fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fade-in 0.15s ease-out;
}

/* Popup modal */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

.animate-scaleIn {
    animation: scaleIn 0.3s ease-out;
}

/* ========================================
   Header specifics
   ======================================== */

/* Ensure dropdown menus show above everything */
.nav-item .dropdown-menu {
    z-index: 60;
}

/* Mobile menu transitions */
.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-submenu.open {
    max-height: 500px;
}

/* ========================================
   WordPress overrides
   ======================================== */

/* Remove default WordPress margins */
.wp-block-group,
.wp-block-columns {
    margin-top: 0;
    margin-bottom: 0;
}

/* Style Gutenberg content to match theme */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
    font-weight: 700;
    line-height: 1.2;
}

.entry-content h1 { font-size: 2.25rem; }
.entry-content h2 { font-size: 1.875rem; }
.entry-content h3 { font-size: 1.5rem; }
.entry-content h4 { font-size: 1.25rem; }

.entry-content p {
    line-height: 1.75;
}

.entry-content a {
    color: var(--primary);
    text-decoration: underline;
}

.entry-content a:hover {
    color: var(--secondary);
}

/* ========================================
   Tailwind color shortcuts (for use without CDN)
   ======================================== */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.bg-primary { background-color: var(--primary); }
.bg-secondary { background-color: var(--secondary); }
.border-primary { border-color: var(--primary); }
.border-secondary { border-color: var(--secondary); }
.hover\:text-primary:hover { color: var(--primary); }
.hover\:bg-primary:hover { background-color: var(--primary); }

/* ========================================
   Gutenberg native blocks - Theme styling
   ======================================== */

/* Cover block - ensure full width */
.entry-content .wp-block-cover {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
    width: 100vw;
}

/* Group block - full width when has background (only direct children of entry-content) */
.entry-content > .wp-block-group.has-background {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
    width: 100vw;
    padding-left: max(1rem, calc((100vw - 72rem) / 2));
    padding-right: max(1rem, calc((100vw - 72rem) / 2));
}

/* Columns block */
.entry-content .wp-block-columns {
    max-width: 72rem;
    margin-left: auto;
    margin-right: auto;
    gap: 2rem;
}

/* Buttons block */
.entry-content .wp-block-button__link {
    border-radius: 0.5rem;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.entry-content .wp-block-button__link:hover {
    transform: scale(1.05);
    opacity: 0.95;
}

/* Primary button style (orange) */
.entry-content .wp-block-button.is-style-fill .wp-block-button__link {
    background-color: var(--primary);
    color: white;
}

/* Image block - rounded */
.entry-content .wp-block-image img {
    border-radius: 0.75rem;
}

.entry-content .wp-block-image.is-style-rounded img {
    border-radius: 0.75rem;
}

/* Separator */
.entry-content .wp-block-separator {
    border-color: var(--gray-200);
}

/* List styling in entry content */
.entry-content ul {
    list-style-type: disc;
    padding-left: 1.5rem;
}

.entry-content ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
}

/* Spacer between sections */
.entry-content .wp-block-spacer {
    margin: 0;
}

/* Ensure paragraphs inside columns don't have excess margin */
.entry-content .wp-block-column p:last-child {
    margin-bottom: 0;
}

/* Theme palette for Gutenberg */
.has-primary-color { color: var(--primary) !important; }
.has-secondary-color { color: var(--secondary) !important; }
.has-primary-background-color { background-color: var(--primary) !important; }
.has-secondary-background-color { background-color: var(--secondary) !important; }
.has-white-color { color: #ffffff !important; }
.has-white-background-color { background-color: #ffffff !important; }
.has-gray-color { color: var(--gray-600) !important; }
.has-gray-background-color { background-color: var(--gray-50) !important; }
.has-dark-color { color: var(--foreground) !important; }
.has-dark-background-color { background-color: var(--foreground) !important; }

/* ========================================
   Fix: Gutenberg nested groups (cards)
   ======================================== */

/* Reset padding/margin on groups used as cards */
.wp-block-group.has-background > .wp-block-group.has-background {
    margin: 0;
}

/* Ensure columns render side-by-side */
.entry-content .wp-block-columns {
    display: flex;
    flex-wrap: wrap;
}

.entry-content .wp-block-column {
    flex: 1;
    min-width: 0;
}

@media (max-width: 781px) {
    .entry-content .wp-block-columns {
        flex-direction: column;
    }
    .entry-content .wp-block-column {
        flex-basis: 100% !important;
    }
}

/* Card with colored header - needs overflow hidden */
.result-card {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
}

.result-card .card-header {
    padding: 1.5rem;
    text-align: center;
}

.result-card .card-header h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.result-card .card-body {
    padding: 2rem;
    text-align: center;
    background: white;
}

.result-card .card-body .percentage {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.result-card .card-body .label {
    color: var(--gray-600);
    font-weight: 500;
}

@media (max-width: 768px) {
    .result-card {
        margin-bottom: 1rem;
    }
    div[style*="grid-template-columns: repeat(3"],
    div[style*="grid-template-columns: repeat(2"] {
        grid-template-columns: 1fr !important;
    }
}

/* ========================================
   Pricing tables (inscriptions)
   ======================================== */
.pricing-table {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.pricing-table .table-header {
    background-color: var(--secondary);
    color: white;
    padding: 0.75rem 1.5rem;
}

.pricing-table .table-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.pricing-table .table-header p {
    font-size: 0.875rem;
    opacity: 0.9;
    margin: 0;
}

.pricing-table table {
    width: 100%;
    border-collapse: collapse;
}

.pricing-table thead {
    background-color: var(--gray-100);
}

.pricing-table th {
    padding: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    text-align: center;
    font-size: 0.875rem;
}

.pricing-table th:first-child {
    text-align: left;
}

.pricing-table th.total-col {
    color: var(--primary);
}

.pricing-table td {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid var(--gray-200);
}

.pricing-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.pricing-table td.total-cell {
    font-weight: 700;
    color: var(--primary);
}

.pricing-table tr:nth-child(even) {
    background-color: var(--gray-50);
}

.pricing-table .table-note {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    color: var(--gray-500);
    font-style: italic;
}

/* Step cards (inscriptions) */
.step-card {
    background: var(--gray-50);
    border-radius: 0.75rem;
    padding: 2rem;
    position: relative;
}

.step-card .step-number {
    position: absolute;
    top: -1rem;
    left: -1rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

/* Info card grid (bourses) */
.info-card {
    background: var(--gray-50);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.info-card h3 {
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.info-card p {
    color: var(--gray-700);
    margin: 0;
}

/* Gradient CTA box */
.gradient-cta-box {
    background: linear-gradient(to right, var(--secondary), var(--primary));
    border-radius: 0.75rem;
    padding: 2rem;
    color: white;
}

/* ========================================
   Timeline (historique)
   ======================================== */
.lc-timeline {
    position: relative;
    padding-left: 3.5rem !important;
    margin: 0 !important;
    list-style: none !important;
}

.lc-timeline::before {
    content: '' !important;
    position: absolute !important;
    left: 1.25rem !important;
    top: 0.5rem !important;
    bottom: 0 !important;
    width: 3px !important;
    background-color: #385A91 !important;
    display: block !important;
}

.lc-timeline-item {
    position: relative !important;
    margin-bottom: 2rem !important;
    padding: 0 !important;
}

.lc-timeline-item::before {
    content: '' !important;
    position: absolute !important;
    left: -2.25rem !important;
    top: 0.35rem !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
    border-radius: 50% !important;
    background-color: #E94C13 !important;
    border: 3px solid white !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25) !important;
    display: block !important;
}

.lc-timeline-item .lc-year {
    color: #E94C13 !important;
    font-weight: 700 !important;
    font-size: 1.125rem !important;
    margin: 0 0 0.25rem 0 !important;
    line-height: 1.4 !important;
}

.lc-timeline-item .lc-desc {
    color: #374151 !important;
    line-height: 1.7 !important;
    margin: 0 !important;
}

/* ========================================
   Icon card (historique "aujourd'hui")
   ======================================== */
.lc-icon-card {
    background: white !important;
    border-radius: 0.75rem !important;
    padding: 1.5rem !important;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1) !important;
}

.lc-icon-card .lc-icon-box {
    width: 3rem !important;
    height: 3rem !important;
    min-width: 3rem !important;
    min-height: 3rem !important;
    border-radius: 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 1rem !important;
}

.lc-icon-card .lc-icon-box svg {
    width: 1.5rem !important;
    height: 1.5rem !important;
    color: white !important;
    display: block !important;
}

.lc-icon-card h3 {
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    color: #385A91 !important;
    margin: 0 0 0.75rem 0 !important;
}

.lc-icon-card p {
    font-size: 0.875rem !important;
    color: #374151 !important;
    line-height: 1.6 !important;
    margin: 0 !important;
}

/* ========================================
   Navy section (projet éducatif)
   ======================================== */
.lc-navy-section {
    background-color: #385A91 !important;
    color: white !important;
    padding: 4rem 1rem !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    max-width: 100vw !important;
    width: 100vw !important;
}

.lc-navy-section h2,
.lc-navy-section h3,
.lc-navy-section p {
    color: white !important;
}

.lc-navy-card {
    background: rgba(255,255,255,0.1) !important;
    border-radius: 0.75rem !important;
    padding: 1.5rem !important;
}

.lc-navy-card .lc-card-number {
    width: 3rem !important;
    height: 3rem !important;
    min-width: 3rem !important;
    border-radius: 50% !important;
    background-color: #E94C13 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 700 !important;
    font-size: 1.25rem !important;
    margin-bottom: 1rem !important;
    color: white !important;
}

.lc-navy-card h3 {
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    margin: 0 0 1rem 0 !important;
}

.lc-navy-card p {
    font-size: 0.875rem !important;
    line-height: 1.7 !important;
    opacity: 0.85 !important;
    margin: 0 !important;
}

/* Check list (personnel) */
.lc-check-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.25rem 3rem !important;
}

.lc-check-item {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    padding: 0.5rem 0 !important;
}

.lc-check-item svg {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    color: #E94C13 !important;
    flex-shrink: 0 !important;
    margin-top: 2px !important;
}

.lc-check-item span {
    color: #374151 !important;
}

@media (max-width: 768px) {
    .lc-check-list {
        grid-template-columns: 1fr !important;
    }
    .lc-navy-section {
        padding: 2rem 1rem !important;
    }
}

/* ========================================
   Schedule list (internat)
   ======================================== */
.lc-schedule-item {
    display: flex !important;
    align-items: baseline !important;
    gap: 0.75rem !important;
    padding: 0.4rem 0 !important;
}

.lc-schedule-item .lc-time {
    color: #E94C13 !important;
    font-weight: 700 !important;
    width: 5rem !important;
    flex-shrink: 0 !important;
}

.lc-schedule-item .lc-dash {
    color: #d1d5db !important;
}

.lc-schedule-item .lc-label {
    color: #374151 !important;
}

/* Benefit card (internat) */
.lc-benefit-card {
    display: flex !important;
    align-items: flex-start !important;
    gap: 1rem !important;
    padding: 1.25rem !important;
    background: #f9fafb !important;
    border-radius: 0.75rem !important;
}

.lc-benefit-card .lc-benefit-title {
    font-weight: 700 !important;
    color: #385A91 !important;
    margin: 0 0 0.25rem 0 !important;
}

.lc-benefit-card .lc-benefit-text {
    color: #374151 !important;
    font-size: 0.875rem !important;
    line-height: 1.6 !important;
    margin: 0 !important;
}

/* Activity grid card (internat) */
.lc-activity-card {
    position: relative !important;
    border-radius: 0.75rem !important;
    overflow: hidden !important;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1) !important;
}

.lc-activity-card img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.lc-activity-card .lc-activity-overlay {
    position: absolute !important;
    inset: 0 !important;
    background: rgba(0,0,0,0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.lc-activity-card .lc-activity-overlay span {
    color: white !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
}

/* ========================================
   Circular image grid (les-plus)
   ======================================== */
.lc-category-header {
    color: white !important;
    text-align: center !important;
    padding: 0.75rem 1rem !important;
    border-radius: 0.5rem !important;
    margin-bottom: 2rem !important;
}

.lc-category-header h2 {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: white !important;
}

.lc-circular-grid {
    display: grid !important;
    gap: 2rem !important;
    justify-items: center !important;
}

.lc-circular-grid.cols-2 { grid-template-columns: repeat(2, 1fr) !important; max-width: 24rem !important; margin: 0 auto !important; }
.lc-circular-grid.cols-3 { grid-template-columns: repeat(3, 1fr) !important; }
.lc-circular-grid.cols-4 { grid-template-columns: repeat(2, 1fr) !important; }

@media (min-width: 768px) {
    .lc-circular-grid.cols-4 { grid-template-columns: repeat(4, 1fr) !important; }
}

.lc-circular-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
}

.lc-circular-item .lc-circle {
    width: 8rem !important;
    height: 8rem !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1) !important;
    margin-bottom: 0.75rem !important;
    border: 4px solid white !important;
    transition: border-color 0.3s ease !important;
}

.lc-circular-item:hover .lc-circle {
    border-color: #E94C13 !important;
}

.lc-circular-item .lc-circle img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.5s ease !important;
}

.lc-circular-item:hover .lc-circle img {
    transform: scale(1.1) !important;
}

.lc-circular-item .lc-circle-label {
    color: #374151 !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    line-height: 1.3 !important;
    max-width: 10rem !important;
}

@media (min-width: 768px) {
    .lc-circular-item .lc-circle {
        width: 9rem !important;
        height: 9rem !important;
    }
}

/* ========================================
   Blog pagination
   ======================================== */
.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--secondary);
    background: white;
    border: 1px solid var(--gray-200);
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-links .page-numbers:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.nav-links .page-numbers.current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.nav-links .prev,
.nav-links .next {
    width: auto;
    padding: 0 1rem;
}
