/* ==========================================================================
   RESPONSIVE.CSS
   ---------------------------------------------------------------------
   Loaded after style.css. Contains:
   1. Accessibility helpers (skip link, focus states, reduced motion)
   2. Hamburger menu (mobile/tablet off-canvas navigation)
   3. Breakpoint overrides for every page, from tablet (1024px) down to
      small mobile (380px)

   Breakpoints used throughout:
     - 1024px : tablet
     - 768px  : small tablet / large phone
     - 480px  : phone
   ========================================================================== */

/* ==========================================================================
   1. Accessibility
   ========================================================================== */

/* Skip link: visually hidden until it receives keyboard focus */
.skip-link {
  position: absolute;
  top: -60px;
  right: 16px;
  z-index: 2000;
  background: var(--dark-purple, #16124E);
  color: #FFFFFF;
  font-family: 'Assistant', sans-serif;
  font-weight: 600;
  font-size: 16px;
  padding: 12px 20px;
  border-radius: 0 0 10px 10px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* Visible, consistent focus ring for keyboard users on every interactive element */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #262265;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Don't show the ring for mouse users who click (only keyboard focus) */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Ensure all tappable controls meet a comfortable minimum touch-target size on touch devices */
@media (max-width: 1024px) {
  .menu-item,
  .dropdown-link,
  .btn-share-header,
  .btn-submit,
  .btn-join,
  .category-search-btn,
  .hero-search-btn,
  .btn-filter-clear,
  .btn-filter-apply,
  .carousel-arrow,
  .carousel-thumb,
  .btn-load-more {
    min-height: 44px;
    order: 1;
  }
}

/* ==========================================================================
   2. Hamburger Menu
   ========================================================================== */

.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
  flex-shrink: 0;
}

.hamburger-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 26px;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--primary-color, #262265);
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.hamburger-btn.is-open .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.is-open .hamburger-line:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.is-open .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Dark backdrop shown behind the open mobile menu */
body.mobile-menu-open {
  overflow: hidden;
}

body.mobile-menu-open::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(17, 13, 61, 0.45);
  z-index: 999;
}

@media (max-width: 1024px) {
  .hamburger-btn {
    display: flex;
    order: 2;
  }

  .logo-container {
    order: 1;
  }

  .btn-share-header {
    order: 3;
  }

  .main-header {
    padding: 11px 20px;
    flex-wrap: nowrap;
  }

  /* Off-canvas nav panel */
  .main-menu {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(320px, 82vw);
    background: #FFFFFF;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 100px 28px 32px 28px;
    box-shadow: -8px 0 40px rgba(17, 13, 61, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    z-index: 1000;
  }

  .main-menu.is-open {
    transform: translateX(0);
  }

  .main-menu .menu-item {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid rgba(38, 34, 101, 0.08);
    justify-content: space-between;
  }

  .dropdown-wrapper {
    width: 100%;
  }

  .dropdown-toggle {
    width: 100%;
    justify-content: space-between;
  }

  /* On mobile the dropdown behaves like an accordion instead of a floating flyout */
  .dropdown-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    padding: 0 0 0 16px;
    opacity: 1;
    visibility: visible;
    transform: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    gap: 16px;
  }

  .dropdown-wrapper.is-open .dropdown-menu {
    max-height: 400px;
    padding: 16px 0 8px 16px;
  }

  .dropdown-link::before {
    display: none;
  }
}

@media (max-width: 480px) {
  .main-menu {
    width: 100%;
    max-width: 100%;
  }
}


/* ==========================================================================
   3. Header & Logo
   ========================================================================== */

