/* ===========================
   RB-Fans.de Mobile Styles
   =========================== */

/* CI Colors */
:root {
  --ci-bg: #0c1a2b;        /* Navy */
  --ci-accent: #d21018;    /* RB-Fans red */
  --ci-accent-dark: #b00e14;
  --ci-body-bg: #f4f4f4;   /* Light grey */
  --ci-text: #ffffff;      /* White */
  --ci-dark-text: #222;
}

/* ===========================
   Global
   =========================== */
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--ci-bg);
  color: var(--ci-text);
  line-height: 1.5;
}

a {
  color: var(--ci-accent);
  text-decoration: none;
}
a:hover {
  color: var(--ci-accent-dark);
}
a:focus {
  outline: 2px solid var(--ci-accent);
  outline-offset: 2px;
}

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

/* ===========================
   Header
   =========================== */
.mobile-header {
  background-image: url('https://www.rb-fans.de/img/new_header_small.jpg'); 
  background-size: contain; /* Prevent stretching */
  background-position: top center;
  background-repeat: no-repeat;
  background-color: var(--ci-bg); /* Fallback */
  height: 80px; /* Adjust based on image aspect ratio */
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: flex-end; /* Push hamburger to right */
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.header-link {
  position: absolute;
  left: 0;
  top: 0;
  width: 33%; 
  height: 100%;
  z-index: 1; /* Below hamburger */
}
.header-link:focus {
  outline: 2px solid var(--ci-accent);
  outline-offset: -2px;
}
.hamburger {
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--ci-text);
  background: rgba(0, 0, 0, 0.5); /* Semi-transparent for visibility */
  border: none;
  padding: 0.5rem;
  border-radius: 4px;
  z-index: 2; /* Above header-link */
  margin-right: 1rem;
}
.hamburger:focus {
  outline: 2px solid var(--ci-accent);
}

/* Collapsible nav */
.tnav {
  display: none; /* Fully hide when collapsed */
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 1rem;
  background: var(--ci-body-bg);
  padding: 0.5rem;
  transition: max-height 0.3s ease;
}
.tnav.show {
  display: flex; /* Show with flex layout */
  max-height: 600px; /* Accommodate social links */
}
.tnav a.nheader {
  background: var(--ci-accent);
  color: #fff;
  text-align: center;
  padding: 0.75rem;
  border-radius: 6px;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.tnav a.nheader:hover, .tnav a.nheader:focus {
  background: var(--ci-accent-dark);
}

/* Social nav (inside .tnav) */
.tnav .social-nav {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}
.tnav .social-nav a {
  background: none;
  color: var(--ci-accent);
  font-size: 1.4rem;
  padding: 0.5rem;
  box-shadow: none;
  border-radius: 50%;
}
.tnav .social-nav a:hover, .tnav .social-nav a:focus {
  color: var(--ci-accent-dark);
  background: rgba(0, 0, 0, 0.1);
}

/* ===========================
   Article & Content
   =========================== */
.header-box,
.article-box {
  background: var(--ci-body-bg);
  color: var(--ci-dark-text);
  padding: 1rem;
  margin: 1rem;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.header-box {
  text-align: center;
}
.header-box img {
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

h1 {
  font-size: 1.5em;
  color: var(--ci-accent);
  margin: 0.5rem 0;
}
h2 {
  font-size: 1.1em;
  color: #555;
  margin: 0;
}

.intro {
  font-size: 1em;
  font-weight: bold;
  margin: 1rem 0;
  color: #333;
}

/* Article metadata */
.article-meta {
  font-size: 0.9rem;
  color: #666;
  margin: 0.5rem 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.article-meta i {
  color: var(--ci-accent);
  margin-right: 0.25rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
th, td {
  border: 1px solid #bbb;
  padding: 0.5em;
  text-align: left;
}
th {
  background: #eee;
}

/* ===========================
   Social Sharing
   =========================== */
.share-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
}
.share-buttons a, .share-buttons button {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.2rem;
  color: #fff;
  transition: background 0.3s, opacity 0.3s;
}
.share-buttons a.twitter { background: #000; }
.share-buttons a.facebook { background: #1877F2; }
.share-buttons a.instagram { background: #E4405F; }
.share-buttons a.tiktok { background: #000; }
.share-buttons button.copy-link { background: #ccc; color: #000; border: none; cursor: pointer; }
.share-buttons a:hover, .share-buttons button:hover { opacity: 0.8; }
.share-buttons a:focus, .share-buttons button:focus { outline: 2px solid var(--ci-accent); }

/* ===========================
   Navigation links
   =========================== */
.nav-links {
  text-align: center;
  margin: 1rem;
}
.nav-links a {
  display: inline-block;
  margin: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--ci-accent);
  color: white;
  border-radius: 4px;
  font-weight: bold;
  text-decoration: none;
}
.nav-links a:hover, .nav-links a:focus {
  background: var(--ci-accent-dark);
}

/* ===========================
   Footer
   =========================== */
.footer {
  background: var(--ci-bg);
  padding: 1rem;
  text-align: center;
}
.footer-content {
  display: flex;
  justify-content: center;
}
.footer-content a {
  color: var(--ci-text);
  font-size: 0.9rem;
}
.footer-content a:hover, .footer-content a:focus {
  color: var(--ci-accent);
}

/* ===========================
   Back to Top
   =========================== */
#backToTop {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--ci-accent);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
#backToTop:hover, #backToTop:focus {
  background: var(--ci-accent-dark);
}

/* ===========================
   Desktop Adjustments
   =========================== */
@media (min-width: 768px) {
  .header-box, .article-box {
    max-width: 800px;
    margin: 1rem auto;
  }
  .mobile-header {
    height: 100px; /* Larger header for desktop */
    max-width: 1400px; /* Prevent stretching on wide screens */
    margin: 0 auto; /* Center header */
  }
  .header-link {
    width: 50%; /* Keep logo region clickable */
  }
  .tnav {
    margin: 0 auto;
    max-width: 800px;
    padding: 1rem;
  }
  .tnav .social-nav {
    padding: 1rem 0;
  }
}