/*
 * Knockwatch - main stylesheet
 *
 * Struktur:
 *   01. Grundlayout och startsida
 *   02. Blogg och Om-sida
 *   03. WAN Events-dashboard
 *   04. Responsiva regler
 *
 * OBS:
 * Reglerna är medvetet kvar i huvudsaklig originalordning för att
 * undvika att ändra CSS-cascaden och därmed sidans utseende.
 */

/* ==========================================================
   01. GRUNDLAYOUT OCH STARTSIDA
   ========================================================== */

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  color-scheme: dark;
  margin: 24px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.main-nav {
    margin-top: 18px;
}


.main-nav a {
    margin-right: 12px;
    color: #c9d1d9;
    text-decoration: none;
    position: relative;
    transition: color 0.2s ease;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0;
    height: 2px;
    background: #58a6ff;
    transition: width 0.25s ease;
}

.main-nav a:hover {
    color: #58a6ff;
}

.main-nav a:hover::after {
    width: 100%;
}


.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 24px 0;
}

.stat {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 14px 18px;
  min-width: 140px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: bold;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.7;
}

.blog-sidebar .post-link {
    margin-bottom: 1.5rem;
}

 .logo img {
    height: 60px;
    width: auto;
}

.logo {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}

.logo span {
    margin-top: -2px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #58a6ff;
}

   footer {
      padding: 16px 0;
      border-top: 1px solid rgba(127,127,127,.25);
      font-size: 0.9rem;
      opacity: 0.85;
    }


/*
KONTAKT
*/

.contact-mail {
    color: #58a6ff;
    text-decoration: none;
}

.contact-mail:hover {
    color: #79c0ff;
}

.contact-image {
    margin-top: 32px;
}

.contact-image img {
    display: block;
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: 16px;
}



/* -----------------------------------------------
   Landstatistik
   ----------------------------------------------- */

.countries {
  max-width: 900px;
  margin: 20px 0 32px 0;
}

.country-row {
  display: grid;
  grid-template-columns: 32px 190px 1fr 80px;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}

.country-flag {
  width: 28px;
  height: 21px;
  object-fit: cover;
  display: block;
  border: 1px solid #30363d;
  box-sizing: border-box;
  border-radius: 4px;
}

.country-flag-unknown {
  width: 28px;
  height: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #30363d;
  box-sizing: border-box;
  font-size: 12px;
  background: #21262d;
  color: #c9d1d9;
  border-radius: 4px;
}

.country-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-background {
  height: 18px;
  background: #21262d;
  border-radius: 4px;
  overflow: hidden;
}

.bar {
  height: 100%;
  background: #58a6ff;
  border-radius: 4px;
  min-width: 2px;
}

