/* Panchang (web/panchang/): the date and city controls, the five limbs, the "Times to know" bar and list, and the
   planetary hours. Page-only classes, prefixed pc-. Tokens only; positions on the bar are set from panchang.js. */

.pc-main { gap: 0; padding-top: 0; }
.pc-hero { display: flex; flex-direction: column; gap: 0; padding: var(--hero-pad) 0 clamp(28px, 4vw, 40px); }
.pc-controls { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }
.pc-hero .meta { margin-top: 16px; }
.pc-lead { max-width: 60ch; margin-top: 20px; }

/* Date: the native date field lies over the words, so a click or a tap opens the browser's own picker. */
.pc-date { display: flex; align-items: center; gap: 6px; }
.pc-date-pick { position: relative; display: flex; align-items: center; justify-content: center; min-width: 210px; min-height: 40px; padding: 0 8px; border-radius: var(--radius-md); cursor: pointer; }
.pc-date-pick:hover { background: var(--fill-hover); }
.pc-date-pick:focus-within { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.pc-date-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.pc-date-pick input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.pc-date-label { font-size: 18px; font-weight: 500; color: var(--text-strong); text-align: center; white-space: nowrap; }
#today:disabled { opacity: 0.45; }

/* City: a button with a small search panel under it. */
.pc-city { position: relative; margin-left: auto; }
.pc-city-btn { max-width: 18em; font-weight: 400; }
.pc-city-btn .city-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pc-city-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: min(360px, calc(100vw - 2 * var(--gutter))); padding: 14px; border-radius: var(--radius-lg); background: var(--color-surface); box-shadow: var(--shadow-lg); }
@media (max-width: 600px) {
  .pc-date { flex: 1 1 100%; }
  .pc-date-pick { flex: 1; min-width: 0; }
  .pc-controls { gap: 12px; }
  .pc-city { position: static; margin-left: 0; }
  .pc-city-panel { left: 0; right: 0; width: auto; }
}

/* The five limbs */
.pc-limbs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--gap-grid); }
.pc-limb { display: flex; flex-direction: column; gap: 6px; padding: 18px 16px; border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-sm); min-width: 0; }
.pc-limb-label { display: flex; align-items: center; gap: 8px; }
.pc-limb-label .icon { width: 16px; height: 16px; }
.pc-limb-desc { margin-top: -2px; line-height: 1.4; }
.pc-limb .value { margin-top: 4px; font-size: clamp(19px, 1.9vw, 22px); overflow-wrap: break-word; }

/* Sections */
.pc-section { padding-top: clamp(40px, 6vw, 64px); }
.pc-section:last-child { padding-bottom: clamp(16px, 4vw, 32px); }
.pc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; }
.pc-head .tag { align-self: center; }
.pc-intro { max-width: 62ch; margin-top: 14px; font-size: 15px; line-height: 1.6; color: var(--text-body); }

/* Times to know: daylight as a bar, each period placed by its time. Periods may overlap. */
.pc-daybar-wrap { margin-top: 28px; }
.pc-daybar-ends { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-body); }
.pc-daybar-ends > span { display: inline-flex; align-items: center; gap: 6px; }
.pc-daybar { position: relative; height: 44px; margin-top: 10px; overflow: hidden; border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-sm); }
.pc-span { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap; font-size: 11px; color: var(--color-neutral-100); background: var(--color-neutral-800); border-inline: 1px solid var(--color-neutral-500); }
.pc-span.is-good { background: var(--color-accent-800); border-color: var(--color-accent-300); }
@media (max-width: 560px) { .pc-span { font-size: 10px; } }
@media (max-width: 340px) { .pc-span > span { display: none; } }

.pc-times { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 0 40px; }
.pc-times li { display: flex; align-items: center; gap: 12px; padding: 14px 0; background: var(--rule) no-repeat bottom / 100% 1px; }
.pc-key { flex: none; width: 10px; height: 10px; border-radius: 2px; background: var(--color-neutral-500); }
.pc-times li.is-good .pc-key { background: var(--color-accent-300); }
.pc-times-name { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pc-times-name > span:first-child { font-size: 16px; font-weight: 500; color: var(--text-strong); }
.pc-times-when { font-size: 15px; color: var(--text-strong); white-space: nowrap; }

/* Planetary hours */
.pc-halves { display: flex; flex-wrap: wrap; gap: 28px 40px; margin-top: 28px; }
.pc-half { flex: 1 1 320px; min-width: 0; }
.pc-half-head { display: flex; align-items: center; gap: 8px; }
.pc-half-head .icon { width: 16px; height: 16px; color: currentColor; }
.pc-half-len { text-transform: none; letter-spacing: 0; white-space: nowrap; color: var(--text-meta); }
.pc-hours { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--gap-grid-dense); }
.pc-hour { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-sm); min-width: 0; }
.pc-hour.is-selected { background: var(--fill-selected); box-shadow: var(--ring-selected); }
.pc-hour .planet { width: 32px; height: 32px; }
.pc-hour > span { display: flex; flex-direction: column; min-width: 0; }
.pc-hour-name { font-size: 14px; font-weight: 500; color: var(--text-strong); }
.pc-hour .meta { font-size: 12px; }
@media (max-width: 420px) {
  .pc-hours { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pc-hour { gap: 8px; padding: 8px; }
  .pc-hour .planet { width: 24px; height: 24px; }
  .pc-hour .meta { font-size: 11px; white-space: nowrap; }
  .pc-date-label { font-size: 16px; }
}
