/*
Theme Name: RDV Emploi Public
Theme URI: https://rdvemploipublic.fr/
Description: Thème WordPress de rdvemploipublic.fr — design aligné sur l'app Next.js (palette, typo, layout). Conçu en respect strict des WP Coding Standards, sans dépendance à un builder.
Author: Adrien Daurat
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rdvemploipublic
*/

/* ============================================================
   PALETTE — alignée sur Next.js (src/app/globals.css)
   ============================================================ */
:root {
    --brand-primary: #1e3a5f;
    --brand-accent: #f59e0b;
    --brand-background: #f8fafc;
    --brand-text: #1e293b;
    --brand-muted: #64748b;
    --brand-border: #e2e8f0;
    --brand-card: #ffffff;
    --brand-hover: #f1f5f9;
    --radius: 0.5rem;
    --radius-sm: 0.375rem;
    --radius-lg: 0.75rem;
    --container: 80rem;        /* max-w-7xl Tailwind */
    --content: 48rem;          /* max-w-3xl Tailwind */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}
html {
    -webkit-text-size-adjust: 100%;
    line-height: 1.5;
}
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    color: var(--brand-text);
    background-color: var(--brand-background);
    font-size: 16px;
    line-height: 1.6;
}
img {
    max-width: 100%;
    height: auto;
    display: block;
}
a {
    color: var(--brand-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}
a:hover {
    color: var(--brand-accent);
}
button,
input,
select,
textarea {
    font: inherit;
}

/* ============================================================
   TYPO
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    color: var(--brand-primary);
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 1rem;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; }
@media (min-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
}
p {
    margin: 0 0 1.25rem;
}
ul, ol {
    margin: 0 0 1.25rem;
    padding-left: 1.5rem;
}
li {
    margin-bottom: 0.5rem;
}
blockquote {
    border-left: 4px solid var(--brand-accent);
    padding: 0.5rem 0 0.5rem 1.25rem;
    margin: 1.5rem 0;
    color: var(--brand-muted);
    font-style: italic;
}
code {
    background: var(--brand-hover);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.875em;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.site-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1rem;
}
@media (min-width: 640px) { .site-container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .site-container { padding: 0 2rem; } }

.site-main {
    min-height: calc(100vh - 4rem - 200px);
    padding: 2rem 0 3rem;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    background: #fff;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
}
.site-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}
.site-logo a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-primary);
}
.site-logo img {
    height: 2rem;
    width: auto;
}


/* Menu reset (override generic ul/li rules) */
.main-nav,
.main-nav-dropdown-inner,
.mobile-nav,
.mobile-nav ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.main-nav-item,
.mobile-nav li {
    margin: 0;
    list-style: none;
}

/* Menu desktop */
.main-nav {
    display: none;
}
@media (min-width: 768px) {
    .main-nav {
        display: flex;
        align-items: baseline;
        gap: 0.25rem;
        margin-left: 2.5rem;
        flex-grow: 1;
    }
}
.main-nav-item {
    position: relative;
}
.main-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #374151;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s ease;
}
.main-nav-link:hover {
    color: var(--brand-primary);
}
.main-nav-dropdown {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 100%;
    padding-top: 0.25rem;
    display: none;
    z-index: 50;
    min-width: 220px;
}
.main-nav-item:hover .main-nav-dropdown,
.main-nav-item:focus-within .main-nav-dropdown {
    display: block;
}
.main-nav-dropdown-inner {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
}
.main-nav-dropdown a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.main-nav-dropdown a:hover {
    background: var(--brand-hover);
    color: var(--brand-primary);
}
.main-nav-caret {
    width: 0.875rem;
    height: 0.875rem;
    opacity: 0.5;
}

/* CTA "Déposer une offre" */
.header-cta {
    display: none;
}
@media (min-width: 768px) {
    .header-cta {
        display: inline-flex;
        align-items: center;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        font-weight: 700;
        color: #0f172a;
        background-color: var(--brand-accent);
        border-radius: var(--radius-sm);
        text-decoration: none;
        min-height: 44px;
        transition: opacity 0.15s ease;
    }
    .header-cta:hover {
        opacity: 0.9;
        color: #0f172a;
    }
}

/* Toggle mobile */
.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0.5rem;
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    color: #374151;
    cursor: pointer;
}
.menu-toggle:hover {
    background: var(--brand-hover);
    color: var(--brand-primary);
}
@media (min-width: 768px) {
    .menu-toggle { display: none; }
}

/* Menu mobile */
.mobile-nav {
    display: none;
    background: #fff;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0.75rem 0.75rem;
}
.mobile-nav.is-open {
    display: block;
}
@media (min-width: 768px) {
    .mobile-nav { display: none !important; }
}
.mobile-nav a {
    display: flex;
    align-items: center;
    color: #374151;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    min-height: 44px;
}
.mobile-nav a:hover { color: var(--brand-primary); }
.mobile-nav-sub a {
    padding-left: 1.75rem;
    font-size: 0.875rem;
    color: var(--brand-muted);
}
.mobile-nav-cta {
    margin-top: 1rem;
    background-color: var(--brand-accent);
    color: #0f172a !important;
    font-weight: 700;
}

/* ============================================================
   ARTICLE / SINGLE / PAGE
   ============================================================ */
