/* ===== IRANSansX Font ===== */
@font-face {
    font-family: 'IRANSansX';
    src: url('/assets/fonts/iransans/IRANSansX-Black.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1e88e5;
    --secondary-color: #0d47a1;
    --accent-color: #ff6f00;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f5f5f5;
    --white: #fff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
    --radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'IRANSansX', Tahoma, sans-serif !important;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-color);
    background: var(--bg-color);
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== Header ===== */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.topline {
    background: var(--secondary-color);
    color: var(--white);
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.topline a {
    color: var(--white);
    margin-right: 15px;
    opacity: 0.9;
}

.topline a:hover {
    opacity: 1;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo-wrap img {
    height: 60px;
    width: auto;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
    padding: 8px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--bg-color);
}

.head-search {
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.head-search:hover {
    background: var(--bg-color);
}

.category-nav {
    background: var(--white);
    border-top: 1px solid var(--border-color);
    padding: 12px 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 1400px;
    margin: 0 auto;
}

.category-nav a {
    padding: 8px 16px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 13px;
    transition: var(--transition);
}

.category-nav a:hover,
.category-nav a.active {
    background: var(--primary-color);
    color: var(--white);
}

/* ===== Main Container ===== */
.home-container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

.home-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    display: block;
    transition: var(--transition);
}

.hero:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.hero img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 40px 30px 30px;
    color: var(--white);
}

.hero-overlay .tag {
    background: var(--accent-color);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
}

.hero-overlay h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
}

.hero-overlay p {
    font-size: 14px;
    opacity: 0.95;
    margin-bottom: 10px;
}

.hero-overlay small {
    font-size: 12px;
    opacity: 0.8;
}

.empty-hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
}

.empty-hero h1 {
    font-size: 32px;
    margin: 15px 0;
}

/* ===== Section Block ===== */
.section-block {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

.section-heading h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--secondary-color);
}

.section-heading a {
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 500;
}

/* ===== Cards Grid ===== */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.news-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: block;
}

.news-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.card-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.news-card:hover .card-image img {
    transform: scale(1.05);
}

.card-image .tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.card-body {
    padding: 15px;
}

.card-body h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.6;
    color: var(--text-color);
}

.card-body small {
    color: var(--text-light);
    font-size: 12px;
}

.empty-site {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.empty-site a {
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== Sidebar ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.side-panel {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.tabs span {
    padding: 10px 15px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}

.tabs span:hover {
    color: var(--primary-color);
}

.tabs span.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.latest-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.latest-item:last-child {
    border-bottom: none;
}

.latest-item:hover {
    background: var(--bg-color);
    padding-right: 10px;
    border-radius: var(--radius);
}

.latest-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.latest-item div {
    flex: 1;
}

.latest-item strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.5;
}

.latest-item small {
    color: var(--text-light);
    font-size: 11px;
}

/* ===== Weather Widget ===== */
.weather {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius);
    padding: 20px;
    color: var(--white);
    box-shadow: var(--shadow);
}

.weather-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    text-align: center;
}

.weather-main {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius);
}

.weather-main b {
    font-size: 36px;
    font-weight: 700;
}

.weather-main span {
    font-size: 32px;
}

.weather-main small {
    display: block;
    font-size: 12px;
    margin-top: 5px;
}

.forecast {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.forecast span {
    text-align: center;
    padding: 10px 5px;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius);
    font-size: 11px;
}

.forecast b {
    display: block;
    font-size: 16px;
    margin-top: 5px;
}

/* ===== Mobile Bottom Nav ===== */
.mobile-bottom {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: 10px 0;
    z-index: 999;
}

.mobile-bottom a {
    flex: 1;
    text-align: center;
    padding: 8px;
    font-size: 12px;
    color: var(--text-light);
    transition: var(--transition);
}

.mobile-bottom a.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--secondary-color);
    color: var(--white);
    padding: 30px 20px;
    margin-top: 40px;
    text-align: center;
}

.site-footer strong {
    display: block;
    font-size: 18px;
    margin-bottom: 8px;
}

.site-footer span {
    opacity: 0.9;
    font-size: 13px;
}

.site-footer a {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 25px;
    background: var(--white);
    color: var(--secondary-color);
    border-radius: var(--radius);
    font-weight: 600;
    transition: var(--transition);
}

.site-footer a:hover {
    background: var(--accent-color);
    color: var(--white);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .home-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: 2;
    }
    
    .main-content {
        order: 1;
    }
}

@media (max-width: 768px) {
    .topline {
        font-size: 11px;
        padding: 6px 15px;
    }
    
    .topline div {
        display: none;
    }
    
    .header-main {
        padding: 12px 15px;
    }
    
    .logo-wrap img {
        height: 45px;
    }
    
    .category-nav {
        padding: 10px 15px;
        overflow-x: auto;
        justify-content: flex-start;
    }
    
    .category-nav a {
        white-space: nowrap;
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .home-container {
        padding: 0 15px;
        margin: 15px auto;
    }
    
    .hero img {
        height: 250px;
    }
    
    .hero-overlay h1 {
        font-size: 20px;
    }
    
    .hero-overlay p {
        font-size: 13px;
    }
    
    .cards {
        grid-template-columns: 1fr;
    }
    
    .mobile-bottom {
        display: flex;
    }
    
    body {
        padding-bottom: 70px;
    }
    
    .site-footer {
        margin-bottom: 70px;
    }
}

@media (max-width: 480px) {
    .hero img {
        height: 200px;
    }
    
    .hero-overlay {
        padding: 20px 15px 15px;
    }
    
    .hero-overlay h1 {
        font-size: 18px;
    }
    
    .section-heading h2 {
        font-size: 16px;
    }
    
    .latest-item img {
        width: 60px;
        height: 60px;
    }
    
    .latest-item strong {
        font-size: 12px;
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card,
.latest-item,
.hero {
    animation: fadeIn 0.5s ease-out;
}

/* ===== Accessibility ===== */
:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== Print Styles ===== */
@media print {
    .site-header,
    .mobile-bottom,
    .site-footer,
    .sidebar {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
}