/* 
 * CineSports Homepage Styles 
 * Enqueue this file in your theme functions.php or copy into Customizer > Additional CSS 
 */

/* --- Variables & Reset --- */
:root {
    --primary: #0f172a;
    --accent: #e11d48;
    /* Brand Red */
    --text-main: #1e293b;
    --text-light: #475569;
    /* Darkened for better contrast */
    --bg-light: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --container: 1200px;
    --gap: 24px;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
    background: #fff;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

a:hover,
a:focus {
    color: var(--accent);
    text-decoration: underline;
    /* WCAG Distinguishable Links */
}

/* Global Focus Styles */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 10px 0;
    font-weight: 700;
    line-height: 1.3;
}

.section-title {
    font-size: 1.5rem;
    border-left: 4px solid var(--accent);
    padding-left: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.view-all {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 600;
}

/* --- Header --- */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

/* Hide default GeneratePress skip link as we have a custom header */
.skip-link {
    display: none !important;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--primary);
}

.logo:hover,
.logo:focus {
    text-decoration: none;
    /* Logo shouldn't have underline */
}

.logo span {
    color: var(--accent);
}

.main-nav ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 24px;
}

.main-nav a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.main-nav a:hover,
.main-nav a:focus,
.main-nav li.current-menu-item>a,
.main-nav li.current-category-ancestor>a {
    color: #FF9933;
    /* Saffron */
    text-decoration: underline;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-main);
}

.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
}

.search-overlay {
    display: none;
    /* JS toggles this */
    position: absolute;
    top: 100%;
    right: 20px;
    background: var(--white);
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    min-width: 300px;
}

.search-overlay .search-form {
    display: flex;
    gap: 8px;
}

.search-overlay .search-field {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.search-overlay .search-submit {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

/* --- Featured Grid --- */
.featured-section {
    padding: 30px 0;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

.featured-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--gap);
}

/* Large Featured */
.feat-large {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.feat-img-wrap {
    height: 100%;
    min-height: 400px;
    overflow: hidden;
    display: block;
}

.feat-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.feat-large:hover .feat-img-wrap img {
    transform: scale(1.05);
}

.feat-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: white;
}

.feat-content h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #fff;
}

.feat-content a {
    color: #fff;
}

.feat-content a:hover,
.feat-content a:focus {
    color: #fff;
    text-decoration: underline;
}

.cat-label {
    background: var(--accent);
    color: white;
    padding: 4px 8px;
    font-size: 0.75rem;
    /* 12px min */
    text-transform: uppercase;
    font-weight: 700;
    border-radius: 4px;
    margin-bottom: 10px;
    display: inline-block;
}

.cat-label:hover,
.cat-label:focus {
    text-decoration: none;
    opacity: 0.9;
}

.meta {
    font-size: 0.85rem;
    opacity: 1;
    /* Removed opacity on small text to ensure contrast */
}

.author {
    margin-right: 15px;
    font-weight: 600;
}

/* Small Featured */
.feat-side {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
}

.feat-small {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    background: var(--white);
    border-radius: 6px;
    overflow: hidden;
    /* optional card style */
}

.feat-small-img {
    flex: 0 0 100px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
}

.feat-small-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feat-small-content h2,
.feat-small-content h2 a,
.feat-small-content h3,
.feat-small-content h3 a {
    font-size: 18px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin-bottom: 5px !important;
}

.cat-label-sm {
    font-size: 0.75rem;
    /* Min 12px for accessibility */
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 700;
    display: block;
    margin-bottom: 2px;
}

.date-sm {
    font-size: 0.75rem;
    color: var(--text-light);
}


/* --- Main Layout --- */
.section-block {
    margin-bottom: 60px;
}

.main-layout {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 40px;
    padding-top: 40px;
    padding-bottom: 40px;
}

.content-area {
    width: 100%;
    min-width: 0;
    /* Prevent grid blowout from wide content */
}

.sidebar {
    width: 100%;
    min-width: 0;
    /* Prevent grid blowout */
}

/* Ensure images never overflow their container */
.entry-content img,
.wp-block-image img {
    max-width: 100%;
    height: auto;
    width: auto;
    /* Override fixed width attributes */
}

