/* Global Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.65; /* Slightly increased for readability */
    margin: 0;
    padding: 0;
    background-color: #f9f9f9; /* Slightly off-white */
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 90%;
    max-width: 1140px; /* Slightly wider max-width */
    margin: 0 auto;
    padding: 0 15px;
}

a {
    color: #0069ff; /* A slightly brighter blue */
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: #004cb3; /* Darker shade for hover */
    text-decoration: none; /* Remove underline on hover for a cleaner look if preferred */
}

img {
    max-width: 100%;
    height: auto;
    display: block; /* Removes bottom space under images */
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-weight: 600; /* A bit bolder for headings */
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem; /* Adjusted for impact */
    color: #1a1a1a;
}

h2 {
    font-size: 2rem;
    color: #2c2c2c;
    margin-bottom: 1.75rem;
}

h3 {
    font-size: 1.5rem;
    color: #333;
}

/* Header */
header {
    background-color: #fff;
    padding: 1rem 0;
    border-bottom: 1px solid #e0e0e0; /* Softer border */
    position: sticky;
    top: 0;
    z-index: 1020; /* Ensure it's above other content */
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

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

.logo a {
    font-size: 1.6rem;
    font-weight: 700; /* Bolder logo */
    color: #222;
    text-decoration: none;
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center; /* Vertically align nav items */
}

header nav ul li {
    margin-left: 25px; /* Slightly more spacing */
}

header nav ul li a {
    color: #4a4a4a; /* Darker grey for better contrast */
    text-decoration: none;
    font-weight: 500;
    padding: 5px 0;
    position: relative; /* For active indicator */
}

header nav ul li a.active {
    color: #0069ff;
    font-weight: 600;
}

header nav ul li a.active::after {
    content: '';
    position: absolute;
    bottom: -5px; /* Position it slightly below the text */
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #0069ff;
}

header nav ul li a:hover {
    color: #0056b3;
}

/* Auth Navigation Smooth Transitions */
#auth-action {
    transition: opacity 0.3s ease-in-out, transform 0.2s ease-in-out;
    min-width: 120px; /* Prevent layout shift during transitions */
}

#auth-action span,
#auth-action a {
    transition: opacity 0.2s ease-in-out;
}

/* Admin Navigation Smooth Transitions */
#admin-nav {
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    position: relative;
}

#admin-nav[style*="display: none"] {
    opacity: 0;
    visibility: hidden;
}

#admin-nav[style*="display: block"] {
    opacity: 1;
    visibility: visible;
}

/* Admin Dropdown Styles */
.admin-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0.3rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-width: 180px;
    z-index: 1000;
    list-style: none;
    padding: 0.5rem 0;
    margin: 5px 0 0 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease-in-out;
}

.admin-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.admin-dropdown li {
    margin: 0;
}

.admin-dropdown li a {
    display: block;
    padding: 0.75rem 1rem;
    color: #4a4a4a;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border-bottom: none;
}

.admin-dropdown li a:hover {
    background-color: #f8f9fa;
    color: #0069ff;
}

.admin-dropdown li a.active {
    background-color: #0069ff;
    color: white;
}

/* Responsive admin dropdown */
@media (max-width: 768px) {
    .admin-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        background-color: transparent;
        opacity: 1;
        visibility: visible;
        transform: none;
        padding: 0;
        margin: 0;
    }
    
    .admin-dropdown li a {
        padding: 5px 20px;
        font-size: 0.9rem;
    }
}

/* Review Navigation - Admin Only */
#review-nav {
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

#review-nav[style*="display: none"] {
    opacity: 0;
    visibility: hidden;
}

#review-nav[style*="display: block"] {
    opacity: 1;
    visibility: visible;
}

/* Loading state styles */
.auth-loading {
    opacity: 0.6;
    pointer-events: none;
}

.auth-buttons .btn {
    margin-left: 12px;
    font-size: 0.85rem;
    padding: 0.45rem 0.9rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem; /* Slightly larger padding */
    font-size: 0.95rem;
    font-weight: 600; /* Bolder button text */
    text-align: center;
    border-radius: 0.3rem; /* Slightly more rounded */
    transition: all 0.25s ease-in-out;
    cursor: pointer;
    border: 1px solid transparent; /* Base border */
}

