/* App-specific composition layered on top of Logan Brand web kit. */

.atx-wordmark {
  font-size: 1.875rem;
}

@media (max-width: 650px) {
  .atx-wordmark {
    font-size: 1.5rem;
  }
}

.atx-section-top {
  margin-block: var(--lb-space-6) var(--lb-space-8);
}

.atx-section {
  margin-block: var(--lb-space-8);
}

.atx-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--lb-space-4);
  margin-bottom: var(--lb-space-3);
}

.atx-head-actions {
  display: flex;
  align-items: center;
  gap: var(--lb-space-2);
  flex-wrap: wrap;
}

.atx-view-switch {
  display: inline-flex;
  border-top: 1px solid var(--lb-border);
  border-left: 1px solid var(--lb-border);
}

.atx-view-switch button {
  min-height: 36px;
  padding: var(--lb-space-1) var(--lb-space-4);
  border: 0;
  border-right: 1px solid var(--lb-border);
  border-bottom: 1px solid var(--lb-border);
  border-radius: var(--lb-radius);
  background: var(--lb-surface);
  color: var(--lb-muted);
  font-size: var(--lb-text-control);
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--lb-duration), color var(--lb-duration);
}

.atx-view-switch button:hover {
  background: var(--lb-hover);
  color: var(--lb-ink);
}

.atx-view-switch button.is-active {
  background: var(--lb-featured);
  color: var(--lb-ink);
  font-weight: 600;
}

.atx-metric-label {
  font-size: var(--lb-text-control);
  color: var(--lb-muted);
}

/* Subscription box */
.atx-sub-box {
  border: 1px solid var(--lb-border);
  background: var(--lb-surface);
  padding: var(--lb-space-6);
  display: grid;
  gap: var(--lb-space-4);
}

.atx-sub-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--lb-space-2);
  align-items: stretch;
}

.atx-url-display {
  flex: 1 1 320px;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: var(--lb-space-2) var(--lb-space-3);
  border: 1px solid var(--lb-border);
  background: var(--lb-canvas);
  color: var(--lb-ink);
  font-family: var(--lb-font-mono);
  font-size: var(--lb-text-small);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atx-button-primary {
  background: var(--lb-ink);
  border-color: var(--lb-ink);
  color: var(--lb-canvas);
}

.lb-root .atx-button-primary:enabled:hover,
.lb-root a.atx-button-primary:hover {
  background: var(--lb-red);
  border-color: var(--lb-red);
  color: var(--lb-surface);
}

.atx-sub-note {
  font-size: var(--lb-text-small);
  color: var(--lb-muted);
}

/* Filter bar */
.atx-controls {
  border: 1px solid var(--lb-border);
  background: var(--lb-surface);
  padding: var(--lb-space-5) var(--lb-space-6);
  display: grid;
  gap: var(--lb-space-4);
  margin-bottom: var(--lb-space-6);
}

.atx-control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--lb-space-3);
}

.atx-control-label {
  font-size: var(--lb-text-small);
  font-weight: 600;
  color: var(--lb-muted);
  min-width: 76px;
}

.atx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--lb-space-2);
}

.atx-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--lb-space-2);
  min-height: 36px;
  padding: var(--lb-space-1) var(--lb-space-3);
  border: 1px solid var(--lb-border);
  border-radius: var(--lb-radius);
  background: var(--lb-surface);
  color: var(--lb-ink);
  font-size: var(--lb-text-control);
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--lb-duration), border-color var(--lb-duration);
}

.atx-chip:hover {
  background: var(--lb-hover);
  border-color: var(--lb-ink);
}

.atx-chip.is-active {
  background: var(--lb-featured);
  border-color: var(--lb-ink);
  font-weight: 600;
}

.atx-chip-count {
  font-family: var(--lb-font-mono);
  font-size: var(--lb-text-small);
  color: var(--lb-muted);
  font-variant-numeric: tabular-nums;
}

.atx-inline-check {
  display: inline-flex;
  align-items: center;
  gap: var(--lb-space-2);
  font-size: var(--lb-text-small);
  color: var(--lb-muted);
  cursor: pointer;
  margin-inline-start: var(--lb-space-2);
}

.atx-inline-check input {
  accent-color: var(--lb-ink);
}

.atx-search {
  flex: 1 1 280px;
  max-width: 420px;
  min-height: 36px;
  padding: var(--lb-space-2) var(--lb-space-3);
}

/* Day groups and event rows */
.atx-day-group + .atx-day-group {
  margin-top: var(--lb-space-8);
}

.atx-day-heading {
  display: flex;
  align-items: baseline;
  gap: var(--lb-space-3);
  margin-bottom: var(--lb-space-3);
}

.atx-day-dow {
  font-family: var(--lb-font-mono);
  font-size: var(--lb-text-small);
  font-weight: 600;
  color: var(--lb-red);
  text-transform: uppercase;
}

