/*
Theme Name: TernakHebat
Theme URI: https://ternakhebat.com
Author: Jenama Digital Nusantara
Author URI: https://ternakhebat.com
Description: Custom WordPress Theme untuk Portal Informasi & Inovasi Peternakan Indonesia. Dioptimasi untuk SEO, Bot Auto-Post, dan Mobile Responsive.
Version: 1.0.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ternakhebat
Tags: blog, news, agriculture, livestock, responsive, seo-optimized
*/

/* ========================================
   RESET & BASE STYLES
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f9fafb;
    color: #1e293b;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* ========================================
   CUSTOM SCROLLBAR
======================================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f8fafc;
}

::-webkit-scrollbar-thumb {
    background: #d97706;
    border-radius: 5px;
    border: 2px solid #f8fafc;
}

::-webkit-scrollbar-thumb:hover {
    background: #b45309;
}

/* ========================================
   SELECTION
======================================== */
::selection {
    background-color: #f59e0b;
    color: white;
}

::-moz-selection {
    background-color: #f59e0b;
    color: white;
}

/* ========================================
   CONTAINER & LAYOUT
======================================== */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

/* ========================================
   ANIMATIONS
======================================== */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-up.active {
    opacity: 1;
    transform: translateY(0);
}

.img-hover-zoom {
    overflow: hidden;
}

.img-hover-zoom img {
    transition: transform 0.6s ease;
}

.img-hover-zoom:hover img {
    transform: scale(1.08);
}

.gradient-bottom {
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.4) 50%, transparent 100%);
}

/* ========================================
   NAVIGATION
======================================== */
/* ========================================
   TICKER BAR & HEADER
======================================== */

/* Ticker Bar */
.ticker-bar {
    background-color: #0f172a;
    color: #cbd5e1;
    padding: 6px 0;
    font-size: 0.75rem;
    display: none;
}

@media (min-width: 768px) {
    .ticker-bar {
        display: block;
    }
}

.ticker-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticker-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ticker-right {
    display: flex;
    gap: 1.25rem;
}

.ticker-right a {
    color: #cbd5e1;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ticker-right a:hover {
    color: #f59e0b;
}

.live-badge {
    background-color: #ef4444;
    color: white;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.live-dot {
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-red 2s infinite;
}

.ticker-text {
    font-weight: 500;
    color: #cbd5e1;
}

/* Main Header */
.main-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

/* Logo */
.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo-wrapper:hover {
    transform: scale(1.02);
}

.logo-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 10px 15px rgba(245, 158, 11, 0.3);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.logo-wrapper:hover .logo-icon {
    transform: scale(1.05);
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    color: white;
    display: block;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1;
    letter-spacing: -0.025em;
}

.logo-title .highlight {
    color: #d97706;
}

.logo-subtitle {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.1em;
    margin-top: 4px;
}

/* Desktop Navigation */
.desktop-nav {
    display: none;
    align-items: center;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .desktop-nav {
        display: flex;
    }
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-btn {
    padding: 8px;
    color: #6b7280;
    background: transparent;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    color: #d97706;
    background-color: #f3f4f6;
}

.search-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}

.cta-button {
    display: none;
    align-items: center;
    gap: 8px;
    background-color: #0f172a;
    color: white;
    padding: 10px 24px;
    border-radius: 9999px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .cta-button {
        display: inline-flex;
    }
}

.cta-button:hover {
    background-color: #f59e0b;
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3);
    color: white;
}

.cta-button:active {
    transform: scale(0.95);
}