.entry {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    max-width: var(--content);
    margin: 0 auto;
}
@media (min-width: 768px) {
    .entry { padding: 2.5rem; }
}
.entry-breadcrumbs {
    font-size: 0.875rem;
    color: var(--brand-muted);
    margin-bottom: 1.5rem;
}
.entry-breadcrumbs a {
    text-decoration: none;
    color: var(--brand-muted);
}
.entry-breadcrumbs a:hover {
    color: var(--brand-primary);
}
.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    color: var(--brand-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}
.entry-cat {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background-color: var(--brand-primary);
    color: #fff;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
}
.entry-cat:hover { color: #fff; opacity: 0.9; }
.entry-title {
    font-size: 1.875rem;
    margin-bottom: 1rem;
}
@media (min-width: 768px) {
    .entry-title { font-size: 2.25rem; }
}
.entry-thumbnail {
    margin: 0 -2rem 2rem;
    border-radius: 0;
    overflow: hidden;
}
@media (min-width: 768px) {
    .entry-thumbnail { margin: 0 -2.5rem 2rem; }
}
.entry-thumbnail img { width: 100%; height: auto; }

.entry-content > *:first-child { margin-top: 0; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content h2 { margin-top: 2rem; }
.entry-content h3 { margin-top: 1.5rem; }
.entry-content figure {
    margin: 1.5rem 0;
}
.entry-content figcaption {
    font-size: 0.875rem;
    color: var(--brand-muted);
    text-align: center;
    margin-top: 0.5rem;
}
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.875rem;
}
.entry-content table th,
.entry-content table td {
    border: 1px solid var(--brand-border);
    padding: 0.625rem 0.875rem;
    text-align: left;
}
.entry-content table th {
    background: var(--brand-hover);
    font-weight: 600;
}
.entry-content a {
    color: var(--brand-primary);
    font-weight: 500;
}
.entry-content a:hover {
    color: var(--brand-accent);
}

.entry-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--brand-border);
    color: var(--brand-muted);
    font-size: 0.875rem;
}

/* ============================================================
   ARCHIVE / LIST
   ============================================================ */
.archive-header {
    text-align: center;
    margin-bottom: 2rem;
}
.archive-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.archive-description {
    color: var(--brand-muted);
    max-width: 40rem;
    margin: 0 auto 1rem;
}
.posts-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
    max-width: var(--content);
    margin: 0 auto;
}
@media (min-width: 640px) {
    .posts-grid { grid-template-columns: repeat(2, 1fr); max-width: var(--container); }
}
@media (min-width: 1024px) {
    .posts-grid { grid-template-columns: repeat(3, 1fr); }
}
.post-card {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.post-card-thumb {
    aspect-ratio: 16 / 10;
    background: var(--brand-hover);
}
.post-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.post-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.post-card-cat {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.post-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--brand-primary);
    margin: 0 0 0.5rem;
    line-height: 1.35;
}
.post-card-title a {
    color: inherit;
    text-decoration: none;
}
.post-card-title a:hover { color: var(--brand-accent); }
.post-card-excerpt {
    color: var(--brand-muted);
    font-size: 0.875rem;
    flex-grow: 1;
    margin-bottom: 0.75rem;
}
.post-card-meta {
    color: var(--brand-muted);
    font-size: 0.75rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.375rem;
    margin: 2.5rem 0 1rem;
    flex-wrap: wrap;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-sm);
    color: var(--brand-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}
.pagination .page-numbers:hover {
    background: var(--brand-hover);
    color: var(--brand-primary);
}
.pagination .page-numbers.current {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: #fff;
    border-top: 1px solid var(--brand-border);
    margin-top: 3rem;
}
.site-footer-inner {
    padding: 3rem 0;
}
.site-footer-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}
@media (min-width: 768px) {
    .site-footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
    }
}
.site-footer-brand .footer-logo {
    color: var(--brand-primary);
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 1rem;
}
.site-footer-brand p {
    color: var(--brand-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}
.site-footer-social {
    display: flex;
    gap: 0.5rem;
}
.site-footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #94a3b8;
    background: transparent;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease, color 0.15s ease;
}
.site-footer-social a:hover {
    background: var(--brand-hover);
    color: var(--brand-primary);
}
.site-footer h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-primary);
    margin-bottom: 1rem;
}
.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.site-footer li {
    margin-bottom: 0.5rem;
}
.site-footer li a {
    display: inline-flex;
    align-items: center;
    color: var(--brand-muted);
    text-decoration: none;
    font-size: 0.875rem;
    min-height: 44px;
}
.site-footer li a:hover { color: var(--brand-primary); }
.site-footer-bottom {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--brand-border);
    color: #94a3b8;
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    text-align: center;
}
@media (min-width: 768px) {
    .site-footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

/* ============================================================
   FORMS / SEARCH / COMMENTS
   ============================================================ */
.search-form {
    display: flex;
    gap: 0.5rem;
}
.search-form input[type="search"] {
    flex-grow: 1;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--brand-text);
}
.search-form input[type="search"]:focus {
    outline: 2px solid var(--brand-primary);
    outline-offset: 1px;
}
.btn,
button.btn,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    background: var(--brand-primary);
    color: #fff;
    border: 0;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.btn:hover,
input[type="submit"]:hover { opacity: 0.9; color: #fff; }

.btn-accent {
    background: var(--brand-accent);
    color: #0f172a;
}
.btn-accent:hover { color: #0f172a; opacity: 0.9; }

/* ============================================================
   404 / NOT FOUND
   ============================================================ */
.error-404 {
    text-align: center;
    max-width: 32rem;
    margin: 4rem auto;
}
.error-404 h1 {
    font-size: 3rem;
    color: var(--brand-primary);
}

/* ============================================================
   UTILS
   ============================================================ */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}
.alignwide { max-width: 60rem; margin-left: auto; margin-right: auto; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