.atx-event-row {
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: start;
}

.atx-event-time {
  font-family: var(--lb-font-mono);
  font-size: var(--lb-text-control);
  font-variant-numeric: tabular-nums;
  color: var(--lb-ink);
}

.atx-event-time small {
  display: block;
  font-size: var(--lb-text-small);
  color: var(--lb-muted);
  margin-top: 2px;
}

.atx-event-body {
  display: grid;
  gap: var(--lb-space-2);
  min-width: 0;
}

.atx-event-title {
  font-family: var(--lb-font-heading);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
  color: var(--lb-ink);
}

.atx-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--lb-space-1) var(--lb-space-4);
  font-size: var(--lb-text-control);
  color: var(--lb-muted);
}

.atx-event-summary {
  font-size: var(--lb-text-control);
  color: var(--lb-ink);
}

.atx-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--lb-space-2);
  margin-top: var(--lb-space-1);
}

.atx-tag {
  font-size: var(--lb-text-small);
  padding: 2px 8px;
  border: 1px solid var(--lb-border);
  background: var(--lb-canvas);
  color: var(--lb-ink);
}

.atx-tag--type {
  background: var(--lb-featured);
  color: var(--lb-ink);
}

.atx-tag--source {
  font-family: var(--lb-font-mono);
  background: var(--lb-surface);
  color: var(--lb-muted);
}

.atx-empty {
  border: 1px solid var(--lb-border);
  background: var(--lb-surface);
  padding: var(--lb-space-8);
  color: var(--lb-muted);
  text-align: center;
}

.atx-status-ok {
  color: var(--lb-green);
  font-family: var(--lb-font-mono);
  font-weight: 600;
}

.atx-status-err {
  color: var(--lb-red);
  font-family: var(--lb-font-mono);
  font-weight: 600;
}

.atx-toast {
  position: fixed;
  right: var(--lb-space-5);
  bottom: var(--lb-space-5);
  padding: var(--lb-space-3) var(--lb-space-4);
  border: 1px solid var(--lb-ink);
  background: var(--lb-ink);
  color: var(--lb-canvas);
  font-size: var(--lb-text-control);
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--lb-duration);
}

.atx-toast.is-visible {
  opacity: 1;
}

/* Month Calendar View */
.atx-cal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--lb-space-3);
  padding: var(--lb-space-3) var(--lb-space-4);
  border: 1px solid var(--lb-border);
  border-bottom: 0;
  background: var(--lb-surface);
}

.atx-cal-month {
  font-family: var(--lb-font-heading);
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.atx-cal-nav {
  display: inline-flex;
  gap: var(--lb-space-2);
}

.atx-cal-nav .lb-button {
  min-height: 36px;
  padding: var(--lb-space-1) var(--lb-space-3);
}

.atx-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--lb-border);
  border-left: 1px solid var(--lb-border);
  background: var(--lb-surface);
}

.atx-cal-dow {
  padding: var(--lb-space-2) var(--lb-space-3);
  border-right: 1px solid var(--lb-border);
  border-bottom: 1px solid var(--lb-border);
  background: var(--lb-canvas);
  font-family: var(--lb-font-mono);
  font-size: var(--lb-text-small);
  font-weight: 600;
  color: var(--lb-muted);
  text-transform: uppercase;
}

.atx-cal-cell {
  min-height: 118px;
  padding: var(--lb-space-2);
  border-right: 1px solid var(--lb-border);
  border-bottom: 1px solid var(--lb-border);
  background: var(--lb-surface);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.atx-cal-cell.is-outside {
  background: var(--lb-canvas);
  color: var(--lb-muted);
}

.atx-cal-cell.is-today {
  background: var(--lb-featured);
}

.atx-cal-cell.is-selected {
  box-shadow: inset 0 0 0 2px var(--lb-ink);
}

.atx-cal-day-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 2px 4px;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--lb-font-mono);
  font-size: var(--lb-text-small);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  text-align: left;
}

.atx-cal-day-btn:hover {
  background: var(--lb-hover);
}

.atx-cal-today-dot {
  width: 6px;
  height: 6px;
  background: var(--lb-red);
  display: inline-block;
}

.atx-cal-ev {
  display: block;
  padding: 3px 5px;
  border: 1px solid var(--lb-border);
  background: var(--lb-surface);
  color: var(--lb-ink);
  font-size: 0.75rem;
  line-height: 1.25;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background-color var(--lb-duration);
}

.atx-cal-ev:hover,
.atx-cal-ev:focus-visible {
  background: var(--lb-hover);
  color: var(--lb-ink);
}

.atx-cal-ev-time {
  font-family: var(--lb-font-mono);
  color: var(--lb-muted);
  margin-right: 4px;
}

