/* =============================================================================
   Flexi Dog — main.css
   Architecture : variables CSS → reset → typo → layouts → composants
   ============================================================================= */

/* ===== VARIABLES ===== */
:root {
    /* Palette */
    --c-blue-700: #1A6B9A;
    --c-blue-500: #2585B8;
    --c-blue-300: #6BA9CE;
    --c-blue-100: #E5F0F7;

    --c-green-700: #2E8B57;
    --c-green-500: #3DAB6E;
    --c-green-100: #E6F4EC;

    --c-orange-700: #D55905;
    --c-orange-500: #E8640A;
    --c-orange-300: #FFB075;

    --c-bg: #F8F9FA;
    --c-bg-card: #FFFFFF;
    --c-bg-dark: #1D1D1F;

    --c-text: #1D1D1F;
    --c-text-body: #333333;
    --c-text-mute: #86868B;
    --c-border: #E5E5E7;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 40px;
    --space-8: 56px;
    --space-9: 72px;
    --space-10: 96px;
    --space-11: 128px;

    /* Typo */
    --ff-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --fs-base: 16px;
    --lh-base: 1.6;
    --fs-h1: clamp(1.75rem, 4vw, 2.5rem);
    --fs-h2: clamp(1.5rem, 3vw, 2rem);
    --fs-h3: 1.25rem;
    --fs-h4: 1.125rem;
    --fs-small: 0.875rem;
    --fs-xs: 0.75rem;

    /* Layout */
    --container-max: 1200px;
    --container-px: var(--space-4);
    --header-h: 64px;
    --topbar-h: 32px;

    /* Effets */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,.1);
    --transition: 0.2s ease-out;
}

/* ===== FONTS ===== */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Regular.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Medium.woff2') format('woff2');
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-SemiBold.woff2') format('woff2');
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Bold.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--ff-base);
    font-size: var(--fs-base);
    line-height: var(--lh-base);
    color: var(--c-text-body);
    background: var(--c-bg);
    min-height: 100vh;
    overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--c-blue-700); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--c-blue-500); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }
:focus-visible { outline: 3px solid var(--c-blue-500); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ===== TYPO ===== */
h1, h2, h3, h4, h5, h6 { color: var(--c-text); font-weight: 700; line-height: 1.25; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); font-weight: 600; }
p { margin-bottom: var(--space-4); }
strong { font-weight: 600; }

/* ===== UTILITY LAYOUTS ===== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-px);
}
.section { padding: var(--space-8) 0; }
.section--lg { padding: var(--space-10) 0; }
.section--alt { background: var(--c-bg-card); }
.section--brand { background: var(--c-blue-100); }
.text-center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -100px; left: var(--space-4); background: var(--c-blue-700); color: #fff; padding: var(--space-3) var(--space-4); z-index: 999; }
.skip-link:focus { top: var(--space-4); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-sm);
    font-weight: 600; font-size: var(--fs-base);
    text-decoration: none; cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    min-height: 44px;
}
.btn--primary { background: var(--c-orange-700); color: #fff; }
.btn--primary:hover { background: #B84804; color: #fff; transform: translateY(-1px); }
.btn--secondary { background: var(--c-blue-700); color: #fff; }
.btn--secondary:hover { background: var(--c-blue-500); color: #fff; }
.btn--ghost { background: transparent; color: var(--c-blue-700); border: 2px solid var(--c-blue-700); }
.btn--ghost:hover { background: var(--c-blue-700); color: #fff; }
.btn--on-dark { background: var(--c-orange-500); color: #fff; }
.btn--on-dark:hover { background: var(--c-orange-700); color: #fff; }

/* ===== TOPBAR ===== */
.topbar {
    background: var(--c-blue-700); color: #fff;
    font-size: var(--fs-xs);
    text-align: center;
    padding: var(--space-2) var(--space-4);
    line-height: 1.3;
}

