/* =====================================================================
   Foremost date picker (internal tools)
   /assets/css/fm-datepicker.css
   Loaded by includes/page-template.php on every page. Pairs with
   /assets/js/fm-datepicker.js, which upgrades every <input type="date">.
   Blue No1 selected day, Neon today marker, Navy text, sentence case.
   Set --fmd-radius on a wrapper to change the corner radius of the field
   (default 60px pill; the Development pages use 16px to match their inputs).
   ===================================================================== */

:root{
  --fmd-blue1:#0061fe; --fmd-blue2:#0039c7; --fmd-blue3:#0d85ff; --fmd-blue4:#87c2ff; --fmd-blue5:#e8effd;
  --fmd-navy:#121d3c;  --fmd-neon:#ccff00;   --fmd-red:#e74c3c;
  --fmd-navy60:rgba(18,29,60,.6); --fmd-navy30:rgba(18,29,60,.3); --fmd-navy10:rgba(18,29,60,.1);
  --fmd-font:'Ambit','Open Sans','Helvetica Neue',Arial,sans-serif;
}

.fm-datefield{font-family:var(--fmd-font);display:inline-block;max-width:100%;vertical-align:top}
.fm-datefield__label{display:block;font-size:12px;font-weight:700;color:var(--fmd-navy60);margin-bottom:6px}
.fm-datefield__control{position:relative;display:inline-flex;align-items:center;max-width:100%}

/* a field that fills its container, used by upgraded inputs that were full width */
.fm-datefield--fill{display:block;width:100%}
.fm-datefield--fill .fm-datefield__control{display:flex;width:100%}
.fm-datefield--fill .fm-datefield__display{width:100%}

.fm-datefield__display{
  width:172px;max-width:100%;height:44px;padding:0 48px 0 16px;
  border:2px solid var(--fmd-blue4);border-radius:var(--fmd-radius,60px);
  font-family:var(--fmd-font);font-size:14px;font-weight:400;color:var(--fmd-navy);
  background:#fff;outline:none;
  transition:border-color .15s ease,box-shadow .15s ease;
}
.fm-datefield__display::placeholder{color:var(--fmd-navy30)}
.fm-datefield__display:hover{border-color:var(--fmd-blue3)}
.fm-datefield__display:focus,
.fm-datefield__display[aria-expanded="true"]{border-color:var(--fmd-blue1);box-shadow:0 0 0 3px rgba(0,97,254,.15)}
.fm-datefield__display[aria-invalid="true"]{border-color:var(--fmd-red)}
.fm-datefield__display[aria-invalid="true"]:focus{box-shadow:0 0 0 3px rgba(231,76,60,.15)}
.fm-datefield__display:disabled{background:var(--fmd-blue5);color:var(--fmd-navy60);cursor:not-allowed;border-color:var(--fmd-blue4)}

