/* ==========================================================================
   PRODUCTION-READY RESPONSIVE PATCH (320px - 1920px)
   ========================================================================== */

/* --- Breakpoint: 1920px+ (Ultra Large Screens) --- */
@media (min-width: 1920px) {
  .container {
    max-width: 1540px;
  }
  .hero-title {
    font-size: 4rem;
  }
  .port-item {
    width: clamp(130px, 11vw, 170px);
    height: clamp(130px, 11vw, 170px);
  }
}

/* --- Global Text Font Boost (+2px) above 992px --- */
@media (min-width: 992px) {
  html {
    font-size: 112.5% !important; /* Increases 16px base size to 18px */
  }
  .party-name h2 {
    font-size: 32px !important;
  }
  .party-name .tamil-text {
    font-size: 32px !important;
  }
  .party-short-name {
    font-size: 20px !important;
  }
  .port-name {
    font-size: 13px !important;
  }
}

/* --- Breakpoint: 1400px+ (Extra Large Screens) --- */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
  .hero-title {
    font-size: 3.5rem;
  }
}

/* --- Breakpoint: 1200px - 1399px (Large Desktops) --- */
@media (max-width: 1399px) {
  .container {
    max-width: 1140px;
  }
  .hero-title {
    font-size: 3rem;
  }
}

/* --- Breakpoint: Proportional Scaling (992px - 1600px) --- */
@media (min-width: 992px) and (max-width: 1600px) {
  .container {
    max-width: 90%;
  }
  .top-bar {
    font-size: clamp(0.75rem, 0.9vw, 0.9rem);
    padding: 5px 0;
  }
  .header .container {
    height: 70px;
  } /* Compact header */
  .party-name h2 {
    font-size: clamp(1rem, 1.8vw, 1.4rem);
  }
  .nav-menu {
    gap: clamp(10px, 1.5vw, 28px);
  }
  .nav-menu a {
    font-size: clamp(0.8rem, 1.2vw, 1rem);
  }
  .hero-section {
    min-height: calc(110vh - 70px) !important;
    height: auto !important;
  }
  .hero-content-side {
    padding: 40px 5% 40px 5% !important;
  }
  .leader-portraits-new {
    margin-top: clamp(20px, 3vw, 40px) !important;
    margin-bottom: 15px !important;
  }
  .port-item {
    width: clamp(65px, 5vw, 85px) !important;
    height: clamp(65px, 5vw, 85px) !important;
  }
  .port-wrapper {
    min-width: clamp(75px, 6vw, 95px) !important;
  }
  .hero-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem) !important;
    margin-bottom: 15px !important;
  }
  .hero-desc {
    font-size: clamp(0.9rem, 1.1vw, 1.05rem) !important;
    margin-bottom: 20px !important;
  }
}

