/*
Theme Name: HelloSites Expert
Description: Expert blog theme with hero header image, trending bar, and article grid. Designed for HelloSites network.
Version: 2.0.0
Author: CGI Company
Text Domain: hellosites-expert
Requires at least: 6.0
Requires PHP: 8.0
*/

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
    background: #f5f5f5;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ============================================
   HEADER WITH BACKGROUND IMAGE
   ============================================ */
.site-header {
    position: relative;
    min-height: 220px;
    display: flex;
    align-items: center;
    padding: 30px 40px;
    overflow: hidden;
}

.header-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

.header-bg::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 2;
}

/* When no custom image, use solid dark color */
.header-bg.no-image {
    background: #1a1a2e;
}

.header-bg.no-image::after {
    display: none;
}

.header-inner {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Logo */
.header-logo {
    flex-shrink: 0;
}

.header-logo img,
.header-logo .custom-logo-link { display: block; }

.header-logo img,
.header-logo .custom-logo {
    max-height: 50px;
    width: auto;
}

/* Expert info */
.header-expert {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-expert-photo {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.5);
    flex-shrink: 0;
}

.header-expert-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-expert-info {
    color: #ffffff;
    line-height: 1.3;
}

.header-expert-name {
    font-size: 1.05rem;
    font-weight: 700;
}

.header-expert-name a {
    color: #ffffff;
    transition: opacity 0.2s;
}

.header-expert-name a:hover { opacity: 0.8; }

.header-expert-business {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.75);
}

.header-spacer { flex: 1; }

/* Navigation */
.header-nav { flex-shrink: 0; }

.header-nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.header-nav ul li a {
    color: rgba(255,255,255,0.9);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
    white-space: nowrap;
}

.header-nav ul li a:hover { color: #ffffff; }

.header-nav ul li.current-menu-item a,
.header-nav ul li.current_page_item a {
    color: #ffffff;
    font-weight: 700;
}

/* Mobile toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    flex-shrink: 0;
    position: relative;
    z-index: 3;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    background: #ffffff;
    padding: 40px;
    border-bottom: 1px solid #e0e0e0;
}

.hero-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.hero-section h1 {
    font-size: 1.7rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 15px;
    line-height: 1.3;
    font-style: italic;
}

.hero-description {
    font-size: 1rem;
    color: #444;
    line-height: 1.75;
    margin-bottom: 22px;
    max-width: 900px;
}

.hero-cta {
    display: inline-block;
    background: #1a1a1a;
    color: #ffffff;
    padding: 11px 24px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}

.hero-cta:hover { background: #333; color: #ffffff; }

/* ============================================
   TRENDING BAR
   ============================================ */
.trending-bar {
    background: #1a1a1a;
    padding: 12px 40px;
    display: flex;
    align-items: center;
    gap: 15px;
    overflow: hidden;
}

.trending-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 15px;
    overflow: hidden;
}

