/*
  Cocktail of the Day pages (/on-this-day). Pushed by OnthisdayController.
*/
/* desktop: grow the row to two 440px columns and the 32px gap */
@media (min-width: 640px) {
  .onthisday-page .dg-layout-default__rhs {
    flex-grow: 1;
    max-width: calc(440px * 2 + 32px);
  }
}

.onthisday-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.onthisday-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* removes the feature box's top rule and its gap */
.dg-component-feature-box--onthisday.dg-rule-top {
  border-top: 0;
  padding-top: 0;
}

/* The standfirst under the heading: the date and the cocktail beside its cutout */
.onthisday-standfirst {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.onthisday-standfirst__image {
  flex: 0 0 4rem;
}
.onthisday-standfirst__image img {
  display: block;
  width: 4rem;
  height: auto;
  border-radius: 0.25rem;
}
.onthisday-standfirst__text {
  margin: 0;
  font-size: var(--font-size-plus-2);
  /* 300 is outside the UIUXRULES body weights: an approved exception (feature box standfirst) */
  font-weight: 300;
  line-height: var(--line-height-body);
}


/* The cocktail's lifestyle photo between the longform's intro and body, full column width */
.onthisday-lifestyle {
  margin: 1rem 0;
}
.onthisday-lifestyle img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.25rem;
}

/* comments */
.onthisday-comments {
  padding-top: 1rem;
}
.onthisday-comments > .content-heading {
  margin-bottom: 1rem;
}
.onthisday-new-comment {
  margin-bottom: 1.5rem;
}
.onthisday-modal-section {
  padding: 1.5rem 0 0;
}
.onthisday-modal-actions {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-top: 1rem;
}
.onthisday-comments__note {
  font-size: var(--font-size-sub-1);
  margin-top: 1rem;
  margin-bottom: 0;
}
.onthisday-comments__forum-link {
  margin-top: 1rem;
}
.onthisday-comments__note + .onthisday-comments__forum-link {
  margin-top: 0;
}


/*
  The calendar: bar, panel and grid of square cells.
  events.css (php-phalcon-default) "Calendar widget": keep in step.
*/
.onthisday-days__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  min-height: 3.5rem;
  padding: 0.75rem 1rem;
  /* the site header's amber, kept in both themes, so the ink stays dark */
  background: #ffbe36;
  color: #333333;
}
/* the date, e.g. "November 10th" */
.onthisday-days__heading {
  margin: 0;
  font-size: var(--font-size-plus-1);
  font-weight: 700;
  line-height: var(--line-height-heading);
  color: #333333;
}
.onthisday-days__controls {
  display: flex;
  /* stays at the right-hand end when the heading is hidden */
  margin-left: auto;
  align-items: center;
  gap: 1rem;
}
/* the dropdown component positions itself absolutely against this */
.onthisday-days__picker {
  position: relative;
  display: inline-block;
}
/* phones only: the Day selector, and Month on the landing page */
@media (min-width: 640px) {
  .onthisday-days__picker--phone {
    display: none;
  }
}
/* selector triggers: the bar's dark ink in both themes, at the heading's weight */
.onthisday-days__picker .dg-component-button {
  gap: 0.25rem;
  font-size: var(--font-size-plus-1);
  font-weight: 700;
  color: #333333;
}
.onthisday-days__picker .dg-component-button .svg-icon {
  width: 1rem;
  height: 0.625rem;
}

