/*
==============================================================================
RESPONSIVE CSS FRAMEWORK - TANZANIARUGBYDEVELOPMENT.ORG
Breakpoints:
- Mobile S:   320px
- Mobile M:   375px
- Mobile L:   425px
- Tablet:     768px
- Laptop:     1024px
- Laptop L:   1440px
- 4K:         2560px
==============================================================================
*/

/* ============================================================================
   BASE STYLES (Mobile S: 320px) - Foundation for all screens
   ============================================================================ */

:root {
  /* Typography */
  --font-size-h1: 1.8rem;
  --font-size-h2: 1.4rem;
  --font-size-p: 0.95rem;
  --font-size-small: 0.85rem;
  
  /* Spacing */
  --padding-xs: 8px;
  --padding-sm: 12px;
  --padding-md: 16px;
  --padding-lg: 20px;
  --padding-xl: 30px;
  
  /* Gap & Margins */
  --gap-sm: 8px;
  --gap-md: 12px;
  --gap-lg: 20px;
  --gap-xl: 30px;
  
  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* Body base styles */
body {
  font-size: 16px;
  line-height: 1.5;
}

/* Headers */
h1, .org-name {
  font-size: var(--font-size-h1);
}

h2 {
  font-size: var(--font-size-h2);
}

/* Paragraphs */
p {
  font-size: var(--font-size-p);
  line-height: 1.6;
}

/* ============================================================================
   MOBILE S (320px) - Extra small devices
   Optimized for: iPhone SE, Galaxy A12
   ============================================================================ */

@media screen and (min-width: 320px) {
  /* Typography */
  :root {
    --font-size-h1: 1.4rem;
    --font-size-h2: 1.1rem;
    --font-size-p: 0.9rem;
    --padding-lg: 16px;
  }

  body {
    padding-top: 140px;
  }

  /* Header adjustments */
  .header {
    padding: 8px 12px;
  }

  .header-top {
    gap: 12px;
  }

  .logo-transparent {
    width: 60px;
  }

  .org-name {
    font-size: 1.2rem;
    margin: 0;
  }

  /* Navigation */
  .nav-links {
    gap: 8px;
  }

  .nav-links a,
  .dropdown-toggle {
    padding: 4px 8px;
    font-size: 0.85rem;
  }

  /* Slide message */
  .slide-message {
    font-size: 1rem;
    padding-left: 16px;
    padding-right: 16px;
  }

  .slide-message h2 {
    font-size: 1.1rem;
    line-height: 1.4;
  }

  /* Welcome section */
  .welcome-section {
    padding: 40px 12px;
  }

  .welcome-content h2 {
    font-size: 1.3rem;
    margin-bottom: 16px;
  }

  .welcome-content p {
    font-size: 0.9rem;
    margin-bottom: 20px;
  }

  /* News section */
  .news-section {
    padding: 30px 12px;
  }

  .news-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .news-box p {
    font-size: 0.85rem;
    padding: 8px;
  }

  /* Stats section */
  .stats-section {
    gap: 16px;
    padding: 30px 10px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .stat-box {
    width: 100%;
    max-width: 200px;
    padding: 12px 8px;
    margin: 0 auto;
  }

  .counter {
    font-size: 2rem;
  }

  /* Buttons */
  .button-like {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  /* Footer */
  .footer {
    padding: 16px 8px;
    flex-direction: column;
    gap: 12px;
  }

  .social-icons a img {
    width: 36px;
    height: 36px;
    margin-right: 8px;
  }

  .footer-logo img {
    width: 60px;
  }

  /* Scroll to top button */
  .scroll-top {
    bottom: 20px;
    right: 20px;
  }

  .scroll-top img {
    width: 40px;
    height: 40px;
  }
}

/* ============================================================================
   MOBILE M (375px) - Small mobile devices
   Optimized for: iPhone 12, Galaxy S10
   ============================================================================ */

@media screen and (min-width: 375px) {
  :root {
    --font-size-h1: 1.5rem;
    --font-size-h2: 1.2rem;
    --font-size-p: 0.92rem;
  }

  .header {
    padding: 10px 14px;
  }

  .logo-transparent {
    width: 65px;
  }

  .org-name {
    font-size: 1.3rem;
  }

  .nav-links a,
  .dropdown-toggle {
    padding: 5px 10px;
    font-size: 0.9rem;
  }

  .slide-message {
    font-size: 1.1rem;
    padding-left: 20px;
    padding-right: 20px;
  }

  .welcome-section {
    padding: 45px 16px;
  }

  .welcome-content h2 {
    font-size: 1.4rem;
  }

  .news-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .button-like {
    padding: 8px 14px;
    font-size: 0.9rem;
  }

  .counter {
    font-size: 2.2rem;
  }

  .footer {
    padding: 18px 12px;
  }

  .social-icons a img {
    width: 38px;
    height: 38px;
  }
}

/* ============================================================================
   MOBILE L (425px) - Large mobile devices
   Optimized for: iPhone 14 Pro Max, Galaxy S21
   ============================================================================ */

@media screen and (min-width: 425px) {
  :root {
    --font-size-h1: 1.6rem;
    --font-size-h2: 1.25rem;
    --font-size-p: 0.95rem;
  }

  .header {
    padding: 10px 16px;
  }

  .logo-transparent {
    width: 70px;
  }

  .org-name {
    font-size: 1.4rem;
  }

  .nav-links {
    gap: 12px;
  }

  .nav-links a,
  .dropdown-toggle {
    padding: 6px 12px;
    font-size: 0.95rem;
  }

  .slide-message {
    font-size: 1.2rem;
    padding-left: 24px;
    padding-right: 24px;
  }

  .slide-message h2 {
    font-size: 1.3rem;
  }

  .welcome-section {
    padding: 50px 20px;
  }

  .welcome-content h2 {
    font-size: 1.5rem;
    margin-bottom: 18px;
  }

  .welcome-content p {
    font-size: 0.95rem;
    margin-bottom: 24px;
  }

  .news-container {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
  }

  .counter {
    font-size: 2.4rem;
  }

  .button-like {
    padding: 8px 16px;
    font-size: 0.95rem;
  }

  .stats-section {
    gap: 14px;
    padding: 35px 12px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .stat-box {
    width: 100%;
    max-width: 210px;
    padding: 14px 8px;
    margin: 0 auto;
  }

  .footer {
    padding: 20px 16px;
    gap: 16px;
  }

  .social-icons a img {
    width: 40px;
    height: 40px;
    margin-right: 10px;
  }

  .footer-logo img {
    width: 65px;
  }
}

/* ============================================================================
   TABLET (768px) - Tablet devices
   Optimized for: iPad, iPad Air, Galaxy Tab
   ============================================================================ */

@media screen and (min-width: 768px) {
  :root {
    --font-size-h1: 1.8rem;
    --font-size-h2: 1.4rem;
    --font-size-p: 1rem;
    --padding-lg: 24px;
    --gap-lg: 24px;
  }

  body {
    padding-top: 160px;
    font-size: 16px;
  }

  /* Header */
  .header {
    padding: 12px 24px;
  }

  .header-top {
    gap: 20px;
    flex-wrap: nowrap;
  }

  .logo-transparent {
    width: 75px;
  }

  .org-name {
    font-size: 1.6rem;
    flex-grow: 1;
  }

  .menu-toggle,
  .menu-close {
    display: none !important;
  }

  /* Navigation */
  .nav-links {
    display: flex !important;
    gap: 16px;
    flex-direction: row;
    flex-wrap: wrap;
    background-color: transparent;
    padding: 10px 0;
    margin-top: 0;
    justify-content: center;
  }

  .nav-links a,
  .dropdown-toggle {
    padding: 8px 14px;
    font-size: 1rem;
  }

  .dropdown {
    position: relative;
  }

  .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
  }

  .dropdown:hover .dropdown-menu {
    display: flex !important;
  }

  /* Slideshow */
  .slideshow {
    height: 50vh;
    max-height: 600px;
  }

  .slide-message {
    font-size: 1.5rem;
    padding-left: 40px;
    padding-right: 40px;
  }

  .slide-message h2 {
    font-size: 1.6rem;
    line-height: 1.5;
  }

  /* Welcome section */
  .welcome-section {
    padding: 60px 40px;
  }

  .welcome-content {
    max-width: 900px;
  }

  .welcome-content h2 {
    font-size: 1.8rem;
    margin-bottom: 24px;
  }

  .welcome-content p {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 32px;
  }

  /* News section */
  .news-section {
    padding: 50px 40px;
  }

  .news-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .news-box p {
    font-size: 0.95rem;
    padding: 12px;
  }

  /* Stats section */
  .stats-section {
    gap: 16px;
    padding: 40px 16px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
  }

  .stat-box {
    width: auto;
    flex: 0 1 calc(33.333% - 16px);
    min-width: 110px;
    max-width: 170px;
    padding: 16px 8px;
    margin: 0;
  }

  .counter {
    font-size: 2.8rem;
    margin-bottom: 12px;
  }

  /* Buttons */
  .button-like {
    padding: 10px 20px;
    font-size: 1rem;
  }

  /* Footer */
  .footer {
    padding: 24px 40px;
    flex-direction: row;
    align-items: center;
    gap: 32px;
  }

  .social-icons a img {
    width: 42px;
    height: 42px;
    margin-right: 12px;
  }

  .footer-logo img {
    width: 75px;
  }

  /* Scroll to top button */
  .scroll-top {
    bottom: 30px;
    right: 30px;
  }

  .scroll-top img {
    width: 45px;
    height: 45px;
  }
}

/* ============================================================================
   LAPTOP (1024px) - Desktop devices
   Optimized for: 11-inch laptops, small desktops
   ============================================================================ */

@media screen and (min-width: 1024px) {
  :root {
    --font-size-h1: 2rem;
    --font-size-h2: 1.6rem;
    --font-size-p: 1.05rem;
    --padding-lg: 30px;
  }

  body {
    padding-top: 140px;
    font-size: 16px;
  }

  /* Header */
  .header {
    padding: 12px 30px;
  }

  .header-top {
    gap: 30px;
  }

  .logo-transparent {
    width: 80px;
  }

  .org-name {
    font-size: 1.8rem;
  }

  /* Navigation */
  .nav-links {
    gap: 20px;
    justify-content: center;
  }

  .nav-links a,
  .dropdown-toggle {
    padding: 8px 16px;
    font-size: 1.05rem;
  }

  .nav-links a:hover,
  .dropdown-toggle:hover {
    transform: translateY(-2px);
    transition: all 0.3s ease;
  }

  /* Slideshow */
  .slideshow {
    height: 55vh;
    max-height: 700px;
  }

  .slide-message {
    font-size: 1.8rem;
    padding-left: 60px;
    padding-right: 60px;
  }

  .slide-message h2 {
    font-size: 1.9rem;
    line-height: 1.6;
  }

  /* Welcome section */
  .welcome-section {
    padding: 80px 60px;
  }

  .welcome-content {
    max-width: 1000px;
  }

  .welcome-content h2 {
    font-size: 2rem;
    margin-bottom: 28px;
  }

  .welcome-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 36px;
  }

  /* News section */
  .news-section {
    padding: 60px 60px;
  }

  .news-section h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
  }

  .news-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
  }

  .news-box {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .news-box:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  }

  .news-box p {
    font-size: 1rem;
    padding: 14px;
  }

  /* Stats section */
  .stats-section {
    gap: 40px;
    padding: 50px 30px;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
  }

  .stat-box {
    flex: 0 1 160px;
    width: 160px;
    padding: 20px;
    margin: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .stat-box:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  }

  .counter {
    font-size: 3rem;
    margin-bottom: 14px;
  }

  /* Buttons */
  .button-like {
    padding: 12px 24px;
    font-size: 1.05rem;
  }

  /* Footer */
  .footer {
    padding: 30px 60px;
    justify-content: space-around;
    gap: 40px;
  }

  .social-icons a img {
    width: 44px;
    height: 44px;
    margin-right: 14px;
  }

  .footer-logo img {
    width: 80px;
  }

  .footer p {
    font-size: 1rem;
  }

  /* Scroll to top button */
  .scroll-top img {
    width: 50px;
    height: 50px;
  }
}