.country-count {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* -----------------------------------------------
   Live terminal
   ----------------------------------------------- */

.terminal {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 16px;
  max-width: 1100px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.terminal-header {
  background: #161b22;
  border-bottom: 1px solid #30363d;
  padding: 10px 14px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.terminal-title {
  color: #c9d1d9;
  font-weight: bold;
  letter-spacing: 0.04em;
}

.terminal-live {
  color: #3fb950;
  font-size: 12px;
}

.terminal-live::before {
  content: "●";
  margin-right: 6px;
}

.terminal-body {
  height: 550px;
  overflow-y: auto;
  overflow-x: auto;
}

.terminal-columns {
  display: grid;

  grid-template-columns:
    150px
    135px
    120px
    65px
    minmax(180px, 1fr)
    55px
    minmax(220px, 1.5fr);

  gap: 12px;

  min-width: 1050px;

  padding: 8px 12px;

  background: #161b22;
  border-bottom: 1px solid #30363d;

  color: #8b949e;

  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;

  position: sticky;
  top: 0;
  z-index: 2;
}

.event-row {
  display: grid;

  grid-template-columns:
    150px
    135px
    120px
    65px
    minmax(180px, 1fr)
    55px
    minmax(220px, 1.5fr);

  gap: 12px;

  min-width: 1050px;

  padding: 7px 12px;

  border-bottom: 1px solid #21262d;

  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.35;

  color: #c9d1d9;
}

.event-row:hover {
  background: #161b22;
}

.event-time {
  color: #8b949e;
  white-space: nowrap;
}

.event-ip {
  color: #58a6ff;
  white-space: nowrap;
}

.event-country {
  color: #c9d1d9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-method {
  font-weight: bold;
  white-space: nowrap;
}

.method-get {
  color: #3fb950;
}

.method-post {
  color: #d29922;
}

.method-other {
  color: #a371f7;
}

.event-path {
  color: #f0f6fc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-status {
  font-weight: bold;
  white-space: nowrap;
}

.status-2xx {
  color: #3fb950;
}

.status-3xx {
  color: #d29922;
}

.status-4xx {
  color: #f85149;
}

.status-5xx {
  color: #ff7b72;
}

.status-other {
  color: #c9d1d9;
}

.event-ua {
  color: #8b949e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.terminal-error {
  color: #f85149;
  padding: 16px;
  font-family: Consolas, "Courier New", monospace;
}

/* -----------------------------------------------
   Övrigt
   ----------------------------------------------- */

.muted {
  opacity: 0.75;
}

/* -----------------------------------------------
   Projektintro
   ----------------------------------------------- */

.project-intro {
  max-width: 900px;
  margin: 14px 0 30px 0;
  padding: 18px 20px;
  border-left: 4px solid #58a6ff;
  background: #161b22;
  border-radius: 0 8px 8px 0;
}

.project-intro .lead {
  margin-top: 0;
  font-size: 1.08rem;
  line-height: 1.6;
}

.project-intro p {
  line-height: 1.6;
}

.project-intro .tagline {
  margin-bottom: 0;
  font-weight: 700;
}

.project-tech {
  max-width: 900px;
  margin: 30px 0 34px 0;
  padding-top: 4px;
}

.project-tech p {
  line-height: 1.6;
}

code {
  background: rgba(127, 127, 127, .12);
  padding: 2px 6px;
  border-radius: 6px;
}

/* -----------------------------------------------
   Intro med Mordor-öga
   ----------------------------------------------- */

.intro-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 36px;
  align-items: center;
  margin-bottom: 28px;
}

.intro-layout .project-intro {
  margin-bottom: 0;
}

.intro-image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.intro-image img {
  display: block;
  width: 420px;
  max-width: none;
  height: auto;
  object-fit: contain;
}

/* -----------------------------------------------
   Dashboard-layout
   ----------------------------------------------- */

.dashboard {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.7fr);
  grid-template-areas:
    "summary live"
    "countries live";
  gap: 0 28px;
  align-items: start;
  max-width: 1400px;
}

.dashboard-summary {
  grid-area: summary;
}

.dashboard-countries {
  grid-area: countries;
}

.dashboard-live {
  grid-area: live;
  min-width: 0;
}

.dashboard .stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 28px 0;
}

.dashboard .stat {
  min-width: 0;
}

.dashboard .countries {
  max-width: none;
}

.dashboard .country-row {
  grid-template-columns: 32px minmax(95px, 145px) 1fr 62px;
  gap: 8px;
}

.dashboard .terminal {
  max-width: none;
}

.dashboard .terminal-columns,
.dashboard .event-row {
  grid-template-columns:
    145px
    125px
    105px
    60px
    minmax(180px, 1fr)
    50px
    minmax(200px, 1.2fr);
  min-width: 980px;
  gap: 10px;
}

/* -----------------------------------------------
   Mindre skärmar
   ----------------------------------------------- */