/* --- Breakpoint: 992px - 1199px (Desktops/Laptops) --- */
@media (max-width: 1199px) {
  .container {
    max-width: 960px;
  }
  .top-bar {
    font-size: 0.8rem;
    padding: 6px 0;
  }
  .top-bar-left {
    gap: 8px;
  }
  .header .container {
    height: 65px;
  }
  .logo-icon img {
    width: 55px;
    height: 55px;
  }
  .party-name h2 {
    font-size: 1.6rem;
  }
  .nav-menu {
    gap: 12px;
  }
  .nav-menu a {
    font-size: 0.8rem;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .about-content h2 {
    font-size: 2rem;
  }
}

/* --- Breakpoint: Specialized Fix for 992px - 1096px (Fixes content cut-off) --- */
@media (min-width: 992px) and (max-width: 1096px) {
  .hero-section {
    min-height: 500px !important;
  }
  .leader-portraits-new {
    margin-top: 45px !important; /* Pull up closer to the header */
    gap: 10px !important; /* Tighten portraits together */
    margin-bottom: 20px !important;
  }
  .port-item {
    width: 68px !important; /* Smaller portraits to stay on one row */
    height: 68px !important;
  }
  .port-name {
    font-size: 10px !important;
  }
  .port-wrapper {
    min-width: 78px !important;
  }
  .hero-title {
    font-size: 2rem !important;
    margin-bottom: 12px !important;
  }
  .hero-desc {
    font-size: 0.95rem !important;
    margin-bottom: 25px !important;
  }
  .hero-content-side {
    padding-bottom: 30px !important;
  }
}

/* --- Breakpoint: 768px - 991px (Tablets) --- */
@media (max-width: 991px) {
  .container {
    max-width: 720px;
  }

  /* Header & Navigation */
  .nav-menu {
    display: none !important;
  }
  .hamburger {
    display: block !important;
  }

  .lang-toggle {
    margin: 10px 0 0 0;
  }
  /* Hero Section - Nuclear Fix for Visibility */
  .hero-section {
    display: block !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    background-color: var(--secondary-color) !important;
    padding: 0 !important;
    /* border: 2px solid blue; TEST BORDER */
  }
  .hero-content-side {
    width: 100% !important;
    height: auto !important;
    padding: 1px 5% !important;
    text-align: center;
    clip-path: none !important;
    margin: 0 !important;
    display: block !important;
    background: var(--primary-color) !important;
    position: relative !important;
    z-index: 5;
  }
  .hero-visual-side {
    display: block !important;
    width: 100% !important;
    height: 430px !important; /* FIXED HEIGHT */
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    z-index: 10;
    background-color: var(--secondary-color) !important;
    visibility: visible !important;
    opacity: 1 !important;
    /* border: 4px solid green; TEST BORDER */
  }
  .hero-slider {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    overflow: hidden !important;
  }
  .slide {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    background-size: contain !important;
    background-position: center bottom !important;
    background-repeat: no-repeat !important;
  }
  .leader-portraits-new {
    justify-content: center !important;
  }
  .hero-desc {
    margin: 0 auto 30px auto !important;
  }
  .hero-btns {
    justify-content: center !important;
  }
  .hero-title {
    font-size: 2.2rem !important;
  }

  /* About & Sections */
  section, .section-padding, .about-section, .updates-section, .join-tkp-section, .page-content-padding {
    padding: 60px 0;
  }
  .about-grid {
    flex-direction: column;
    text-align: center;
  }
  .about-img,
  .about-content {
    flex: 1 1 100%;
  }
  .leader-banner {
    height: auto;
    min-height: 350px;
    padding: 60px 0;
  }
  .leader-content {
    padding: 0;
  }
  .leader-title {
    font-size: 1.8rem;
  }

}

/* --- Breakpoint: 576px - 767px (Large Phones) --- */
@media (max-width: 767px) {
  .container {
    max-width: 540px;
    padding: 0 15px;
  }

  /* Hero Adjustments for Small Screens */
  .hero-visual-side {
    height: 400px; /* Slightly smaller for mobile */
  }

  /* Top Bar */
  .top-bar {
    padding: 4px 0;
  }
  .top-bar-left {
    justify-content: center;
    width: 100%;
    margin-bottom: 8px;
    font-size: 0.75rem;
    gap: 6px;
    flex-direction: column; /* Stack slogans on medium mobile */
  }
  .top-bar .container {
    justify-content: center;
    text-align: center;
  }
  .divider {
    display: none;
  }
  .join-btn {
    padding: 5px 15px;
    font-size: 0.75rem;
  }

  /* Typography */
  .hero-title {
    font-size: 1.8rem;
  }
  .about-content h2 {
    font-size: 1.8rem;
  }
  .leader-title {
    font-size: 2rem;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }
  .footer-col h4 {
    border-left: none;
    padding-left: 0;
  }
  .social-icons {
    justify-content: center;
  }
}

/* --- Breakpoint: Below 576px (Small Phones) --- */
@media (max-width: 575px) {
  /* Header/Logo for Small Mobile */
  .top-bar {
    padding: 2px 0;
  }
  .top-bar-left {
    font-size: 0.7rem !important;
    margin-bottom: 5px;
  }
  .join-btn {
    padding: 4px 12px;
    font-size: 0.7rem;
  }
  .header .container {
    height: 60px;
  }
  .logo-area {
    gap: 0px;
  }
	 .logo-icon {
    width: 65px !important;
    height: 45px !important;
  }
  .logo-icon img {
    width: 55px !important;
    height: 55px !important;
  }
  .party-name h2 {
    font-size: 1.2rem !important;
  }

  /* Global Spacing */
  section, .section-padding, .about-section, .updates-section, .join-tkp-section, .page-content-padding {
    padding: 40px 0;
  }

  /* Hero Small Mobile */
  .hero-section {
    padding-top: 20px;
  }
  .hero-content-side {
    padding: 30px 5%;
  }
  .hero-visual-side {
    height: 320px; /* Compact height for small mobile */
  }

  /* Logo & Name */
  .party-name h2 {
    font-size: 1rem;
  }

  /* Hero */
  .hero-title {
    font-size: 1.6rem;
  }
  .hero-badge {
    padding: 6px 15px;
    font-size: 0.8rem;
  }
  .port-item {
    width: 60px;
    height: 60px;
  }
  .hero-btns {
    flex-direction: column;
    gap: 10px;
  }
  .btn-hero-primary,
  .btn-hero-secondary {
    width: 100%;
    padding: 12px 20px;
    font-size: 0.9rem;
  }
  
  .section-header {
    margin-bottom: 25px;
  }
  .section-header h2 {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  /* Map */
  .map-wrapper {
    height: auto;
    min-height: 300px;
    padding: 10px;
  }
  .buttons {
    flex-direction: column;
    width: 100%;
  }
  .btn {
    width: 100%;
  }

  /* Sticky Elements */
  .lang-switch {
    bottom: 20px;
    top: auto;
    right: 10px;
    padding: 8px 15px;
    font-size: 0.85rem;
  }
}

/* --- Utility Fixes for all Breakpoints --- */
img {
  max-width: 100%;
  height: auto;
}
.overflow-hidden {
  overflow: hidden;
}

/* --- Breakpoint: Below 360px (Ultra Small Phones e.g iPhone SE/Fold) --- */
@media (max-width: 360px) {
	 .logo-icon  {
    width: 60px !important;
    height: 60px !important;
  }
  .logo-icon img {
    width: 45px !important;
    height: 45px !important;
  }
  .party-name h2 {
    font-size: 0.8rem !important;
    white-space: normal !important;
  }
  .top-bar-left {
    font-size: 0.6rem !important;
  }
  .join-btn {
    padding: 3px 8px;
    font-size: 0.6rem;
  }
  .hamburger {
    font-size: 1.5rem !important;
  }
  .header .container {
    padding: 0 10px !important;
  }
  .logo-area {
    gap: 0px !important;
  }
  .port-item {
    width: 60px !important;
    height: 60px !important;
  }
  .port-wrapper {
    min-width: 65px !important;
    gap: 8px !important;
  }
  .port-name {
    font-size: 9px !important;
  }
  .leader-portraits-new {
    gap: 8px !important;
    margin-bottom: 20px !important;
  }
}

@media (max-width: 768px) {
  .top-bar .container {
    flex-wrap: nowrap;
  }

  .top-bar-left {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 5px;
  }

  .top-bar-left span {
    flex: 1;
    font-size: 0.75rem;
    text-align: left;
  }

  .top-bar-left span:last-child {
    text-align: right;
  }
}

@media (max-width: 410px) {
	.hero-visual-side{
		height:350px !important;
	}
}