.cta-button .badge {
    background-color: #f59e0b;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 9999px;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: #374151;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

@media (min-width: 1024px) {
    .mobile-menu-btn {
        display: none;
    }
}

.mobile-menu-btn:hover {
    color: #d97706;
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
    display: block;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    background-color: white;
    border-top: 1px solid #f3f4f6;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@media (min-width: 1024px) {
    .mobile-menu {
        display: none !important;
    }
}

.mobile-menu-content {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-nav-item {
    font-weight: 700;
    font-size: 1.125rem;
    color: #1e293b;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
}

.mobile-nav-item:hover {
    color: #d97706;
}

.menu-divider {
    margin: 8px 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

.mobile-cta {
    background-color: #f59e0b;
    color: white;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.3s ease;
    display: block;
}

.mobile-cta:hover {
    background-color: #d97706;
    color: white;
}

.nav-item {
    position: relative;
    font-weight: 700;
    color: #1e293b;
    transition: color 0.3s ease;
}

.nav-item::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: -4px;
    left: 0;
    background-color: #f59e0b;
    transition: width 0.3s ease-in-out;
    border-radius: 2px;
}

.nav-item:hover {
    color: #d97706;
}

.nav-item:hover::after {
    width: 100%;
}

/* ========================================
   LIVE INDICATOR
======================================== */
.live-indicator {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* ========================================
   BUTTONS
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 700;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: #0f172a;
    color: white;
}

.btn-primary:hover {
    background-color: #f59e0b;
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3);
}

.btn-secondary {
    background-color: white;
    color: #0f172a;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background-color: #f59e0b;
    color: white;
}

/* ========================================
   CARDS
======================================== */
.card {
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

/* ========================================
   BADGES
======================================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background-color: #f59e0b;
    color: white;
}

.badge-secondary {
    background-color: #fffbeb;
    color: #d97706;
}

/* ========================================
   PROSE - CONTENT STYLING FOR BOT POSTS
   (CRITICAL FOR single.php)
======================================== */
.prose {
    max-width: 100%;
    color: #334155;
    line-height: 1.8;
}

.prose p {
    margin-bottom: 1.5rem;
    font-size: 1.0625rem;
    line-height: 1.8;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    font-family: 'Lora', Georgia, serif;
    font-weight: 700;
    color: #0f172a;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.prose h1 {
    font-size: 2.25rem;
}

.prose h2 {
    font-size: 1.875rem;
}

.prose h3 {
    font-size: 1.5rem;
}

.prose h4 {
    font-size: 1.25rem;
}

.prose h5 {
    font-size: 1.125rem;
}

.prose h6 {
    font-size: 1rem;
}

.prose ul,
.prose ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.prose ul li,
.prose ol li {
    margin-bottom: 0.5rem;
}

.prose ul {
    list-style-type: disc;
}

.prose ol {
    list-style-type: decimal;
}

.prose blockquote {
    border-left: 4px solid #f59e0b;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #64748b;
    background-color: #fffbeb;
    padding: 1.5rem;
    border-radius: 0.5rem;
}

.prose a {
    color: #f59e0b;
    text-decoration: underline;
}

.prose a:hover {
    color: #d97706;
}

.prose img {
    margin: 2rem auto;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.prose strong {
    font-weight: 700;
    color: #0f172a;
}

.prose em {
    font-style: italic;
}

.prose code {
    background-color: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #dc2626;
}

.prose pre {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 2rem 0;
}

.prose pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* TABLE STYLING - CRITICAL FOR MOBILE */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.9375rem;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 0.5rem;
    overflow: hidden;
}

.prose table thead {
    background-color: #f59e0b;
    color: white;
}

.prose table th,
.prose table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border: 1px solid #e2e8f0;
}

.prose table th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
}

.prose table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.prose table tbody tr:hover {
    background-color: #fffbeb;
}

/* MOBILE TABLE WRAPPER - PREVENTS LAYOUT BREAK */
.prose .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 2rem 0;
}

/* ========================================
   RESPONSIVE MOBILE STYLES
======================================== */
@media (max-width: 768px) {
    /* Mobile Typography - Justify Text */
    .prose p {
        text-align: justify;
        font-size: 1rem;
    }
    
    .prose h1 {
        font-size: 1.75rem;
    }
    
    .prose h2 {
        font-size: 1.5rem;
    }
    
    .prose h3 {
        font-size: 1.25rem;
    }
    
    .prose h4 {
        font-size: 1.125rem;
    }
    
    /* Mobile Table - Horizontal Scroll */
    .prose table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .prose table th,
    .prose table td {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* ========================================
   PAGINATION
======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    background-color: white;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-weight: 700;
    color: #64748b;
    transition: all 0.3s ease;
}

.pagination .page-numbers:hover {
    border-color: #f59e0b;
    color: #f59e0b;
    background-color: #fffbeb;
}

.pagination .page-numbers.current {
    background-color: #f59e0b;
    border-color: #f59e0b;
    color: white;
}

.pagination .prev,
.pagination .next {
    font-weight: 700;
}

/* ========================================
   UTILITY CLASSES
======================================== */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.rounded {
    border-radius: 0.5rem;
}

.shadow {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ========================================
   WORDPRESS SPECIFIC
======================================== */
.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.875rem;
    color: #64748b;
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
}

.sticky {
    /* Styles for sticky posts */
}

.bypostauthor {
    /* Styles for post author comments */
}

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

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: bold;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}


/* ========================================
   ADDITIONAL UTILITY CLASSES FOR INLINE STYLES
======================================== */

