/*
Theme Name: MotorFocus News
Theme URI: https://motorfocus.in/
Author: MotorFocus
Author URI: https://motorfocus.in/
Description: A clean, fast news theme for MotorFocus — latest car & bike news, reviews and launches. Red accent, white background, serif headlines, card grids and a sticky header. Built from scratch for motorfocus.in.
Version: 1.0.2
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: motorfocus-news
Tags: news, blog, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ============================================================
   MotorFocus News 1.0.0 — original theme, written from scratch
   Design: clean news layout, red accent #d61a20, serif headlines
   ============================================================ */

:root {
    --accent: #d61a20;
    --accent-dark: #b0141a;
    --ink: #1a1a1a;
    --muted: #6b7280;
    --border: #e6e6e6;
    --light: #f5f5f5;
    --dark: #1c1c1c;
    --radius: 4px;
    --max-width: 1180px;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-head: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: #fff;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    line-height: 1.25;
    margin: 0 0 12px;
    color: var(--ink);
}

p { margin: 0 0 16px; }

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.screen-reader-text {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Topbar ---------- */
.topbar {
    background: var(--dark);
    color: #fff;
    font-size: 13px;
    min-height: 40px;
    display: flex;
    align-items: center;
}
.topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
}
.topbar a { color: #e5e5e5; }
.topbar a:hover { color: #fff; text-decoration: underline; }
.topbar-links { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }
.topbar-links li { margin: 0; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid var(--border);
    min-height: 78px;
    display: flex;
    align-items: center;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
}
.site-branding { flex-shrink: 1; min-width: 0; }
.site-title {
    margin: 0;
    font-family: var(--font-head);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1;
    white-space: nowrap;
}
.site-title a { color: var(--ink); }
.site-title a:hover { color: var(--ink); }
.site-title .logo-motor { color: var(--ink); }
.site-title .logo-focus { color: var(--accent); }
.site-tagline {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--muted);
    font-family: var(--font-body);
}

.primary-nav ul {
    display: flex;
    gap: 26px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.primary-nav a {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--ink);
    padding: 6px 0;
    border-bottom: 2px solid transparent;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
    color: var(--ink);
    line-height: 1;
    border-radius: var(--radius);
}
.icon-btn:hover { color: var(--accent); background: var(--light); }
.icon-btn svg { width: 20px; height: 20px; display: block; }
.menu-toggle { display: none; }

/* ---------- Search panel ---------- */
.search-panel {
    background: var(--light);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}
.search-panel[hidden] { display: none; }
.search-panel .search-form {
    display: flex;
    gap: 10px;
    max-width: 640px;
    margin: 0 auto;
}
.search-panel .search-field,
.widget_search .search-field,
.search-form .search-field {
    flex: 1;
    padding: 11px 14px;
    font-size: 15px;
    font-family: var(--font-body);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    min-width: 0;
}
.search-form .search-submit,
.search-panel .search-submit {
    padding: 11px 22px;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-body);
}
.search-form .search-submit:hover { background: var(--accent-dark); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
    font-size: 13px;
    color: var(--muted);
    padding: 18px 0 0;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 6px; color: #c4c4c4; }

/* ---------- Section heads ---------- */
.section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 24px;
}
.section-head h2,
.section-head .section-title {
    margin: 0;
    font-size: 15px;
    font-family: var(--font-body);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-left: 4px solid var(--accent);
    padding-left: 12px;
    white-space: nowrap;
}
.section-head::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ---------- Hero (homepage) ---------- */
.hero {
    padding: 34px 0 10px;
}
.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}
.hero-card .thumb-wrap,
.card .thumb-wrap {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
}
.hero-card .thumb-wrap { aspect-ratio: 16 / 9; }
.hero-card .thumb-wrap img,
.card .thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.hero-card:hover .thumb-wrap img,
.card:hover .thumb-wrap img { transform: scale(1.04); }

