/*
Theme Name: Tamil Vaarthai News
Theme URI: https://example.com/tamil-vaarthai
Author: Your Name
Author URI: https://example.com
Description: A clean, fast magazine-style WordPress theme built for Tamil news publications. Includes a hero grid, category blocks, trending sidebar widgets, and a tag cloud footer.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tamil-vaarthai
Tags: news, magazine, blog, one-column, two-columns, right-sidebar, custom-menu, featured-images, threaded-comments, translation-ready

Tamil Vaarthai News is a lightweight magazine theme. Colors, spacing and
typography are all controlled via CSS custom properties in :root below,
so re-skinning the site is a matter of editing a handful of variables.
*/

/* ==========================================================================
   1. CSS Variables / Design Tokens
   ========================================================================== */
:root {
    --tv-color-bg: #f7f8fa;
    --tv-color-surface: #ffffff;
    --tv-color-text: #1a1d29;
    --tv-color-text-muted: #6b7280;
    --tv-color-border: #e5e7eb;
    --tv-color-primary: #b3122b;      /* headline red accent */
    --tv-color-primary-dark: #8a0e21;
    --tv-color-navy: #101534;         /* header / footer navy */
    --tv-color-navy-light: #1d2350;
    --tv-color-tag-bg: #eef0f6;

    --tv-font-body: 'Mukta Malar', 'Noto Sans Tamil', system-ui, -apple-system, sans-serif;
    --tv-font-heading: 'Mukta Malar', 'Noto Sans Tamil', system-ui, -apple-system, sans-serif;

    --tv-radius: 10px;
    --tv-shadow: 0 1px 3px rgba(16, 21, 52, 0.08), 0 1px 2px rgba(16, 21, 52, 0.06);
    --tv-max-width: 1280px;
}

[data-theme="dark"] {
    --tv-color-bg: #0f1117;
    --tv-color-surface: #171a24;
    --tv-color-text: #eef0f6;
    --tv-color-text-muted: #9aa0ac;
    --tv-color-border: #2a2e3a;
    --tv-color-tag-bg: #22263300;
}

/* ==========================================================================
   2. Reset & Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--tv-font-body);
    background: var(--tv-color-bg);
    color: var(--tv-color-text);
    line-height: 1.6;
    font-size: 16px;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--tv-color-primary); }

ul, ol { padding: 0; margin: 0; list-style: none; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--tv-font-heading);
    line-height: 1.3;
    margin: 0 0 .5em;
    font-weight: 700;
}

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

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px,1px,1px,1px);
}

/* ==========================================================================
   3. Top Bar
   ========================================================================== */
.tv-topbar {
    background: var(--tv-color-navy);
    color: #cfd2e6;
    font-size: 13px;
}
.tv-topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 38px;
}
.tv-topbar a { color: #cfd2e6; margin-inline-end: 14px; }
.tv-topbar a:hover { color: #fff; }
.tv-topbar-date { opacity: .8; }

/* ==========================================================================
   4. Header
   ========================================================================== */
.tv-header {
    background: var(--tv-color-surface);
    border-bottom: 1px solid var(--tv-color-border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.tv-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    gap: 24px;
}
.tv-logo img { height: 48px; width: auto; }
.tv-logo { font-size: 26px; font-weight: 800; color: var(--tv-color-primary); }

.tv-primary-menu {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.tv-primary-menu a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    color: var(--tv-color-text);
}
.tv-primary-menu a:hover,
.tv-primary-menu .current-menu-item > a {
    background: var(--tv-color-tag-bg);
    color: var(--tv-color-primary);
}

.tv-header-search { display: flex; align-items: center; }
.tv-header-search input[type="search"] {
    border: 1px solid var(--tv-color-border);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 14px;
    width: 200px;
    background: var(--tv-color-bg);
    color: var(--tv-color-text);
}

.tv-menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--tv-color-border);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
}

/* ==========================================================================
   5. Layout Grid (main content + sidebar)
   ========================================================================== */
.tv-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    padding: 28px 0 48px;
    align-items: start;
}
.tv-main { min-width: 0; }
.tv-sidebar { min-width: 0; position: sticky; top: 84px; }

@media (max-width: 991px) {
    .tv-layout { grid-template-columns: 1fr; }
    .tv-sidebar { position: static; }
    .tv-primary-menu-wrap, .tv-header-search { display: none; }
    .tv-primary-menu-wrap.is-open { display: block; width: 100%; }
    .tv-primary-menu-wrap.is-open .tv-primary-menu { flex-direction: column; }
    .tv-menu-toggle { display: inline-flex; }
}

/* ==========================================================================
   6. Hero Grid (front page top section)
   ========================================================================== */
.tv-hero-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}
.tv-hero-main {
    position: relative;
    border-radius: var(--tv-radius);
    overflow: hidden;
    background: var(--tv-color-surface);
    box-shadow: var(--tv-shadow);
}
.tv-hero-main img { aspect-ratio: 16/10; object-fit: cover; }
.tv-hero-main .tv-hero-caption {
    padding: 18px;
}
.tv-hero-main .tv-cat-pill { margin-bottom: 8px; }
.tv-hero-main h2 { font-size: 26px; }
.tv-hero-main h2 a:hover { color: var(--tv-color-primary); }