.btn-primary {
    background-color: #0069ff;
    color: #fff;
    border-color: #0069ff;
}

.btn-primary:hover {
    background-color: #0052cc;
    border-color: #004cb3;
    color: #fff;
    transform: translateY(-1px); /* Subtle lift */
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.btn-large {
    padding: 0.8rem 1.75rem;
    font-size: 1.15rem;
}

/* Hero Section */
.hero {
    background-color: #ffffff; /* Clean white */
    padding: 5rem 0; /* More padding */
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.hero h1 {
    font-size: 3rem; /* Larger hero heading */
    margin-bottom: 1.25rem;
    color: #1a1a1a;
    font-weight: 700; /* Very bold hero title */
}

.hero p {
    font-size: 1.2rem; /* Larger hero paragraph */
    color: #555;
    margin-bottom: 2.5rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.hero .login-prompt {
    font-size: 1rem;
    color: #6c757d;
    margin-top: 1.5rem;
}

/* Featured Articles / Newsletter Grid */
.featured-articles,
.newsletter-list {
    padding: 3.5rem 0; /* More vertical padding */
}

.article-grid,
.newsletter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* Slightly wider min card width */
    gap: 2.5rem; /* Increased gap */
}

.article-card,
.newsletter-card {
    background-color: #fff;
    border: 1px solid #e0e0e0; /* Softer border */
    border-radius: 0.35rem; /* Consistent rounding */
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    transition: transform 0.25s ease-in-out, box-shadow 0.25s ease-in-out;
    display: flex; /* For better internal alignment if needed */
    flex-direction: column;
}

.article-card:hover,
.newsletter-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.07);
}

.article-card img,
.newsletter-card img {
    width: 100%;
    height: 220px; /* Slightly taller images */
    object-fit: cover;
}

.card-content {
    padding: 1.75rem; /* More padding in cards */
    flex-grow: 1; /* Allows footer of card to align if cards have different text length */
    display: flex;
    flex-direction: column;
}

.article-card h3,
.newsletter-card h3 {
    font-size: 1.35rem;
    margin-bottom: 0.6rem;
    color: #222;
    font-weight: 600;
}

.article-card p,
.newsletter-card p {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 1.25rem;
    flex-grow: 1; /* Pushes button to bottom */
}

.newsletter-date {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #777;
    margin-bottom: 0.75rem; /* More space below date */
    text-transform: uppercase; /* JournalClub.io often uses uppercase for meta text */
    letter-spacing: 0.5px;
}

.read-more,
.newsletter-card .btn-primary {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    align-self: flex-start; /* Align button to the left */
}

.view-all {
    text-align: center;
    margin-top: 3rem;
}

/* Page Title Section (for non-home pages) */
.page-title-section {
    background-color: #f0f0f0; /* Slightly different grey */
    padding: 2.5rem 0;
    text-align: center;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid #ddd;
}

.page-title-section h1 {
    color: #333;
    font-size: 2.25rem;
}

/* Form Sections */
.form-section {
    padding: 2.5rem 0;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0.3rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    max-width: 500px;
    margin: 2.5rem auto;
}

.form-section .container {
    max-width: 450px;
}

