/* ==========================================================================
   CSEProjects360 - Responsive Stylesheet
   Breakpoints: 1024px (tablet), 768px (mobile-landscape), 480px (mobile)
   ========================================================================== */

/* ==========================================================================
   Large Desktop (1280px+) — slight adjustments
   ========================================================================== */
@media (min-width: 1280px) {
  :root {
    --container-width: 1200px;
  }
}

/* ==========================================================================
   Tablet / Small Desktop (max-width: 1024px)
   ========================================================================== */
@media (max-width: 1024px) {

  h1 { font-size: 2.1rem; }
  h2 { font-size: 1.7rem; }

  /* Header */
  .main-nav a {
    padding: 8px 9px;
    font-size: 0.84rem;
  }

  /* Hero */
  .hero-content h1 {
    font-size: 2.1rem;
  }

  .hero-content {
    flex: 0 0 54%;
    max-width: 54%;
  }

  .hero-image {
    flex: 0 0 46%;
    max-width: 46%;
  }

  /* Services */
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Domains */
  .domains-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* About */
  .about-inner {
    gap: 36px;
  }

  .about-image {
    flex: 0 0 40%;
    max-width: 40%;
  }

  /* Footer */
  .footer-top {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 28px;
  }

  /* Projects grid */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Blog */
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* IEEE */
  .ieee-inner {
    flex-direction: column;
    gap: 32px;
  }

  .ieee-topics {
    max-width: 100%;
    flex: none;
  }

  /* Project detail */
  .project-detail-sidebar {
    flex: 0 0 260px;
    max-width: 260px;
  }
}

/* ==========================================================================
   Mobile Landscape / Tablet Portrait (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {

  :root {
    --header-height: 60px;
  }

  /* Typography */
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.15rem; }

  .section-pad { padding: 48px 0; }
  .section-pad-sm { padding: 30px 0; }
  .section-header { margin-bottom: 30px; }
  .section-header h2 { font-size: 1.5rem; }

  /* Header — mobile nav */
  .menu-toggle {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border-grey);
    border-bottom: 1px solid var(--border-grey);
    flex-direction: column;
    padding: 12px 16px;
    gap: 2px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 999;
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    padding: 11px 14px;
    font-size: 0.93rem;
    border-radius: var(--border-radius);
    width: 100%;
  }

  .main-nav .btn-nav-login {
    width: 100%;
    text-align: center;
    margin-top: 6px;
  }

  /* Hero — stacked */
  #hero {
    padding: 36px 0 0;
  }

  .hero-inner {
    flex-direction: column;
    gap: 30px;
    min-height: auto;
  }

  .hero-content {
    flex: none;
    max-width: 100%;
    padding-bottom: 0;
    text-align: center;
  }

  .hero-content h1 {
    font-size: 1.75rem;
  }

  .hero-content p {
    max-width: 100%;
    margin: 0 auto 24px;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-links {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-image {
    flex: none;
    max-width: 100%;
    width: 100%;
  }

  .hero-image .img-placeholder,
  .hero-image img {
    border-radius: var(--border-radius-md);
    height: 240px;
  }

  /* Feature Strip — scroll */
  .feature-strip-inner {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .feature-item {
    min-width: 160px;
    flex-shrink: 0;
  }

  /* Services */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .service-card {
    padding: 24px 20px;
  }

  .service-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .service-card-actions .btn {
    width: 100%;
  }

  .service-card-link {
    text-align: center;
  }

  /* About */
  .about-inner {
    flex-direction: column;
    gap: 28px;
  }

  .about-image {
    max-width: 100%;
    flex: none;
  }

  .about-features {
    grid-template-columns: 1fr;
  }

  /* Domains */
  .domains-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  /* Projects */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-item:nth-child(2),
  .stat-item:nth-child(4),
  .stat-item:nth-child(6) {
    border-right: none;
  }

  .stat-item:nth-child(3) {
    border-right: 1px solid rgba(255,255,255,0.15);
  }

  .stat-item:nth-child(5),
  .stat-item:nth-child(6) {
    border-bottom: none;
  }

  /* Training */
  .training-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  /* Testimonials */
  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  /* Blog */
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  /* Contact */
  .contact-inner {
    flex-direction: column;
    gap: 30px;
  }

  .contact-info {
    max-width: 100%;
    flex: none;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* Footer */
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  /* Project filter */
  .project-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-search {
    min-width: 0;
  }

  /* Project detail layout */
  .project-detail-layout {
    flex-direction: column;
  }

  .project-detail-sidebar {
    flex: none;
    max-width: 100%;
    position: static;
  }

  /* Page hero */
  .page-hero h1 {
    font-size: 1.5rem;
  }

  /* Login */
  .login-box {
    padding: 28px 22px;
  }

  /* CTA Banner */
  .cta-banner .btn {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 0 auto 10px;
  }
}

/* ==========================================================================
   Mobile Portrait (max-width: 480px)
   ========================================================================== */
@media (max-width: 480px) {

  h1 { font-size: 1.55rem; }
  h2 { font-size: 1.3rem; }

  .container { padding: 0 16px; }

  .section-pad { padding: 38px 0; }

  /* Hero */
  .hero-content h1 {
    font-size: 1.55rem;
  }

  .hero-badge {
    font-size: 0.72rem;
  }

  .hero-stats {
    gap: 18px;
  }

  .hero-stat strong {
    font-size: 1.1rem;
  }

  /* Feature strip */
  .feature-item {
    min-width: 140px;
    padding: 16px 12px;
    gap: 8px;
  }

  .feature-icon {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
  }

  /* Services */
  .services-grid {
    grid-template-columns: 1fr;
  }

  .service-card-top {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Domains */
  .domains-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Projects */
  .projects-grid {
    grid-template-columns: 1fr;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Training */
  .training-grid {
    grid-template-columns: 1fr;
  }

  /* Blog */
  .blog-grid {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer-top {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-brand {
    grid-column: auto;
  }

  /* Buttons */
  .btn {
    width: 100%;
    text-align: center;
    display: block;
  }

  .hero-cta .btn {
    display: inline-block;
    width: auto;
  }

  /* Testimonials */
  .testimonial-card {
    padding: 20px 16px;
  }

  /* Filter tabs */
  .filter-tabs {
    gap: 4px;
  }

  .filter-tab {
    font-size: 0.78rem;
    padding: 6px 10px;
  }

  /* About features */
  .about-features {
    grid-template-columns: 1fr;
  }

  /* Section header */
  .section-header h2 {
    font-size: 1.3rem;
  }
}

/* ==========================================================================
   Print
   ========================================================================== */
@media print {
  #site-header,
  #site-footer,
  .menu-toggle,
  .cta-banner,
  .project-filter-bar {
    display: none;
  }

  body {
    font-size: 12pt;
  }

  .section-pad {
    padding: 20pt 0;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #666;
  }
}
