/**
 * Responsive CSS
 * Responsive styles for mobile, tablet and desktop
 */

/* ========================================
   DESKTOP - LARGE SCREENS (> 1200px)
   ======================================== */

@media (min-width: 1200px) {
  .layout .container {
    max-width: 1140px;
  }
}

/* ========================================
   DESKTOP - MEDIUM SCREENS / SMALL LAPTOPS (992px - 1199px)
   Medium screen optimization
   ======================================== */

@media (min-width: 992px) and (max-width: 1199px) {

  /* Container - optimized for small laptops */
  .layout .container {
    max-width: 100%;
    padding-left: 25px;
    padding-right: 25px;
  }

  /* Layout spacing */
  .layout {
    margin-bottom: 2.25rem;
  }

  /* 3-column layouts optimized */
  .layout--threecol-section {
    gap: 1.5rem;
  }

  .layout--threecol-section--33-34-33 > .layout__region {
    flex: 1 1 calc(33.333% - 1rem);
  }

  /* Custom 3-column layout optimized */
  .layout--threecol-section--50-25-25 {
    gap: 1.75rem;
  }

  .layout--threecol-section--50-25-25 > .layout__region--first {
    flex: 0 0 43%;
    max-width: 43%;
  }

  .layout--threecol-section--50-25-25 > .layout__region--second {
    flex: 0 0 38%;
    max-width: 38%;
  }

  .layout--threecol-section--50-25-25 > .layout__region--third {
    flex: 0 0 16%;
    max-width: 16%;
    padding-right: 0.75rem;
  }

  /* Typography for better readability */
  .layout--threecol-section .field__item h2,
  .layout--twocol-section .field__item h2 {
    font-size: 1.05rem;
  }

  .layout--threecol-section .field__item p,
  .layout--twocol-section .field__item p {
    font-size: 0.95rem;
  }

  /* Rotated boxes */
  div[style*="border-radius:9px"] > div {
    padding: 1.5rem 2.25rem;
  }

  div[style*="border-radius:9px"] h2.h3 {
    font-size: 1.15rem;
  }

  div[style*="border-radius:9px"] h3.h6 {
    font-size: 0.95rem;
  }

  /* Buttons */
  .btn.h6 {
    font-size: 0.85rem;
    padding: 0.45rem 0.9rem;
  }

  /* Full Report card */
  .card.p-2 {
    padding: 0.7rem !important;
  }

  .card.p-2 h2 {
    font-size: 0.875rem;
  }

  /* Director section */
  .layout--threecol-section--50-25-25 img.align-left {
    max-width: 95px;
    width: 23%;
  }

  .layout--threecol-section--50-25-25 img.align-right {
    max-width: 75px;
    width: 25%;
  }
}

/* ========================================
   TABLETS - LARGE / LANDSCAPE (768px - 991px)
   Medium screen optimization
   ======================================== */

