/*
Theme Name: Agribusiness News Theme
Theme URI: https://example.com/agribusiness-theme
Author: Agribusiness Media
Author URI: https://example.com
Description: A high-contrast, offline-first WordPress theme for Agribusiness news with built-in commodities ticker, weather widget, and sticky podcast player.
Version: 1.0.0
Text Domain: agribusiness
Tags: news, agriculture, pwa, offline-first, two-columns, right-sidebar
*/

:root {
    --color-primary: #1B4D3E;
    /* Deep Green */
    --color-secondary: #5D4037;
    /* Earthy Brown */
    --color-accent: #DAA520;
    /* Harvest Gold */
    --color-text: #1a1a1a;
    --color-bg: #fdfdfd;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --spacing-unit: 1rem;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    font-weight: 700;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-accent);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

/* Utilities */
.hidden {
    display: none;
}

/* Utilities */
.hidden {
    display: none;
}

.flex {
    display: flex;
}

.grid {
    display: grid;
}

/* -------------------------------------------------------------------------- */
/*                            Commodities Ticker                              */
/* -------------------------------------------------------------------------- */
.commodities-ticker {
    background: var(--color-primary);
    color: #fff;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    z-index: 100;
}

.ticker-wrap {
    display: inline-block;
    padding-left: 100%;
    animation: ticker 30s linear infinite;
}

.ticker-item {
    display: inline-block;
    padding: 0 2rem;
}

.price-up {
    color: #4ade80;
}

.price-down {
    color: #f87171;
}

.price-neutral {
    color: #9ca3af;
}

@keyframes ticker {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-100%, 0, 0);
    }
}

/* -------------------------------------------------------------------------- */
/*                              Weather Widget                                */
/* -------------------------------------------------------------------------- */
.weather-widget {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* -------------------------------------------------------------------------- */
/*                              Sticky Player                                 */
/* -------------------------------------------------------------------------- */
.sticky-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 999;
    transition: transform 0.3s ease;
}

.sticky-player.collapsed .player-content {
    display: none;
}

.sticky-player.collapsed {
    transform: translateY(calc(100% - 40px));
}

.player-toggle {
    display: none;
    /* Only visible when collapsed logic is fully refined, hiding for now to keep simple */
}

.player-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.track-info {
    display: flex;
    flex-direction: column;
}

.track-title {
    font-weight: 600;
    color: var(--color-primary);
}

.track-date {
    font-size: 0.8rem;
    color: #666;
}

audio {
    flex-grow: 1;
    height: 40px;
}

.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 100px;
    /* Above player */
    right: 20px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whatsapp-float:hover {
    background-color: #128C7E;
    color: #fff;
}

/* -------------------------------------------------------------------------- */
/*                                News Grid                                   */
/* -------------------------------------------------------------------------- */
.content-grid-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin-top: 2rem;
}

.news-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.news-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.news-card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-card-content {
    padding: 1rem;
}

.entry-title {
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
}

.entry-title a {
    color: var(--color-text);
}

.entry-meta {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.5rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .content-grid-wrapper {
        grid-template-columns: 1fr;
    }

    .sticky-player {
        flex-direction: column;
        padding: 0.5rem;
    }

    .player-content {
        flex-direction: column;
        align-items: stretch;
    }

    .whatsapp-float {
        bottom: 130px;
        /* Adjust for taller mobile player */
    }
}