@media (max-width: 900px) {

  .intro-layout {
    display: block;
    margin-bottom: 0;
  }

  .intro-image {
    display: none;
  }

  body {
    margin: 14px;
  }

  .dashboard {
    display: flex;
    flex-direction: column;
  }

  .dashboard-summary {
    order: 1;
    width: 100%;
  }

  .dashboard-live {
    order: 2;
    width: 100%;
  }

  .dashboard-countries {
    order: 3;
    width: 100%;
  }

  .dashboard .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard .country-row {
    grid-template-columns: 32px 120px 1fr 65px;
  }

  .terminal-body {
    height: 450px;
  }

  .dashboard .terminal-columns,
  .dashboard .event-row {
    grid-template-columns:
      150px
      135px
      120px
      65px
      minmax(180px, 1fr)
      55px
      minmax(220px, 1.5fr);
    min-width: 1050px;
    gap: 12px;
  }

  .dashboard .terminal-columns > div:last-child,
  .dashboard .event-row .event-ua {
    display: block;
  }

}

@media (max-width: 520px) {

  .dashboard .stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat {
    padding: 12px 14px;
  }

  .stat-value {
    font-size: 1.55rem;
  }

  .project-intro {
    padding: 16px;
  }

}

/* ==========================================================
   02. BLOGG OCH OM-SIDA
   ========================================================== */

/* --- Blogglayout --- */

.blog-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
}

.blog-sidebar {
    border-right: 1px solid #333;
    padding-right: 20px;

    height: 100vh;
    overflow-y: auto;

    position: sticky;
    top: 0;
}

.blog-content {
    max-width: 760px;
    padding: 40px;
}

.blog-content h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

.blog-content h2 {
    font-size: 1.4rem;
    margin-top: 2em;
    margin-bottom: 0.6em;
}

.blog-content p {
    font-size: 1.08rem;
    line-height: 1.75;
    margin-bottom: 1.2em;
}

.blog-content ul {
    margin-bottom: 1.4em;
    padding-left: 1.4em;
}

.blog-content li {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 0.5em;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    margin: 24px 0;
    border-radius: 12px;
}

.blog-content .mail-block {
    margin: 30px 0;
}

.blog-content .mail-block p {
    font-size: 0.92rem;
    line-height: 1.45;
    color: #0F3163;
    font-style: italic;
    margin-bottom: 0.7em;
}

.blog-sidebar .post-title {
    color: #c9d1d9;
    text-decoration: none;
    position: relative;
    display: inline-block;
    transition: color 0.2s ease;
}

.blog-sidebar .post-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0;
    height: 2px;
    background: #58a6ff;
    transition: width 0.25s ease;
}

.blog-sidebar .post-title:hover {
    color: #58a6ff;
}

.blog-sidebar .post-title:hover::after {
    width: 100%;
}


@media (max-width: 800px) {
    .blog-layout {
        display: block;
    }

    .blog-sidebar {
        position: static;
        height: auto;
        overflow: visible;
        border-right: none;
        border-bottom: 1px solid #333;
        padding: 20px;
        margin-bottom: 20px;
    }

    .blog-content {
        max-width: none;
        padding: 20px;
        min-width: 0;
    }
}

.about {
        max-width: 900px;
        margin: 0 auto;
        padding: 40px 24px;
    }

    .about-avatar {
        text-align: center;
        margin-bottom: 28px;
    }

    .about-avatar img {
        width: 200px;
        max-width: 80%;
        border-radius: 18px;

         opacity: 1;

        transition: opacity 1.5s ease-in-out;
    }

    /* --------------------------------------------------
   Portstatistik
-------------------------------------------------- */

.wan-port-stats {
    margin-top: 2rem;
}

.wan-port-stats h2 {
    margin-bottom: 0.5rem;
}

.section-description {
    margin-bottom: 1.5rem;
}

/* --------------------------------------------------
   Porttabell
-------------------------------------------------- */

.port-table {
    width: 100%;
}