.form-group {
    margin-bottom: 1.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 500;
    color: #444;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.8rem 1rem; /* More padding in inputs */
    border: 1px solid #ccc;
    border-radius: 0.3rem;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus {
    border-color: #0069ff;
    box-shadow: 0 0 0 0.2rem rgba(0,105,255,.25);
    outline: none;
}

.form-section button.btn-primary {
    width: 100%;
    padding: 0.85rem;
    font-size: 1.05rem;
}

.form-section p {
    text-align: center;
    margin-top: 1.75rem;
    font-size: 0.95rem;
}

/* FAQ Specific */
.faq-item {
    background: #fff;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    border: 1px solid #e0e0e0;
    border-radius: .3rem;
}
.faq-item h4 {
    margin-bottom: .75rem;
    color: #0069ff;
    font-size: 1.2rem;
}
.faq-item p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Footer */
footer {
    background-color: #2c2c2c; /* Darker footer */
    color: #bcbcbc; /* Lighter grey text */
    padding: 3.5rem 0 2rem;
    margin-top: 3.5rem;
}

footer .container {
    text-align: center;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
    margin-bottom: 2.5rem;
}

.footer-logo a {
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
    display: block;
    margin-bottom: 0.75rem;
}

.footer-logo p {
    font-size: 0.95rem;
    margin-bottom: 0;
    color: #a0a0a0;
}

.footer-links ul,
.footer-legal ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li,
.footer-legal li {
    margin-bottom: 0.6rem;
}

.footer-links a,
.footer-legal a {
    color: #bcbcbc;
    transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-legal a:hover {
    color: #fff;
    text-decoration: none;
}

.footer-logo,
.footer-links,
.footer-legal {
    flex: 1;
    margin-bottom: 1.75rem;
    min-width: 180px;
}

.copyright p {
    font-size: 0.9rem;
    color: #888;
    margin-top: 2.5rem;
    border-top: 1px solid #444; /* Darker separator */
    padding-top: 2rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2.5rem;
    padding: 1rem 0;
}

.pagination .btn {
    margin: 0 0.6rem;
    font-weight: 500;
}

.pagination span {
    margin: 0 1.25rem;
    color: #555;
    font-size: 0.95rem;
}

.pagination .disabled,
.pagination .btn-secondary.disabled {
    background-color: #e9ecef;
    border-color: #e9ecef;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.pagination .disabled:hover,
.pagination .btn-secondary.disabled:hover {
    background-color: #e9ecef;
    border-color: #e9ecef;
    color: #888;
}

/* Responsive adjustments */
@media (max-width: 992px) { /* Adjusted breakpoint */
    .article-grid,
    .newsletter-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        padding-top: 0.5rem; /* Add some padding when stacked */
        padding-bottom: 0.5rem;
    }
    header .logo {
        margin-bottom: 0.75rem; /* Space below logo when stacked */
    }
    header nav {
        margin-top: 0.5rem;
        width: 100%; /* Make nav full width */
    }
    header nav ul {
        justify-content: center;
        flex-wrap: wrap;
    }
    header nav ul li {
        margin: 5px 10px;
    }
    header nav ul li a.active::after {
        bottom: -2px; /* Adjust active indicator for smaller screens */
    }
    .auth-buttons {
        margin-top: 1rem;
        width: 100%;
        display: flex;
        justify-content: center;
    }
    .auth-buttons .btn {
        flex-grow: 1; /* Make buttons take available space */
        margin: 0 5px;
    }

    .hero h1 {
        font-size: 2.25rem;
    }
    .hero p {
        font-size: 1.1rem;
    }
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer-logo,
    .footer-links,
    .footer-legal {
        margin-bottom: 2rem;
        width: 100%;
        text-align: center;
    }
    .footer-links ul,
    .footer-legal ul {
        display: inline-block;
        text-align: left;
    }
}

@media (max-width: 480px) { /* For very small screens */
    .container {
        width: 95%;
    }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    .btn, .auth-buttons .btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
    }
    .btn-large { 
        font-size: 1rem;
        padding: 0.7rem 1.2rem;
    }
    .article-grid,
    .newsletter-grid {
        grid-template-columns: 1fr; /* Stack cards on very small screens */
    }
}

/* Responsive adjustments for article cards if any, similar to newsletter cards */

/* Styles for Newsletter Cards generated by newsletters.html script */
.card-image-placeholder {
    height: 180px; /* Or your desired height */
    background-color: #e9ecef; /* Light grey background */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #6c757d; /* Muted text color */
    font-size: 1.1em;
    font-weight: bold;
    border-bottom: 1px solid #dee2e6;
}

.newsletter-card h3.summary-link-container a.summary-link {
    text-decoration: none; /* Keep it clean */
    color: var(--primary-color); /* Or your link color, ensure --primary-color is defined */
}

.newsletter-card h3.summary-link-container a.summary-link:hover {
    text-decoration: underline;
}

/* Ensure primary color is defined, if not already globally */
:root {
    --primary-color: #0069ff; /* Matching the existing button blue */
} 