/* Yonsei Dental: mobile layout correction, 2026-09-08.
   Loaded by front-page.php; desktop rules remain unchanged. */
@media (max-width: 1023px) {
  .spread, .spread .pages, .spread .pagewrap {
    min-width: 0;
    max-width: 100%;
  }

  .spread .pages section {
    min-width: 0;
    width: 100%;
    height: auto;
    max-height: none;
    justify-content: flex-start;
    padding-top: calc(var(--nav-h, 4.1rem) + 24px) !important;
    padding-left: 20px;
    padding-right: 20px;
    scroll-margin-top: calc(var(--nav-h, 4.1rem) + 16px);
  }

  .spread .pages section.active {
    animation: none;
    transform: none;
  }

  .spread .sec-tabs {
    order: -1;
    position: relative !important;
    top: auto !important;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0 0 28px;
    padding: 0 0 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    font-size: 13px;
    line-height: 1.6;
    letter-spacing: 0;
  }

  .spread .sec-tabs a {
    display: block;
    flex: 0 0 auto;
    white-space: nowrap !important;
    padding: 8px 0;
  }

  #doctors .doctor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 24px;
    width: 100%;
    max-width: 100%;
    align-items: start;
  }

  #doctors .doctor .portrait {
    width: min(78%, 280px) !important;
    max-width: 280px !important;
    height: auto !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    overflow: visible !important;
  }

  #doctors .doctor .portrait img {
    display: block;
    position: static !important;
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    object-position: center;
    transform: none !important;
    margin: 0;
  }

  #doctors .doctor .info { min-width: 0; width: 100%; }
  #doctors .doctor .name { gap: 8px 12px; align-items: center; }
  #doctors .doctor .name h3 { font-size: 23px; }
  #doctors .doctor .fields { font-size: 14px; line-height: 1.8; }
  #doctors .doctor li {
    font-size: 14px;
    line-height: 1.85;
    overflow-wrap: anywhere;
  }
  #doctors .doctor + .doctor { margin-top: 32px; padding-top: 32px; }

  .spread .m-plate:empty { display: none; }
  .spread .m-plate .photo { max-width: 100%; height: auto; }
  .spread .m-plate .photo img {
    width: 100%; height: auto; max-height: none;
    aspect-ratio: auto; object-fit: contain;
  }
}

@media (max-width: 560px) {
  .runbar {
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    gap: 8px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .runbar .brand { min-width: 0; }
  .runbar .brand img {
    width: 108px; max-width: 100%; height: auto;
  }
  .runbar .now {
    font-size: 12px; letter-spacing: 0; gap: 5px;
    padding: 4px 0; white-space: nowrap;
  }
  .runbar .tools { gap: 10px; }
  .runbar .btn-seal {
    font-size: 11px; letter-spacing: 0;
    padding: 7px 9px; white-space: nowrap;
  }
  .runbar .menu-btn { width: 22px; flex: 0 0 22px; }
}
