/* ==========================================================================
   09-largefont.css  —  THE 14 POINT FLOOR

   Switched on by the eight "Larger font size" themes, never on its own.
   Two settings that have to agree are one setting too many: a person who
   picks a theme for older eyes should not also have to find a size switch
   and remember which way round they left it.

   WHAT THIS IS, AND WHAT IT IS NOT

   It is a FLOOR, not a multiplier. Every size in the app that was below
   about 14 points is lifted to it; anything already larger is left exactly
   where it was. A multiplier would have made the headings enormous while
   the small print stayed small, which is the opposite of the problem.

   14 points is roughly 18.7 pixels at the usual browser setting. The app is
   full of 9, 10 and 11px labels — sensible for a control room, and simply
   not readable for somebody in their seventies at arm's length.

   WHY IT IS ONE FILE

   Because it has to be LAST. It is a set of overrides that must beat every
   size written anywhere else, and the honest way to win a specificity fight
   is to be the last stylesheet rather than to scatter !important through
   eight others. It loads after all of them and does nothing at all unless
   body carries .font-larger.

   WHAT IS DELIBERATELY LEFT ALONE

   Monospace countdowns keep their own rhythm, and the portrait ring's
   percentage stays small — it sits inside a circle and growing it would
   cover the face it is drawn on. Both are figures you glance at, not text
   you read.
   ========================================================================== */

/* `type-floor` is put on <body> by js/49-fontfloor.js for whoever chose a
   Larger font size theme. Everything here is SCREEN ONLY: paper keeps its
   own sizes (css/08-print.css). */
