/* --- General Styles --- */
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.7; margin: 0; background: #f4f4f4; color: #333; }
main { max-width: 1200px; margin: 2rem auto; padding: 0 1rem; }

/* --- Header Styles --- */
header { background: #fff; padding: 0; border-bottom: 1px solid #e0e0e0; box-shadow: 0 2px 4px rgba(0,0,0,.05); position: relative; z-index: 100; }
.header-container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; display: flex; justify-content: space-between; align-items: center; height: 70px; }
.logo a { font-size: 1.8em; font-weight: bold; color: #0056b3; text-decoration: none; }
.main-nav ul { margin: 0; padding: 0; list-style: none; display: flex; }
.main-nav li { margin-left: 2rem; }
.main-nav a { text-decoration: none; color: #333; font-weight: 500; font-size: 1.1em; padding: 5px 0; border-bottom: 2px solid transparent; transition: color .2s,border-bottom .2s; }
.main-nav a:hover { color: #0056b3; border-bottom: 2px solid #0056b3; }
.mobile-menu-toggle { display: none; }

/* --- Homepage Article Grid (FIXED for 3 columns) --- */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
@media (min-width: 1100px) {
    .article-grid { grid-template-columns: repeat(3, 1fr); }
}

.article-card { background: #fff; text-decoration: none; color: #333; box-shadow: 0 2px 8px rgba(0,0,0,.1); display: flex; flex-direction: column; border-radius: 8px; overflow: hidden; }
.article-card:hover { transform: translateY(-5px); transition: transform .2s ease; }
.article-card img { width: 100%; height: 200px; object-fit: cover; }
.card-content { padding: 1rem; display: flex; flex-direction: column; flex-grow: 1; }
.card-content h3 { margin-top: 0; font-size: 1.2em; flex-grow: 1; }
/* Homepage Title Style (FIXED) */
.card-content h3 a { color: #222; text-decoration: none; font-weight: bold; }
.card-content h3 a:hover { color: #0056b3; }
.read-more { color: #0056b3; font-weight: bold; text-decoration: none; display: inline-block; margin-top: 1rem; }

/* --- Single Article Page Styles --- */
.article-full { background: #fff; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.article-full .main-image { max-width: 100%; height: auto; margin-bottom: 1.5rem; border-radius: 8px; }
.article-full .meta { color: #666; font-size: .9em; margin-bottom: 1rem; }
.article-full .meta a { color: #0056b3; text-decoration: none; font-weight: bold; }
.article-full .content { font-size: 1.1em; }
.article-full a { color: #0056b3; text-decoration: none; }

/* --- Article Content Formatting --- */
.content h1, .content h2, .content h3 { line-height: 1.3; color: #111; margin-top: 2rem; margin-bottom: 1rem; }
.content p { margin-bottom: 1.2rem; }
.content strong { color: #000; }
.content em { font-style: italic; color: #444; }
.key-highlights { background-color: #eef5ff; border-left: 5px solid #0056b3; padding: 1.5rem; margin: 2rem 0; border-radius: 5px; }
.key-highlights h4 { margin-top: 0; margin-bottom: 1rem; font-size: 1.3em; color: #003d7c; }
.key-highlights ul { margin: 0; padding-left: 20px; }
.key-highlights li { margin-bottom: .5rem; font-size: 1.05em; }

/* Table Styles & Responsive Container (FIXED) */
.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 2rem 0; }
.content table { width: 100%; border-collapse: collapse; min-width: 600px; }
.content td, .content th { border: 1px solid #ddd; padding: 12px; text-align: left; }
.content th { background-color: #f8f8f8; font-weight: bold; }
.content tr:nth-child(2n) { background-color: #fdfdfd; }

/* --- Author Meta & Pagination --- */
.author-meta { font-size: .9em; color: #555; margin-bottom: 1rem; }
.author-meta a { color: #0056b3; text-decoration: none; font-weight: bold; }
.pagination { text-align: center; margin: 3rem 0 1rem; }
.pagination a { color: #0056b3; padding: 10px 18px; text-decoration: none; border: 1px solid #ddd; margin: 0 4px; border-radius: 4px; }
.pagination a.active { background-color: #0056b3; color: #fff; border: 1px solid #0056b3; }
.pagination a:hover:not(.active) { background-color: #f2f2f2; }

/* --- Footer --- */
footer { background: #222; color: #aaa; padding: 0; margin-top: 3rem; font-size: .9em; }
.footer-container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem; display: flex; justify-content: space-between; align-items: center; width: 100%; box-sizing: border-box; }
.copyright { text-align: left; }
.footer-links { text-align: right; }
.footer-links a { color: #fff; text-decoration: none; margin-left: 1.5rem; transition: color .2s; }
.footer-links a:hover { color: #bbb; }

/* --- Public Writer Page Styles (FIXED) --- */
.author-profile-box { background: #fff; padding: 2rem; margin-bottom: 2rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.1); display: flex; align-items: flex-start; }
.author-profile-pic {
    width: 55px; /* Set to 55px as requested */
    height: 55px; /* Set to 55px as requested */
    border-radius: 50%;
    object-fit: cover;
    margin-right: 1.5rem;
    border: 2px solid #eee;
    flex-shrink: 0;
}
.author-details { flex: 1; }
.author-details h2 { margin-top: 0; margin-bottom: 0.25rem; }
.author-job-profile { font-size: 1.1em; font-style: italic; color: #555; margin-top: 0; margin-bottom: 1rem; }
.author-bio { font-size: 1.1em; line-height: 1.8; color: #333; }
.author-bio p { margin-bottom: 1em; }

/* --- Responsive & Mobile Fixes --- */
@media (max-width: 1024px) {
    .article-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .header-container { flex-direction: row; height: 70px; padding: 0 1rem; }
    .main-nav { display: none; position: absolute; top: 70px; left: 0; width: 100%; background: #fff; box-shadow: 0 4px 8px rgba(0,0,0,.1); }
    .main-nav ul { flex-direction: column; width: 100%; }
    .main-nav li { margin: 0; width: 100%; text-align: center; border-bottom: 1px solid #f0f0f0; }
    .main-nav a { display: block; padding: 1rem; border: none !important; }
    body.nav-open .main-nav { display: block; }
    .mobile-menu-toggle { display: flex; flex-direction: column; justify-content: space-around; width: 30px; height: 25px; background: 0 0; border: none; cursor: pointer; padding: 0; }
    .mobile-menu-toggle span { width: 100%; height: 3px; background: #333; border-radius: 2px; transition: all .3s ease; }
    body.nav-open .mobile-menu-toggle span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    body.nav-open .mobile-menu-toggle span:nth-child(2) { opacity: 0; }
    body.nav-open .mobile-menu-toggle span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }
    main { margin: 1rem auto; }
    .article-grid { grid-template-columns: 1fr; }
    .card-content h3 { font-size: 1.1em; line-height: 1.4; }
    
    /* Mobile Article Page Title Fixes */
    .article-full { padding: 1rem; }
    .article-full h1 { margin-top: 0; line-height: 1.3; font-size: 1.8em; }
    
    /* Mobile Writer Page Fixes */
    .author-profile-box { flex-direction: column; align-items: center; text-align: center; }
    .author-profile-pic { margin-right: 0; margin-bottom: 1.5rem; }

    /* Mobile Footer Fixes */
    .footer-container { flex-direction: column; }
    .copyright { margin-bottom: 1rem; text-align: center; }
    .footer-links { text-align: center; }
    .footer-links a { margin: 0 .7rem; }
}




/* --- NEW: Article Byline Styles --- */
.meta-container {
    margin-bottom: 1.5rem;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
}

.meta.with-image {
    display: flex;
    align-items: center; /* Vertically align image and text */
}

.author-avatar {
    width: 50px;  /* Set to 50px as requested */
    height: 50px; /* Set to 50px as requested */
    border-radius: 50%; /* Make the image round */
    object-fit: cover;
    margin-right: 15px; /* Space between image and text */
}

.meta-text {
    display: flex;
    flex-direction: column; /* Stack the two lines of text */
}

.author-line {
    font-weight: bold;
    font-size: 1.1em;
}
.author-line a {
    color: #333;
}

.date-line {
    font-size: 0.9em;
    color: #666;
}

.meta.no-image {
    /* This is the old style, for authors without an image */
    color: #666;
    font-size: 0.9em;
}

/* --- Find the old .logo img rule and replace it with this --- */
.logo img {
    max-height: 50px; /* Ensures logo doesn't get too tall in the header */
    width: auto;      /* Maintains aspect ratio by default */
    max-width: 100%;  /* Ensures logo never overflows its container on mobile */
    display: block;   /* Fixes potential spacing issues */
}