/* ============================================================================
   LAPTOP L (1440px) - Large desktop devices
   Optimized for: 15-inch laptops, desktop monitors
   ============================================================================ */

@media screen and (min-width: 1440px) {
  :root {
    --font-size-h1: 2.2rem;
    --font-size-h2: 1.8rem;
    --font-size-p: 1.1rem;
    --padding-lg: 40px;
  }

  body {
    font-size: 17px;
  }

  /* Header */
  .header {
    padding: 14px 40px;
  }

  .header-top {
    gap: 40px;
  }

  .logo-transparent {
    width: 90px;
  }

  .org-name {
    font-size: 2rem;
  }

  /* Navigation */
  .nav-links {
    gap: 24px;
  }

  .nav-links a,
  .dropdown-toggle {
    padding: 10px 18px;
    font-size: 1.1rem;
  }

  /* Slideshow */
  .slideshow {
    height: 60vh;
    max-height: 800px;
  }

  .slide-message {
    font-size: 2rem;
    padding-left: 80px;
    padding-right: 80px;
  }

  .slide-message h2 {
    font-size: 2.2rem;
    line-height: 1.7;
  }

  /* Welcome section */
  .welcome-section {
    padding: 100px 80px;
  }

  .welcome-content {
    max-width: 1200px;
  }

  .welcome-content h2 {
    font-size: 2.2rem;
    margin-bottom: 32px;
  }

  .welcome-content p {
    font-size: 1.15rem;
    line-height: 1.9;
    margin-bottom: 40px;
  }

  /* News section */
  .news-section {
    padding: 80px 80px;
  }

  .news-section h2 {
    font-size: 2rem;
    margin-bottom: 40px;
  }

  .news-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 1400px;
    margin: 0 auto;
  }

  .news-box {
    border-radius: 12px;
  }

  .news-box p {
    font-size: 1.05rem;
    padding: 16px;
  }

  /* Stats section */
  .stats-section {
    gap: 60px;
    padding: 70px 40px;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
  }

  .stat-box {
    flex: 0 1 190px;
    width: 190px;
    padding: 24px;
    margin: 0;
  }

  .counter {
    font-size: 3.2rem;
    margin-bottom: 16px;
  }

  .stat-box p {
    font-size: 1.1rem;
  }

  /* Buttons */
  .button-like {
    padding: 14px 28px;
    font-size: 1.1rem;
  }

  /* Footer */
  .footer {
    padding: 36px 80px;
    justify-content: space-around;
  }

  .footer p {
    font-size: 1.05rem;
  }

  .social-icons a img {
    width: 46px;
    height: 46px;
    margin-right: 16px;
  }

  .footer-logo img {
    width: 90px;
  }
}