.cat-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 4px 9px;
    border-radius: 2px;
    line-height: 1.4;
}
.cat-badge:hover { color: #fff; background: var(--accent-dark); }
.hero-card .cat-badge { position: absolute; left: 14px; bottom: 14px; }
.hero-card h2 {
    font-size: 30px;
    margin: 16px 0 10px;
}
.hero-card h2 a:hover { color: var(--accent); }

.hero-side { display: flex; flex-direction: column; gap: 18px; }
.side-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.side-item .side-thumb {
    width: 110px;
    flex-shrink: 0;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: var(--radius);
}
.side-item .side-thumb img {
    width: 100%; height: 100%; object-fit: cover;
}
.side-item h3 {
    font-size: 16px;
    margin: 0 0 6px;
}
.side-item h3 a:hover { color: var(--accent); }
.side-item .entry-meta { font-size: 12px; }

/* ---------- Post grid / cards ---------- */
.latest-news { padding: 30px 0 10px; }
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}
.card .thumb-wrap { aspect-ratio: 16 / 10; margin-bottom: 14px; }
.card .thumb-wrap .cat-badge { position: absolute; left: 12px; bottom: 12px; }
.card h2, .card h3 {
    font-size: 20px;
    margin: 0 0 8px;
}
.card h2 a:hover, .card h3 a:hover { color: var(--accent); }
.entry-meta {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 10px;
}
.entry-meta .author-name { color: #444; font-weight: 700; }
.entry-meta a { color: var(--muted); }
.entry-meta a:hover { color: var(--accent); }
.card .entry-excerpt {
    color: #444;
    font-size: 15px;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.read-more {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--accent);
}
.read-more:hover { color: var(--accent-dark); }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 36px 0 10px;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    background: #fff;
}
.pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.pagination .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ---------- Layout: content + sidebar ---------- */
.site-main { padding: 20px 0 10px; }
.content-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 44px;
    align-items: start;
}
.content-sidebar .sidebar { position: sticky; top: 96px; }

/* ---------- Single post ---------- */
.single-post .entry-header { margin-bottom: 20px; }
.single-post .entry-title {
    font-size: 36px;
    margin: 0 0 14px;
}
.single-post .entry-meta { font-size: 14px; }
.single-post .entry-meta .cat-badge { margin-right: 8px; }
.featured-image {
    margin: 0 0 24px;
    border-radius: var(--radius);
    overflow: hidden;
}
.featured-image img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.entry-content { font-size: 17px; }
.entry-content h2 { font-size: 28px; margin: 32px 0 14px; }
.entry-content h3 { font-size: 22px; margin: 28px 0 12px; }
.entry-content img { border-radius: var(--radius); }
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 20px;
    font-size: 15px;
}
.entry-content th,
.entry-content td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
}
.entry-content thead th { background: var(--light); }
.entry-content tbody tr:nth-child(even) { background: #fafafa; }
.entry-content ul, .entry-content ol { margin: 0 0 18px; padding-left: 24px; }
.entry-content li { margin-bottom: 6px; }
.entry-content blockquote {
    margin: 0 0 20px;
    padding: 12px 20px;
    border-left: 4px solid var(--accent);
    background: var(--light);
    font-style: italic;
    color: #444;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content a { color: var(--accent); }
.entry-content a:hover { color: var(--accent-dark); text-decoration: underline; }

.post-tags { margin: 28px 0 0; font-size: 14px; }
.post-tags a {
    display: inline-block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 10px;
    margin: 0 6px 6px 0;
    color: var(--muted);
}
.post-tags a:hover { border-color: var(--accent); color: var(--accent); }

.author-box {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: var(--light);
    border-radius: var(--radius);
    padding: 22px;
    margin: 34px 0;
}
.author-box .avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 3px solid var(--light);
    outline: 1px solid var(--border);
    flex-shrink: 0;
}
.author-box h3 { font-size: 19px; margin: 0 0 6px; }
.author-box p { margin: 0; font-size: 15px; color: #444; }

.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--border);
    padding-top: 22px;
    margin: 0 0 30px;
    font-size: 15px;
}
.post-nav a { font-weight: 600; }
.post-nav .nav-next { text-align: right; margin-left: auto; }
.post-nav .nav-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 4px;
}

/* ---------- Sidebar widgets ---------- */
.sidebar .widget {
    margin-bottom: 34px;
}
.sidebar .widget-title,
.sidebar .widgettitle {
    font-size: 15px;
    font-family: var(--font-body);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-left: 4px solid var(--accent);
    padding-left: 12px;
    margin: 0 0 16px;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget_recent_entries li,
.sidebar .widget_categories li,
.sidebar .widget_archive li,
.sidebar .widget_meta li,
.sidebar .widget_pages li,
.sidebar .widget_nav_menu li {
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
}
.sidebar .widget_recent_entries li:last-child,
.sidebar .widget_categories li:last-child { border-bottom: 0; }
.sidebar .widget_categories a { display: flex; justify-content: space-between; }
.recent-posts-widget li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.recent-posts-widget li:last-child { border-bottom: 0; }
.recent-posts-widget .rp-thumb { width: 76px; flex-shrink: 0; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius); }
.recent-posts-widget .rp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.recent-posts-widget .rp-title { font-size: 14px; font-weight: 600; line-height: 1.4; }
.tagcloud a {
    display: inline-block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 10px;
    margin: 0 6px 6px 0;
    font-size: 13px !important;
    color: var(--muted);
}
.tagcloud a:hover { border-color: var(--accent); color: var(--accent); }
.widget_search .search-form { display: flex; gap: 8px; }
.widget_search .search-field { width: 100%; }

