/* ==========================================================================
   Chronos — responsive.css
   Layout adjustments for tablets, phones and short landscape screens.
   Loaded after style.css so these rules override the desktop defaults.
   ========================================================================== */

/* ---------- Large tablets / small laptops ---------- */
@media (max-width: 1120px) {
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid .info-card:last-child { grid-column: 1 / -1; }
  .two-col,
  .cal-layout,
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .form-submit { grid-column: 1 / -1; }
}

/* ---------- Tablets & phones: sidebar becomes a drawer ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw);
    transform: translateX(-102%); visibility: hidden;
    transition: transform .3s var(--ease), visibility 0s linear .3s;
    box-shadow: var(--shadow); overflow-y: auto;
  }
  .sidebar.is-open { transform: none; visibility: visible; transition: transform .3s var(--ease), visibility 0s; }
  .sidebar .sidebar-close, .topbar .menu-btn { display: inline-grid; }
  .nav-link[aria-current="page"]::before { left: -1.1rem; }
}

/* ---------- Phones ---------- */
@media (max-width: 600px) {
  body { font-size: 14.5px; }
  h2 { font-size: 1.35rem; }
  .topbar { padding: .65rem 1rem; gap: .5rem; }
  .topbar-actions .icon-btn { width: 42px; height: 42px; }
  #shortcutsBtn { display: none; }

  .dash-grid { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .clock-card { border-radius: 22px; }
  .clock-top { justify-content: center; }
  .clock-actions { width: 100%; }
  .clock-actions .btn, .clock-actions .segmented { flex: 1 1 auto; justify-content: center; }
  .clock-actions .segmented button { flex: 1; padding: 0 .6rem; }

  .form-grid,
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .form-actions .btn { flex: 1 1 auto; }

  .world-grid { grid-template-columns: minmax(0, 1fr); }
  .section-head .btn { width: 100%; }

  .list-item { flex-wrap: wrap; }
  .alarm-time { font-size: 1.7rem; }
  .item-actions { margin-left: auto; }

  .control-row { width: 100%; }
  .control-row .btn { flex: 1 1 0; padding: 0 1rem; min-width: 0; }
  .timer-inputs { gap: .6rem; }

  .cal-weekdays, .cal-grid { gap: 3px; }
  .cal-day { min-height: 48px; border-radius: 11px; font-size: .9rem; }
  .cal-weekdays span { font-size: .65rem; letter-spacing: .02em; }

  .setting { flex-wrap: wrap; }
  .setting select { min-width: 0; flex: 1 1 140px; }

  .toasts { right: .75rem; left: .75rem; width: auto; bottom: calc(.75rem + var(--safe-bottom)); }
  .modal-actions { flex-direction: column-reverse; }
  .ring-time { font-size: 2.7rem; }
  .shortcut-list > div { flex-direction: column; align-items: flex-start; gap: .25rem; }
  .shortcut-list dd { text-align: left; }
}

/* ---------- Very small phones ---------- */
@media (max-width: 360px) {
  main { padding: .75rem; }
  .card { padding: 1rem; border-radius: 16px; }
  .info-big { font-size: 1.9rem; }
  .big-display { font-size: 2.4rem; }
}

/* ---------- Short landscape screens (phones turned sideways) ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .clock-card.is-fullscreen .clock { font-size: min(calc(16cqw * var(--clock-scale)), 40vh); }
  .clock-card.is-fullscreen .clock-actions { bottom: .75rem; }
  .clock-card.is-fullscreen { padding: 2.5rem 1rem 3.5rem; gap: 1vh; }
  .modal-card { padding: 1.1rem; }
  .ring-icon { width: 56px; height: 56px; margin-bottom: .4rem; }
  .ring-icon .icon { width: 28px; height: 28px; }
  .ring-time { font-size: 2.2rem; }
  .modal-actions { margin-top: .9rem; flex-direction: row; }
}

/* ---------- Devices without hover (touch): hide keyboard hints ---------- */
@media (hover: none) {
  .nav-link kbd, .hint { display: none; }
}

/* ---------- Print: just the content ---------- */
@media print {
  .sidebar, .topbar, .toasts, .modal, .loader { display: none !important; }
  body::before { display: none; }
  .app { display: block; }
}
#snoozeBtn { display: inline-block; line-height: 1.2; }
