/* static/css/calendar_responsive.css */

/* ====== タブレット以下：案件モーダル/プレビュー ====== */

@media (max-width: 48rem) {
  .project-modal__dialog {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
  }

  .project-modal__columns {
    grid-template-columns: 1fr;
  }

  .project-modal__move-buttons {
    flex-direction: row;
    justify-content: center;
  }

  .project-modal__user-list {
    min-height: 11.25rem;
    max-height: 13.75rem;
  }

  .preview-modal__dialog {
    width: calc(100vw - 1rem);
    margin: 0.5rem auto;
    max-height: calc(100vh - 1rem);
  }

  .preview-modal__body {
    max-height: calc(100vh - 9.375rem);
    padding: 0.75rem;
  }
}

/* ====== スマホ対応 ====== */

@media only screen and (max-width: 43.75rem) {
  html,
  body {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .container {
    width: 100%;
    max-width: 100%;
    font-size: 0.9rem;
    padding: 1rem 0.5rem;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .container > .container.two-column-layout {
    padding-left: 0;
    padding-right: 0;
  }

  .two-column-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
    overflow-x: visible;
  }

  .left-column {
    display: contents;
  }

  .right-column {
    order: 3;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  #schedule-link-mode-box {
    order: 1;
    width: 100%;
    box-sizing: border-box;
  }

  .tentative-section {
    order: 2;
    width: 100%;
    box-sizing: border-box;
  }

  .current-label-section {
    order: 4;
    width: 100%;
    box-sizing: border-box;
  }

  .confirmed-section,
  .tentative-section,
  .schedule-link-mode-box,
  .current-label-section {
    padding: 0.6rem 0.9rem 0.75rem;
    margin-bottom: 0;
  }

  .calendar-step-label {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    margin: 0 0 0.6rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.9rem;
    line-height: 1.4;
    box-sizing: border-box;
  }

  .calendar-step-label--calendar {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    margin: 0 0 0.6rem;
  }

  .uniform-width {
    width: 100%;
    max-width: 100%;
  }

  .select-scroll-wrapper {
    max-height: 14rem;
    white-space: normal;
  }

  .custom-project-list li {
    white-space: normal;
  }

  .project-title {
    white-space: normal;
  }

  .button-row {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
  }

  .button-row button {
    flex: 0 0 auto;
    width: auto;
    min-width: 4.5rem;
    height: 1.9rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .button-row #user-list-modal-open-btn {
    min-width: 5.5rem;
  }

  .button-row #confirmed-project-modal-open-btn {
    min-width: 5rem;
  }

  .schedule-link-mode-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .schedule-link-mode-button {
    width: 100%;
    min-width: 0;
    height: 2.5rem;
    font-size: 0.95rem;
  }

  .schedule-link-mode-description {
    max-width: none;
    font-size: 0.85rem;
    line-height: 1.6;
  }

  #calendar {
    width: 100%;
    max-width: 100%;
    margin: 0.75rem 0 0;
  }

  .fc-toolbar {
    gap: 0.25rem;
  }

  .fc-toolbar-title {
    font-size: 1rem !important;
  }

  .fc-button {
    font-size: 0.85rem !important;
    padding: 0.2rem 0.4rem !important;
  }

  .fc .fc-toolbar.fc-header-toolbar {
    margin-bottom: 0.5rem;
  }

  .current-action-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.3rem;
  }

  .current-action-grid .schedule-link-action-box[style*="display: none"] + .preview-modal-open-btn {
    grid-column: 1 / -1;
  }

  .current-action-grid .schedule-link-open-button,
  .current-action-grid .preview-modal-open-btn {
    width: 100%;
    height: 2.5rem;
    padding: 0.2rem 0.15rem;
    font-size: clamp(0.6rem, 3.2vw, 0.85rem);
    white-space: nowrap;
    overflow: hidden;
    letter-spacing: -0.02em;
  }

  .schedule-link-modal__dialog {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
  }

  .schedule-link-modal__body {
    max-height: calc(100vh - 9.5rem);
    padding: 0.75rem;
  }

  .schedule-link-row {
    flex-direction: column;
    align-items: stretch;
  }

  .schedule-link-input {
    width: 100%;
    box-sizing: border-box;
  }

  .schedule-link-copy-button {
    width: 100%;
  }

  #project-modal-public-password-row,
  #project-modal-clear-public-password-row {
    padding: 0.75rem;
  }

  #project-modal-clear-public-password-row {
    grid-template-columns: auto 1fr;
  }

  #project-modal-public-password-input {
    height: 2.5rem;
    font-size: 0.95rem;
  }

  .project-modal__password-status {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .project-modal__password-status-badge {
    min-width: 0;
  }

  .project-modal__password-status-text {
    font-size: 0.85rem;
  }

  .table-scroll-wrapper {
    overflow-x: auto;
  }

  #selected-dates {
    min-width: 48rem;
  }
}