/* ==========================================================
   atlasgeo.ch — Digital Globe Design
   CSS-Prefix: dg-
   Fonts: Outfit (Headings) + Cabin (Body)
   ========================================================== */

/* --- Variables --- */
:root {
    --dg-slate: #37474F;
    --dg-light: #ECEFF1;
    --dg-lime: #7CB342;
    --dg-lime-hover: #689F38;
    --dg-lime-light: #E8F5E9;
    --dg-bg: #F5F7FA;
    --dg-text: #263238;
    --dg-muted: #90A4AE;
    --dg-card: #FFFFFF;
    --dg-dark: #1B2631;
    --dg-font-heading: 'Outfit', sans-serif;
    --dg-font-body: 'Cabin', sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--dg-font-body);
    color: var(--dg-text);
    background-color: var(--dg-bg);
    font-size: 16px;
    line-height: 1.7;
}

a { color: var(--dg-lime); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--dg-lime-hover); }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--dg-font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--dg-slate);
}

h1 { font-size: 36px; margin-bottom: 16px; }
h2 { font-size: 24px; margin-bottom: 14px; }
h3 { font-size: 20px; margin-bottom: 12px; }
h4 { font-size: 17px; margin-bottom: 10px; }

p { margin-bottom: 16px; }

/* --- Header --- */
.dg-header {
    background: var(--dg-card);
    border-bottom: 1px solid var(--dg-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dg-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dg-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.dg-logo img {
    height: 52px;
    width: auto;
}

.dg-frontpage .dg-logo img {
    height: 64px;
}

.dg-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
}

.dg-nav a {
    color: var(--dg-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s;
}

.dg-nav a:hover,
.dg-nav a.dg-active { color: var(--dg-slate); }

.dg-search-bar {
    padding: 8px 14px;
    border: 1px solid var(--dg-light);
    border-radius: 20px;
    font-family: var(--dg-font-body);
    font-size: 13px;
    width: 180px;
    background: var(--dg-bg);
    outline: none;
}

.dg-search-bar:focus { border-color: var(--dg-lime); }

/* Mobile Menu Toggle */
.dg-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.dg-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--dg-slate);
    margin: 5px 0;
    transition: transform 0.3s;
}

/* --- Hero --- */
.dg-hero {
    background: linear-gradient(135deg, var(--dg-slate) 0%, var(--dg-dark) 100%);
    color: #fff;
    padding: 50px 24px;
    position: relative;
    overflow: hidden;
}

.dg-hero-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    pointer-events: none;
}

.dg-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.dg-hero h1 {
    font-size: 40px;
    color: #fff;
    margin-bottom: 14px;
}

.dg-hero h1 span { color: var(--dg-lime); }

.dg-hero p {
    font-size: 17px;
    color: var(--dg-muted);
    margin-bottom: 24px;
}

.dg-hero-btn {
    display: inline-block;
    background: var(--dg-lime);
    color: #fff;
    padding: 12px 28px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    transition: background 0.2s;
}

