/**
 * Single Pages Redesign 2025
 * Professional, clean, academic style
 */

:root {
    --color-primary: #002147;
    /* Oxford Blue */
    --color-primary-light: #003366;
    --color-secondary: #008080;
    /* Teal */
    --color-secondary-dark: #006666;
    --color-text-main: #333333;
    --color-text-muted: #666666;
    --color-bg-light: #f8f9fa;
    --color-border: #e0e0e0;
    --color-white: #ffffff;

    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.05);
    --shadow: var(--shadow-md);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Grays */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Font Weights */
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Transitions */
    --transition-fast: all 0.2s ease;

    /* Aliases for Calculator Compatibility */
    --primary: var(--color-primary);
    --primary-light: var(--color-primary-light);
    --white: var(--color-white);
}

/* Layout */
.single-page-container {
    max-width: 1600px;
    /* Increased width for full-page feel */
    width: 95%;
    /* Ensure it takes up most of the screen on smaller large screens */
    margin: 0 auto;
    padding: 30px 20px;
    font-family: var(--font-body);
    color: var(--color-text-main);
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    /* Slightly wider sidebar */
    gap: 50px;
    /* Increased gap */
}

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

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.breadcrumbs a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: var(--color-secondary);
}

.breadcrumbs span {
    margin: 0 8px;
    color: #ccc;
}

/* Header Section */
.page-header {
    margin-bottom: 40px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 30px;
}

.page-meta-top {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--color-bg-light);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    border: 1px solid var(--color-border);
}

.meta-badge i {
    color: var(--color-secondary);
}

.page-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0 0 24px 0;
    line-height: 1.2;
}

.page-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background: var(--color-primary-light);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--color-secondary);
    color: var(--color-white);
}

.btn-secondary:hover {
    background: var(--color-secondary-dark);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-main);
}

.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-bg-light);
}

/* Cards */
.content-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    /* Increased padding */
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    overflow-wrap: break-word;
    /* Ensure long words don't overflow */
    word-wrap: break-word;
    max-width: 100%;
    /* Ensure card itself respects container */
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
}

.card-title i {
    color: var(--color-secondary);
}

/* Key Facts Grid */
.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.fact-item {
    display: flex;
    gap: 12px;
}

.fact-icon {
    width: 40px;
    height: 40px;
    background: var(--color-bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-secondary);
    flex-shrink: 0;
}

.fact-content {
    display: flex;
    flex-direction: column;
}

.fact-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

.fact-value {
    font-weight: 600;
    color: var(--color-primary);
}

/* Tabs */
.tabs-nav {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 30px;
    overflow-x: auto;
}

.tab-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--color-primary);
}

.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-secondary);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Sidebar */
.sidebar-widget {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quick-info-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-bg-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

.quick-info-list li:last-child {
    border-bottom: none;
}

.quick-info-list i {
    color: var(--color-secondary);
    width: 16px;
    flex-shrink: 0;
    margin-top: 4px;
}

.quick-info-list strong {
    white-space: nowrap;
    flex-shrink: 0;
    color: var(--color-primary);
    margin-right: 4px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.1);
}

/* Typography Content */
.entry-content {
    line-height: 1.7;
    color: var(--color-text-main);
}

.entry-content h2 {
    color: var(--color-primary);
    margin-top: 30px;
    margin-bottom: 15px;
}

.entry-content p {
    margin-bottom: 15px;
    max-width: 100%;
    /* Ensure paragraphs don't overflow */
}

/* Prevent overflow for all direct children */
.entry-content>* {
    max-width: 100%;
}

/* Specific fix for ads and iframes */
.entry-content iframe,
.entry-content video,
.entry-content embed,
.entry-content .google-auto-placed,
.entry-content ins.adsbygoogle {
    max-width: 100% !important;
    box-sizing: border-box;
}

/* =========================================
   Responsive Tables (Card View)
   ========================================= */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 1rem;
}

.entry-content th,
.entry-content td {
    padding: 12px;
    border: 1px solid var(--color-border);
    text-align: left;
}

.entry-content th {
    background-color: var(--color-bg-light);
    font-weight: 600;
    color: var(--color-primary);
}

@media (max-width: 768px) {

    /* Force table to not be like tables anymore */
    .entry-content table,
    .entry-content thead,
    .entry-content tbody,
    .entry-content th,
    .entry-content td,
    .entry-content tr {
        display: block;
    }

    /* Hide table headers (but not display: none;, for accessibility) */
    .entry-content thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .entry-content tr {
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        margin-bottom: 20px;
        background: #fff;
        box-shadow: var(--shadow-sm);
        padding: 5px;
        border-bottom: 0;
    }

    .entry-content td:before {
        /* Now like a table header */
        content: attr(data-label);
        font-weight: 700;
        color: var(--color-primary);
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 4px;
        display: block;
    }
}

/* Ensure ad containers don't break layout */
div[id^="google_ads_iframe"],
div[id^="div-gpt-ad"] {
    max-width: 100% !important;
    overflow: hidden;
}



.entry-content ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.entry-content li {
    margin-bottom: 8px;
}

/* Featured Image */
.featured-image-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
    margin-bottom: 30px;
    max-height: 450px;
    /* Limit height on desktop */
    width: 100%;
}

.featured-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .single-page-container {
        padding: 20px 10px;
        /* Reduce container padding */
        width: 100%;
        /* Use full width on mobile */
    }

    .content-card {
        padding: 20px;
        /* Reduce card padding from 40px to 20px */
    }

    .page-title {
        font-size: 1.75rem;
        /* Smaller title on mobile */
    }

    .content-grid {
        gap: 30px;
        /* Reduce gap between elements */
    }

    .featured-image-container {
        max-height: 250px;
        /* Smaller height on mobile */
    }
}