/* ============================================================
   RESPONSIVE.CSS — All Media Queries
   Requires: base.css, components.css, articles.css
   Two breakpoints: tablet (≤768px) and mobile (≤480px)
   Desktop styles live in base/components CSS.
   ============================================================ */

/* ≤ 768px  Tablet */
@media (max-width: 768px) {

  html,
  body {
    font-size: 16px;
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .container {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

  /* Nav */
  .navbar {
    z-index: 9998;
    overflow-x: hidden !important;
    padding: 0;
  }

  .nav-content {
    padding: 1rem 0.8rem;
    gap: 0.5rem;
  }

  .logo-group {
    flex: 1;
  }

  .logo {
    font-size: 1.55rem;
    gap: 0.4rem;
  }

  .logo i {
    font-size: 1.65rem;
  }

  .logo-tagline {
    font-size: 0.74rem;
    margin-top: 2px;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    padding: 1.5rem 1rem;
    z-index: 9997;
    overflow-y: auto;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-link {
    width: 100%;
    text-align: center;
    font-size: 1.1rem;
    padding: 1rem 1.2rem;
    margin-bottom: 0.8rem;
    transition: all 0.2s ease;
  }

  .nav-link:hover,
  .nav-link.active {
    transform: translateX(-3px);
  }

  .nav-link-featured {
    font-size: 1.15rem !important;
  }

  .mobile-menu-btn {
    display: flex !important;
    z-index: 10000;
    padding: 0.6rem 0.8rem;
    min-width: 50px;
    min-height: 50px;
    transition: all 0.2s ease;
  }

  .mobile-menu-btn:hover,
  .mobile-menu-btn:active {
    transform: translateY(-2px);
  }

  .mobile-menu-btn i {
    font-size: 1.4rem;
  }

  .lang-btn {
    width: 100%;
    justify-content: center;
    padding: 1rem 1.2rem;
    font-size: 1.05rem;
    margin-top: 0.5rem;
  }

  .lang-btn:hover {
    transform: translateY(-2px);
  }

  /* Hero */
  .hero {
    padding: 3rem 0;
    min-height: auto;
    overflow-x: hidden;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 0;
    max-width: 100%;
  }

  .hero-text {
    order: 2;
    text-align: center !important;
    padding: 0 5px;
    width: 100%;
  }

  html[lang="en"] .hero-text {
    text-align: center !important;
  }

  .hero-title {
    font-size: 1.95rem !important;
    line-height: 1.35;
    margin-bottom: 1rem;
    text-align: center;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  .hero-subtitle {
    font-size: 0.92rem !important;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    text-align: justify;
    text-align-last: center;
    padding: 0 4px;
    opacity: 0.93;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  .hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
    padding: 0 5px;
    margin: 0;
  }

  .hero-buttons .btn {
    width: 100% !important;
    height: auto !important;
    min-height: 44px;
    padding: 0.6rem 0.8rem !important;
    font-size: 0.85rem !important;
    white-space: normal;
    line-height: 1.3;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  .hero-buttons .btn:nth-child(4) {
    display: none;
  }

  .hero-buttons .btn:active {
    transform: translate(2px, 2px);
  }

  .hero-image-wrapper {
    order: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    width: 100%;
  }

  .hero-image {
    width: clamp(300px, 85vw, 420px);
    aspect-ratio: 1 / 1;
  }

  /* Hero pages */
  .hero,
  .page-hero,
  .universities-hero,
  .services-hero {
    padding: 3rem 0 2.5rem;
    min-height: auto;
  }

  .page-hero {
    padding: 1.5rem 0 1rem;
  }

  .page-hero h1,
  .universities-hero h1,
  .services-hero h1 {
    font-size: clamp(2rem, 6vw, 2.8rem);
    line-height: 1.3;
    padding: 0 15px;
  }

  .page-hero p,
  .universities-hero p,
  .services-hero p {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    line-height: 1.8;
    padding: 0 15px;
  }

  /* Swipeable cards */
  .swipeable-section {
    min-height: auto !important;
    padding: 2rem 0;
    background-size: 10px 10px;
  }

  .cards-wrapper {
    height: auto !important;
    min-height: 450px;
    max-height: 70vh;
    margin-bottom: 1.5rem;
  }

  .swipeable-card {
    max-width: 94%;
    width: 94%;
    margin: 0 3%;
    padding: 1.1rem 1.1rem 1.6rem;
    height: auto !important;
    max-height: 65vh !important;
    min-height: 400px;
    overflow-y: scroll !important;
    overscroll-behavior: contain;
  }

  .swipeable-card.active,
  .swipeable-card.prev {
    transform: scale(1) translateX(0);
  }

  .card-inner {
    height: auto !important;
    min-height: auto !important;
  }

  .card-content {
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
    padding-right: 0.2rem;
  }

  .card-nav-btn {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }

  .card-nav-btn:hover {
    transform: scale(1.05);
  }

  .card-icon-large {
    font-size: 1.85rem;
    margin-bottom: 0.6rem;
  }

  .swipeable-card h2 {
    font-size: 1.18rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
  }

  .card-content p {
    font-size: 0.87rem;
    line-height: 1.5;
    margin-bottom: 0.6rem;
  }

  .card-content h3 {
    font-size: 0.93rem;
    margin-top: 0.7rem;
    margin-bottom: 0.4rem;
  }

  /* Alert/tip boxes */
  .tip-box,
  .alert-box,
  .success-box {
    padding: 0.8rem;
    margin: 0.8rem 0;
  }

  .tip-box h5,
  .alert-box h5,
  .success-box h5 {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
  }

  .tip-box p,
  .alert-box p,
  .success-box p {
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0.3rem 0 0;
  }

  /* Navigation dots */
  .cards-navigation {
    gap: 0.5rem;
    padding: 6px 10px;
    bottom: 25px;
    z-index: 200;
  }

  .nav-dot {
    width: 12px;
    height: 12px;
  }

  /* Conclusion */
  .conclusion-section {
    padding: 1.5rem 0;
    margin-top: 2rem;
  }

  .conclusion-section h2 {
    font-size: 1.35rem;
  }

  .conclusion-section p {
    font-size: 0.92rem;
    padding: 0 15px;
    line-height: 1.6;
  }

  /* Buttons */
  .btn {
    height: 46px;
    font-size: 15px;
    padding: 0 1.3rem;
  }

  .toc-sidebar {
    right: -100%;
    width: 85vw;
    top: 70px;
    max-height: calc(100vh - 80px);
  }

  .toc-sidebar.active {
    right: 0;
  }

  .toc-toggle-btn {
    top: 20px;
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }

  .toc-toggle-btn:hover {
    transform: scale(1.1);
  }

  .toc-toggle-btn.active {
    right: calc(85vw + 20px);
  }

  .toc-header {
    padding: 1.2rem;
  }

  .toc-header h2 {
    font-size: 1.1rem;
  }

  .toc-close-btn {
    width: 32px;
    height: 32px;
  }

  .toc-items {
    padding: 1rem;
  }

  .toc-item {
    padding: 0.9rem 1rem;
    margin-bottom: 0.7rem;
    font-size: 0.88rem;
  }

  .toc-icon {
    font-size: 1.4rem;
  }

  /* Sections */
  .services-section,
  .majors-section {
    padding: 3rem 0;
  }

  .section-header {
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
  }

  .section-title {
    font-size: 2.4rem !important;
    margin-bottom: 1rem;
    line-height: 1.3;
  }

  .section-subtitle {
    font-size: 1.15rem !important;
    line-height: 1.7;
    max-width: 100%;
  }

  .services-grid,
  .majors-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0;
  }

  .service-card,
  .major-card {
    padding: 2.2rem 1.7rem;
    position: relative;
    overflow: hidden;
  }

  .service-card::before,
  .major-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    transform: scaleX(0);
    transition: transform 0.3s ease;
  }

  .service-icon,
  .major-icon {
    font-size: 3.8rem;
    width: 85px;
    height: 85px;
    margin: 0 auto 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
  }

  .service-title,
  .major-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    text-align: center;
    line-height: 1.4;
  }

  .service-desc,
  .major-desc {
    font-size: 1.08rem;
    line-height: 1.78;
    text-align: center;
  }

  .service-card .btn {
    font-size: 1.02rem;
    height: 52px;
    margin-top: 1.5rem;
    width: 100%;
  }

  /* CTA */
  .cta-section {
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
  }

  .cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: 15px 15px;
    pointer-events: none;
  }

  .cta-section .container {
    position: relative;
    z-index: 1;
  }

  .cta-title {
    font-size: 2.4rem !important;
    margin-bottom: 1.2rem;
    text-align: center;
    line-height: 1.3;
  }

  .cta-subtitle {
    font-size: 1.15rem !important;
    margin-bottom: 2rem;
    text-align: center;
    line-height: 1.75;
    opacity: 0.95;
  }

  .cta-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    width: 100%;
    margin-bottom: 2rem;
  }

  .btn-cta {
    width: 100%;
    font-size: 1.08rem !important;
    padding: 1rem 1.5rem !important;
    height: auto !important;
    min-height: 62px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
  }

  .btn-cta:active {
    transform: translate(2px, 2px);
  }

  .cta-benefits {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
  }

  .cta-benefit-item {
    font-size: 1.05rem;
    padding: 0.9rem 1.3rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .cta-benefit-item::before {
    content: '✓';
    margin-left: 0.5rem;
    font-size: 1.2rem;
    font-weight: bold;
  }

  /* Universities */
  .universities-hero,
  .services-hero {
    padding: 3rem 0;
    text-align: center;
  }

  .university-card {
    padding: 0;
    margin-bottom: 0;
  }

  .university-header {
    padding: 2.2rem 1.7rem 1.7rem;
  }

  .university-body {
    padding: 2.2rem 1.7rem;
  }

  .university-name {
    font-size: 1.75rem !important;
    line-height: 1.35;
    margin-bottom: 1rem;
  }

  .university-location {
    font-size: 1.15rem !important;
    margin-bottom: 1rem;
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
  }

  .university-location i {
    font-size: 1.2rem;
  }

  .university-desc {
    font-size: 1.15rem !important;
    line-height: 1.85 !important;
  }

  .university-rank {
    font-size: 1.08rem !important;
    padding: 0.75rem 1.3rem;
  }

  .university-link {
    padding: 1.05rem 2rem;
    font-size: 1.08rem;
    width: 100%;
    display: block;
    text-align: center;
    margin-top: 1.5rem;
  }

  .university-body h2 {
    font-size: 1.75rem !important;
    margin-top: 2.2rem;
    margin-bottom: 1.2rem;
    line-height: 1.3;
  }

  .university-body h3 {
    font-size: 1.42rem !important;
    margin-bottom: 1rem;
    line-height: 1.4;
  }

  .university-body h4 {
    font-size: 1.2rem !important;
    margin-bottom: 0.9rem;
    line-height: 1.4;
  }

  .university-body p,
  .university-body ul {
    font-size: 1.1rem !important;
    line-height: 1.82 !important;
  }

  .university-body li {
    margin-bottom: 0.9rem;
  }

  .university-body div[style*="padding: 1rem"] {
    padding: 1.6rem !important;
  }

  .university-body div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  /* Pricing */
  .pricing-table {
    font-size: 1rem;
    overflow-x: auto;
  }

  .pricing-table th,
  .pricing-table td {
    font-size: 1rem;
    padding: 0.85rem 0.7rem;
  }

  .pricing-item summary {
    font-size: 1.12rem;
    padding: 1.15rem 1.4rem;
  }

  /* Performance */
  *,
  *::before,
  *::after {
    transition-duration: 0.2s !important;
  }

  a,
  button,
  input,
  select,
  textarea {
    touch-action: manipulation;
  }

  img {
    image-rendering: crisp-edges;
  }

  video {
    object-fit: cover;
    transform: translateZ(0);
  }

  p,
  li {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .btn,
  .nav-link,
  .service-card,
  .major-card,
  .university-card {
    user-select: none;
  }

  /* Feedback */
  .feedback-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .feedback-card {
    padding: 1.5rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .feedback-avatar {
    width: 45px;
    height: 45px;
  }

  .feedback-avatar i {
    font-size: 1.3rem;
  }

  .feedback-text {
    font-size: 0.95rem;
  }

  /* Bento */
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 200px;
    gap: 1rem;
  }

  .bento-large,
  .bento-schedule {
    grid-column: span 2;
    grid-row: span 3;
  }

  .bento-medium,
  .bento-tall {
    grid-column: span 1;
    grid-row: span 2;
  }

  .bento-wide {
    grid-column: span 2;
    grid-row: span 2;
  }

  .bento-schedule {
    min-height: 600px;
  }

  .bento-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .trip-schedule {
    gap: 0.8rem;
  }

  .trip-schedule li {
    padding: 0.8rem;
  }

  .trip-schedule i {
    font-size: 1.2rem;
  }

  .trip-schedule strong {
    font-size: 1rem;
  }

  .trip-schedule p {
    font-size: 0.85rem;
  }

  /* Footer */
  footer {
    padding: 2.5rem 0;
  }

  .footer-text {
    font-size: 1rem;
    line-height: 1.75;
    text-align: center;
    margin-bottom: 1.5rem;
  }

  .social-link {
    width: 56px;
    height: 56px;
    font-size: 1.65rem;
  }

  .social-link:active {
    transform: translate(2px, 2px);
  }
}

/* ≤ 480px  Mobile — overrides tablet above */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  body {
    font-size: 15px;
    text-rendering: optimizeSpeed;
    font-feature-settings: "kern" 1;
  }

  .container {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  /* Nav */
  .logo {
    font-size: 1.5rem;
  }

  .logo i {
    font-size: 1.6rem;
  }

  .logo-tagline {
    font-size: 0.72rem;
  }

  .mobile-menu-btn {
    min-width: 48px;
    min-height: 48px;
    padding: 0.5rem 0.7rem;
  }

  .nav-link {
    font-size: 1.05rem;
    padding: 0.9rem 1rem;
  }

  /* Hero */
  .hero,
  .page-hero,
  .universities-hero,
  .services-hero {
    padding: 2.5rem 0 2rem;
  }

  .page-hero {
    padding: 1.2rem 0 0.8rem;
  }

  .page-hero h1,
  .universities-hero h1,
  .services-hero h1 {
    font-size: clamp(1.8rem, 7vw, 2.2rem);
    padding: 0 12px;
    margin-bottom: 0.8rem;
  }

  .page-hero p,
  .universities-hero p,
  .services-hero p {
    font-size: clamp(0.95rem, 3vw, 1rem);
    padding: 0 12px;
  }

  .hero-image {
    width: clamp(250px, 90vw, 380px);
  }

  .universities-hero .hero-title,
  .services-hero .hero-title {
    font-size: 2.1rem !important;
  }

  .universities-hero .hero-subtitle,
  .services-hero .hero-subtitle {
    font-size: 1.08rem !important;
  }

  /* Swipeable cards */
  .swipeable-card {
    max-width: 96%;
    width: 96%;
    margin: 0 2%;
    padding: 1rem 1rem 1.5rem;
    font-size: 0.85rem;
    max-height: 80vh;
  }

  .swipeable-card h2 {
    font-size: 1.15rem;
    margin-bottom: 0.7rem;
    padding-bottom: 0.4rem;
  }

  .card-icon-large {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
  }

  .card-content p {
    font-size: 0.85rem;
    line-height: 1.45;
    margin-bottom: 0.5rem;
  }

  .card-content h3 {
    font-size: 0.9rem;
    margin-top: 0.6rem;
    margin-bottom: 0.3rem;
  }

  .card-content h4 {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
  }

  .card-nav-btn {
    width: 36px;
    height: 36px;
    font-size: 0.88rem;
  }

  /* Alert/tip boxes */
  .tip-box,
  .alert-box,
  .success-box {
    padding: 0.7rem;
    margin: 0.7rem 0;
  }

  .tip-box h5,
  .alert-box h5,
  .success-box h5 {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
  }

  .tip-box p,
  .alert-box p,
  .success-box p {
    font-size: 0.75rem;
    line-height: 1.35;
    margin-top: 0.25rem;
  }

  /* Navigation dots */
  .nav-dot {
    width: 10px;
    height: 10px;
  }

  .cards-navigation {
    gap: 0.4rem;
    padding: 5px 8px;
    bottom: 20px;
  }

  /* Conclusion */
  .conclusion-section h2 {
    font-size: 1.3rem;
  }

  .conclusion-section p {
    font-size: 0.9rem;
    padding: 0 12px;
  }

  /* Buttons */
  .btn {
    height: 45px;
    font-size: 14px;
    padding: 0 1rem;
  }

  .toc-toggle-btn {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
  }

  /* Titles */
  .section-title {
    font-size: 2rem !important;
  }

  .section-subtitle {
    font-size: 1.05rem !important;
  }

  /* Cards */
  .service-card,
  .major-card {
    padding: 2rem 1.5rem;
  }

  .service-icon,
  .major-icon {
    width: 80px;
    height: 80px;
    font-size: 3.5rem;
  }

  .service-title,
  .major-title {
    font-size: 1.35rem;
  }

  .service-desc,
  .major-desc {
    font-size: 1.05rem;
  }

  .service-card .btn {
    font-size: 1rem;
    height: 50px;
  }

  .service-detail-card {
    padding: 2rem 1.5rem;
  }

  .service-detail-card h3 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
  }

  .service-detail-card p {
    font-size: 1.06rem;
    line-height: 1.75;
  }

  /* CTA */
  .cta-title {
    font-size: 2rem !important;
  }

  .cta-subtitle {
    font-size: 1.05rem !important;
  }

  .btn-cta {
    font-size: 1rem !important;
    min-height: 56px !important;
  }

  /* Universities */
  .university-name {
    font-size: 1.65rem !important;
  }

  .university-location,
  .university-desc {
    font-size: 1.1rem !important;
  }

  .university-rank {
    font-size: 1.05rem !important;
  }

  .university-header,
  .university-body {
    padding: 2rem 1.5rem;
  }

  .university-body h2 {
    font-size: 1.65rem !important;
  }

  .university-body h3 {
    font-size: 1.3rem !important;
    margin-bottom: 1rem;
  }

  .university-body h4 {
    font-size: 1.12rem !important;
    margin-bottom: 0.9rem;
  }

  .university-body p,
  .university-body ul,
  .university-body ol {
    font-size: 1.06rem !important;
    line-height: 1.78 !important;
    padding-right: 1.8rem;
  }

  html[lang="en"] .university-body ul,
  html[lang="en"] .university-body ol {
    padding-left: 1.8rem;
    padding-right: 0;
  }

  /* Inputs */
  input[type="text"],
  input[type="email"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px !important;
    padding: 0.95rem 1.1rem;
  }

  /* WhatsApp float */
  .whatsapp-float {
    width: 60px;
    height: 60px;
    font-size: 30px;
    bottom: 24px;
    right: 24px;
  }

  html[lang="ar"] .whatsapp-float {
    left: 24px;
    right: auto;
  }

  /* Pricing */
  .pricing-table {
    font-size: 0.92rem;
    display: block;
    width: 100%;
    overflow-x: auto;
    scroll-behavior: smooth;
  }

  .pricing-table th,
  .pricing-table td {
    white-space: nowrap;
    min-width: 100px;
    font-size: 0.95rem;
    padding: 0.8rem 0.6rem;
  }

  .pricing-item summary {
    font-size: 1.1rem;
    padding: 1.1rem 1.3rem;
  }

  .todo-btn {
    min-height: 50px;
    font-size: 1rem;
    padding: 0.8rem 1.2rem;
  }

  /* Bento — single column on mobile */
  .bento-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 250px;
    display: flex;
    flex-direction: column;
  }

  .bento-large,
  .bento-medium,
  .bento-tall,
  .bento-wide {
    grid-column: span 1;
    grid-row: span 1;
    height: 300px;
  }

  .bento-schedule {
    grid-column: span 1;
    padding: 1.5rem;
    height: auto;
    min-height: 500px;
    order: -1;
  }

  /* Footer */
  .footer-text {
    font-size: 0.95rem;
  }

  .social-link {
    width: 54px;
    height: 54px;
    font-size: 1.6rem;
  }
}