@media screen {

body.type-floor {
  /* The base everything else is measured from. */
  font-size: 16px;     /* 12pt (1.90.1; was 14pt) */
  line-height: 1.5;
}

/* THE FLOOR ITSELF. js/49-fontfloor.js reads each element's size and, where
   it is under 14pt, marks it and puts the size it should be in --xp-fs.
   This rule applies it. Marked important so it beats a size written on the
   element itself. The three :not(#…) are there only for weight: some phone
   rules that are themselves marked important name the screen they are on
   by its id (#calendar-overlay #cal-my -- two ids), and an id outweighs any
   number of classes. Three ids that match nothing make this rule the
   heavier without narrowing what it applies to. Inside @media screen, so a
   page printed or turned into a PDF is untouched by it. */
[data-xp-floor]:not(#xp-w1):not(#xp-w2):not(#xp-w3) { font-size: var(--xp-fs) !important; }

/* Held for the instant js/49-fontfloor.js measures and marks: a size read
   halfway through a fade is the wrong size. */
html.xp-type-measuring *, html.xp-type-measuring *::before, html.xp-type-measuring *::after {
  transition: none !important;
}

/* ---- why there is no blanket font rule here ----------------------------
   The obvious thing to write is

       body.font-larger * { font-size: max(14pt, 1em); }

   and it does not work, for two reasons that only show up on a real page.

   First, this application sets font sizes INLINE in hundreds of places, and
   an inline style beats a stylesheet rule. Adding !important would beat the
   inline style — and then it would also beat the 24px heading sitting next
   to the 9px label, because `1em` reads the PARENT's size, not the
   element's own. Everything would be dragged to one size: the small print
   up, and the headings down.

   Second, CSS cannot say "this element's own size, but not below 14pt".
   There is no keyword for a thing's own computed value.

   So the floor is applied in JavaScript instead — js/49-fontfloor.js walks
   the page, reads what each element actually ended up with, and raises only
   the ones below the line. It can never shrink anything, because it only
   ever takes the larger of the two numbers.

   What stays in this file is the part CSS is good at: giving the bigger
   type somewhere to sit.
   ------------------------------------------------------------------------ */

/* ---- the things that are meant to be bigger still ----------------------- */
/* Headings are raised by the same pass, to their own floors. */

/* ---- room to put it in -------------------------------------------------- */
/* Bigger type in the same boxes is bigger type in a smaller box. These give
   the containers that were sized for 10px labels the height to hold 14pt
   ones without clipping. */
body.type-floor .btn,
body.type-floor .tb-btn {
  padding: 9px 15px;
  min-height: 44px;          /* and a thumb can hit it */
  line-height: 1.25;
}
body.type-floor input,
body.type-floor select,
body.type-floor textarea {
  padding: 10px 12px;
  min-height: 44px;
}
body.type-floor .feed-item { padding: 15px; }
body.type-floor .feed-date-pill { padding: 4px 9px; }
body.type-floor .roster-card { padding: 13px; }
body.type-floor .modal-box { max-height: 94vh; }
body.type-floor .tbl td,
body.type-floor .pp-table td,
body.type-floor .aa-table td { padding: 9px 10px; }

/* THE CALENDAR'S SEVEN COLUMNS STAY SEVEN EQUAL COLUMNS. They are `1fr`
   each, and `1fr` will not shrink below the widest thing inside it -- so at
   14pt a day holding an event pushed its whole column wider than the rest.
   `minmax(0, 1fr)` keeps them equal; the event's words wrap inside the day. */
body.type-min #calendar-overlay [style*="repeat(7,1fr)"],
body.type-min #cal-grid, body.type-min #cal-week-body,
body.type-min #cal-week-header { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; }
body.type-min #cal-grid > *, body.type-min #cal-week-body > * { min-width: 0; }
body.type-floor .cal-event-pill,
body.type-floor .cal-event-pill * { white-space: normal !important; overflow-wrap: anywhere; }

/* A SPEAKER'S NAME IS NEVER CUT OFF. The Dashboard cards held it to one
   line and clipped the rest with "…" -- fine at 12px, where few names ran
   over; at 14pt most titled names did ("Rev. Reginald Wayne Sharp…"). The
   name is what the card is for, so it wraps instead. */
body.type-min .feed-name { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }

/* WORDS THE STYLESHEETS DRAW THEMSELVES. A few labels are not in the page
   at all -- they are drawn by a rule (::before / ::after), where the pass in
   js/49-fontfloor.js cannot reach them. They are lifted here instead. */
body.type-min .empty-module::before,
body.type-min .dash-sec.is-drop-target .dash-sec-head::after,
body.type-min .xp-stacked td::before { font-size: max(10pt, 1em); }
body.type-floor .empty-module::before,
body.type-floor .dash-sec.is-drop-target .dash-sec-head::after,
body.type-floor .xp-stacked td::before { font-size: 12pt; }

}  /* end @media screen */


/* What stays small on purpose is listed in js/49-fontfloor.js, where the
   pass can actually see what it is skipping. */


/* ==========================================================================
   THE SHAPE DRAWN ROUND A DATE ON THE CALENDAR

   Three shapes. The class goes on <body> so every calendar view picks it up
   at once — month, week, day and the year grid — rather than each of them
   having to be told.
   ========================================================================== */

/* Rounded rectangle: the default, and what the app has always drawn. */
body.cal-round .cal-day-cell { border-radius: 6px; }
body.cal-round .cy-day       { border-radius: 4px; }

/* Perfect square: crisp, gridded, no softness anywhere. */
body.cal-square .cal-day-cell,
body.cal-square .cy-day,
body.cal-square .cal-event-pill { border-radius: 0 !important; }

/* Circle. A month cell cannot become a circle without losing the events
   inside it, so what becomes circular is the DATE NUMBER — which is the
   thing the shape is really about. The year grid's little day boxes do
   become circles, because they hold nothing but a number and a dot. */
body.cal-circle .cal-day-cell { border-radius: 8px; }
body.cal-circle .cal-day-cell > div > span:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--c-border);
}
body.cal-circle .cy-day { border-radius: 50%; }
body.cal-circle .cy-pad { border-radius: 50%; }