/* ===== HEADER ===== */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--c-border);
    position: sticky; top: 0; z-index: 100;
    transition: box-shadow var(--transition);
}
.site-header.is-scrolled { box-shadow: var(--shadow-md); }
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) var(--container-px);
    max-width: var(--container-max); margin: 0 auto;
    min-height: var(--header-h);
}
.site-logo { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 700; color: var(--c-blue-700); font-size: 1.125rem; }
.site-logo svg { width: 32px; height: 32px; }
.main-nav { display: none; }
@media (min-width: 1024px) {
    .main-nav { display: flex; gap: var(--space-5); }
    .main-nav a { color: var(--c-text-body); font-weight: 500; padding: var(--space-2) 0; position: relative; }
    .main-nav a:hover, .main-nav .current-menu-item > a { color: var(--c-blue-700); }
    .main-nav .current-menu-item > a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--c-blue-700); }
}
.header-actions { display: flex; align-items: center; gap: var(--space-3); }
.cart-link {
    display: inline-flex; align-items: center; gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--c-bg);
    border-radius: var(--radius-md);
    color: var(--c-text-body); font-weight: 500; font-size: var(--fs-small);
    position: relative;
}
.cart-link:hover { background: var(--c-blue-100); color: var(--c-blue-700); }
.cart-count {
    background: var(--c-orange-500); color: #fff;
    min-width: 20px; height: 20px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    padding: 0 5px;
}
.hamburger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
}
@media (min-width: 1024px) { .hamburger { display: none; } }
.hamburger svg { width: 24px; height: 24px; }

/* ===== DRAWER MOBILE ===== */
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(320px, 80vw);
    background: #fff;
    transform: translateX(100%);
    transition: transform var(--transition);
    z-index: 200;
    overflow-y: auto;
    padding: var(--space-5);
}
body.menu-open .drawer { transform: translateX(0); }
.drawer-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    opacity: 0; pointer-events: none;
    transition: opacity var(--transition);
    z-index: 150;
}
body.menu-open .drawer-overlay { opacity: 1; pointer-events: auto; }
.drawer-close { position: absolute; top: var(--space-3); right: var(--space-3); width: 40px; height: 40px; }
.drawer-nav { margin-top: var(--space-7); }
.drawer-nav a {
    display: block;
    padding: var(--space-3) 0;
    color: var(--c-text);
    font-size: 1.125rem;
    font-weight: 500;
    border-bottom: 1px solid var(--c-border);
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, var(--c-blue-700) 0%, var(--c-green-700) 100%);
    color: #fff;
    padding: var(--space-9) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero h1 { color: #fff; margin-bottom: var(--space-4); }
.hero p { font-size: 1.125rem; opacity: .95; margin-bottom: var(--space-6); }
.hero .btn--on-dark { font-size: 1.125rem; padding: var(--space-4) var(--space-6); }

/* ===== CARD ===== */
.card {
    background: var(--c-bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--c-border);
}
.card--featured {
    border-left: 4px solid var(--c-orange-500);
    padding-left: var(--space-5);
}
.card__title { margin-bottom: var(--space-2); }
.card__meta { color: var(--c-text-mute); font-size: var(--fs-small); }

/* ===== GRID ===== */
.grid { display: grid; gap: var(--space-5); }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr 1fr; }
@media (min-width: 768px) {
    .grid--2 { grid-template-columns: 1fr 1fr; }
    .grid--3 { grid-template-columns: repeat(3, 1fr); }
    .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex; align-items: center; gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: 12px;
    font-size: var(--fs-xs);
    font-weight: 600;
    line-height: 1.4;
}
.badge--success { background: var(--c-green-100); color: var(--c-green-700); }
.badge--accent { background: var(--c-orange-300); color: var(--c-orange-700); }
.badge--info { background: var(--c-blue-100); color: var(--c-blue-700); }

/* ===== REASSURANCE STRIP ===== */
.reassurance {
    background: var(--c-blue-100);
    padding: var(--space-5) 0;
}
.reassurance-grid {
    display: grid; grid-template-columns: 1fr; gap: var(--space-4);
    text-align: center;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-px);
}
@media (min-width: 768px) {
    .reassurance-grid { grid-template-columns: repeat(3, 1fr); }
}
.reassurance-item { display: flex; align-items: center; justify-content: center; gap: var(--space-2); font-size: var(--fs-small); color: var(--c-text); font-weight: 500; }
.reassurance-item svg { width: 24px; height: 24px; flex-shrink: 0; color: var(--c-blue-700); }

/* ===== BREADCRUMB ===== */
.breadcrumb {
    padding: var(--space-4) 0;
    font-size: var(--fs-small);
    color: var(--c-text-mute);
}
.breadcrumb a { color: var(--c-text-mute); }
.breadcrumb a:hover { color: var(--c-blue-700); }
.breadcrumb-sep { margin: 0 var(--space-2); }

