/* === Base Styles === */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px; /* 1rem = 16px */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.4;
    margin: 0;
    padding: 0;
    color: #e0e6ed;
    background-color: #1e1f26;
}

.bold-text {
    font-weight: 900;
    text-shadow: 0 0 2px #eceff4;
}

.container {
    width: 100%;
    max-width: 80rem;
    margin: 0 auto;
    padding: 1.25rem;
    background-color: #2b2d36;
}

.site-header {
    text-align: center;
    padding: 1.875rem 0;  /* 30px */
    background: #3b4f6b;
    color: #eceff4;
}

.header-inner {
    max-width: 75rem;
    margin: 0 auto;
    padding: 0 0.625rem; /* 10px */
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem; /* 20px */
    margin-bottom: 1.25rem;
}

.logo {
    height: 4.375rem; /* 70px */
}

.header-title {
    margin: 0;
    font-size: 2.4rem;
}

.header-text {
    margin: 0;
    color: #d8dee9;
}

h1, h2, h3 {
    color: #eceff4;
}

h1 {
    font-size: 2rem;
    margin: 0;
}

.block {
    background: #3b4252;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.375rem rgba(0,0,0,0.4);
}

.tables-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    text-align: stretch;
}

.peering-table {
    flex: 1 1 28rem;
    min-width: 16.25rem;
    max-width: 100%;
    background: #434c5e;
    padding: 0.9375rem;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.375rem rgba(0,0,0,0.3);
    margin: auto;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    color: #eceff4;
    table-layout: auto;
}

th, td {
    padding: 0.625rem;
    text-align: left;
    border-bottom: 1px solid #4c566a;
    word-break: break-word;
}

th {
    background-color: #4c566a;
    color: #eceff4;
    white-space: nowrap;
}

td {
    word-break: break-word;
}

tr:nth-child(odd) {
    background-color: #3b4252;
}

tr:nth-child(even) {
    background-color: #2e3440;
}


/* First column same color as row */
.peering-table tr:nth-child(odd) td:first-child,
.peering-table tr:nth-child(odd) th:first-child {
    background-color: #3b4252;
}

.peering-table tr:nth-child(even) td:first-child,
.peering-table tr:nth-child(even) th:first-child {
    background-color: #2e3440;
}

/* White borders for the table */
.peering-table {
    border-collapse: separate;
    border-spacing: 0;
}

/* Vertical border between first column and rest */
.peering-table td:first-child,
.peering-table th:first-child {
    border-right: 2px solid #ffffff; /* vertical divider */
}

/* Horizontal border under every row */
.peering-table td,
.peering-table th {
    border-bottom: 1px solid #ffffff;
}

.peering-table tr:last-child td,
.peering-table tr:last-child th {
    border-bottom: none; /* remove bottom border for last row */
}


a {
    color: #88c0d0;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

nav {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.button {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #eceff4;
    background-color: #4c566a;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

nav a:hover {
    background-color: #5e81ac;
    transform: translateY(-0.0625rem);
}

.peering-link {
    display: inline-block;
    margin: 0.625rem 0;
}

.site-footer {
    position: fixed;
    bottom: 0.625rem;
    right: 1.25rem;
    font-size: 0.9rem;
    background-color: rgba(59, 66, 82, 0.8);
    padding: 0.3125rem 0.75rem;
    border-radius: 0.25rem;
    z-index: 1000;
}

.site-footer a {
    color: #88c0d0;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

#peering-map {
    background: #434c5e;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.375rem rgba(0,0,0,0.4);
}

#map {
    height: 25rem;
    width: 100%;
    border-radius: 0.375rem;
}

/* === Responsive Layout Adjustments === */
@media (max-width: 48rem) {
    .header-top {
        flex-direction: column;
        text-align: center;
    }

    .logo {
        height: 3.125rem;
    }

    .header-title {
        font-size: 1.6rem;
    }

    .container {
        padding: 0.9375rem;
    }

    .block {
        padding: 0.9375rem;
    }

    .peering-table {
        flex: 1 1 100%;
        min-width: auto;
    }

    table, th, td {
        font-size: 0.9rem;
    }
}

@media (max-width: 30rem) {
    body {
        font-size: 0.8rem;
    }

    .header-title {
        font-size: 1.4rem;
    }

    .button {
        font-size: 0.85rem;
        padding: 0.3125rem 0.625rem;
    }

    .peering-table th, .peering-table td {
        padding: 0.375rem;
        overflow-wrap: anywhere;
        word-break: break-all;
    }

    #map {
        height: 15.625rem;
    }
}