.port-row {
    display: grid;
    grid-template-columns: 100px 1fr 140px 140px;
    gap: 1rem;

    align-items: center;

    padding: 0.75rem 1rem;

    border-bottom: 1px solid rgba(128, 128, 128, 0.25);
}

.port-header {
    font-weight: 600;
    border-bottom: 2px solid rgba(128, 128, 128, 0.4);
}

.port-loading {
    padding: 1rem;
    opacity: 0.7;
}

/* ==========================================================
   03. WAN EVENTS-DASHBOARD
   ========================================================== */

.wan-events {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* --------------------------------------------------
   Dashboard header
-------------------------------------------------- */

.wan-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 2rem;
}

.wan-dashboard-header h1 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.wan-dashboard-header p {
    margin: 0;
}

/* --------------------------------------------------
   Live indicator
-------------------------------------------------- */

/* --------------------------------------------------
   Live / latest WAN observation
   -------------------------------------------------- */

.wan-live-strip {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(128, 128, 128, 0.25);
    border-radius: 8px;
    background: rgba(22, 27, 34, 0.7);
}

.wan-live-strip .wan-live-status {
    padding: 0;
    border: 0;
    border-radius: 0;
}

.wan-live-dot.activity {
    animation: wan-live-pulse 0.8s ease-out;
}

@keyframes wan-live-pulse {
    0% { transform: scale(1); box-shadow: 0 0 4px rgba(63,185,80,.4); }
    35% { transform: scale(1.8); box-shadow: 0 0 14px rgba(63,185,80,1); }
    100% { transform: scale(1); box-shadow: 0 0 5px rgba(63,185,80,.45); }
}

.wan-latest-event {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.78rem;
    white-space: nowrap;
}