/* ===== PRE-FOOTER NEWSLETTER ===== */
.pre-footer {
    background: linear-gradient(135deg, var(--c-green-700) 0%, var(--c-green-500) 100%);
    color: #fff;
    padding: var(--space-8) 0;
    text-align: center;
}
.pre-footer h2 { color: #fff; font-size: var(--fs-h3); margin-bottom: var(--space-2); }
.pre-footer p { opacity: .9; margin-bottom: var(--space-5); }
.newsletter-form {
    display: flex; flex-direction: column; gap: var(--space-2);
    max-width: 480px; margin: 0 auto;
}
@media (min-width: 600px) {
    .newsletter-form { flex-direction: row; }
}
.newsletter-form input[type="email"] {
    flex: 1; padding: var(--space-3) var(--space-4);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-size: var(--fs-base);
    min-height: 44px;
}
.newsletter-form input[type="email"]:focus { border-color: var(--c-orange-500); outline: none; }
.newsletter-form button { background: var(--c-orange-500); color: #fff; padding: var(--space-3) var(--space-5); border-radius: var(--radius-sm); font-weight: 600; min-height: 44px; }
.newsletter-form button:hover { background: var(--c-orange-700); }
.newsletter-msg { margin-top: var(--space-3); font-size: var(--fs-small); min-height: 1.5em; }
.newsletter-msg.is-success { color: #C9F2DC; }
.newsletter-msg.is-error { color: #FFD3D3; }

/* ===== FOOTER ===== */
.site-footer {
    background: var(--c-bg-dark);
    color: #fff;
    padding: var(--space-7) 0 var(--space-4);
}
.footer-main {
    display: grid; grid-template-columns: 1fr; gap: var(--space-5);
}
@media (min-width: 768px) {
    .footer-main { grid-template-columns: 2fr 1fr; align-items: start; }
}
.footer-brand .site-logo { color: var(--c-blue-300); margin-bottom: var(--space-2); }
.footer-brand p { color: rgba(255,255,255,.75); font-size: var(--fs-small); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-4); }
.footer-links a { color: rgba(255,255,255,.85); font-size: var(--fs-small); }
.footer-links a:hover { color: #fff; }
.footer-badges { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.footer-badges .badge { background: rgba(255,255,255,.1); color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    margin-top: var(--space-5);
    padding-top: var(--space-3);
    font-size: var(--fs-xs);
    color: rgba(255,255,255,.6);
    text-align: center;
}

/* ===== ARCHIVE / BLOG GRID ===== */
.archive-header { padding: var(--space-7) 0 var(--space-5); }
.archive-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-5); }
@media (min-width: 768px) { .archive-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .archive-grid { grid-template-columns: repeat(3, 1fr); } }
.card-article { background: #fff; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.card-article__image { aspect-ratio: 16/9; background: var(--c-bg); }
.card-article__image img { width: 100%; height: 100%; object-fit: cover; }
.card-article__body { padding: var(--space-4); }
.card-article__meta { font-size: var(--fs-xs); color: var(--c-text-mute); margin-bottom: var(--space-2); }
.card-article__title { font-size: var(--fs-h4); margin-bottom: var(--space-2); }
.card-article__excerpt { font-size: var(--fs-small); color: var(--c-text-body); margin-bottom: var(--space-3); }

/* ===== SINGLE POST ===== */
.post-layout { display: grid; grid-template-columns: 1fr; gap: var(--space-7); }
@media (min-width: 1024px) {
    .post-layout { grid-template-columns: 1fr 280px; }
}
.post-content { line-height: 1.7; }
.post-content h2, .post-content h3 { margin-top: var(--space-6); margin-bottom: var(--space-3); }
.post-content p, .post-content ul, .post-content ol { margin-bottom: var(--space-4); }
.post-content ul, .post-content ol { padding-left: var(--space-5); list-style: revert; }
.post-content img { border-radius: var(--radius-md); margin: var(--space-4) 0; }
.post-meta { color: var(--c-text-mute); font-size: var(--fs-small); margin-bottom: var(--space-5); display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: var(--space-2); justify-content: center; padding: var(--space-6) 0; }
.pagination a, .pagination span { padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--c-bg-card); border: 1px solid var(--c-border); min-width: 40px; text-align: center; }
.pagination .current { background: var(--c-blue-700); color: #fff; border-color: var(--c-blue-700); }
