/* ==========================================================================
   MOTORO BLOG - Custom Stylesheet
   Child theme of TwentyTwentyFive
   Brand: #1F2D3D (bleuNuit), #FF4600 (orange), #7B8A96 (grey)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. GLOBAL RESETS & BASE
   -------------------------------------------------------------------------- */

/* Fix: Remove extra dark space below footer */
html {
    background-color: #1F2D3D;
}

body {
    background-color: #FFFFFF;
    min-height: 100vh;
}

/* Ensure the footer is flush — no gap below */
.wp-site-blocks {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.wp-site-blocks > main {
    flex-grow: 1;
}

/* --------------------------------------------------------------------------
   2. TYPOGRAPHY
   -------------------------------------------------------------------------- */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
        Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
    color: #1F2D3D;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: #1F2D3D;
    font-weight: 700;
    line-height: 1.25;
}

a {
    color: #FF4600;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: #E03E00;
}

/* --------------------------------------------------------------------------
   3. HEADER REFINEMENTS
   -------------------------------------------------------------------------- */

/* Make sure header nav links have proper hover states */
header .wp-block-navigation a:hover,
header .wp-block-navigation a:focus {
    color: #FF4600 !important;
}

/* --------------------------------------------------------------------------
   4. ARCHIVE PAGE TITLE (Category pages)
   -------------------------------------------------------------------------- */

/* The archive title — clean, bold, no "Category:" prefix (handled in PHP) */
.wp-block-query-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #1F2D3D;
    letter-spacing: -0.02em;
    margin-bottom: 0.25em;
    position: relative;
    padding-bottom: 0.5em;
}

.wp-block-query-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    background-color: #FF4600;
    border-radius: 2px;
    margin-top: 0.5em;
}

/* Term description */
.wp-block-term-description {
    color: #7B8A96;
    font-size: 1.05rem;
    max-width: 640px;
    margin-bottom: 2.5rem;
}

/* --------------------------------------------------------------------------
   5. POST CARD GRID
   -------------------------------------------------------------------------- */

/* The post template container — card grid layout */
.motoro-post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 1rem;
}

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

@media (max-width: 600px) {
    .motoro-post-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Individual post card */
.motoro-post-card {
    background: #FFFFFF;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #E8EAED;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}

.motoro-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(31, 45, 61, 0.12);
}

/* Card featured image */
.motoro-post-card .wp-block-post-featured-image {
    margin: 0;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.motoro-post-card .wp-block-post-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.motoro-post-card:hover .wp-block-post-featured-image img {
    transform: scale(1.05);
}

/* Card content area */
.motoro-card-content {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Category tag inside card */
.motoro-card-content .wp-block-post-terms {
    margin-bottom: 0.5rem;
}

.motoro-card-content .wp-block-post-terms a {
    display: inline-block;
    background-color: #FFF0E8;
    color: #FF4600;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2em 0.65em;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.motoro-card-content .wp-block-post-terms a:hover {
    background-color: #FF4600;
    color: #FFFFFF;
}

/* Separator between multiple category tags */
.motoro-card-content .wp-block-post-terms .wp-block-post-terms__separator {
    display: none;
}

/* Card title */
.motoro-card-content .wp-block-post-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.5rem;
    color: #1F2D3D;
}

.motoro-card-content .wp-block-post-title a {
    color: inherit;
    text-decoration: none;
}

.motoro-card-content .wp-block-post-title a:hover {
    color: #FF4600;
}

/* Card excerpt */
.motoro-card-content .wp-block-post-excerpt {
    font-size: 0.9rem;
    line-height: 1.55;
    color: #7B8A96;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.motoro-card-content .wp-block-post-excerpt .wp-block-post-excerpt__excerpt {
    margin-bottom: 0;
}

/* Hide the "Read more" link inside excerpt (we make the whole title clickable) */
.motoro-card-content .wp-block-post-excerpt .wp-block-post-excerpt__more-text {
    display: none;
}

/* Card date */
.motoro-card-content .wp-block-post-date {
    font-size: 0.8rem;
    color: #A0ADB8;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #F0F2F4;
}

.motoro-card-content .wp-block-post-date a {
    color: inherit;
}

/* --------------------------------------------------------------------------
   6. EMPTY STATE (No posts found)
   -------------------------------------------------------------------------- */

.motoro-empty-state {
    text-align: center;
    padding: 5rem 2rem;
    max-width: 480px;
    margin: 0 auto;
}

.motoro-empty-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    opacity: 0.6;
    display: block;
}

.motoro-empty-state h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1F2D3D;
    margin-bottom: 0.75rem;
}

.motoro-empty-state p {
    color: #7B8A96;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.motoro-empty-state .wp-block-search {
    max-width: 400px;
    margin: 0 auto;
}

/* Also style the default no-results block if it leaks through */
.wp-block-query-no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #7B8A96;
    font-size: 1rem;
}

/* --------------------------------------------------------------------------
   7. HOME / BLOG PAGE (when posts exist)
   -------------------------------------------------------------------------- */

/* Hero heading on the home/blog page */
.motoro-blog-heading {
    text-align: center;
    padding: 3rem 1rem 1.5rem;
}

.motoro-blog-heading h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #1F2D3D;
    margin-bottom: 0.5rem;
}

