/* ============================================
   RCA Academy - Responsive Stylesheet
   ============================================ */

/* --- Global Overflow Fix --- */
html, body {
  overflow-x: hidden;
}

img, iframe, video, canvas {
  max-width: 100%;
}

.table-responsive,
.resource-list,
.admin-card__body {
  max-width: 100%;
}

/* --- 1200px --- */
@media (max-width: 1200px) {
  .container {
    max-width: 960px;
  }

  .hero__title {
    font-size: 3rem;
  }

  .hero__title span {
    font-size: 1.8rem;
  }

  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 30px;
  }

  .footer-grid .footer-col:last-child {
    grid-column: span 3;
  }

  .numbers-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  #mainNav .navbar-brand__name {
    font-size: 0.78rem;
  }

  #mainNav .navbar-nav {
    font-size: 0.74rem !important;
  }

  .row.g-5 {
    --bs-gutter-x: 1.5rem !important;
    --bs-gutter-y: 1.5rem !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .home-trades-row {
    width: 100% !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  .home-trades-row > .col-lg-6 {
    width: 100% !important;
    flex: 0 0 100% !important;
  }

  .partners-scroll {
    overflow: hidden;
  }
}

/* --- 1024px --- */
@media (max-width: 1024px) {
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.8rem; }

  .hero__title {
    font-size: 2.5rem;
  }

  .hero__title span {
    font-size: 1.5rem;
  }

  .section-padding {
    padding: 70px 0;
  }

  .core-study__item {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .core-study__item.reverse {
    direction: ltr;
  }

  .newsletter__inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .staff-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- 992px --- */
@media (max-width: 992px) {
  :root {
    --nav-height: 70px;
  }

  .container {
    max-width: 720px;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: var(--primary);
    flex-direction: column;
    align-items: flex-start;
    padding: 100px 30px 30px;
    transition: right 0.3s ease;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    z-index: 1050;
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-link {
    padding: 12px 0 !important;
    font-size: 0.9rem;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-link::after {
    display: none;
  }

  .navbar-dropdown .dropdown-menu {
    position: static;
    box-shadow: none;
    border-top: none;
    background: rgba(255, 255, 255, 0.05);
    margin-top: 5px;
    min-width: auto;
    padding-left: 15px;
  }

  .navbar-dropdown .dropdown-menu .dropdown-item {
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 15px;
  }

  .navbar-dropdown .dropdown-menu .dropdown-item:hover {
    background: transparent;
    color: var(--accent);
    padding-left: 20px;
  }

  .hamburger {
    display: flex;
  }

  .navbar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1049;
  }

  .navbar-overlay.active {
    display: block;
  }

  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    min-height: 80vh;
  }

  .hero__title {
    font-size: 2.2rem;
  }

  .hero__title span {
    font-size: 1.3rem;
  }

  .page-hero {
    min-height: 50vh;
  }

  .page-hero__title {
    font-size: 2rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .footer-grid .footer-col:last-child {
    grid-column: span 2;
  }

  .contact-section .container {
    grid-template-columns: 1fr;
  }

  .newsletter__form {
    flex-direction: column;
  }

  .newsletter__form button {
    width: 100%;
  }
}

/* --- 768px --- */
@media (max-width: 768px) {
  .container {
    max-width: 540px;
  }

  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.6rem; }
  h3 { font-size: 1.3rem; }

  .section-padding {
    padding: 60px 0;
  }

  .tabs__nav--vertical {
    border-right: 2px solid var(--border);
    border-bottom: 0;
    margin-bottom: 10px;
  }

  .tabs__nav--vertical .tabs__btn {
    border-right: 3px solid transparent;
    border-bottom: 0;
    text-align: left;
  }

  .tabs__nav--vertical .tabs__btn.active {
    border-right-color: var(--accent);
    border-bottom-color: transparent;
  }

  .section-header {
    margin-bottom: 40px;
  }

  .section-header__title {
    font-size: 1.7rem;
  }

  .hero {
    min-height: 70vh;
  }

  .hero__title {
    font-size: 1.8rem;
    letter-spacing: 1px;
  }

  .hero__title span {
    font-size: 1.1rem;
  }

  .hero__subtitle {
    font-size: 1rem;
  }

  .hero__btn {
    padding: 12px 30px;
    font-size: 0.85rem;
  }

  .hero__btn--outline {
    margin-left: 0;
    margin-top: 10px;
  }

  .page-hero {
    min-height: 45vh;
  }

  .page-hero__title {
    font-size: 1.8rem;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .news-card__body {
    padding: 20px;
  }

  .numbers-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .stat-card {
    padding: 30px 15px;
  }

  .stat-card__number {
    font-size: 2.2rem;
  }

  .stat-card__icon {
    width: 55px;
    height: 55px;
    font-size: 1.4rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-grid .footer-col:last-child {
    grid-column: span 1;
  }

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

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

  .about-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 5px;
  }

  .about-tab {
    white-space: nowrap;
    padding: 10px 18px;
    font-size: 0.85rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .staff-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .event-card {
    flex-direction: column;
  }

  .event-card__date {
    width: 100%;
    flex-direction: row;
    gap: 10px;
    padding: 15px 20px;
  }

  .event-card__date-day {
    font-size: 1.5rem;
  }

  .partners-scroll__track {
    gap: 40px;
  }

  .cookie-consent .container {
    flex-direction: column;
    text-align: center;
  }

  .resource-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .tabs__nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .tabs__btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .resource-item__download {
    width: 100%;
    text-align: center;
  }

  .publication-item .d-flex {
    flex-wrap: wrap;
  }

  .page-head__actions,
  .page-head__actions .btn {
    width: 100%;
  }

  .lightbox__nav {
    font-size: 1.5rem;
    padding: 10px;
  }

  .lightbox__prev {
    left: 10px;
  }

  .lightbox__next {
    right: 10px;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }

  /* Make tables scrollable on mobile */
  .table-responsive-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -15px;
    padding: 0 15px;
  }

  .table-responsive-wrap table {
    min-width: 600px;
  }
}

/* --- 576px --- */
@media (max-width: 576px) {
  .container {
    max-width: 100%;
    padding: 0 15px;
  }

  .navbar-brand__name {
    max-width: 145px;
    overflow: hidden;
    font-size: 0.72rem;
    line-height: 1.15;
    white-space: normal;
  }

  .navbar-brand img {
    width: 34px;
    height: 34px;
    object-fit: contain;
  }

  .navbar-toggler {
    flex-shrink: 0;
    padding: 0.35rem 0.5rem;
  }

  .page-hero {
    background-attachment: scroll;
  }

  .home-staff-list {
    margin-right: -15px;
    margin-left: -15px;
    padding-right: 15px;
    padding-left: 15px;
  }

  .trade-category-index {
    align-items: flex-start;
  }

  .trade-category-index strong {
    width: 100%;
  }

  .newsletter__form {
    width: 100%;
  }

  .newsletter__form input,
  .newsletter__form button {
    width: 100%;
    min-width: 0;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.2rem; }

  .hero {
    min-height: 65vh;
  }

  .hero__title {
    font-size: 1.5rem;
  }

  .hero__title span {
    font-size: 1rem;
  }

  .page-hero {
    min-height: 40vh;
  }

  .page-hero__title {
    font-size: 1.5rem;
  }

  .numbers-grid {
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }

  .stat-card {
    padding: 25px 12px;
  }

  .stat-card__number {
    font-size: 1.8rem;
  }

  .stat-card__label {
    font-size: 0.75rem;
  }

  .newsletter__images {
    grid-template-columns: 1fr;
  }

  .newsletter__images img:first-child {
    grid-row: span 1;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .staff-grid {
    grid-template-columns: 1fr;
  }

  .section-padding {
    padding: 50px 0;
  }

  .pagination a,
  .pagination span {
    min-width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }

  .footer-social a {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }
}

/* --- 480px --- */
@media (max-width: 480px) {
  .hero {
    min-height: 60vh;
  }

  .hero__title {
    font-size: 1.3rem;
    letter-spacing: 0.5px;
  }

  .hero__title span {
    font-size: 0.95rem;
  }

  .hero__subtitle {
    font-size: 0.9rem;
  }

  .hero__btn {
    padding: 12px 25px;
    font-size: 0.8rem;
    display: block;
    text-align: center;
  }

  .news-grid {
    gap: 20px;
  }

  .section-header__subtitle {
    font-size: 0.72rem;
    letter-spacing: 2px;
  }

  .card-custom__body {
    padding: 20px;
  }

  .resource-item__info {
    width: 100%;
  }

  .news-img-wrap {
    height: 180px;
  }

  .numbers-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    display: flex;
    gap: 20px;
    text-align: left;
    padding: 20px;
  }

  .stat-card__icon {
    margin: 0;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    flex-shrink: 0;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .contact-info-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .newsletter__form input {
    padding: 12px 15px;
  }

  .newsletter__form button {
    padding: 12px 20px;
  }

  .nav-menu {
    width: 280px;
  }
}

/* --- 360px --- */
@media (max-width: 360px) {
  .hero {
    min-height: 55vh;
  }

  .hero__title {
    font-size: 1.2rem;
  }

  .page-hero__title {
    font-size: 1.3rem;
  }

  .stat-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .about-tabs .about-tab {
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  .resource-item__info {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --- Print --- */
@media print {
  .navbar,
  .back-to-top,
  .cookie-consent,
  .footer-social,
  .newsletter,
  .hamburger {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
  }

  .hero,
  .page-hero {
    min-height: auto;
    background: none;
  }

  .hero::before,
  .page-hero::before {
    display: none;
  }

  .hero__title,
  .page-hero__title {
    color: #000;
  }
}