.fm-datefield__btn{
  position:absolute;right:5px;top:50%;transform:translateY(-50%);
  width:34px;height:34px;border:0;border-radius:50%;padding:0;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  background:var(--fmd-blue5);color:var(--fmd-blue1);
  transition:background .15s ease,color .15s ease,transform .15s ease-out;
}
.fm-datefield__btn:hover{background:var(--fmd-blue1);color:#fff;transform:translateY(-50%) scale(1.03)}
.fm-datefield__btn svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.fm-datefield__btn:focus-visible{outline:2px solid var(--fmd-navy);outline-offset:2px}
.fm-datefield__btn:disabled{opacity:.4;cursor:not-allowed;transform:translateY(-50%)}
.fm-datefield__btn:disabled:hover{background:var(--fmd-blue5);color:var(--fmd-blue1)}

.fm-datefield__error{margin-top:6px;font-size:12px;font-weight:700;color:var(--fmd-red)}
.fm-datefield__error[hidden]{display:none}

/* ------------------------------ popover ------------------------------ */

.fm-datepop{
  position:absolute;top:calc(100% + 10px);left:0;z-index:1200;
  width:320px;overflow:hidden;
  background:#fff;border-radius:24px;
  box-shadow:0 24px 64px rgba(18,29,60,.22),0 2px 8px rgba(18,29,60,.08);
  font-family:var(--fmd-font);color:var(--fmd-navy);
  transform-origin:top left;
  animation:fmdOpen .16s ease-out;
}
.fm-datepop[hidden]{display:none !important}
.fm-datepop--end{left:auto;right:0;transform-origin:top right}
.fm-datepop--up{top:auto;bottom:calc(100% + 10px);transform-origin:bottom left}
.fm-datepop--up.fm-datepop--end{transform-origin:bottom right}
@keyframes fmdOpen{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}

/* the band at the top states what is currently chosen */
.fm-datepop__band{padding:16px 20px 18px;background:var(--fmd-blue1);color:#fff}
.fm-datepop__band-note{font-size:12px;color:var(--fmd-neon);margin-bottom:2px}
.fm-datepop__band-date{font-size:22px;font-weight:700;line-height:1.2;letter-spacing:-.2px}

.fm-datepop__body{padding:12px 14px 6px}
.fm-datepop__view{display:flex;flex-direction:column;min-height:276px}

.fm-datepop__head{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-bottom:8px}
.fm-datepop__label{
  border:0;background:none;cursor:pointer;
  padding:6px 12px;border-radius:60px;
  font-family:var(--fmd-font);font-size:15px;font-weight:700;color:var(--fmd-navy);
  transition:background .12s ease,color .12s ease;
}
.fm-datepop__label:hover{background:var(--fmd-blue5);color:var(--fmd-blue1)}
.fm-datepop__label:focus-visible{outline:2px solid var(--fmd-blue1);outline-offset:1px}
.fm-datepop__nav{
  width:34px;height:34px;border:0;background:none;border-radius:50%;cursor:pointer;
  color:var(--fmd-blue1);display:flex;align-items:center;justify-content:center;
  transition:background .12s ease,transform .15s ease-out;
}
.fm-datepop__nav:hover{background:var(--fmd-blue5);transform:scale(1.03)}
.fm-datepop__nav:focus-visible{outline:2px solid var(--fmd-blue1);outline-offset:1px}

.fm-datepop__grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;align-content:start}
.fm-datepop__dow{text-align:center;font-size:11px;font-weight:700;color:var(--fmd-navy30);padding:4px 0 8px}
.fm-datepop__blank{height:38px}

.fm-datepop__day{
  position:relative;height:38px;border:0;background:none;border-radius:50%;cursor:pointer;padding:0;
  font-family:var(--fmd-font);font-size:13px;color:var(--fmd-navy);
  display:flex;align-items:center;justify-content:center;
  transition:background .12s ease,color .12s ease,transform .15s ease-out;
}
.fm-datepop__day--weekend{color:var(--fmd-navy60)}
.fm-datepop__day:hover{background:var(--fmd-blue5);color:var(--fmd-blue1);transform:scale(1.03)}
.fm-datepop__day:focus-visible{outline:2px solid var(--fmd-navy);outline-offset:-2px}
.fm-datepop__day--today{font-weight:700}
.fm-datepop__day--today::after{
  content:'';position:absolute;bottom:4px;left:50%;width:5px;height:5px;margin-left:-2.5px;
  border-radius:50%;background:var(--fmd-neon);box-shadow:0 0 0 1px var(--fmd-navy30);
}
.fm-datepop__day--sel,
.fm-datepop__day--sel:hover{background:var(--fmd-blue1);color:#fff;font-weight:700}

/* month list and year list share one grid */
.fm-datepop__cells{flex:1;display:grid;grid-template-columns:repeat(3,1fr);grid-auto-rows:1fr;gap:6px;padding:4px 0 8px}
.fm-datepop__cell{
  position:relative;border:0;background:none;border-radius:16px;cursor:pointer;
  font-family:var(--fmd-font);font-size:14px;color:var(--fmd-navy);
  transition:background .12s ease,color .12s ease,transform .15s ease-out;
}
.fm-datepop__cell:hover{background:var(--fmd-blue5);color:var(--fmd-blue1);transform:scale(1.03)}
.fm-datepop__cell:focus-visible{outline:2px solid var(--fmd-navy);outline-offset:-2px}
.fm-datepop__cell--now{font-weight:700;box-shadow:inset 0 0 0 2px var(--fmd-blue4)}
.fm-datepop__cell--sel,
.fm-datepop__cell--sel:hover{background:var(--fmd-blue1);color:#fff;font-weight:700}

.fm-datepop__foot{
  display:flex;align-items:center;gap:6px;
  margin:0 14px;padding:10px 0 14px;border-top:1px solid var(--fmd-blue5);
}
.fm-datepop__link{
  border:0;background:var(--fmd-blue5);cursor:pointer;
  padding:7px 14px;border-radius:60px;
  font-family:var(--fmd-font);font-size:12px;color:var(--fmd-blue1);
  transition:background .12s ease,color .12s ease,transform .15s ease-out;
}
.fm-datepop__link:hover{background:var(--fmd-blue1);color:#fff;transform:scale(1.03)}
.fm-datepop__link:focus-visible{outline:2px solid var(--fmd-navy);outline-offset:2px}
.fm-datepop__link--clear{margin-left:auto;background:none;color:var(--fmd-navy60)}
.fm-datepop__link--clear:hover{background:var(--fmd-navy10);color:var(--fmd-navy)}

/* a range pair side by side */
.fm-daterange{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap}
.fm-daterange__sep{padding-bottom:13px;font-size:13px;color:var(--fmd-navy60)}

@media (max-width:520px){
  .fm-datefield,.fm-datefield__control,.fm-datefield__display{width:100%}
  .fm-daterange > .fm-datefield{flex:1 1 100%}
  .fm-daterange__sep{display:none}
  /* on a phone the calendar is a sheet fixed to the bottom of the screen */
  .fm-datepop,.fm-datepop--up,.fm-datepop--end{
    position:fixed;left:12px;right:12px;bottom:12px;top:auto;width:auto;max-width:360px;margin:0 auto;
    transform-origin:bottom center;
  }
}

@media (prefers-reduced-motion:reduce){
  .fm-datepop{animation:none}
  .fm-datefield__display,.fm-datefield__btn,.fm-datepop__nav,.fm-datepop__label,
  .fm-datepop__day,.fm-datepop__cell,.fm-datepop__link{transition:none}
  .fm-datefield__btn:hover,.fm-datepop__nav:hover,.fm-datepop__day:hover,
  .fm-datepop__cell:hover,.fm-datepop__link:hover{transform:none}
  .fm-datefield__btn:hover{transform:translateY(-50%)}
}