@media (max-width: 1024px) {
  .main-header {
    height: auto;
    min-height: 84px;
  }

  .logo-box {
    width: 48px;
    height: 58px;
  }

  .logo-text {
    font-size: 18px;
  }

  .btn-share-header {
    width: auto;
    padding: 0 18px;
    height: 44px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .logo-text {
    display: none;
  }

  .btn-share-header {
    padding: 0 14px;
    font-size: 14px;
  }
}

/* ==========================================================================
   4. Global Layout / Typography
   ========================================================================== */

@media (max-width: 1024px) {
  .page-container,
  .main-footer {
    padding-left: 24px;
    padding-right: 24px;
  }

  .page-container {
    padding-bottom: 30px;
  }

  .page-main-title {
    font-size: 40px;
  }

  .page-description {
    font-size: 20px;
  }

  .section-heading-lg {
    font-size: 32px;
  }
}

@media (max-width: 480px) {
  .page-container,
  .main-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .main-footer {
    padding-top: 40px;
  }

  .page-main-title {
    font-size: 30px;
  }

  .page-description {
    font-size: 18px;
  }

  .breadcrumbs {
    font-size: 14px;
  }

  .section-heading-lg {
    font-size: 26px;
  }
}

/* ==========================================================================
   5. Form Pages (form.html / thanks.html)
   ========================================================================== */

@media (max-width: 1024px) {
  .form-header-section {
    margin: 32px auto 24px auto;
  }

  .form-wrapper {
    padding: 24px 20px;
    gap: 28px;
  }

  .grid-3-cols,
  .grid-2-cols,
  .uploaded-files-container {
    grid-template-columns: 1fr;
  }

  .form-bottom-row {
    flex-direction: column;
  }

  .form-actions {
    max-width: 100%;
    width: 100%;
    align-items: stretch;
  }

  .btn-submit {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 22px;
  }

  .upload-dropzone {
    height: 170px;
    padding: 16px;
  }

  .success-section {
    margin: 40px auto 40px auto;
  }

  .main-heading {
    font-size: 30px;
  }

  .body-text,
  .reference-number {
    font-size: 18px;
  }
}

/* ==========================================================================
   6. About Page
   ========================================================================== */

@media (max-width: 1024px) {
  .about-hero,
  .about-video-section,
  .about-split-section,
  .faq-section,
  .carousel-section,
  .useful-links-section {
    max-width: 100%;
  }

  .about-split-section {
    flex-direction: column;
    gap: 24px;
  }

  .about-split-image {
    width: 100%;
    height: auto;
    aspect-ratio: 430 / 338;
  }

  .faq-question-text {
    font-size: 18px;
  }

  .carousel-card {
    padding: 20px;
  }

  .carousel-main {
    flex-direction: column;
  }

  .carousel-main-image {
    width: 100%;
    height: auto;
    aspect-ratio: 740 / 468;
  }

  .carousel-thumbs {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .about-paragraph,
  .about-split-text p {
    font-size: 16px;
  }

  .carousel-thumb {
    /* width: 100px; */
    /* height: 76px; */
  }

  .link-text {
    font-size: 16px;
  }
}

/* ==========================================================================
   7. Home Page
   ========================================================================== */

@media (max-width: 1024px) {
  .hero-banner {
    height: 420px;
  }

  .hero-title-regular,
  .hero-title-bold {
    font-size: 34px;
  }

  .hero-subtitle {
    font-size: 20px;
  }

  .hero-search {
    height: auto;
    flex-wrap: wrap;
    padding: 16px 20px;
  }

  .hero-search-btn {
    width: 100%;
    order: 3;
  }

  .hero-search-input {
    order: 1;
    width: 100%;
  }

  .hero-search-icon {
    order: 2;
  }

  .home-intro {
    font-size: 20px;
  }

  .join-section-centered {
    padding: 32px 24px;
  }

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

  .recent-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

@media (max-width: 640px) {
  .hero-banner {
    /* height: 320px; */
    border-radius: 14px;
  }

  .hero-title-regular,
  .hero-title-bold {
    font-size: 24px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .category-cards {
    grid-template-columns: 1fr;
  }

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

  .category-card {
    height: 260px;
  }
}

@media (max-width: 480px) {
  .recent-cards {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   8. Product Page
   ========================================================================== */

@media (max-width: 1200px) {
  .product-top,
  .product-bottom {
    flex-direction: column;
  }

  .product-media-col,
  .product-links-section {
    max-width: 100%;
    flex-basis: auto;
    width: 100%;
  }

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

@media (max-width: 1024px) {
  .product-title {
    font-size: 28px;
  }

  .product-main-image {
    height: auto;
    aspect-ratio: 740 / 518;
  }

  .product-info-header {
    flex-wrap: wrap;
  }

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

@media (max-width: 640px) {
  .product-meta-grid.grid-3-cols {
    grid-template-columns: 1fr 1fr;
  }

  .product-carousel-controls {
    flex-wrap: wrap;
    gap: 16px;
  }

  .product-thumbs {
    width: 100%;
    justify-content: flex-start;
  }

  .product-more-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .product-meta-grid.grid-3-cols {
    grid-template-columns: 1fr;
  }

  .product-download-btn span {
    display: none;
  }

  .product-photo-badge,
  .product-download-btn {
    width: 40px;
    padding: 0;
    justify-content: center;
  }
}

/* ==========================================================================
   9. Category / Search Pages
   ========================================================================== */

@media (max-width: 1200px) {
  .category-layout {
    flex-direction: column;
  }

  .category-sidebar {
    max-width: 100%;
    flex-basis: auto;
    position: static;
    width: 100%;
  }

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

@media (max-width: 1024px) {
  .category-hero {
    height: 300px;
  }

  .category-hero-title {
    font-size: 30px;
  }

  .category-search-title {
    font-size: 30px;
  }

  .category-search-subtitle {
    font-size: 18px;
  }

  .category-search-form {
    height: auto;
    flex-wrap: wrap;
    padding: 16px 20px;
  }

  .category-search-btn {
    width: 100%;
    order: 3;
  }

  .category-search-input {
    order: 1;
    width: 100%;
  }

  .category-search-icon {
    order: 2;
  }

  .filter-actions {
    flex-direction: column-reverse;
  }
}

@media (max-width: 640px) {
  .archive-grid {
    grid-template-columns: 1fr;
  }

  .category-hero-title {
    font-size: 24px;
  }

  .category-hero-subtitle {
    font-size: 15px;
  }
}

/* ==========================================================================
   10. Join / CTA Section (shared across pages)
   ========================================================================== */

@media (max-width: 1024px) {
  .join-section {
    flex-direction: column;
    padding: 32px 24px;
    text-align: center;
    gap: 24px;
  }

  .join-text {
    text-align: center;
    max-width: 100%;
  }

  .join-title {
    font-size: 28px;
  }

  .join-description {
    font-size: 17px;
  }

  .btn-join {
    width: 100%;
  }
}

/* ==========================================================================
   11. Footer
   ========================================================================== */

@media (max-width: 1024px) {
  .footer-top {
    flex-wrap: wrap;
    gap: 32px;
    padding-bottom: 32px;
  }

  .brand-col {
    max-width: 100%;
    order: -1;
    flex: 1 1 100%;
  }

  .footer-bottom {
    height: auto;
    flex-direction: column;
    gap: 12px;
    padding: 16px 0;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer-top {
    flex-direction: column;
    gap: 28px;
  }

  .footer-logo-wrapper {
    flex-wrap: wrap;
  }

  .footer-text-stack {
    max-width: 100%;
  }

  /* Footer accordion: "קישורים מהירים" / "מידע נוסף" collapse on small mobile */
  .footer-accordion-toggle .footer-accordion-icon {
    display: block;
  }

  .footer-accordion-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Assistant', sans-serif;
    padding: 14px 0;
    border-bottom: 1px solid rgba(38, 34, 101, 0.1);
  }

  .footer-accordion-icon {
    flex-shrink: 0;
    transition: transform 0.2s ease;
  }

  .footer-accordion-toggle[aria-expanded="true"] .footer-accordion-icon {
    transform: rotate(180deg);
  }

  .links-col .footer-links {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    gap: 0;
  }

  .links-col .footer-links li {
    padding: 8px 0;
  }

  .footer-accordion-toggle[aria-expanded="true"] + .footer-links {
    max-height: 300px;
    padding-top: 4px;
  }
}

@media(max-width: 1024px){
  .footer-description br{display: none;}
  .faq-section {
      margin-top: 60px;
  }
  .carousel-section {
      margin-top: 60px;
  }
  .join-section {
      margin-top: 60px;
  }
  .useful-links-section {
      margin-top: 60px;
  }
  .carousel-arrow-wrap{
    display: flex;
    gap:10px;
  }
}