.wan-latest-label {
    color: #8b949e;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.wan-latest-time { color: #8b949e; font-variant-numeric: tabular-nums; }
.wan-latest-country {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
}

.wan-latest-flag {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    flex: 0 0 auto;
}
.wan-latest-ip { color: #58a6ff; font-weight: 600; }
.wan-latest-arrow { color: #8b949e; }
.wan-latest-port { color: #f0f6fc; font-weight: 700; }
.wan-latest-service { color: #8b949e; font-size: 0.72rem; }

.wan-latest-event.activity {
    animation: wan-event-flash 1s ease-out;
}

@keyframes wan-event-flash {
    0% { text-shadow: 0 0 8px rgba(63,185,80,.8); }
    100% { text-shadow: none; }
}

.wan-live-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;

    padding: 0.45rem 0.8rem;

    border: 1px solid rgba(128, 128, 128, 0.35);
    border-radius: 999px;

    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.wan-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;

    background: currentColor;
}

/* --------------------------------------------------
   Dashboard grid
-------------------------------------------------- */

.wan-dashboard {
    display: grid;

    grid-template-columns:
        minmax(0, 1.7fr)
        minmax(280px, 1fr);

    gap: 1.25rem;
}

/* --------------------------------------------------
   Panels
-------------------------------------------------- */

.wan-panel {
    min-width: 0;

    padding: 1.4rem;

    border: 1px solid rgba(128, 128, 128, 0.25);
    border-radius: 10px;
}

.wan-panel-wide {
    grid-column: 1 / -1;
}

.wan-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    margin-bottom: 1.25rem;
}

.wan-panel-header h2 {
    margin: 0 0 0.3rem 0;
    font-size: 1.05rem;
}

.wan-panel-header p {
    margin: 0;

    font-size: 0.8rem;
    opacity: 0.65;
}

/* --------------------------------------------------
   Port statistics
-------------------------------------------------- */

.wan-port-header,
.port-row {
    display: grid;

    grid-template-columns:
        65px
        100px
        minmax(120px, 1fr)
        90px;

    gap: 0.8rem;

    align-items: center;
}

.wan-port-header {
    padding: 0 0.6rem 0.6rem 0.6rem;

    border-bottom: 1px solid rgba(128, 128, 128, 0.25);

    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;

    opacity: 0.65;
}

.port-row {
    padding: 0.7rem 0.6rem;

    border-bottom: 1px solid rgba(128, 128, 128, 0.12);
}

.port-row:last-child {
    border-bottom: 0;
}

.port-loading {
    padding: 1rem 0.6rem;
    opacity: 0.6;
}

/* --------------------------------------------------
   WAN overview
-------------------------------------------------- */

.wan-overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.wan-metric {
    padding: 1rem;

    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 8px;
}

.wan-metric-label {
    display: block;

    margin-bottom: 0.4rem;

    font-size: 0.75rem;
    opacity: 0.65;
}

.wan-metric strong {
    display: block;
    font-size: 1.35rem;
}

/* --------------------------------------------------
   Placeholder panels
-------------------------------------------------- */

.wan-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 130px;

    border: 1px dashed rgba(128, 128, 128, 0.3);
    border-radius: 8px;

    font-size: 0.8rem;
    opacity: 0.5;
}

/* --------------------------------------------------
   WAN port bars
-------------------------------------------------- */

.port-number {
    font-weight: 700;
}

.port-service {
    font-size: 0.85rem;
}

.port-hits {
    display: grid;
    grid-template-columns: minmax(60px, 1fr) 65px;
    gap: 0.7rem;
    align-items: center;
}

.port-bar-background {
    width: 100%;
    height: 8px;

    overflow: hidden;

    border-radius: 999px;

    background: rgba(128, 128, 128, 0.15);
}

.port-bar {
    height: 100%;

    border-radius: inherit;

    background: currentColor;

    opacity: 0.65;

    transition: width 0.4s ease;
}

.port-hits-number,
.port-unique-ips {
    text-align: right;

    font-variant-numeric: tabular-nums;
}

.port-hits-number {
    font-size: 0.8rem;
}

.port-unique-ips {
    font-size: 0.8rem;
}

/* --------------------------------------------------
   Tablet / mobile
-------------------------------------------------- */

@media (max-width: 850px) {

    .wan-dashboard {
        grid-template-columns: 1fr;
    }

    .wan-panel-wide {
        grid-column: auto;
    }

}

@media (max-width: 600px) {

    .wan-events {
        padding: 1rem;
    }

    .wan-dashboard-header {
        flex-direction: column;
        gap: 1rem;
    }

    .wan-port-header,
    .port-row {
        grid-template-columns:
            50px
            75px
            minmax(70px, 1fr)
            75px;

        gap: 0.4rem;

        font-size: 0.8rem;
    }

    .wan-overview-grid {
        grid-template-columns: 1fr 1fr;
    }

}

/* ==================================================
   WAN COUNTRY STATISTICS
================================================== */

.wan-country-header,
.wan-country-row {
    display: grid;
    grid-template-columns:
        minmax(150px, 1.3fr)
        minmax(140px, 1fr)
        85px;
    gap: 0.8rem;
    align-items: center;
}

.wan-country-header {
    padding: 0 0.6rem 0.6rem 0.6rem;
    border-bottom: 1px solid rgba(128, 128, 128, 0.25);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.65;
}

.wan-country-row {
    padding: 0.7rem 0.6rem;
    border-bottom: 1px solid rgba(128, 128, 128, 0.12);
}

.wan-country-row:last-child {
    border-bottom: 0;
}

/* Flagga + land */

.wan-country-name {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.wan-country-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wan-country-flag {
    width: 24px;
    height: 16px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 2px;
}

.wan-country-flag-unknown {
    width: 24px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(128, 128, 128, 0.35);
    border-radius: 2px;
    font-size: 0.65rem;
    font-weight: 700;
}

/* Hits + stapel */

.wan-country-hits {
    display: grid;
    grid-template-columns:
        minmax(50px, 1fr)
        60px;
    gap: 0.6rem;
    align-items: center;
}

.wan-country-bar-background {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(128, 128, 128, 0.15);
}

.wan-country-bar {
    height: 100%;
    border-radius: inherit;
    background: currentColor;
    opacity: 0.65;
    transition: width 0.4s ease;
}

.wan-country-hits-number,
.wan-country-unique-ips {
    text-align: right;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

/* Mobil */

@media (max-width: 600px) {

    .wan-country-header,
    .wan-country-row {
        grid-template-columns:
            minmax(105px, 1.2fr)
            minmax(100px, 1fr)
            65px;
        gap: 0.4rem;
        font-size: 0.8rem;
    }

    .wan-country-flag {
        width: 20px;
        height: 14px;
    }

    .wan-country-flag-unknown {
        width: 20px;
        height: 14px;
    }

    .wan-country-hits {
        grid-template-columns:
            minmax(35px, 1fr)
            48px;
        gap: 0.4rem;
    }
}

/* --------------------------------------------------
   Mobil
-------------------------------------------------- */

@media (max-width: 700px) {

    .wan-events {
        padding: 1rem;
    }

    .port-row {
        grid-template-columns: 60px 1fr 80px 90px;
        gap: 0.5rem;

        padding-left: 0;
        padding-right: 0;

        font-size: 0.9rem;
    }

}

/* ==================================================
   WAN SERVICE DISTRIBUTION
================================================== */

.wan-service-header,
.wan-service-row {
    display: grid;
    grid-template-columns:
        95px
        minmax(140px, 1fr)
        70px;
    gap: 0.8rem;
    align-items: center;
}

.wan-service-header {
    padding: 0 0.6rem 0.6rem 0.6rem;
    border-bottom: 1px solid rgba(128, 128, 128, 0.25);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.65;
}

.wan-service-row {
    padding: 0.7rem 0.6rem;
    border-bottom: 1px solid rgba(128, 128, 128, 0.12);
}

.wan-service-row:last-child {
    border-bottom: 0;
}

.wan-service-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.wan-service-hits {
    display: grid;
    grid-template-columns:
        minmax(50px, 1fr)
        60px;
    gap: 0.6rem;
    align-items: center;
}

.wan-service-bar-background {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(128, 128, 128, 0.15);
}

.wan-service-bar {
    height: 100%;
    border-radius: inherit;
    background: currentColor;
    opacity: 0.65;
    transition: width 0.4s ease;
}

.wan-service-hits-number,
.wan-service-ports {
    text-align: right;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {

    .wan-service-header,
    .wan-service-row {
        grid-template-columns:
            75px
            minmax(100px, 1fr)
            55px;
        gap: 0.4rem;
        font-size: 0.8rem;
    }

    .wan-service-hits {
        grid-template-columns:
            minmax(35px, 1fr)
            48px;
        gap: 0.4rem;
    }
}

/* ==================================================
   WAN TOP SCANNERS
================================================== */

.wan-scanner-header,
.wan-scanner-row {
    display: grid;
    grid-template-columns:
        minmax(140px, 1.2fr)
        minmax(150px, 1.2fr)
        minmax(180px, 2fr)
        90px;
    gap: 1rem;
    align-items: center;
}

.wan-scanner-header {
    padding: 0 0.6rem 0.6rem 0.6rem;
    border-bottom: 1px solid rgba(128, 128, 128, 0.25);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.65;
}

.wan-scanner-row {
    padding: 0.7rem 0.6rem;
    border-bottom: 1px solid rgba(128, 128, 128, 0.12);
}

.wan-scanner-row:last-child {
    border-bottom: 0;
}

.wan-scanner-ip {
    color: #58a6ff;
    text-decoration: none;
}

.wan-scanner-ip:visited {
    color: #58a6ff;
}

.wan-scanner-ip:hover {
    color: #79c0ff;
    text-decoration: underline;
}

.wan-scanner-ip:focus-visible {
    outline: 1px solid #58a6ff;
    outline-offset: 3px;
}

.wan-scanner-country {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.wan-scanner-country span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wan-scanner-flag {
    width: 24px;
    height: 16px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 2px;
}

.wan-scanner-flag-unknown {
    width: 24px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(128, 128, 128, 0.35);
    border-radius: 2px;
    font-size: 0.65rem;
    font-weight: 700;
}

.wan-scanner-events {
    display: grid;
    grid-template-columns:
        minmax(70px, 1fr)
        70px;
    gap: 0.8rem;
    align-items: center;
}

.wan-scanner-bar-background {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(128, 128, 128, 0.15);
}

.wan-scanner-bar {
    height: 100%;
    border-radius: inherit;
    background: currentColor;
    opacity: 0.65;
    transition: width 0.4s ease;
}

.wan-scanner-events-number,
.wan-scanner-ports {
    text-align: right;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

/* Mobil */

@media (max-width: 600px) {

    .wan-scanner-header,
    .wan-scanner-row {
        grid-template-columns:
            minmax(110px, 1fr)
            minmax(90px, 1fr)
            65px;
        gap: 0.5rem;
        font-size: 0.8rem;
    }

    .wan-scanner-header > div:nth-child(3) {
        display: none;
    }

    .wan-scanner-events {
        display: none;
    }

    .wan-scanner-flag {
        width: 20px;
        height: 14px;
    }

    .wan-scanner-flag-unknown {
        width: 20px;
        height: 14px;
    }
}

/* ==================================================
   WAN RECENT EVENTS
================================================== */

.wan-recent-header,
.wan-recent-row {
    display: grid;
    grid-template-columns:
        150px
        145px
        minmax(150px, 1fr)
        80px
        100px;
    gap: 1rem;
    align-items: center;
}

.wan-recent-header {
    padding: 0 0.6rem 0.6rem 0.6rem;
    border-bottom: 1px solid rgba(128, 128, 128, 0.25);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.65;
}

.wan-recent-row {
    padding: 0.7rem 0.6rem;
    border-bottom: 1px solid rgba(128, 128, 128, 0.12);
}

.wan-recent-row:last-child {
    border-bottom: 0;
}

.wan-recent-time {
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    opacity: 0.75;
}

.wan-recent-ip {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.wan-recent-country {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.wan-recent-country span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wan-recent-flag {
    width: 24px;
    height: 16px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 2px;
}

.wan-recent-flag-unknown {
    width: 24px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(128, 128, 128, 0.35);
    border-radius: 2px;
    font-size: 0.65rem;
    font-weight: 700;
}

.wan-recent-port {

    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.wan-recent-service {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Mobil */

@media (max-width: 600px) {

    .wan-recent-header,
    .wan-recent-row {
        grid-template-columns:
            70px
            minmax(105px, 1fr)
            60px
            65px;
        gap: 0.45rem;
        font-size: 0.8rem;
    }

    .wan-recent-header > div:nth-child(3) {
        display: none;
    }

    .wan-recent-country {
        display: none;
    }

    .wan-recent-time {
        font-size: 0.75rem;
    }

    .wan-recent-time-date {
        display: none;
    }
}

.blog-image {
    margin: 2rem auto;
    max-width: 850px;
}

.blog-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

/* ----------------------------------------------------------
   Responsiv justering: introbild / Mordor-öga
   ---------------------------------------------------------- */

@media (max-width: 600px) {
  .intro-image img {
    width: 100%;
    max-width: 380px;
  }
}


/* ----------------------------------------------------------
   Responsiv justering: WAN live-rad
   ---------------------------------------------------------- */
@media (max-width: 600px) {
    .wan-live-strip {
        width: 100%;
        box-sizing: border-box;
    }

    .wan-latest-label,
    .wan-latest-country,
    .wan-latest-service {
        display: none;
    }

    .wan-latest-event {
        gap: 0.4rem;
        font-size: 0.72rem;
    }
}
