/* Global Styles */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --bg-light: #f3f4f6;
    --bg-white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --max-width: 1200px;
    --border-radius: 8px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
}

body {
    overflow-x: hidden;
    position: relative;
}

/* Top Navigation */
.top-nav {
    background: var(--bg-white);
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 40px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Hero Section */
.hero-section {
    width: 100vw;
    position: relative;
    left: calc(-50vw + 50%);
    margin: 0;
    min-height: 600px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-white);
    text-align: center;
    padding: var(--spacing-lg) 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hero-container {
    position: relative;
    z-index: 2;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-text {
    margin-bottom: var(--spacing-lg);
}

.hero-eyebrow {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    display: block;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    line-height: 1.2;
}

.hero-description {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.9;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.primary-btn, .secondary-btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.primary-btn {
    background: #4A90E2;
    color: white;
    border: none;
}

.primary-btn:hover {
    background: #357ABD;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.secondary-btn {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.hero-logo {
    margin-bottom: 2rem;
    text-align: center;
}

.hero-logo .responsive-logo {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .hero-logo .responsive-logo {
        width: 80%;
        height: auto;
    }
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(74, 144, 226, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero-text h1 {
        font-size: 3rem;
    }
    
    .hero-description {
        font-size: 1.2rem;
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .hero-section {
        min-height: 60vh;
    }
}

/* Section Styles */
.section-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-sm);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.view-all:hover {
    color: var(--secondary-color);
}

/* Card Grids */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

/* Card Styles */
.featured-card,
.post-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.featured-card:hover,
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card-image {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.card-content {
    padding: var(--spacing-md);
}

.card-meta {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.card-meta time,
.card-meta .category a {
    color: var(--text-secondary);
    text-decoration: none;
}

.card-meta .category a:hover {
    color: var(--primary-color);
}

.card-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
}

.card-content h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.card-content h3 a:hover {
    color: var(--primary-color);
}

.card-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.read-more:hover {
    color: var(--secondary-color);
}

/* Featured Posts Section */
.featured-section {
    margin: 4rem 0;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.featured-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.featured-card:hover {
    transform: translateY(-5px);
}

.card-image {
    display: block;
    position: relative;
    padding-top: 60%;
    overflow: hidden;
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.featured-card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 1.5rem;
}

.card-category {
    margin-bottom: 0.5rem;
}

.card-category span {
    font-size: 0.875rem;
    color: #2563eb;
    font-weight: 500;
}

.card-title {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    line-height: 1.4;
}

.card-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.card-title a:hover {
    color: #2563eb;
}

.card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #666;
}

@media (max-width: 1024px) {
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .featured-grid {
        grid-template-columns: 1fr;
    }
}

/* Pagination Styles */
.pagination-nav {
    margin: 4rem 0;
    padding: 0 1rem;
}

.pagination-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.pagination-counter {
    font-size: 1rem;
    color: #6B7280;
    background-color: #F3F4F6;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

.pagination-button {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: #2563EB;
    background-color: #EFF6FF;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    border: 1px solid #BFDBFE;
}

.pagination-button:hover {
    background-color: #2563EB;
    color: white;
    border-color: #2563EB;
}

.pagination-button::after {
    content: "";
}

.pagination-button[href*="next"]::after {
    content: "→";
    margin-left: 0.5rem;
    font-family: system-ui;
}

.pagination-button[href*="previous"]::before {
    content: "←";
    margin-right: 0.5rem;
    font-family: system-ui;
}

@media (max-width: 640px) {
    .pagination-wrapper {
        flex-direction: column;
        gap: 1rem;
    }
    
    .pagination-counter,
    .pagination-button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* Newsletter Section */
.newsletter-section {
    background: var(--bg-light);
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-lg);
}

.newsletter-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.newsletter-content p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.newsletter-form {
    display: flex;
    gap: var(--spacing-sm);
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: var(--spacing-sm);
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.newsletter-form button {
    border: none;
    cursor: pointer;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.modal-overlay.visible {
    display: flex;
    opacity: 1;
}

.modal-container {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    width: var(--modal-width, 80%);
    max-width: var(--modal-max-width, 500px);
    position: relative;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@media (max-width: 768px) {
    .modal-container {
        width: 90%;  /* Mobile responsiveness preserved */
    }
}

.modal-overlay.visible .modal-container {
    opacity: 1;
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.3s ease;
}

.modal-close.visible {
    visibility: visible;
    opacity: 1;
}

.modal-close:hover {
    color: #666;
}

.modal-header {
    margin-bottom: 1rem;
}

.modal-title {
    margin: 0;
    font-size: 1.5rem;
}

.modal-content {
    margin-bottom: 1.5rem;
}

.popup-text {
    margin-bottom: 1rem;
}

.modal-image {
    max-width: 100%;
    height: auto;
    margin-bottom: 1rem;
}

.modal-actions {
    text-align: center;
}

.modal-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #00E676;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.modal-button:hover {
    background-color: #00C853;
}

/* Media Section */
.media-section {
    padding: var(--spacing-lg) 0;
    background: var(--bg-light);
}

.media-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.media-pair {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    align-items: stretch;
}

.media-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.media-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.media-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.media-image,
.media-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.media-video {
    background: #000;
}

/* Media Section Responsive */
@media (max-width: 768px) {
    .media-pair {
        grid-template-columns: 1fr;
    }
    
    .media-wrapper {
        padding-top: 56.25%; /* Maintain aspect ratio on mobile */
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .section-header {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .hero-cta {
        flex-direction: column;
    }
    
    .card-meta {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
}