.tv-hero-list { display: flex; flex-direction: column; gap: 14px; }
.tv-hero-list-item {
    display: flex;
    gap: 12px;
    background: var(--tv-color-surface);
    border-radius: var(--tv-radius);
    padding: 10px;
    box-shadow: var(--tv-shadow);
}
.tv-hero-list-item img {
    width: 96px; height: 72px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.tv-hero-list-item h4 { font-size: 15px; margin: 0; }

/* ==========================================================================
   7. Category Section Blocks
   ========================================================================== */
.tv-section { margin-bottom: 36px; }
.tv-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--tv-color-primary);
    padding-bottom: 10px;
    margin-bottom: 18px;
}
.tv-section-header h3 {
    font-size: 20px;
    margin: 0;
    padding-inline-start: 10px;
    border-inline-start: 4px solid var(--tv-color-primary);
}
.tv-section-header .tv-more-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--tv-color-primary);
}

.tv-cat-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 18px;
}
.tv-cat-lead { }
.tv-cat-lead img {
    border-radius: var(--tv-radius);
    aspect-ratio: 16/10;
    object-fit: cover;
    margin-bottom: 10px;
}
.tv-cat-lead h4 { font-size: 18px; }

.tv-cat-compact-list { display: flex; flex-direction: column; gap: 12px; }
.tv-cat-compact-item { display: flex; gap: 10px; align-items: flex-start; }
.tv-cat-compact-item img {
    width: 84px; height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.tv-cat-compact-item h5 { font-size: 14px; margin: 0; }

@media (max-width: 767px) {
    .tv-hero-grid, .tv-cat-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   8. Category pill / meta
   ========================================================================== */
.tv-cat-pill {
    display: inline-block;
    background: var(--tv-color-primary);
    color: #fff !important;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.tv-post-meta {
    font-size: 12px;
    color: var(--tv-color-text-muted);
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

/* ==========================================================================
   9. Sidebar Widgets
   ========================================================================== */
.tv-widget {
    background: var(--tv-color-surface);
    border-radius: var(--tv-radius);
    box-shadow: var(--tv-shadow);
    padding: 18px;
    margin-bottom: 22px;
}
.tv-widget-title {
    font-size: 16px;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--tv-color-tag-bg);
    display: flex;
    align-items: center;
    gap: 8px;
}
.tv-trending-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--tv-color-border);
}
.tv-trending-item:last-child { border-bottom: none; }
.tv-trending-num {
    font-weight: 800;
    font-size: 18px;
    color: var(--tv-color-primary);
    width: 22px;
    flex-shrink: 0;
}
.tv-trending-item img {
    width: 64px; height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.tv-trending-item h4 { font-size: 13.5px; margin: 0; }

.tv-tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tv-tag-cloud a {
    background: var(--tv-color-tag-bg);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
}

.tv-ad-slot {
    background: var(--tv-color-tag-bg);
    border-radius: var(--tv-radius);
    text-align: center;
    padding: 12px;
    margin-bottom: 22px;
    font-size: 12px;
    color: var(--tv-color-text-muted);
}

/* ==========================================================================
   10. Single Post / Page
   ========================================================================== */
.tv-single-header { margin-bottom: 20px; }
.tv-single-header h1 { font-size: 30px; }
.tv-single-thumb img {
    border-radius: var(--tv-radius);
    margin-bottom: 20px;
    aspect-ratio: 16/9;
    object-fit: cover;
}
.tv-entry-content { font-size: 17px; }
.tv-entry-content p { margin: 0 0 1.2em; }
.tv-entry-content img { border-radius: var(--tv-radius); margin: 1em 0; }
.tv-entry-content h2, .tv-entry-content h3 { margin-top: 1.4em; }

.tv-post-list-item {
    display: flex;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--tv-color-border);
}
.tv-post-list-item img {
    width: 220px; height: 140px;
    object-fit: cover;
    border-radius: var(--tv-radius);
    flex-shrink: 0;
}
.tv-post-list-item h2 { font-size: 20px; }
.tv-post-list-item p { color: var(--tv-color-text-muted); margin: 6px 0 0; }

@media (max-width: 600px) {
    .tv-post-list-item { flex-direction: column; }
    .tv-post-list-item img { width: 100%; height: 180px; }
}

/* ==========================================================================
   11. Pagination
   ========================================================================== */
.tv-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}
.tv-pagination a, .tv-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--tv-color-surface);
    box-shadow: var(--tv-shadow);
    font-weight: 600;
    font-size: 14px;
}
.tv-pagination .current { background: var(--tv-color-primary); color: #fff; }

/* ==========================================================================
   12. Footer
   ========================================================================== */
.tv-footer {
    background: var(--tv-color-navy);
    color: #cfd2e6;
    margin-top: 40px;
}
.tv-footer .container { padding-top: 40px; padding-bottom: 20px; }
.tv-footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 24px;
}
.tv-footer h4 {
    color: #fff;
    font-size: 15px;
    margin-bottom: 14px;
}
.tv-footer a { color: #cfd2e6; }
.tv-footer a:hover { color: #fff; }
.tv-footer-about { font-size: 14px; line-height: 1.7; opacity: .9; }
.tv-footer-links li { margin-bottom: 8px; font-size: 14px; }
.tv-footer-social { display: flex; gap: 10px; margin-top: 14px; }
.tv-footer-social a {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--tv-color-navy-light);
    border-radius: 50%;
}
.tv-footer-bottom {
    border-top: 1px solid rgba(255,255,255,.12);
    padding: 16px 0;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    opacity: .85;
}

@media (max-width: 767px) {
    .tv-footer-grid { grid-template-columns: 1fr; }
}