/* ============================================================================
   4K (2560px) - Ultra-wide displays
   Optimized for: 4K monitors, premium desktop setups
   ============================================================================ */

@media screen and (min-width: 2560px) {
  :root {
    --font-size-h1: 2.6rem;
    --font-size-h2: 2.1rem;
    --font-size-p: 1.3rem;
    --padding-lg: 60px;
  }

  body {
    font-size: 18px;
  }

  /* Header */
  .header {
    padding: 18px 60px;
  }

  .header-top {
    gap: 60px;
  }

  .logo-transparent {
    width: 110px;
  }

  .org-name {
    font-size: 2.4rem;
  }

  /* Navigation */
  .nav-links {
    gap: 32px;
  }

  .nav-links a,
  .dropdown-toggle {
    padding: 12px 24px;
    font-size: 1.3rem;
  }

  /* Slideshow */
  .slideshow {
    height: 65vh;
    max-height: 1000px;
  }

  .slide-message {
    font-size: 2.4rem;
    padding-left: 120px;
    padding-right: 120px;
  }

  .slide-message h2 {
    font-size: 2.6rem;
    line-height: 1.8;
  }

  /* Welcome section */
  .welcome-section {
    padding: 140px 120px;
  }

  .welcome-content {
    max-width: 1600px;
  }

  .welcome-content h2 {
    font-size: 2.6rem;
    margin-bottom: 40px;
  }

  .welcome-content p {
    font-size: 1.35rem;
    line-height: 2;
    margin-bottom: 50px;
  }

  /* News section */
  .news-section {
    padding: 120px 120px;
  }

  .news-section h2 {
    font-size: 2.4rem;
    margin-bottom: 50px;
  }

  .news-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    max-width: 1800px;
    margin: 0 auto;
  }

  .news-box p {
    font-size: 1.2rem;
    padding: 20px;
  }

  /* Stats section */
  .stats-section {
    gap: 80px;
    padding: 90px 60px;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
  }

  .stat-box {
    flex: 0 1 220px;
    width: 220px;
    padding: 28px;
    margin: 0;
  }

  .counter {
    font-size: 4rem;
    margin-bottom: 20px;
  }

  .stat-box p {
    font-size: 1.3rem;
  }

  /* Buttons */
  .button-like {
    padding: 18px 36px;
    font-size: 1.3rem;
  }

  /* Footer */
  .footer {
    padding: 50px 120px;
    gap: 80px;
  }

  .footer p {
    font-size: 1.25rem;
  }

  .social-icons a img {
    width: 56px;
    height: 56px;
    margin-right: 20px;
  }

  .footer-logo img {
    width: 110px;
  }

  /* Scroll to top button */
  .scroll-top {
    bottom: 50px;
    right: 50px;
  }

  .scroll-top img {
    width: 64px;
    height: 64px;
  }
}

