/* TFT Opening Hours — front-end styles.

   ONE component, used three times. "Our Regular Hours", "The Week Ahead" and
   "Upcoming Opening Changes" are the same section markup with different rows,
   so they look and behave identically and nothing has to be kept in step by
   hand. Every section is: prominent heading, then a two-column table — label
   on the left (with any pills), hours on the right.

   Colour reinforces but never carries meaning alone: every marked row also
   states a word, so it survives greyscale and a screen reader. Closures are
   styled distinctly from altered hours on purpose — a customer driving to a
   locked pub is the expensive failure.

   Minimal and inheritance-friendly: this renders inside Elementor sections
   that already set their own typography. No <button> elements on the front
   end, so the staff-portal theme's button override problem doesn't apply. */

/* ── Open / closed banner ── */
.op-is-open { font-weight: 600; }
.op-is-open.op-open { color: #1f7a3d; }
.op-is-open.op-closed { color: #a32020; }
.op-next { font-weight: 400; opacity: .9; }

/* ── Section ── */
.op-block { margin: 0 0 1.8em; text-align: left; }
.op-block:last-child { margin-bottom: 0; }

.op-block-title {
  margin: 0 0 .5em;
  padding-bottom: .35em;
  border-bottom: 2px solid currentColor;
  font-size: 1.05em;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .02em;
  text-align: left;
  text-transform: uppercase;
}

/* ── Shared table ── */
.op-table { width: 100%; border-collapse: collapse; }
.op-table caption { text-align: left; font-weight: 600; padding-bottom: .5em; }
.op-table th,
.op-table td { padding: .5em .25em; text-align: left; vertical-align: baseline; border: 0; }
.op-table tr + tr th,
.op-table tr + tr td { border-top: 1px solid rgba(0, 0, 0, .07); }
.op-table th.op-day { font-weight: 600; line-height: 1.5; }
.op-table td.op-times { text-align: right; white-space: nowrap; }
.op-table tr.op-row-closed .op-closed-label { opacity: .75; }

/* Today, in The Week Ahead. */
.op-table tr.op-today th.op-day,
.op-table tr.op-today td.op-times { font-weight: 700; }

/* ── Pills ── */
.op-day-flag,
.op-today-tag {
  display: inline-block;
  margin-left: .5em;
  padding: .1em .5em;
  border-radius: 2px;
  font-size: .68em;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.6;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: .14em;
}
.op-today-tag   { background: #eceff3; color: #47505c; }
.op-flag-hours  { background: #fdf0d5; color: #8a5a00; }
.op-flag-open   { background: #e6f4ea; color: #1f7a3d; }
.op-flag-closed { background: #fbe9e9; color: #a32020; }

/* Left edge marker, coloured by what kind of change it is. */
.op-table tr.op-row-special th.op-day { box-shadow: inset 2px 0 0 0 #c9ccd1; padding-left: .6em; }
.op-table tr.op-special-hours  th.op-day { box-shadow: inset 2px 0 0 0 #e0a63a; }
.op-table tr.op-special-open   th.op-day { box-shadow: inset 2px 0 0 0 #1f7a3d; }
.op-table tr.op-special-closed th.op-day { box-shadow: inset 2px 0 0 0 #a32020; }

/* The reason shares the hours cell, so a special day explains itself without
   costing a second line. On a closure it is the ONLY thing there — the pill
   already said "Closed" — so it must not carry a trailing gap. */
.op-row-reason { opacity: .7; font-weight: 400; margin-right: .6em; }
.op-times > .op-row-reason:only-child { margin-right: 0; }
.op-times-value { font-weight: inherit; }

@media (max-width: 480px) {
  .op-block-title { font-size: 1em; }
  .op-table th,
  .op-table td { padding: .45em .2em; }
  /* Pills drop below the date rather than squeezing the hours column off the
     right edge. The date stays on its own line and stays scannable. */
  .op-day-flag,
  .op-today-tag { display: inline-block; margin: .25em .35em 0 0; }
  .op-table th.op-day { white-space: normal; }
  /* The reason gets its own line; the hours stay hard right on the first. */
  .op-row-reason { display: block; margin-right: 0; font-size: .9em; }
  .op-table td.op-times { white-space: normal; }
  .op-times-value { white-space: nowrap; }
}

/* ── 1.12.0 [OPH-3]: sessions and the period table ──
   A day with more than one trading session (NYE) prints one line per session,
   label after the times, right-aligned like every other hours cell. New class
   names only — nothing above changes, so a payload without sessions looks
   exactly as it did in 1.11.0. */
.op-times-multi .op-session { display: block; }
.op-times-multi .op-row-reason { display: block; margin-right: 0; }
.op-times-multi .op-session + .op-session { margin-top: .15em; }

/* "Back to normal from …" under Our Regular Hours while a period shows. */
.op-block-note { margin: .5em 0 0; padding: 0 .25em; font-size: .92em; opacity: .8; text-align: left; }

@media (max-width: 480px) {
  .op-times-multi .op-session { white-space: normal; }
}

/* ── 1.12.2 [OPH-3-FIX-1] ──
   New class names only, appended — nothing above changes.
   3c: a session label on its own line under that session's times, never split
   mid-phrase. 6b: the label under the open line, on its own smaller line.
   3b: the one-line jump link at the top while the period table waits at the
   bottom. */
.op-session-label { display: block; font-size: .88em; font-weight: 400; opacity: .75; white-space: nowrap; }
.op-open-note { display: block; margin-top: .15em; font-size: .8em; font-weight: 400; opacity: .85; }
.op-jump { margin: 0 0 1.2em; text-align: left; }
.op-jump a { font-weight: 600; }

/* ── 1.12.3 [OPH-3-FIX-2] ──
   Appended — the 1.12.2 file above is an exact prefix; later rules win.
   2.4 + 2.5: the open line is two tiers. The headline ("We're closed." / "We're
   open until 1am") keeps the size of wherever it is placed; the next opening
   and the session label go on their own lines at ONE fixed size on every page
   (rem, not em — on Opening Hours the line sits in a 43px heading, on Home in
   22px text). */
.op-next { display: block; margin-top: .3em; font-size: 1.125rem; line-height: 1.35; }
.op-open-note { margin-top: .25em; font-size: 1rem; line-height: 1.35; }

/* 2.1: a later session of the same date (NYE's 7:30pm - 1am) reads as part of
   the row above: no rule between them, the left bar runs on, and it takes the
   row above's stripe. (The theme stripes odd rows' cells — hello-elementor
   reset.css, rgba(128,128,128,.07) — so the colour is repeated here.) */
.op-table tr.op-row-cont th,
.op-table tr.op-row-cont td { border-top: 0; padding-top: .1em; }
.op-table tbody > tr:nth-child(2n+1) + tr.op-row-cont > th,
.op-table tbody > tr:nth-child(2n+1) + tr.op-row-cont > td { background-color: rgba(128, 128, 128, .07); }
.op-table tbody > tr:nth-child(2n) + tr.op-row-cont > th,
.op-table tbody > tr:nth-child(2n) + tr.op-row-cont > td { background-color: transparent; }

@media (max-width: 480px) {
  /* 2.2: the pills stay beside the date instead of dropping under it (a touch
     smaller, so "Thu 31 Dec 2026 TODAY DIFFERENT HOURS" fits at 390px). The
     date column then needs its full width, so the hours column gives way:
     times never break ("7:30pm - 1am" stays whole), while a day label or a
     session label may wrap onto a second line of its OWN — still under its own
     times, never beside them — rather than push the page sideways. */
  .op-table th.op-day { white-space: nowrap; }
  .op-day-flag,
  .op-today-tag { margin: 0 0 0 .3em; padding: .1em .4em; font-size: .62em; letter-spacing: .02em; }
  .op-table td.op-times { white-space: nowrap; }
  .op-table td.op-times .op-row-reason,
  .op-session-label { white-space: normal; }
}