/* ---------- Page ---------- */
.page-entry .entry-title { font-size: 34px; margin: 0 0 18px; }
.page-entry .entry-content { font-size: 17px; }

/* ---------- Archive / search ---------- */
.archive-head { margin: 8px 0 26px; }
.archive-head h1 { font-size: 30px; margin: 0 0 8px; }
.archive-head .archive-description { color: var(--muted); }
.no-results { padding: 30px 0; }
.no-results h2 { font-size: 26px; }

/* ---------- Comments ---------- */
.comments-area { margin: 30px 0; border-top: 1px solid var(--border); padding-top: 26px; }
.comments-area h2 { font-size: 24px; }
.comment-list { list-style: none; margin: 0 0 26px; padding: 0; }
.comment-list .comment { margin-bottom: 20px; }
.comment-body { background: var(--light); border-radius: var(--radius); padding: 16px 18px; }
.comment-author { font-weight: 700; }
.comment-meta { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 15px;
    margin-bottom: 12px;
}
.comment-form .submit,
.wp-block-button__link,
button[type="submit"] {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: var(--radius);
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-body);
}
.comment-form .submit:hover { background: var(--accent-dark); }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--dark);
    color: #cfcfcf;
    margin-top: 60px;
    padding: 40px 0 26px;
}
.site-footer a { color: #cfcfcf; }
.site-footer a:hover { color: #fff; }
.footer-top {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 30px;
}
.footer-title {
    color: #fff;
    font-size: 16px;
    font-family: var(--font-body);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin: 0 0 16px;
}
.footer-about p { margin: 0 0 14px; font-size: 15px; }
.footer-social { display: flex; gap: 14px; font-size: 14px; font-weight: 600; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer ul li { padding: 5px 0; font-size: 15px; }
.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
    color: #9a9a9a;
}
.footer-bottom a { color: #9a9a9a; }

/* ---------- Back to top ---------- */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 90;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--accent-dark); }

/* ---------- Archive author header ---------- */
.archive-author { display: flex; align-items: center; gap: 24px; padding: 34px 0 26px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.archive-author img.avatar { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; display: block; border: 3px solid var(--bg-alt); flex-shrink: 0; }
.archive-author-info { min-width: 0; }
.archive-author .section-head { margin: 0 0 10px; }
.archive-author .archive-description { color: var(--muted); }

/* ---------- 404 ---------- */
.error-404 { text-align: center; padding: 60px 0; }
.error-404 h1 { font-size: 72px; margin: 0 0 10px; color: var(--accent); }
.error-404 p { color: var(--muted); font-size: 17px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .post-grid { grid-template-columns: repeat(2, 1fr); }
    .content-sidebar { grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; }
}

@media (max-width: 900px) {
    .menu-toggle { display: inline-flex; }
    .site-tagline { display: none; }
    .site-title { font-size: 22px; }
    .site-header .container { gap: 12px; }
    .primary-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 12px 24px rgba(0, 0, 0, .08);
    }
    .primary-nav.open { display: block; }
    .primary-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 8px 20px 14px;
    }
    .primary-nav ul li { border-bottom: 1px solid var(--border); }
    .primary-nav ul li:last-child { border-bottom: 0; }
    .primary-nav a {
        display: block;
        padding: 12px 0;
        border-bottom: 0;
    }
    .primary-nav a:hover,
    .primary-nav .current-menu-item > a { border-bottom: 0; }
    .site-header { position: sticky; }
    .hero-grid { grid-template-columns: 1fr; }
    .content-sidebar { grid-template-columns: 1fr; }
    .content-sidebar .sidebar { position: static; }
    .footer-top { grid-template-columns: 1fr; gap: 28px; }
    .topbar-links { display: none; }
}

@media (max-width: 640px) {
    .post-grid { grid-template-columns: 1fr; }
    .single-post .entry-title { font-size: 28px; }
    .hero-card h2 { font-size: 24px; }
    .page-entry .entry-title { font-size: 28px; }
    .author-box { flex-direction: column; }
    .author-box .avatar { width: 88px; height: 88px; }
    .post-nav { flex-direction: column; }
    .post-nav .nav-next { text-align: left; margin-left: 0; }
    .footer-bottom { flex-direction: column; gap: 6px; }
    .topbar .topbar-date { font-size: 12px; }
}