.dg-hero-btn:hover { background: var(--dg-lime-hover); color: #fff; }

.dg-hero-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.dg-metric-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.dg-metric-num {
    font-family: var(--dg-font-heading);
    font-size: 32px;
    font-weight: 700;
    color: var(--dg-lime);
}

.dg-metric-label {
    font-size: 12px;
    color: var(--dg-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* --- Breadcrumb --- */
.dg-breadcrumb {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    font-size: 13px;
    color: var(--dg-muted);
}

.dg-breadcrumb a { color: var(--dg-muted); }
.dg-breadcrumb a:hover { color: var(--dg-lime); }
.dg-breadcrumb span { margin: 0 6px; }

/* --- Main Content --- */
.dg-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 60px;
}

.dg-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dg-section-header h2 { margin-bottom: 0; }

.dg-section-header a {
    color: var(--dg-lime);
    font-size: 14px;
    font-weight: 600;
}

/* --- Country Card Grid --- */
.dg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.dg-card {
    background: var(--dg-card);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--dg-light);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: block;
}

.dg-card:hover {
    border-color: var(--dg-lime);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    color: inherit;
}

.dg-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.dg-card-flag { font-size: 40px; line-height: 1; }

.dg-card-tag {
    background: var(--dg-lime-light);
    color: var(--dg-lime);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.dg-card h3 { margin-bottom: 12px; }

.dg-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.dg-card-stat {
    background: var(--dg-bg);
    padding: 8px 10px;
    border-radius: 6px;
}

.dg-card-stat-label {
    font-size: 11px;
    color: var(--dg-muted);
    text-transform: uppercase;
}

.dg-card-stat-value {
    font-family: var(--dg-font-heading);
    font-size: 15px;
    font-weight: 600;
}

/* --- Country Profile Dashboard --- */
.dg-profile {
    background: var(--dg-card);
    border-radius: 12px;
    border: 1px solid var(--dg-light);
    margin-top: 32px;
    overflow: hidden;
}

.dg-profile-top {
    background: var(--dg-slate);
    color: #fff;
    padding: 28px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dg-profile-top h1,
.dg-profile-top h2 {
    font-size: 28px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 0;
}

.dg-pflag { font-size: 42px; }

.dg-profile-tabs {
    display: flex;
    gap: 0;
    background: var(--dg-bg);
    border-bottom: 1px solid var(--dg-light);
}

.dg-profile-tab {
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dg-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s;
}

.dg-profile-tab:hover { color: var(--dg-slate); }

.dg-profile-tab.dg-tab-active {
    color: var(--dg-slate);
    border-bottom-color: var(--dg-lime);
    background: var(--dg-card);
}

/* --- Tab Panels --- */
.dg-tab-panel { animation: dg-fade-in 0.25s ease; }
@keyframes dg-fade-in { from { opacity: 0; } to { opacity: 1; } }

.dg-profile-body { padding: 32px; }

/* --- Data Widgets --- */
.dg-data-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.dg-data-widget {
    background: var(--dg-bg);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.dg-data-widget-label {
    font-size: 11px;
    color: var(--dg-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.dg-data-widget-value {
    font-family: var(--dg-font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--dg-slate);
}

.dg-data-widget-sub {
    font-size: 12px;
    color: var(--dg-muted);
    margin-top: 2px;
}

/* --- Bar Chart --- */
.dg-bar-chart { margin: 24px 0; }

.dg-bar-chart h3 { margin-bottom: 14px; }

.dg-bar-row {
    display: grid;
    grid-template-columns: 140px 1fr 60px;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.dg-bar-label { font-weight: 500; }

.dg-bar-track {
    height: 24px;
    background: var(--dg-bg);
    border-radius: 4px;
    overflow: hidden;
}

.dg-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--dg-lime), #AED581);
    border-radius: 4px;
}

.dg-bar-value {
    text-align: right;
    font-weight: 600;
    color: var(--dg-muted);
    font-size: 13px;
}

/* --- Tables --- */
.dg-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.dg-table th {
    background: var(--dg-bg);
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dg-muted);
    font-weight: 600;
}

.dg-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--dg-light);
    font-size: 14px;
}

.dg-table tr:hover td { background: var(--dg-lime-light); }

/* --- Content (Artikel-Text) --- */
.dg-content { max-width: 800px; }

.dg-content p { margin-bottom: 16px; line-height: 1.8; text-align: justify; }
.dg-content h2 { margin-top: 32px; }
.dg-content h3 { margin-top: 24px; }

.dg-content ul, .dg-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

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

.dg-content blockquote {
    border-left: 3px solid var(--dg-lime);
    padding: 12px 20px;
    margin: 20px 0;
    background: var(--dg-lime-light);
    border-radius: 0 6px 6px 0;
}

/* --- Footer --- */
.dg-footer {
    background: var(--dg-dark);
    color: var(--dg-muted);
    padding: 40px 24px;
}

.dg-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.dg-footer h4 {
    font-family: var(--dg-font-heading);
    color: #fff;
    margin-bottom: 10px;
    font-size: 15px;
}

.dg-footer a { color: var(--dg-muted); }
.dg-footer a:hover { color: var(--dg-lime); }
.dg-footer ul { list-style: none; }
.dg-footer ul li { padding: 3px 0; font-size: 13px; }

.dg-footer-copy {
    max-width: 1200px;
    margin: 20px auto 0;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 12px;
    text-align: center;
}

/* --- Legal Pages --- */
.dg-legal {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

.dg-legal h1 { margin-bottom: 24px; }
.dg-legal h2 { margin-top: 32px; font-size: 20px; }
.dg-legal p { line-height: 1.8; text-align: justify; }

/* --- 404 Page --- */
.dg-error-content {
    text-align: center;
    padding: 80px 24px;
}

.dg-error-content h1 {
    font-size: 48px;
    color: var(--dg-muted);
    margin-bottom: 16px;
}

.dg-error-content p { color: var(--dg-muted); font-size: 18px; }

.dg-error-content a {
    display: inline-block;
    margin-top: 24px;
    background: var(--dg-lime);
    color: #fff;
    padding: 12px 28px;
    border-radius: 6px;
    font-weight: 600;
}

.dg-error-content a:hover { background: var(--dg-lime-hover); color: #fff; }

/* --- Responsive --- */
@media (max-width: 900px) {
    .dg-grid { grid-template-columns: 1fr; }
    .dg-hero-inner { grid-template-columns: 1fr; }
    .dg-hero h1 { font-size: 28px; }
    .dg-data-grid { grid-template-columns: 1fr 1fr; }
    .dg-footer-inner { flex-direction: column; gap: 24px; }
    .dg-bar-row { grid-template-columns: 100px 1fr 50px; }
    .dg-nav { display: none; }
    .dg-search-bar { display: none; }
    .dg-menu-toggle { display: block; }
    .dg-nav.dg-nav-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--dg-card);
        padding: 16px 24px;
        border-bottom: 1px solid var(--dg-light);
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }
    .dg-profile-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .dg-profile-tab { white-space: nowrap; }
    .dg-profile-body { padding: 20px; }
    .dg-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 600px) {
    .dg-data-grid { grid-template-columns: 1fr; }
    .dg-card-stats { grid-template-columns: 1fr; }
    .dg-hero-metrics { grid-template-columns: 1fr; }
    h1 { font-size: 28px; }
}

/* --- Twemoji flag sizing --- */
img.emoji {
    height: 1.2em;
    width: 1.2em;
    vertical-align: -0.15em;
    display: inline;
}

.dg-card-flag img.emoji { height: 40px; width: 40px; }
.dg-pflag img.emoji { height: 42px; width: 42px; }

/* --- Search Dropdown --- */
.dg-search-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--dg-card);
    border: 1px solid var(--dg-light);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    z-index: 200;
    margin-top: 6px;
}