.atx-cal-more {
  display: block;
  width: 100%;
  padding: 2px 5px;
  border: 0;
  background: transparent;
  color: var(--lb-muted);
  font-family: var(--lb-font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.atx-cal-more:hover {
  color: var(--lb-ink);
  background: var(--lb-hover);
}

.atx-cal-detail {
  margin-top: var(--lb-space-6);
}

.atx-cal-mobile-count {
  display: none;
  font-family: var(--lb-font-mono);
  font-size: 0.7rem;
  color: var(--lb-red);
  font-weight: 600;
  padding: 0 4px;
}

/* Week Timeline View */
.atx-timeline-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--lb-border);
  background: var(--lb-surface);
}

.atx-timeline {
  min-width: 820px;
}

.atx-timeline-head {
  display: grid;
  grid-template-columns: 60px repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--lb-border);
  background: var(--lb-canvas);
}

.atx-timeline-gutter-head {
  padding: var(--lb-space-2);
  border-right: 1px solid var(--lb-border);
  font-family: var(--lb-font-mono);
  font-size: 0.6875rem;
  color: var(--lb-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.atx-timeline-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: var(--lb-space-2) var(--lb-space-3);
  border-right: 1px solid var(--lb-border);
}

.atx-timeline-day-head:last-child {
  border-right: 0;
}

.atx-timeline-day-head.is-today {
  background: var(--lb-featured);
}

.atx-week-dow {
  font-family: var(--lb-font-mono);
  font-size: var(--lb-text-small);
  font-weight: 600;
  color: var(--lb-muted);
  text-transform: uppercase;
}

.atx-week-num {
  font-family: var(--lb-font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--lb-ink);
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.atx-timeline-body {
  display: grid;
  grid-template-columns: 60px repeat(7, minmax(0, 1fr));
  position: relative;
}

.atx-time-axis {
  position: relative;
  border-right: 1px solid var(--lb-border);
  background: var(--lb-canvas);
}

.atx-time-tick {
  position: absolute;
  left: 0;
  right: 0;
  padding: 2px 6px 0 0;
  text-align: right;
  font-family: var(--lb-font-mono);
  font-size: 0.6875rem;
  color: var(--lb-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.atx-day-lane {
  position: relative;
  border-right: 1px solid var(--lb-border);
  background: var(--lb-surface);
  overflow: visible;
}

.atx-day-lane:last-child {
  border-right: 0;
}

.atx-day-lane.is-today {
  background: var(--lb-featured);
}

.atx-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid var(--lb-border);
  pointer-events: none;
}

.atx-now-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px solid var(--lb-red);
  z-index: 6;
  pointer-events: none;
}

.atx-tl-event {
  position: absolute;
  z-index: 2;
  padding: 4px 6px;
  border: 1px solid var(--lb-border);
  border-left: 3px solid var(--lb-ink);
  background: var(--lb-surface);
  color: var(--lb-ink);
  text-decoration: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background-color var(--lb-duration), border-color var(--lb-duration);
}

.atx-tl-event:hover,
.atx-tl-event:focus-visible {
  background: var(--lb-hover);
  border-color: var(--lb-ink);
  color: var(--lb-ink);
  z-index: 10;
}

.atx-tl-event-time {
  font-family: var(--lb-font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--lb-muted);
  line-height: 1.15;
  white-space: nowrap;
}

.atx-tl-event-title {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.22;
  overflow-wrap: break-word;
  word-break: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.atx-tl-event.is-short .atx-tl-event-title {
  -webkit-line-clamp: 1;
}

.atx-tl-event-area {
  font-size: 0.65rem;
  color: var(--lb-muted);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.atx-tl-overflow {
  position: absolute;
  z-index: 3;
  padding: 5px 6px;
  border: 1px dashed var(--lb-ink);
  background: var(--lb-featured);
  color: var(--lb-ink);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background-color var(--lb-duration);
}

.atx-tl-overflow:hover,
.atx-tl-overflow:focus-visible {
  background: var(--lb-featured-hover);
  z-index: 10;
}

.atx-tl-overflow-head {
  font-family: var(--lb-font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--lb-red);
  line-height: 1.2;
}

.atx-tl-overflow-preview {
  font-size: 0.68rem;
  color: var(--lb-muted);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.atx-timeline-day-head {
  cursor: pointer;
}

.atx-timeline-day-head.is-selected {
  box-shadow: inset 0 -2px 0 0 var(--lb-ink);
}

@media (max-width: 760px) {
  .atx-cal-cell {
    min-height: 64px;
    padding: 4px;
  }
  .atx-cal-ev,
  .atx-cal-more {
    display: none;
  }
  .atx-cal-mobile-count {
    display: block;
  }
}

@media (max-width: 650px) {
  .atx-controls {
    padding: var(--lb-space-4);
  }
  .atx-sub-box {
    padding: var(--lb-space-4);
  }
  .atx-event-row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--lb-space-2);
  }
  .atx-event-time small {
    display: inline;
    margin-left: var(--lb-space-2);
  }
}