@media (min-width: 768px) and (max-width: 991px) {

  /* Container - optimized for tablets */
  .layout .container {
    max-width: 100%;
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Overall layout spacing */
  .layout {
    margin-bottom: 2rem;
  }

  /* Maintain 2-column layouts on tablets */
  .layout--twocol-section--50-50 > .layout__region {
    flex: 0 0 calc(50% - 0.75rem);
    max-width: calc(50% - 0.75rem);
  }

  /* 3-column layouts: keep 3 columns but optimized */
  .layout--threecol-section {
    gap: 1.25rem;
  }

  .layout--threecol-section--33-34-33 > .layout__region {
    flex: 1 1 calc(33.333% - 1rem);
    min-width: 0;
  }

  /* Custom 3-column layout: keep inline but adjust proportions */
  .layout--threecol-section--50-25-25 {
    gap: 1.5rem;
  }

  .layout--threecol-section--50-25-25 > .layout__region--first {
    flex: 0 0 46%;
    max-width: 46%;
  }

  .layout--threecol-section--50-25-25 > .layout__region--second {
    flex: 0 0 36%;
    max-width: 36%;
  }

  .layout--threecol-section--50-25-25 > .layout__region--third {
    flex: 0 0 16%;
    max-width: 16%;
    padding-right: 0.5rem;
  }

  /* Adjust card padding for medium screens */
  .layout--threecol-section .block-content-basic,
  .layout--twocol-section .block-content-basic {
    padding: 0.75rem;
  }

  /* Typography adjustments */
  .layout--threecol-section .field__item h2,
  .layout--twocol-section .field__item h2 {
    font-size: 1rem;
  }

  .layout--threecol-section .field__item p,
  .layout--twocol-section .field__item p {
    font-size: 0.9rem;
  }

  /* Button adjustments */
  .btn.h6 {
    font-size: 0.8rem;
    padding: 0.4rem 0.85rem;
  }

  /* Rotated boxes - reduce padding but maintain two columns */
  div[style*="border-radius:9px"] > div {
    padding: 1.25rem 2rem;
  }

  div[style*="border-radius:9px"] h2.h3 {
    font-size: 1.1rem;
  }

  div[style*="border-radius:9px"] h3.h6 {
    font-size: 0.9rem;
  }

  /* Maintain rotation on tablets */
  div[style*="transform:rotate(-4deg)"] {
    transform: rotate(-3deg) !important;
  }

  /* Full Report card adjustments */
  .card.p-2 {
    padding: 0.65rem !important;
  }

  .card.p-2 h2 {
    font-size: 0.85rem;
  }

  .card.p-2 p {
    font-size: 0.8rem;
  }

  /* Director section image */
  .layout--threecol-section--50-25-25 img.align-left {
    max-width: 90px;
    width: 22%;
  }

  .layout--threecol-section--50-25-25 img.align-right {
    max-width: 70px;
    width: 24%;
  }
}

/* ========================================
   TABLETS - SMALL / PORTRAIT (576px - 767px)
   Medium-small screen optimization
   ======================================== */

@media (min-width: 576px) and (max-width: 767px) {

  /* Container - optimized width for small tablets */
  .layout .container {
    max-width: 100%;
    padding-left: 18px;
    padding-right: 18px;
  }

  /* Layout spacing */
  .layout {
    margin-bottom: 1.75rem;
  }

  /* Maintain 2-column layouts on small tablets */
  .layout--twocol-section {
    gap: 1.25rem;
  }

  .layout--twocol-section--50-50 > .layout__region {
    flex: 0 0 calc(50% - 0.625rem);
    max-width: calc(50% - 0.625rem);
  }

  /* 3-column layouts: convert to 2 columns */
  .layout--threecol-section {
    gap: 1.25rem;
  }

  .layout--threecol-section--33-34-33 > .layout__region--first,
  .layout--threecol-section--33-34-33 > .layout__region--second {
    flex: 0 0 calc(50% - 0.625rem);
    max-width: calc(50% - 0.625rem);
  }

  .layout--threecol-section--33-34-33 > .layout__region--third {
    flex: 1 1 100%;
    max-width: 100%;
  }

  /* Custom 3-column layout: stack vertically */
  .layout--threecol-section--50-25-25 {
    flex-direction: column;
    gap: 1.5rem;
  }

  .layout--threecol-section--50-25-25 > .layout__region {
    flex: 1 1 100%;
    max-width: 100%;
    padding-right: 0;
  }

  /* Typography adjustments */
  .layout--threecol-section .field__item h2,
  .layout--twocol-section .field__item h2 {
    font-size: 1rem;
  }

  .layout--threecol-section .field__item p,
  .layout--twocol-section .field__item p {
    font-size: 0.9rem;
  }

  /* Rotated boxes - less rotation */
  div[style*="transform:rotate(-4deg)"] {
    transform: rotate(-2deg) !important;
  }

  div[style*="border-radius:9px"] > div {
    padding: 1.15rem 1.5rem;
  }

  div[style*="border-radius:9px"] h2.h3 {
    font-size: 1.05rem;
  }

  div[style*="border-radius:9px"] h3.h6 {
    font-size: 0.9rem;
  }

  /* Buttons */
  .btn.h6 {
    font-size: 0.825rem;
    padding: 0.45rem 0.9rem;
  }

  /* Full Report card */
  .card.p-2 {
    padding: 0.75rem !important;
  }

  /* Director section - centered on portrait tablets */
  .layout--threecol-section--50-25-25 img.align-left,
  .layout--threecol-section--50-25-25 img.align-right {
    float: none;
    margin: 0 auto 1rem;
    display: block;
    max-width: 120px;
  }
}

/* ========================================
   MOBILE - LARGE (480px - 575px)
   ======================================== */

@media (min-width: 480px) and (max-width: 575px) {

  /* 2-column layouts -> 1 column on mobile */
  .layout--twocol-section {
    flex-direction: column;
  }

  .layout--twocol-section > .layout__region {
    flex: 1 1 100%;
  }

  /* Custom 3-column layout: collapse to single column */
  .layout--threecol-section--50-25-25 {
    flex-direction: column;
  }

  .layout--threecol-section--50-25-25 > .layout__region {
    flex: 1 1 100%;
    max-width: 100%;
  }

  /* Rotated boxes without rotation on mobile */
  div[style*="transform:rotate(-4deg)"] {
    transform: rotate(0deg) !important;
  }

  div[style*="border-radius:9px"] > div {
    padding: 1rem 1.25rem;
  }
}

/* ========================================
   MOBILE - SMALL (< 480px)
   ======================================== */

@media (max-width: 479px) {

  /* Container with reduced padding */
  .layout .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  /* All layouts in single column */
  .layout--threecol-section,
  .layout--twocol-section,
  .layout--threecol-section--50-25-25 {
    flex-direction: column;
    gap: 1rem;
  }

  .layout__region {
    flex: 1 1 100% !important;
    min-width: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Cards without minimum height */
  .block-content-basic {
    min-height: auto !important;
  }

  /* Images */
  img.align-left,
  img.align-right {
    float: none;
    margin: 0 auto 1rem;
    display: block;
    max-width: 120px;
  }

  .layout--threecol-section img,
  .layout--twocol-section img {
    aspect-ratio: auto;
  }

  /* Rotated boxes */
  div[style*="transform:rotate(-4deg)"] {
    transform: none !important;
    margin-bottom: 1rem;
  }

  div[style*="border-radius:9px"] {
    border-radius: 0.5rem;
  }

  div[style*="border-radius:9px"] > div {
    padding: 0.75rem 1rem;
  }

  /* Smaller titles in rotated boxes */
  div[style*="border-radius:9px"] h2.h3 {
    font-size: 1rem;
  }

  div[style*="border-radius:9px"] h3.h6 {
    font-size: 0.85rem;
  }

  /* Buttons */
  .btn {
    display: block;
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
  }

  /* Main titles */
  .layout h1 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  .layout h1 .h5 {
    font-size: 0.85rem;
  }

  .layout h2.h2 {
    font-size: 1.1rem;
  }

  .layout h2.h5 {
    font-size: 0.95rem;
  }

  /* Full Report card */
  .card.p-2 {
    padding: 0.75rem !important;
  }

  .card.p-2 img {
    max-width: 120px;
  }

  /* Previous Topics */
  .layout--twocol-section p[style*="border-top"] {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .layout--twocol-section p[style*="border-top"] img {
    margin-bottom: 0.5rem;
  }

  /* Reduced spacing */
  .layout {
    margin-bottom: 1.5rem;
  }

  .layout--threecol-section,
  .layout--twocol-section {
    margin-bottom: 1rem;
  }

  /* Reduced inline padding */
  p[style*="font-size:80%"] {
    font-size: 0.85rem !important;
  }
}

/* ========================================
   LANDSCAPE MOBILE (< 768px and landscape)
   ======================================== */

@media (max-width: 767px) and (orientation: landscape) {

  /* Reduce minimum height in landscape */
  .block-content-basic {
    min-height: auto;
  }

  /* Adjust spacing to take advantage of width */
  .layout {
    margin-bottom: 2rem;
  }

  /* Rotated boxes without rotation */
  div[style*="transform:rotate(-4deg)"] {
    transform: rotate(0deg) !important;
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {

  /* Remove transformations for printing */
  div[style*="transform:rotate(-4deg)"] {
    transform: none !important;
  }

  /* Ensure everything is readable */
  .layout {
    margin-bottom: 1.5rem;
  }

  /* Hide interactive elements */
  .btn {
    display: none;
  }

  /* Black borders for printing */
  img[style*="border-top"] {
    border-top-color: #000 !important;
  }
}

/* ========================================
   ACCESSIBILITY - REDUCE MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {

  /* Disable transformations and transitions */
  div[style*="transform:rotate(-4deg)"] {
    transform: none !important;
  }

  .btn,
  div[style*="transform:rotate(-4deg)"] {
    transition: none !important;
  }
}