/* --- Card Styles --- */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-img {
    height: 180px;
    background: #eee;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    padding: 15px;
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.excerpt {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.meta-sm {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Horizontal Card */
.card-horizontal {
    display: flex;
    gap: 15px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.card-h-img {
    flex: 0 0 100px;
    border-radius: 6px;
    overflow: hidden;
}

/* --- Editorial Pick --- */
.editorial-pick {
    background: var(--primary);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin: 40px 0;
    text-align: center;
}

.editorial-pick .badge {
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 15px;
    display: inline-block;
}

.editorial-pick h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.editorial-pick h2 a {
    color: white;
}

.editorial-pick h2 a:hover,
.editorial-pick h2 a:focus {
    text-decoration: underline;
}

.editorial-pick p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    opacity: 1;
    /* Ensure good contrast against primary color */
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.btn-read {
    display: inline-block;
    padding: 10px 24px;
    background: white;
    color: var(--primary);
    border-radius: 6px;
    font-weight: 700;
    transition: background 0.2s;
}

.btn-read:hover {
    background: #e2e8f0;
}


/* --- Sidebar Widgets --- */
.widget {
    margin-bottom: 30px;
}

.widget-title {
    font-size: 1.1rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 15px;
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--accent);
}

.clean-list {
    list-style: none;
    padding: 0;
}

.clean-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

.clean-list li:last-child {
    border: none;
}

.ad-widget {
    text-align: center;
    padding: 20px;
}

.ad-label {
    display: block;
    font-size: 0.75rem;
    /* Min 12px */
    color: #555;
    /* WCAG compliant contrast */
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: 600;
}

.ad-box-300 {
    width: 300px;
    height: 250px;
    margin: 0 auto;
}

.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.clean-list a {
    text-decoration: none;
    color: var(--text-main);
}

.clean-list a:hover,
.clean-list a:focus {
    color: var(--accent);
    text-decoration: underline;
}

/* --- Newsletter --- */
.newsletter-section {
    background: #f1f5f9;
    padding: 40px 0;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.ns-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.ns-form {
    display: flex;
    gap: 10px;
}

.ns-form input {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 4px;
    min-width: 250px;
}

.ns-form button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

/* --- Footer --- */
.site-footer {
    background: var(--primary);
    color: #cbd5e1;
    padding: 50px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-col h4 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #e2e8f0;
    /* Ensure high contrast */
}

.footer-col ul li a:hover,
.footer-col ul li a:focus {
    color: white;
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px 0;
    font-size: 0.9rem;
    text-align: center;
}


/* --- Responsive --- */
@media (max-width: 991px) {
    .featured-grid {
        grid-template-columns: 1fr;
    }

    .feat-img-wrap {
        height: 300px;
    }

    .main-layout {
        grid-template-columns: 1fr;
        /* Stack sidebar below content */
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }

    /* Hide Main Nav, show hamburger */
    .mobile-menu-toggle {
        display: flex;
    }

    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .ns-container {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .ns-form {
        flex-direction: column;
        width: 100%;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .feat-small-img {
        flex: 0 0 80px;
        height: 60px;
    }

    .cat-section .section-header {
        flex-direction: row;
        /* Keep View All on same line */
    }
}

/* --- Category Page Specifics --- */
.category-page-header {
    background: #f1f5f9;
    /* Subtle grey */
    padding: 40px 0;
    margin-bottom: 20px;
    border-bottom: 4px solid var(--accent);
    /* Accent line */
    text-align: left;
}

.cs-breadcrumb {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 500;
}

.cat-title {
    font-size: 2.5rem;
    color: var(--primary);
    margin: 0;
    line-height: 1.2;
}

.cat-desc {
    font-size: 1.1rem;
    margin-top: 10px;
    color: var(--text-light);
    max-width: 800px;
}

/* Pagination */
.pagination-wrapper {
    margin-top: 50px;
    display: flex;
    justify-content: center;
}

.page-numbers {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.2s;
}

.page-numbers:hover,
.page-numbers.current {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.prev.page-numbers,
.next.page-numbers {
    font-weight: 700;
    border: none;
    padding: 8px 10px;
}

/* Loop Adjustments */
.category-grid {
    margin-top: 40px;
}

/* Sidebar Specific Overrides */
.sidebar .widget-title,
.sidebar .clean-list li a {
    font-size: 18px !important;
    line-height: 1.4 !important;
    font-weight: 600 !important;
}

@media (max-width: 768px) {

    .sidebar .widget-title,
    .sidebar .clean-list li a,
    .feat-small-content h2,
    .feat-small-content h2 a,
    .feat-small-content h3,
    .feat-small-content h3 a {
        font-size: 16px !important;
    }
}

/* Footer Contrast & WCAG Enhancements */
.site-info a,
.copyright-bar a,
.footer-col ul li a {
    text-decoration: underline;
    text-underline-offset: 4px;
}