/* Dropdown options. events.css .events-dropdown-options: keep in step */
.onthisday-dropdown-options {
  display: flex;
  flex-direction: column;
  max-height: min(24rem, 60vh);
  overflow-y: auto;
}
.onthisday-dropdown-options__option {
  display: flex;
  align-items: baseline;
  position: relative;
  border-radius: 0.25rem;
  /* right padding reserves the check slot on every row, so widths match */
  padding: 0.25rem 3rem 0.25rem 0.5rem;
  text-decoration: none;
  font-size: var(--font-size-base);
  font-weight: 500;
}
a.onthisday-dropdown-options__option,
a.onthisday-dropdown-options__option:visited {
  color: #333333;
}
html[data-theme="dark"] a.onthisday-dropdown-options__option,
html[data-theme="dark"] a.onthisday-dropdown-options__option:visited {
  color: #e8e8e8;
}
.onthisday-dropdown-options__option:hover {
  background: #f3f3f3;
}
html[data-theme="dark"] .onthisday-dropdown-options__option:hover {
  background: #333333;
}
.onthisday-dropdown-options__option--selected {
  font-weight: 700;
}
.onthisday-dropdown-options__check {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
}
.onthisday-dropdown-options__check .svg-icon {
  display: block;
  width: 1rem;
  height: 1rem;
}
.onthisday-days__panel {
  padding: 1.25rem;
  background: #f4f4f5;
}
html[data-theme="dark"] .onthisday-days__panel {
  background: #2a2a2a;
}
.onthisday-days__grid {
  display: grid;
  /* seven to a row; keep minmax(0, 1fr), not 1fr: keeps square cells inside the panel in Safari */
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #ffffff;
}
html[data-theme="dark"] .onthisday-days__grid {
  background: #1a1a1a;
}
.onthisday-days__cell {
  /* square; cell-body is absolutely placed so content can't stretch it (Safari) */
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  /* transparent, so the current cell's outline doesn't change its size */
  border: 3px solid transparent;
  background: #f4f4f5;
}
html[data-theme="dark"] .onthisday-days__cell {
  background: #2a2a2a;
}
.onthisday-days__cell--current {
  border-color: #8d8d8d;
}
html[data-theme="dark"] .onthisday-days__cell--current {
  border-color: #737373;
}
.onthisday-days__cell-body {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
}
a.onthisday-days__cell-body,
a.onthisday-days__cell-body:visited {
  color: #333333;
}
html[data-theme="dark"] a.onthisday-days__cell-body,
html[data-theme="dark"] a.onthisday-days__cell-body:visited {
  color: #e8e8e8;
}
a.onthisday-days__cell-body:hover,
a.onthisday-days__cell-body:focus-visible {
  background: rgba(0, 0, 0, 0.04);
}
html[data-theme="dark"] a.onthisday-days__cell-body:hover,
html[data-theme="dark"] a.onthisday-days__cell-body:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}
/* a day without an entry: not linked, greyed */
span.onthisday-days__cell-body {
  color: #909090;
}
.onthisday-days__number {
  font-size: var(--font-size-plus-1);
  font-weight: 500;
  line-height: 1;
}
/* the landing page's months: three to a row, uppercase names */
.onthisday-days__grid--months {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
/* the current month is outlined */
.onthisday-days__grid--months .onthisday-days__cell--today {
  border-color: #8d8d8d;
}
html[data-theme="dark"] .onthisday-days__grid--months .onthisday-days__cell--today {
  border-color: #737373;
}
.onthisday-days__grid--months .onthisday-days__number {
  font-size: var(--font-size-sub-1);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.1;
}

/* ---------------------------------------------------------------------
   Day calendar on phones: the bar alone, pinned at the top under the site header.
   events.css "Mobile calendar": keep in step.
   Keep the COLUMN sticky, not the section: sticky only travels within its parent.
   --------------------------------------------------------------------- */
@media (max-width: 639.98px) {
  /* stacked columns 16px apart, matching the gutter */
  .onthisday-page .dg-layout-default__rhs {
    gap: 16px;
  }
  .onthisday-calendar-column {
    order: -1;
    position: sticky;
    /* 4px below the header's pinned bar */
    top: calc(var(--header-pinned-height, 0px) + 4px);
    /* above the scrolling content; the bar's dropdowns are in this stacking context */
    z-index: 10;
  }
  /* fills the 4px gap with the page background */
  .onthisday-calendar-column::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 0;
    right: 0;
    height: 4px;
    background: #ffffff;
  }
  html[data-theme="dark"] .onthisday-calendar-column::before {
    background: #1a1a1a;
  }
  .onthisday-days__head {
    min-height: 0;
    padding: 0.5rem;
  }
  /* the landing page's bar heading: visually hidden, kept for screen readers (aria-labelledby) */
  .onthisday-days__heading--desktop {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  /* no grid on phones */
  .onthisday-days__panel {
    display: none;
  }
}

