/* ===================================================================
   Optimized Stylesheet for CyExpats.com (Version 3)
   This file replaces tailwind.min.css and inline styles.
   Includes all styles for header, navigation, and page content.
   =================================================================== */

/* --- Global & Body --- */
body {
    font-family: 'Inter', 'Segoe UI', Roboto, -apple-system, sans-serif;
    background-color: #f8fafc;
    color: #111827;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

a {
    color: #0369a1;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #0284c7;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* --- Header & Navigation --- */
.site-header {
    background-color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 2rem; /* Add this line */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .header-container {
        padding: 1.25rem 1rem;
    }
}

.site-logo img {
    width: 188px;
    height: auto;
    display: block;
}

.mobile-menu-toggle {
    display: flex; /* Changed from 'block' */
    align-items: center; /* Added */
    justify-content: center; /* Added */
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    z-index: 1001; /* Ensure it's above the nav */
}

@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none;
    }
}

.mobile-menu-toggle .icon-close {
    display: none;
}

.site-nav {
    display: none; /* Hidden on mobile by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

.site-nav.is-open {
    display: flex;
    transform: translateX(0);
}

@media (min-width: 768px) {
    .site-nav {
        display: flex;
        position: static;
        height: auto;
        width: auto;
        background-color: transparent;
        backdrop-filter: none;
        flex-direction: row;
        align-items: center;
        gap: 2rem;
        transform: none;
        transition: none;
    }
}

.site-nav a {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
}

@media (min-width: 768px) {
    .site-nav a {
        font-size: 1rem;
        font-weight: 500;
        padding-bottom: 4px;
        border-bottom: 2px solid transparent;
    }
}

.site-nav a.is-active {
    color: #0369a1;
    border-bottom: 2px solid #0369a1;
}

.site-nav .nav-button {
    background-color: #0369a1;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

.site-nav .nav-button:hover {
    background-color: #0284c7;
    color: #ffffff;
}

/* --- Hero Section (Homepage) --- */
.home-hero {
    position: relative;
    margin-bottom: 3rem;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

.home-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom, 
        rgba(17, 24, 39, 0.05) 0%, 
        rgba(17, 24, 39, 0.7) 100%
    );
}

.home-hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    text-align: center;
    color: #ffffff;
}

.home-hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.home-hero-subtitle {
    font-size: 1.125rem;
    max-width: 48rem;
    margin: 0 auto;
}

/* --- Hero Section (Inner Pages) --- */
.hero-section {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    margin-top: -38px; /* Explicitly set top margin to 0 */
}

.hero-background {
    position: absolute;
    inset: 0;
}

.hero-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(3, 105, 161, 0.9) 0%, rgba(4, 120, 184, 0.9) 100%);
}

.hero-content {
    position: relative;
    max-width: 80rem;
    margin: 0 auto;
    padding: 4rem 1rem;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    line-height: 1;
    font-weight: bold;
    letter-spacing: -0.025em;
}

.hero-title span {
    display: block;
    font-family: 'Lora', serif;
}

.hero-subtitle {
    margin-top: 1.5rem;
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.25rem;
    line-height: 1.75rem;
    color: #e1f5fe;
}

.hero-button-container {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease-in-out;
}

.btn-primary {
    background-color: #ffffff;
    color: #0369a1;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    color: #0284c7;
}

/* --- Section & Grid Layout --- */
.page-section {
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-heading {
    font-size: 1.275rem; /* Reduced from 2.25rem */
    line-height: 2.25rem; /* Reduced from 2.5rem */
    font-weight: bold;
    color: #111827;
    margin-bottom: 2rem;
    border-bottom: 3px solid #0369a1;
    padding-bottom: 0.5rem;
    text-align: left; /* Changed from 'center' */
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* --- Card Styles --- */
.card {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.07), 0 1px 2px 0 rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.card-icon-wrapper {
    background-color: #e0f2fe;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-right: 1rem;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon {
    color: #0369a1;
    font-size: 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.card-body {
    color: #4b5563;
    font-size: 0.875rem;
    flex-grow: 1;
}

.card-footer {
    margin-top: 1.5rem;
}

.card-link {
    display: inline-flex;
    align-items: center;
    color: #0369a1;
    font-size: 0.875rem;
    font-weight: 600;
}

/* --- Featured Card Styles --- */
.featured-card-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 2rem 1rem;
    background-color: #f8fafc;
}

.featured-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    background-color: #ffffff;
    text-align: center;
    flex: 1;
    min-width: 340px;
    max-width: 100%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.featured-card-tag {
    display: inline-block;
    background-color: #fef9c3;
    color: #a16207;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.featured-card-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.featured-card-title {
    font-size: 20px;
    font-weight: 600;
    color: #0293d6;
    margin-bottom: 12px;
    line-height: 1.3;
}

.featured-card-text {
    font-size: 15px;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 20px;
}

.featured-card-button {
    display: inline-block;
    background-color: #0369a1;
    color: #ffffff;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.2s;
    align-self: center;
    width: fit-content;
}

.featured-card-button:hover {
    background-color: #0284c7;
    color: #ffffff;
}

/* --- Link List Section (Homepage) --- */
.link-list-container {
    background-color: #ffffff;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    border: 1px solid #f3f4f6;
    margin-bottom: 3rem;
}

.link-list-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
}

@media (min-width: 640px) {
    .link-list-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) {
    .link-list-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.link-list-column {
    background-color: #f9fafb;
    padding: 1.25rem;
    border-radius: 0.5rem;
}

.link-list-title {
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #0369a1;
    display: flex;
    align-items: center;
}

.link-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.link-list a {
    color: #374151;
    display: flex;
    align-items: center;
}

.link-list a:hover {
    color: #0369a1;
    text-decoration: underline;
}

@media (min-width: 1200px) {
    .featured-card-section {
        flex-wrap: nowrap;
    }
}

@media (max-width: 768px) {
    .home-hero-title {
        font-size: 1.75rem;
    }

    .home-hero-subtitle {
        font-size: 0.875rem;
    }

    .home-hero-content {
        padding: 1.5rem;
    }
}