.motoro-blog-heading p {
    color: #7B8A96;
    font-size: 1.1rem;
    max-width: 560px;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   8. SINGLE POST
   -------------------------------------------------------------------------- */

.single .wp-block-post-title {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 800;
    color: #1F2D3D;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.single .wp-block-post-date {
    color: #7B8A96;
}

.single .wp-block-post-terms a {
    color: #FF4600;
    font-weight: 600;
}

.single .wp-block-post-content {
    font-size: 1.05rem;
    line-height: 1.75;
    color: #3A4A5C;
}

.single .wp-block-post-content h2 {
    margin-top: 2em;
    font-size: 1.5rem;
}

.single .wp-block-post-content h3 {
    margin-top: 1.75em;
    font-size: 1.25rem;
}

.single .wp-block-post-content blockquote {
    border-left: 4px solid #FF4600;
    padding-left: 1.25rem;
    margin: 2rem 0;
    color: #7B8A96;
    font-style: italic;
}

.single .wp-block-post-content img {
    border-radius: 8px;
}

/* --------------------------------------------------------------------------
   9. PAGINATION
   -------------------------------------------------------------------------- */

.wp-block-query-pagination {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #E8EAED;
}

.wp-block-query-pagination-numbers .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #7B8A96;
    transition: all 0.2s ease;
}

.wp-block-query-pagination-numbers .page-numbers:hover {
    background-color: #F5F5F5;
    color: #1F2D3D;
}

.wp-block-query-pagination-numbers .page-numbers.current {
    background-color: #FF4600;
    color: #FFFFFF;
}

.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
    font-weight: 600;
    color: #1F2D3D;
    transition: color 0.2s ease;
}

.wp-block-query-pagination-previous:hover,
.wp-block-query-pagination-next:hover {
    color: #FF4600;
}

/* --------------------------------------------------------------------------
   10. SEARCH FORM STYLING
   -------------------------------------------------------------------------- */

.wp-block-search__input {
    border: 2px solid #E8EAED;
    border-radius: 8px;
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
    color: #1F2D3D;
}

.wp-block-search__input:focus {
    border-color: #FF4600;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 70, 0, 0.1);
}

.wp-block-search__button {
    background-color: #FF4600;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    padding: 0.65rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.wp-block-search__button:hover {
    background-color: #E03E00;
}

/* --------------------------------------------------------------------------
   11. FOOTER REFINEMENTS
   -------------------------------------------------------------------------- */

/* Ensure no gap/extra space after footer */
footer.wp-block-template-part {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* --------------------------------------------------------------------------
   12. RESPONSIVE FINE-TUNING
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .wp-block-query-title {
        font-size: 1.5rem;
    }

    .motoro-blog-heading {
        padding: 2rem 1rem 1rem;
    }

    .motoro-empty-state {
        padding: 3rem 1.5rem;
    }

    .wp-block-query-pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* --------------------------------------------------------------------------
   13. ACCESSIBILITY ENHANCEMENTS
   -------------------------------------------------------------------------- */

/* Focus visible states for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid #FF4600;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .motoro-post-card,
    .motoro-post-card .wp-block-post-featured-image img,
    a {
        transition: none;
    }

    .motoro-post-card:hover {
        transform: none;
    }

    .motoro-post-card:hover .wp-block-post-featured-image img {
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   14. PRINT STYLES
   -------------------------------------------------------------------------- */

@media print {
    header.wp-block-template-part,
    footer.wp-block-template-part,
    .wp-block-query-pagination,
    .wp-block-search {
        display: none !important;
    }

    .motoro-post-card {
        break-inside: avoid;
        border: 1px solid #ccc;
        box-shadow: none;
    }

    body {
        background: #fff;
        color: #000;
    }
}


/* --------------------------------------------------------------------------
   SOCIAL LINKS (shortcode)
   -------------------------------------------------------------------------- */

.motoro-social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.875rem;
}

.motoro-social-links a {
    color: #FF4600;
    text-decoration: none;
    transition: color 0.2s;
}

.motoro-social-links a:hover {
    color: #FF7A40;
}

.motoro-social-sep {
    color: #7B8A96;
    user-select: none;
}


/* --------------------------------------------------------------------------
   TABLES
   -------------------------------------------------------------------------- */

.wp-block-table,
.entry-content table,
article table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

.wp-block-table table,
.entry-content table,
article table {
    width: 100%;
    border-collapse: collapse;
}

.wp-block-table th,
.wp-block-table td,
.entry-content th,
.entry-content td,
article th,
article td {
    border: 1px solid #E0E0E0;
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: top;
}

.wp-block-table thead th,
.entry-content thead th,
article thead th {
    background-color: #1F2D3D;
    color: #FFFFFF;
    font-weight: 700;
    border-color: #1F2D3D;
}

.wp-block-table tbody tr:nth-child(even),
.entry-content tbody tr:nth-child(even),
article tbody tr:nth-child(even) {
    background-color: #F5F5F5;
}

.wp-block-table tbody tr:hover,
.entry-content tbody tr:hover,
article tbody tr:hover {
    background-color: #FFF0E8;
}

.wp-block-table td:first-child,
.entry-content td:first-child,
article td:first-child {
    font-weight: 600;
    color: #1F2D3D;
}

/* Responsive tables */
@media (max-width: 600px) {
    .wp-block-table,
    .entry-content table,
    article table {
        font-size: 0.85rem;
    }
    .wp-block-table th,
    .wp-block-table td,
    .entry-content th,
    .entry-content td {
        padding: 0.5rem 0.6rem;
    }
}