/* ============================================================================
   UTILITY CLASSES - Optional helpers for responsive design
   ============================================================================ */

/* Hide elements on specific breakpoints */
@media (max-width: 425px) {
  .hide-mobile-s {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) and (max-width: 1023px) {
  .hide-tablet {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .hide-desktop {
    display: none !important;
  }
}

@media (max-width: 1439px) {
  .hide-laptop {
    display: none !important;
  }
}

@media (max-width: 2559px) {
  .hide-4k {
    display: none !important;
  }
}

/* Show elements on specific breakpoints */
@media (max-width: 425px) {
  .show-mobile-s {
    display: block !important;
  }
}

@media (max-width: 768px) {
  .show-mobile {
    display: block !important;
  }
}

@media (min-width: 769px) and (max-width: 1023px) {
  .show-tablet {
    display: block !important;
  }
}

@media (min-width: 1024px) {
  .show-desktop {
    display: block !important;
  }
}

/* Core stats-section rules: ensure horizontal layout that fits and never causes sideways scroll */
.stats-section {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 120px;
  padding: 120px 100px;
  box-sizing: border-box;
  width: 100%;
}

.stat-box {
  flex: 0 1 280px;
  width: 280px;
  padding: 36px;
  margin: 0;
  box-sizing: border-box;
}