.trending-label {
    background: #3366cc;
    color: #ffffff;
    padding: 5px 14px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.trending-ticker {
    overflow: hidden;
    flex: 1;
    position: relative;
    height: 24px;
}

.trending-ticker-track {
    display: flex;
    animation: ticker-scroll 20s linear infinite;
    position: absolute;
    white-space: nowrap;
}

.trending-ticker-track a {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: 50px;
    white-space: nowrap;
    transition: color 0.2s;
}

.trending-ticker-track a:hover { color: #ffffff; }

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================
   POSTS GRID
   ============================================ */
.content-area {
    max-width: 1200px;
    margin: 0 auto;
    padding: 35px 40px 30px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.post-card {
    background: #ffffff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s, transform 0.15s;
}

.post-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.13);
    transform: translateY(-2px);
}

.post-card-image {
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.post-card:hover .post-card-image img { transform: scale(1.04); }

.post-card-content { padding: 16px 18px 20px; }

.post-card-date {
    font-size: 0.78rem;
    color: #999;
    margin-bottom: 6px;
}

.post-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    color: #1a1a1a;
}

.post-card-title a { color: inherit; transition: color 0.2s; }
.post-card-title a:hover { color: #555; }

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    margin-top: 40px;
    display: flex;
    gap: 6px;
    justify-content: center;
}

.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 14px;
    background: #fff;
    border-radius: 3px;
    font-size: 0.9rem;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.pagination .current { background: #1a1a1a; color: #fff; }

/* ============================================
   SINGLE POST LAYOUT
   ============================================ */
.single-content-area {
    max-width: 1200px;
    margin: 0 auto;
    padding: 35px 40px 30px;
}

.single-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}

.single-article { min-width: 0; }

/* Breadcrumb */
.breadcrumb {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 20px;
}

.breadcrumb a { color: #666; transition: color 0.2s; }
.breadcrumb a:hover { color: #1a1a1a; }
.breadcrumb .sep { margin: 0 8px; color: #ccc; }

/* Article */
.single-post-header { margin-bottom: 20px; }

.single-post-header h1 {
    font-size: 1.9rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    margin-bottom: 15px;
}

.single-post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: #999;
    flex-wrap: wrap;
}

.single-post-meta-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.single-post-meta-author img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.single-post-meta-author span { color: #555; font-weight: 500; }

.single-post-featured {
    margin-bottom: 28px;
    border-radius: 5px;
    overflow: hidden;
}

.single-post-featured img { width: 100%; height: auto; }

.single-post-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #444;
}

.single-post-content p { margin-bottom: 1.4em; }

.single-post-content h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 1.8em 0 0.7em;
}

.single-post-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 1.5em 0 0.6em;
}

.single-post-content ul, .single-post-content ol { margin: 0 0 1.4em 1.5em; }
.single-post-content li { margin-bottom: 0.5em; }

.single-post-content blockquote {
    border-left: 4px solid #3366cc;
    padding: 15px 20px;
    margin: 1.5em 0;
    background: #f9f9f9;
    font-style: italic;
    color: #555;
}

.single-post-content img { border-radius: 4px; margin: 1em 0; }
.single-post-content a { color: #3366cc; text-decoration: underline; }

/* Author box */
.author-box {
    margin-top: 40px;
    padding: 25px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    gap: 18px;
    align-items: start;
}

.author-box-photo {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.author-box-photo img { width: 100%; height: 100%; object-fit: cover; }

.author-box-info h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin-bottom: 3px;
}

.author-box-info h3 { font-size: 1.05rem; color: #1a1a1a; margin-bottom: 6px; }
.author-box-info p { font-size: 0.88rem; color: #666; line-height: 1.6; }

/* Post nav */
.post-nav {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.post-nav a { font-size: 0.88rem; color: #1a1a1a; font-weight: 500; transition: color 0.2s; }
.post-nav a:hover { color: #555; }

.post-nav .nav-label {
    font-size: 0.72rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

/* ============================================
   RIGHT SIDEBAR
   ============================================ */
.sidebar-right { position: sticky; top: 25px; }

.sidebar-expert {
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 22px;
    text-align: center;
    margin-bottom: 20px;
}

.sidebar-expert-photo {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 10px;
}

.sidebar-expert-photo img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-expert-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 2px;
}

.sidebar-expert-business {
    font-size: 0.82rem;
    color: #999;
}

.sidebar-recent {
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

.sidebar-recent-post {
    display: block;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.sidebar-recent-post:last-child { border-bottom: none; }
.sidebar-recent-post:hover { background: #fafafa; }

.sidebar-recent-post-image {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.sidebar-recent-post-image img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-recent-post-content { padding: 12px 16px 14px; }

.sidebar-recent-post-date { font-size: 0.73rem; color: #999; margin-bottom: 4px; }

.sidebar-recent-post-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
}

/* ============================================
   PAGE TEMPLATE
   ============================================ */
.page-content { max-width: 750px; }

.page-content h1 {
    font-size: 1.9rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.page-content p {
    margin-bottom: 1.4em;
    line-height: 1.8;
    color: #444;
    font-size: 1.05rem;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    padding: 30px 40px;
    text-align: center;
    color: #999;
    font-size: 0.83rem;
    border-top: 1px solid #e0e0e0;
    background: #fff;
}

.footer-logo {
    max-width: 120px;
    margin: 0 auto 8px;
    opacity: 0.5;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
    .single-layout { grid-template-columns: 1fr 270px; gap: 30px; }
}

@media (max-width: 768px) {
    .site-header { min-height: 160px; padding: 20px; }

    .header-inner { gap: 10px; }

    .header-nav {
        display: none;
        width: 100%;
        order: 99;
        padding-top: 10px;
    }

    .header-nav.open { display: block; }

    .header-nav ul {
        flex-direction: column;
        gap: 0;
    }

    .header-nav ul li a {
        display: block;
        padding: 10px 0;
        border-top: 1px solid rgba(255,255,255,0.15);
    }

    .mobile-menu-toggle { display: block; }
    .header-spacer { display: none; }

    .hero-section { padding: 25px 20px; }
    .hero-section h1 { font-size: 1.3rem; }

    .trending-bar { padding: 10px 20px; }

    .content-area, .single-content-area { padding: 20px; }

    .posts-grid { grid-template-columns: 1fr; }

    .single-layout { grid-template-columns: 1fr; }
    .sidebar-right { position: static; }

    .single-post-header h1 { font-size: 1.4rem; }

    .site-footer { padding: 20px; }

    .author-box { flex-direction: column; align-items: center; text-align: center; }
}
