/* Responsive CSS for nsrp-next */

/* Desktop First Approach */
* {
  box-sizing: border-box;
}

/* Base styles - Desktop (1920px+) */
html {
  font-size: 16px;
}

/* Large Desktop (1440px - 1920px) */
@media screen and (max-width: 1920px) {
  #wrap {
    max-width: 100%;
  }

  .main_visual .section-slides {
    width: 100%;
  }

  .section-slides > .slides-container {
    width: 100%;
  }

  .section-slides > .slides-container > p {
    width: 100vw;
  }
}

/* Desktop (1200px - 1440px) */
@media screen and (max-width: 1440px) {
  #wrap {
    max-width: 100%;
  }

  #wrap > header > p {
    left: 2%;
    width: 250px;
  }

  .pc_menu {
    right: 2%;
  }
}

/* Tablet Landscape (992px - 1200px) */
@media screen and (max-width: 1200px) {
  #wrap {
    max-width: 100%;
    overflow-x: hidden;
  }

  #wrap > header > p {
    width: 200px;
    height: 150px;
  }

  .pc_menu {
    display: none !important;
  }

  #toggle {
    display: block !important;
  }

  .main_visual {
    height: auto;
    min-height: 500px;
  }

  .hyperlink_page ul {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  #announcement {
    padding: 50px 20px;
  }

  .page {
    padding: 50px 20px;
  }

  table {
    font-size: 14px;
  }
}

/* Tablet Portrait (768px - 992px) */
@media screen and (max-width: 992px) {
  #wrap > header {
    padding: 10px 0;
  }

  #wrap > header > p {
    width: 180px;
    height: 120px;
  }

  .main_visual .slides-container p a {
    font-size: 0;
  }

  .slides-pagination {
    bottom: 20px;
  }

  #announcement .apply .board {
    padding: 30px;
  }

  .hyperlink_page ul {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }

  .hyperlink_dote {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* Mobile Large (576px - 768px) */
@media screen and (max-width: 768px) {
  html {
    font-size: 14px;
  }

  #wrap {
    overflow-x: hidden;
  }

  #wrap > header {
    height: 70px;
    padding: 10px 0;
  }

  #wrap > header > p {
    left: 5%;
    width: 150px;
    height: 80px;
    background-image: url(../images/logo_small.png);
  }

  .pc_menu {
    display: none !important;
  }

  #toggle {
    display: block !important;
    right: 5%;
  }

  .main_visual {
    height: auto;
    min-height: 400px;
  }

  .section-slides > .slides-container > p {
    width: 100vw;
    height: 400px;
  }

  .mouse {
    display: none;
  }

  .slides-navigation {
    display: none;
  }

  .slides-pagination {
    bottom: 10px;
  }

  .slides-pagination li {
    margin: 0 5px;
  }

  #announcement {
    padding: 30px 15px;
  }

  #announcement .apply .board {
    padding: 20px;
  }

  #announcement .apply .board h3 {
    font-size: 1.5rem;
  }

  #announcement .apply dl dt a {
    font-size: 0.9rem;
  }

  .dote {
    padding: 50px 15px;
  }

  .hyperlink_page {
    padding: 30px 15px;
  }

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

  .hyperlink_page ul li a {
    padding: 15px 10px;
    font-size: 0.9rem;
  }

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

  .page {
    padding: 30px 15px;
  }

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

  .page table {
    font-size: 12px;
  }

  .page table th,
  .page table td {
    padding: 8px 5px;
  }

  .question {
    width: 100%;
  }

  .question th {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px;
    background: #f5f5f5;
  }

  .question td {
    display: block;
    width: 100%;
    padding: 10px;
  }

  .question input[type="text"],
  .question textarea {
    width: 100% !important;
  }

  footer {
    padding: 30px 15px;
  }

  footer address {
    font-size: 0.8rem;
  }

  .topbar,
  .underbar {
    right: 10px;
    bottom: 10px;
  }

  .topbar img,
  .underbar img {
    width: 40px;
    height: 40px;
  }

  .bg_train {
    display: none;
  }
}

/* Mobile Medium (425px - 576px) */
@media screen and (max-width: 576px) {
  html {
    font-size: 13px;
  }

  #wrap > header {
    height: 60px;
  }

  #wrap > header > p {
    width: 120px;
    height: 60px;
  }

  .section-slides > .slides-container > p {
    height: 300px;
  }

  #announcement .apply .board h3 {
    font-size: 1.3rem;
  }

  .hyperlink_page ul {
    grid-template-columns: 1fr;
  }

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

  .page table {
    font-size: 11px;
  }

  .page table th,
  .page table td {
    padding: 6px 3px;
  }

  .num a,
  .num strong {
    padding: 5px 8px;
    font-size: 0.9rem;
  }
}

/* Mobile Small (320px - 425px) */
@media screen and (max-width: 425px) {
  html {
    font-size: 12px;
  }

  #wrap > header {
    height: 55px;
  }

  #wrap > header > p {
    width: 100px;
    height: 50px;
  }

  .section-slides > .slides-container > p {
    height: 250px;
  }

  .slides-pagination {
    display: none;
  }

  #announcement {
    padding: 20px 10px;
  }

  #announcement .apply .board {
    padding: 15px;
  }

  #announcement .apply .board h3 {
    font-size: 1.2rem;
  }

  #announcement .apply .board p {
    font-size: 0.85rem;
  }

  .hyperlink_page {
    padding: 20px 10px;
  }

  .page {
    padding: 20px 10px;
  }

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

  .question th {
    font-size: 0.9rem;
  }

  footer {
    padding: 20px 10px;
  }
}

/* Landscape orientation fixes */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .main_visual {
    height: auto;
    min-height: 300px;
  }

  .section-slides > .slides-container > p {
    height: 300px;
  }

  .mouse {
    display: none;
  }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  #wrap > header > p {
    background-size: contain;
  }
}

/* Overflow fixes for all screen sizes */
body {
  overflow-x: hidden;
}

#wrap {
  overflow-x: hidden;
  position: relative;
}

/* Table responsiveness */
@media screen and (max-width: 768px) {
  .page table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .page table thead {
    display: table-header-group;
  }

  .page table tbody {
    display: table-row-group;
  }
}

/* Form responsiveness */
@media screen and (max-width: 768px) {
  form input[type="text"],
  form input[type="email"],
  form select,
  form textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Grid layout improvements for modern browsers */
@supports (display: grid) {
  .hyperlink_page ul,
  .hyperlink_dote {
    display: grid;
  }
}

/* Flexbox fallback for older browsers */
@supports not (display: grid) {
  .hyperlink_page ul,
  .hyperlink_dote {
    display: flex;
    flex-wrap: wrap;
  }

  .hyperlink_page ul li,
  .hyperlink_dote li {
    flex: 0 0 calc(33.333% - 20px);
  }

  @media screen and (max-width: 768px) {
    .hyperlink_page ul li,
    .hyperlink_dote li {
      flex: 0 0 calc(50% - 10px);
    }
  }
}
