/**
 * SheetPro Theme Custom Styles
 */

/* WordPress Core Alignment */
.alignwide { max-width: 1200px; margin-left: auto; margin-right: auto; }
.alignfull { width: 100%; max-width: 100%; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignleft { float: left; margin-right: 1.5rem; }
.alignright { float: right; margin-left: 1.5rem; }

/* WordPress Navigation */
.nav-links { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.nav-links a, .nav-links span { padding: 0.5rem 1rem; border: 1px solid #e5e7eb; border-radius: 0.5rem; }
.nav-links .current { background: #2563eb; color: white; border-color: #2563eb; }
.nav-links a:hover { background: #f9fafb; }

/* Custom Logo */
.custom-logo-link { display: flex; align-items: center; }
.custom-logo { max-height: 40px; width: auto; }

/* Navigation Menu Items */
.menu-item a { color: #374151; font-weight: 500; transition: color 0.15s; }
.menu-item a:hover { color: #2563eb; }
.current-menu-item a { color: #2563eb; }

/* Widget Styles */
.widget { margin-bottom: 2rem; }
.widget-title { font-size: 0.875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; color: white; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget ul li { margin-bottom: 0.5rem; }
.widget ul li a { color: #9ca3af; transition: color 0.15s; }
.widget ul li a:hover { color: white; }

/* FAQ Toggle Animation */
.faq-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

/* Download Button Animation */
.download-btn { position: relative; overflow: hidden; }
.download-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}
.download-btn:active::after { width: 200px; height: 200px; }

/* Mobile Menu */
#mobile-menu.active { display: block; }

/* Cookie Banner Animation */
#cookie-banner.show { display: block; animation: slideUp 0.3s ease; }
@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Scroll to Top Button */
#scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: #2563eb;
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    z-index: 40;
}
#scroll-to-top:hover { background: #1d4ed8; transform: translateY(-2px); }
#scroll-to-top.show { display: flex; }

/* Print Styles */
@media print {
    header, footer, .download-btn, #cookie-banner, #scroll-to-top { display: none !important; }
    body { font-size: 12pt; }
    a[href]::after { content: " (" attr(href) ")"; font-size: 10pt; }
}

/* Focus Visible for Accessibility */
:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =====================================================
   EXCEL MOCKUP STYLES
   ===================================================== */

.excel-mockup-container {
    position: relative;
    transform: perspective(1000px) rotateY(-5deg) rotateX(2deg);
    transition: transform 0.3s ease;
}

.excel-mockup-container:hover {
    transform: perspective(1000px) rotateY(-2deg) rotateX(1deg);
}

.excel-window {
    background: #f3f3f3;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 11px;
}

/* Title Bar */
.excel-titlebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, #217346 0%, #1a5c38 100%);
    padding: 6px 12px;
    color: white;
}

.excel-titlebar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.excel-icon {
    width: 18px;
    height: 18px;
}

.excel-filename {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.95;
}

.excel-titlebar-buttons {
    display: flex;
    gap: 8px;
}

.excel-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.excel-btn.minimize { background: #f5c242; }
.excel-btn.maximize { background: #3dc04f; }
.excel-btn.close { background: #ed594a; }

/* Ribbon */
.excel-ribbon {
    background: #217346;
    padding: 4px 12px;
    border-bottom: 1px solid #1a5c38;
}

.excel-ribbon-tabs {
    display: flex;
    gap: 16px;
    color: white;
    font-size: 11px;
}

.excel-ribbon-tabs span {
    padding: 4px 0;
    opacity: 0.7;
    cursor: pointer;
}

.excel-ribbon-tabs span.active {
    opacity: 1;
    border-bottom: 2px solid white;
}

/* Formula Bar */
.excel-formula-bar {
    display: flex;
    align-items: center;
    background: white;
    border-bottom: 1px solid #d6d6d6;
    padding: 4px 8px;
    gap: 8px;
}

.excel-cell-ref {
    min-width: 50px;
    padding: 2px 6px;
    background: #f5f5f5;
    border: 1px solid #d6d6d6;
    font-size: 10px;
    text-align: center;
}

.excel-fx {
    color: #666;
    font-style: italic;
    font-size: 10px;
}

.excel-formula-input {
    flex: 1;
    padding: 2px 6px;
    background: white;
    border: 1px solid #d6d6d6;
    font-size: 10px;
    color: #333;
    min-height: 18px;
}

/* Spreadsheet Grid */
.excel-sheet-area {
    background: white;
    overflow: hidden;
}

.excel-grid {
    display: grid;
    grid-template-columns: 30px repeat(5, minmax(0, 1fr));
    border: 1px solid #d6d6d6;
}

.excel-corner {
    background: #f5f5f5;
    border-right: 1px solid #c0c0c0;
    border-bottom: 1px solid #c0c0c0;
}

.excel-col-header {
    background: #f5f5f5;
    border-right: 1px solid #c0c0c0;
    border-bottom: 1px solid #c0c0c0;
    padding: 4px;
    text-align: center;
    font-weight: 500;
    color: #333;
}

.excel-row-header {
    background: #f5f5f5;
    border-right: 1px solid #c0c0c0;
    border-bottom: 1px solid #c0c0c0;
    padding: 4px;
    text-align: center;
    font-weight: 500;
    color: #333;
}

.excel-cell {
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding: 4px 6px;
    min-height: 22px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333;
}

/* Cell Types */
.excel-cell.header-cell {
    background: #217346;
    color: white;
    font-weight: 600;
}

.excel-cell.number-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.excel-cell.currency-cell {
    text-align: right;
    color: #1a5c38;
    font-weight: 500;
}

.excel-cell.total-label {
    font-weight: 600;
    text-align: right;
}

.excel-cell.total-cell {
    font-weight: 700;
    text-align: right;
    background: #f0f7f4;
}

.excel-cell.total-cell.highlight {
    background: #d4edda;
    color: #155724;
}

.excel-cell.positive {
    color: #28a745;
}

.excel-cell.warning {
    color: #ffc107;
}

.excel-cell.critical {
    color: #dc3545;
    font-weight: 600;
}

/* Sheet Tabs */
.excel-sheet-tabs {
    display: flex;
    align-items: flex-end;
    background: #e0e0e0;
    padding: 4px 8px 0;
    gap: 2px;
}

.excel-sheet-tab {
    background: #f5f5f5;
    padding: 4px 12px;
    border-radius: 4px 4px 0 0;
    font-size: 10px;
    color: #666;
    cursor: pointer;
    border: 1px solid #c0c0c0;
    border-bottom: none;
}

.excel-sheet-tab.active {
    background: white;
    color: #333;
    font-weight: 500;
}

.excel-sheet-tab-add {
    padding: 4px 8px;
    color: #888;
    cursor: pointer;
    font-size: 12px;
}

/* Status Bar */
.excel-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #217346;
    padding: 3px 12px;
    color: white;
    font-size: 10px;
}

.excel-status-left {
    opacity: 0.9;
}

.excel-zoom {
    opacity: 0.8;
}

/* Decorative Elements */
.excel-mockup-shadow {
    position: absolute;
    bottom: -15px;
    left: 10%;
    right: 10%;
    height: 20px;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.2) 0%, transparent 70%);
    filter: blur(8px);
    z-index: -1;
}

.excel-mockup-reflection {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
    border-radius: 8px 8px 0 0;
}

/* Preview Notice */
.excel-preview-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.excel-preview-notice .notice-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
}

.excel-preview-notice p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
}

.excel-preview-notice strong {
    color: white;
}

/* ============ AVG Search (header centered + hero + mobile) ============ */
.avg-search-form { position: relative; }
/* header variant: hidden on mobile, flex-grow centered on desktop */
.avg-search-form--header { display: none; }
@media (min-width: 768px) {
  .avg-search-form--header { display: flex; align-items: center; }
}
.avg-search-input {
  width: 100%; padding: 0.55rem 0.9rem 0.55rem 2.4rem;
  font-size: 0.875rem; color: #111827;
  background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 0.5rem;
  outline: none; transition: box-shadow .15s, border-color .15s; -webkit-appearance: none;
}
.avg-search-input:focus { border-color: var(--avg-secondary,#3B82F6); box-shadow: 0 0 0 3px rgba(59,130,246,.18); background:#fff; }
.avg-search-icon { position:absolute; left:0.8rem; top:50%; transform:translateY(-50%); width:1rem; height:1rem; color:#9ca3af; pointer-events:none; }
.avg-search-submit { position:absolute; right:0.35rem; top:50%; transform:translateY(-50%); background:transparent; border:0; cursor:pointer; padding:0.3rem; color:#9ca3af; display:flex; align-items:center; }
.avg-search-submit:hover { color: var(--avg-secondary,#3B82F6); }
/* hero variant */
.avg-search-form--hero { max-width:36rem; margin:0 auto 2rem; }
.avg-search-form--hero .avg-search-input { padding:1rem 7.5rem 1rem 2.9rem; font-size:1rem; background:#fff; border:0; border-radius:0.75rem; box-shadow:0 20px 40px -12px rgba(0,0,0,.35); }
.avg-search-form--hero .avg-search-icon { left:1.1rem; width:1.25rem; height:1.25rem; }
.avg-search-form--hero .avg-search-button { position:absolute; right:0.5rem; top:50%; transform:translateY(-50%); background:var(--avg-secondary,#3B82F6); color:#fff; font-weight:600; border:0; border-radius:0.5rem; padding:0.6rem 1.4rem; cursor:pointer; transition:background .15s; }
.avg-search-form--hero .avg-search-button:hover { background:var(--avg-primary,#1E3A8A); }
/* mobile variant */
.avg-search-form--mobile { padding:0 0.5rem 0.5rem; display:block; }

/* nav spacing (compiled tailwind lacks space-x-6) */
.avg-header-nav { gap: 1.75rem; }
.avg-header-nav > ul { display:flex; align-items:center; gap:1.75rem; margin:0; padding:0; list-style:none; }
.avg-header-nav > ul > a, .avg-header-nav > ul > li { white-space: nowrap; }
.avg-search-form--header { max-width: 30rem; margin-left: 2.5rem; margin-right: 2.5rem; }
@media (max-width: 1100px){ .avg-search-form--header { margin-left:1.25rem; margin-right:1.25rem; } }

/* ═══════════════════════════════════════════════════
   Tableur Facile identity — French palette + slate
   Overrides the Tailwind blue palette site-wide
   ═══════════════════════════════════════════════════ */
:root { --avg-primary: #7A0C20; --avg-secondary: #C8102E; }
.from-blue-900 { --tw-gradient-from: #7A0C20 !important; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(122,12,32,0)) !important; }
.via-blue-800 { --tw-gradient-stops: var(--tw-gradient-from), #9B1C31, var(--tw-gradient-to, rgba(155,28,49,0)) !important; }
.to-blue-700 { --tw-gradient-to: #B91C3C !important; }
.bg-blue-600 { background-color: #C8102E !important; }
.hover\:bg-blue-700:hover { background-color: #9B1C31 !important; }
.bg-blue-700 { background-color: #9B1C31 !important; }
.text-blue-600 { color: #C8102E !important; }
.hover\:text-blue-700:hover { color: #9B1C31 !important; }
.text-blue-100 { color: #FECDD3 !important; }
.text-blue-200 { color: #FDA4AF !important; }
.bg-blue-100 { background-color: #FFE4E6 !important; }
.bg-blue-50 { background-color: #FFF1F2 !important; }
.border-blue-200 { border-color: #FECDD3 !important; }
.hover\:bg-blue-50:hover { background-color: #FFF1F2 !important; }
.bg-white\/10 { background-color: rgba(255,255,255,0.12) !important; }

/* MOBILE-AVATAR-FIX: img.avatar max-width:100% + flex aplastaba los avatares */
img.avatar{max-width:none;flex-shrink:0;align-self:center}
[class*="__avatar"]{flex-shrink:0}

/* ===== FASE 1 build: clases Tailwind faltantes (scan del tema completo) ===== */
/* spacing / sizing */
.w-20{width:5rem}
.h-20{height:5rem}
.w-auto{width:auto}
.h-auto{height:auto}
.gap-2\.5{gap:0.625rem}
.gap-5{gap:1.25rem}
.gap-10{gap:2.5rem}
.gap-x-6{column-gap:1.5rem}
.gap-y-3{row-gap:0.75rem}
.mb-1{margin-bottom:0.25rem}
.mb-3{margin-bottom:0.75rem}
.mb-5{margin-bottom:1.25rem}
.mb-16{margin-bottom:4rem}
.mt-10{margin-top:2.5rem}
.mx-2{margin-left:0.5rem;margin-right:0.5rem}
.my-8{margin-top:2rem;margin-bottom:2rem}
.pt-2{padding-top:0.5rem}
.py-14{padding-top:3.5rem;padding-bottom:3.5rem}
.space-y-12>:not([hidden])~:not([hidden]){margin-top:3rem}
.min-w-0{min-width:0}
.max-w-lg{max-width:32rem}
.max-w-2xl{max-width:42rem}
/* type / misc */
.leading-relaxed{line-height:1.625}
.tracking-wider{letter-spacing:0.05em}
.no-underline{text-decoration-line:none}
.rounded-md{border-radius:0.375rem}
.border-b{border-bottom-width:1px}
/* colors */
.bg-green-100{background-color:#dcfce7}
.bg-purple-100{background-color:#f3e8ff}
.text-purple-600{color:#9333ea}
.text-gray-300{color:#d1d5db}
.text-blue-100\/80{color:rgba(254,205,211,0.8)}
.border-white\/30{border-color:rgba(255,255,255,0.3)}
.border-blue-600\/30{border-color:rgba(200,16,46,0.3)}
.hover\:bg-white\/20:hover{background-color:rgba(255,255,255,0.2)}
/* responsive */
@media (min-width:640px){
  .sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (min-width:768px){
  .md\:flex-row{flex-direction:row}
}
@media (min-width:1024px){
  .lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}
  .lg\:p-8{padding:2rem}
  .lg\:p-12{padding:3rem}
  .lg\:text-4xl{font-size:2.25rem;line-height:2.5rem}
}
/* prose typography modifiers (color overrides) */
.prose-sm{font-size:0.875rem;line-height:1.7142857}
.prose-headings\:text-gray-900 :is(h1,h2,h3,h4){color:#111827}
.prose-p\:text-gray-600 p{color:#4b5563}
.prose-li\:text-gray-600 li{color:#4b5563}
.prose-a\:text-blue-600 a{color:#C8102E}
.prose-strong\:text-gray-900 strong{color:#111827}
/* ---- E-E-A-T author avatars: round + centered, no squash ---- */
.tf-byline-item{align-items:center}
.tf-byline-avatar{display:inline-flex;flex-shrink:0;line-height:0}
.tf-byline-avatar img,.tf-byline-avatar .tf-avatar-img{width:44px;height:44px;min-width:44px;border-radius:9999px;object-fit:cover;display:block;max-width:none;border:2px solid rgba(255,255,255,.45)}
.tf-author-photo{flex-shrink:0}
.tf-author-photo img,.tf-author-photo .tf-avatar-img{width:100%;height:100%;object-fit:cover;display:block;max-width:none;border-radius:9999px}
/* ---- Missing Tailwind utilities used by redesigned pages (purged build didn't include them) ---- */
.border-blue-100{border-color:var(--avg-primary-light)}
.border-white\/15{border-color:rgba(255,255,255,.15)}
.border-white\/20{border-color:rgba(255,255,255,.2)}
.break-words{overflow-wrap:break-word;word-break:break-word}
.gap-1\.5{gap:.375rem}
.h-9{height:2.25rem}.h-11{height:2.75rem}
.w-9{width:2.25rem}.w-11{width:2.75rem}
.leading-snug{line-height:1.375}
.max-w-xl{max-width:36rem}
.max-w-6xl{max-width:72rem}
.mb-10{margin-bottom:2.5rem}
.mt-5{margin-top:1.25rem}
.opacity-20{opacity:.2}
.pb-6{padding-bottom:1.5rem}
.pointer-events-none{pointer-events:none}
.px-3\.5{padding-left:.875rem;padding-right:.875rem}
.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}
.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}
.rounded-3xl{border-radius:1.5rem}
.space-y-5>:not([hidden])~:not([hidden]){margin-top:1.25rem}
.text-base{font-size:1rem;line-height:1.5rem}
.text-blue-50{color:#eafaf7}
/* universal WP avatar safety (never squash/stretch) */
img.avatar{max-width:none;flex-shrink:0;align-self:center}
@media (min-width:640px){
  .sm\:gap-6{gap:1.5rem}
  .sm\:gap-8{gap:2rem}
  .sm\:items-start{align-items:flex-start}
  .sm\:px-12{padding-left:3rem;padding-right:3rem}
  .sm\:text-left{text-align:left}
  .sm\:text-sm{font-size:.875rem;line-height:1.25rem}
}
@media (min-width:1024px){
  .lg\:gap-8{gap:2rem}
  .lg\:mb-12{margin-bottom:3rem}
  .lg\:mb-16{margin-bottom:4rem}
  .lg\:mt-10{margin-top:2.5rem}
  .lg\:p-6{padding:1.5rem}
  .lg\:px-6{padding-left:1.5rem;padding-right:1.5rem}
  .lg\:px-16{padding-left:4rem;padding-right:4rem}
  .lg\:py-20{padding-top:5rem;padding-bottom:5rem}
  .lg\:py-24{padding-top:6rem;padding-bottom:6rem}
  .lg\:text-3xl{font-size:1.875rem;line-height:2.25rem}
  .lg\:text-6xl{font-size:3.75rem;line-height:1}
  .lg\:text-lg{font-size:1.125rem;line-height:1.75rem}
  .lg\:text-xl{font-size:1.25rem;line-height:1.75rem}
}
