/*
Theme Name: Saeed Financial Theme
Author: Saeed & Amir
Description: A professional financial theme with dynamic homepage layouts.
Version: 1.0
*/

:root {
    --primary: #0f172a;       /* سرمه‌ای تیره */
    --primary-light: #1e293b; /* سرمه‌ای روشن‌تر */
    --accent: #ca8a04;        /* طلایی تیره (برای دکمه‌ها و لینک‌ها) */
    --accent-hover: #a16207;
    --text-main: #334155;
    --bg-light: #f1f5f9;
    --border: #e2e8f0;
    --font-head: 'Lalezar', cursive;
    --font-body: 'Vazirmatn', sans-serif;
}

/* Reset & Basics */
* { box-sizing: border-box; }
body {
    margin: 0; padding: 0;
    font-family: var(--font-body);
    background: var(--bg-light);
    color: var(--text-main);
    line-height: 1.8;
    direction: rtl;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Typography */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); margin-top: 0; color: var(--primary); }

/* Header & Nav */
header { background: #fff; border-bottom: 3px solid var(--primary); padding: 20px 0; }
.top-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.logo { font-size: 3rem; color: var(--primary); line-height: 1; }
.main-nav { background: var(--primary); }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; }
.main-nav a { display: block; color: #fff; padding: 15px 25px; font-weight: bold; }
.main-nav a:hover { background: var(--accent); color: #fff; }

/* Homepage: Top Section (Random 5) */
.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 250px 250px;
    gap: 15px;
    margin-bottom: 50px;
}
.hero-item { position: relative; overflow: hidden; border-radius: 8px; }
.hero-item img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.hero-item:hover img { transform: scale(1.05); }
.hero-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 20px; color: #fff;
}
.hero-item.main { grid-column: 1 / 2; grid-row: 1 / 3; } /* آیتم بزرگ سمت راست */
.hero-title { font-size: 1.2rem; margin: 0; color: #fff; text-shadow: 1px 1px 3px rgba(0,0,0,0.5); }

/* Category Section Styles */
.cat-section { margin-bottom: 60px; }
.sec-title { border-bottom: 2px solid var(--primary); padding-bottom: 10px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: baseline; }
.view-all { font-size: 0.9rem; color: var(--accent); }

/* Style A: 3 Columns Cards */
.layout-a { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card-a { background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.03); }
.card-a-img { height: 200px; object-fit: cover; }
.card-a-body { padding: 15px; }

/* Style B: List with Thumb Right */
.layout-b { display: flex; flex-direction: column; gap: 15px; }
.card-b { display: flex; background: #fff; border: 1px solid var(--border); align-items: center; padding: 10px; border-radius: 8px; }
.card-b img { width: 150px; height: 100px; object-fit: cover; border-radius: 4px; margin-left: 20px; }

/* Style C: Dark Overlay Grid */
.layout-c { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.card-c { position: relative; height: 300px; border-radius: 8px; overflow: hidden; }
.card-c img { height: 100%; width: 100%; object-fit: cover; }
.card-c-content { position: absolute; bottom: 0; background: rgba(15, 23, 42, 0.9); width: 100%; padding: 15px; color: #fff; }
.card-c h3 { color: #fff; font-size: 1rem; }

/* Single & Page Styling */
.entry-content { background: #fff; padding: 30px; border-radius: 8px; border: 1px solid var(--border); font-size: 1.1rem; text-align: justify; }
.entry-content h2 { margin-top: 30px; border-right: 5px solid var(--accent); padding-right: 15px; }
.entry-content blockquote {
    background: #f8fafc; border-right: 5px solid var(--primary);
    margin: 20px 0; padding: 20px; font-style: italic; color: #555;
}
.entry-content ul { list-style: disc inside; margin-bottom: 20px; }
.entry-content li { margin-bottom: 10px; }

/* Responsive Tables */
.table-responsive { overflow-x: auto; margin-bottom: 20px; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 12px; border: 1px solid var(--border); text-align: right; }
th { background: var(--primary); color: #fff; }
tr:nth-child(even) { background: #f1f5f9; }

/* Sidebar */
.sidebar-widget { background: #fff; padding: 20px; border: 1px solid var(--border); margin-bottom: 20px; border-radius: 8px; }
.widget-title { border-bottom: 2px solid var(--accent); padding-bottom: 10px; margin-bottom: 15px; font-size: 1.2rem; }

/* Footer */
footer { background: var(--primary); color: #cbd5e1; padding: 40px 0; margin-top: 50px; text-align: center; }

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
    .hero-item.main { grid-column: auto; grid-row: auto; height: 300px; }
    .layout-a, .layout-c { grid-template-columns: 1fr; }
    .main-grid-layout { grid-template-columns: 1fr !important; } /* برای سینگل پیج */
    .top-header { flex-direction: column; text-align: center; }
    .main-nav ul { flex-direction: column; }
    .main-nav a { border-bottom: 1px solid rgba(255,255,255,0.1); }
}