.dg-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--dg-text);
    font-size: 14px;
    text-decoration: none;
    transition: background 0.15s;
}

.dg-search-item:hover {
    background: var(--dg-lime-light);
    color: var(--dg-text);
}

.dg-search-flag { font-size: 20px; flex-shrink: 0; }
.dg-search-flag img.emoji { height: 20px; width: 20px; }

/* --- FAQ Accordion --- */
.dg-faq { margin-top: 16px; }

.dg-faq-item {
    border: 1px solid var(--dg-light);
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--dg-card);
    overflow: hidden;
}

.dg-faq-item summary {
    padding: 14px 18px;
    font-family: var(--dg-font-heading);
    font-weight: 600;
    font-size: 16px;
    color: var(--dg-slate);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s;
}

.dg-faq-item summary:hover { background: var(--dg-bg); }

.dg-faq-item summary::after {
    content: '+';
    font-size: 20px;
    font-weight: 400;
    color: var(--dg-muted);
    flex-shrink: 0;
    margin-left: 12px;
    transition: transform 0.2s;
}

.dg-faq-item[open] summary::after {
    content: '−';
    color: var(--dg-lime);
}

.dg-faq-item summary::-webkit-details-marker { display: none; }

.dg-faq-item p {
    padding: 0 18px 14px;
    margin: 0;
    color: var(--dg-text);
    line-height: 1.7;
    font-size: 15px;
}

/* --- Sources Block --- */
.dg-sources {
    margin-top: 32px;
    padding: 20px 24px;
    background: var(--dg-bg);
    border-radius: 8px;
    border-left: 3px solid var(--dg-muted);
}

.dg-sources h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--dg-muted);
}

.dg-sources p { font-size: 13px; color: var(--dg-muted); margin-bottom: 8px; }
.dg-sources ul { padding-left: 18px; margin: 0; }
.dg-sources li { font-size: 13px; color: var(--dg-muted); margin-bottom: 4px; }
.dg-sources a { color: var(--dg-muted); text-decoration: underline; }
.dg-sources a:hover { color: var(--dg-lime); }