/* Background Colors */
.bg-kandang-900 { background-color: #0f172a !important; }
.bg-kandang-800 { background-color: #1e293b !important; }
.bg-ternak-50 { background-color: #fffbeb !important; }
.bg-ternak-500 { background-color: #f59e0b !important; }
.bg-ternak-600 { background-color: #d97706 !important; }
.bg-white { background-color: white !important; }
.bg-gray-50 { background-color: #f9fafb !important; }
.bg-gray-100 { background-color: #f3f4f6 !important; }
.bg-gray-200 { background-color: #e5e7eb !important; }
.bg-red-500 { background-color: #ef4444 !important; }
.bg-green-600 { background-color: #16a34a !important; }

/* Text Colors */
.text-white { color: white !important; }
.text-slate-300 { color: #cbd5e1 !important; }
.text-slate-800 { color: #1e293b !important; }
.text-gray-300 { color: #d1d5db !important; }
.text-gray-400 { color: #9ca3af !important; }
.text-gray-500 { color: #6b7280 !important; }
.text-gray-600 { color: #4b5563 !important; }
.text-gray-700 { color: #374151 !important; }
.text-ternak-500 { color: #f59e0b !important; }
.text-ternak-600 { color: #d97706 !important; }
.text-kandang-900 { color: #0f172a !important; }

/* Display */
.flex { display: flex !important; }
.inline-flex { display: inline-flex !important; }
.grid { display: grid !important; }
.hidden { display: none !important; }
.block { display: block !important; }
.inline-block { display: inline-block !important; }

/* Flex Direction */
.flex-col { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }

/* Align & Justify */
.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }

/* Gap */
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }
.gap-6 { gap: 1.5rem !important; }
.gap-8 { gap: 2rem !important; }

/* Padding */
.p-2 { padding: 0.5rem !important; }
.p-4 { padding: 1rem !important; }
.p-6 { padding: 1.5rem !important; }
.px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-3 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
.px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-6 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.px-8 { padding-left: 2rem !important; padding-right: 2rem !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
.py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }

/* Margin */
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-6 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }

/* Border Radius */
.rounded { border-radius: 0.25rem !important; }
.rounded-full { border-radius: 9999px !important; }
.rounded-xl { border-radius: 0.75rem !important; }
.rounded-2xl { border-radius: 1rem !important; }

/* Font Weight */
.font-medium { font-weight: 500 !important; }
.font-bold { font-weight: 700 !important; }
.font-black { font-weight: 900 !important; }

/* Font Size */
.text-xs { font-size: 0.75rem !important; }
.text-sm { font-size: 0.875rem !important; }
.text-lg { font-size: 1.125rem !important; }
.text-xl { font-size: 1.25rem !important; }
.text-2xl { font-size: 1.5rem !important; }
.text-3xl { font-size: 1.875rem !important; }

/* Text Transform */
.uppercase { text-transform: uppercase !important; }

/* Letter Spacing */
.tracking-wide { letter-spacing: 0.025em !important; }
.tracking-wider { letter-spacing: 0.05em !important; }
.tracking-widest { letter-spacing: 0.1em !important; }

/* Width */
.w-4 { width: 1rem !important; }
.w-5 { width: 1.25rem !important; }
.w-6 { width: 1.5rem !important; }
.w-full { width: 100% !important; }

/* Height */
.h-4 { height: 1rem !important; }
.h-5 { height: 1.25rem !important; }
.h-6 { height: 1.5rem !important; }

/* Position */
.relative { position: relative !important; }
.absolute { position: absolute !important; }
.sticky { position: sticky !important; }

/* Z-Index */
.z-10 { z-index: 10 !important; }
.z-50 { z-index: 50 !important; }

/* Overflow */
.overflow-hidden { overflow: hidden !important; }

/* Transition */
.transition-colors { transition: color 0.3s ease, background-color 0.3s ease !important; }
.transition-all { transition: all 0.3s ease !important; }

/* Shadow */
.shadow-lg { box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1) !important; }
.shadow-md { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important; }

/* Border */
.border-2 { border-width: 2px !important; }
.border-slate-200 { border-color: #e2e8f0 !important; }

/* Responsive Utilities */
@media (min-width: 768px) {
    .md\:block { display: block !important; }
    .md\:flex { display: flex !important; }
    .md\:hidden { display: none !important; }
    .md\:text-5xl { font-size: 3rem !important; }
}

@media (min-width: 1024px) {
    .lg\:flex { display: flex !important; }
    .lg\:hidden { display: none !important; }
    .lg\:px-8 { padding-left: 2rem !important; padding-right: 2rem !important; }
}
