/* Sun Jomar Accountants website.
   Layout, sizes and breakpoints reproduce the old Google Sites website
   (menu at 1280px and wider, column grid from 768px, one column below 480px).
   Colours and fonts are CSS variables at the top. */

:root {
  --baby-blue: #a2cffe;     /* page and menu background (baby blue) */
  --baby-yellow: #fdfea2;   /* highlight of the heading an internal link jumps to */
  --purple: #351c75;        /* text, links, headings */
  --menu-ink: #351c75;      /* menu text and icons (same purple as the page text) */
  --blue-2: #45479b;        /* a few words coloured blue in the text */
  --green: #38761d;         /* "(New)" markers */
  --black: #000000;
  --font-text: Arial;       /* text on the pages and in the menu */
  --font-base: sans-serif;  /* spaces between paragraphs (blank lines) */
  --menu-width: 250px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-base);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--baby-blue);
}

img {
  border: 0;
}

a {
  color: inherit;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: #ffffff;
  color: var(--menu-ink);
  font-family: var(--font-text);
}

.skip:focus {
  left: 0;
}

/* ---- Menu ---------------------------------------------------------- */

.nav-toggle {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 91;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.nav-button {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 90;
  width: 48px;
  height: 55px;
  padding: 16px 12px;
  color: var(--menu-ink);
  cursor: pointer;
}

.nav-button svg,
.expander svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.nav-button path {
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.45s;
}

/* the three bars turn into a cross while the menu is open */
.nav-toggle:checked ~ .nav-button path:nth-child(1) {
  transform: rotate(45deg) translateY(5px);
}

.nav-toggle:checked ~ .nav-button path:nth-child(2) {
  opacity: 0;
  transform: rotate(135deg);
}

.nav-toggle:checked ~ .nav-button path:nth-child(3) {
  transform: rotate(135deg) translateY(-5px);
}

.nav-scrim {
  display: none;
}

.sitenav {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  display: block;
  width: var(--menu-width);
  max-width: 80%;
  height: 100%;
  overflow-y: auto;
  background: var(--baby-blue);
  color: var(--menu-ink);
  font-family: var(--font-text);
  font-size: 12pt;
}

.sitenav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sitenav > ul {
  padding-top: 0;
}

.navrow {
  position: relative;
  margin-top: 16px;
  padding: 0 12px 0 36px;
  white-space: nowrap;
}

.navrow.lvl2 {
  padding-left: 56px;
}

.navrow a {
  display: block;
  position: relative;
  overflow: hidden;
  padding-left: 4px;
  color: var(--menu-ink);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navrow a[aria-current="page"] {
  font-weight: bold;
}

.navrow a::after {
  content: attr(data-t);
  display: block;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-weight: bold;
}

.expand {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.expander {
  position: absolute;
  left: 4px;
  bottom: 50%;
  display: inline-block;
  width: 36px;
  height: 24px;
  padding-left: 12px;
  color: var(--menu-ink);
  cursor: pointer;
  transform: translateY(50%);
}

.expander svg {
  width: 24px;
  height: 24px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.expand:checked ~ .navrow .expander svg {
  transform: rotate(180deg);
}

.sub {
  display: none;
}

.expand:checked ~ .sub {
  display: block;
}

/* ---- Page frame ------------------------------------------------------ */

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page > * {
  flex: 0 0 auto;
}

.page > .grow {
  flex: 1 0 auto;
}

section {
  display: block;
  position: relative;
  width: 100%;
}

section.hero {
  padding-top: 56px;
  padding-bottom: 56px;
}

.cols {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 5px;
  padding-right: 5px;
}

.col {
  width: 100%;
}

.col-in {
  width: 100%;
  padding-left: calc(15% / var(--m));
  padding-right: calc(15% / var(--m));
}

.blk {
  position: relative;
  width: 100%;
  max-width: 1280px;
}

.blk > .txt,
.blk > .pic,
.blk > .card,
.blk > .embed {
  display: inline-block;
  vertical-align: top;
  width: 100%;
}

.blk.gap {
  padding-top: calc(30% / var(--d));
}

.blk.first {
  padding-top: 1.5rem;
}

.blk.last {
  padding-bottom: 1.5rem;
}

.blk.gap.first {
  padding-top: calc(30% / var(--d));
}

/* Pictures */

.pic {
  display: block;
  overflow: hidden;
}

.pic img {
  display: block;
  width: 100%;
  height: auto;
}

.embed {
  position: relative;
  width: 100%;
  line-height: 0;
}

.embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Text */

.txt {
  padding: 8px;
  word-wrap: break-word;
}

.col.roomy .txt {
  padding-top: 14px;
  padding-bottom: 14px;
}

.txt p,
.txt small,
.txt h3 {
  display: block;
  margin: 0;
  font-family: var(--font-text);
  font-size: inherit;
  font-weight: 400;
  line-height: 1.5;
  color: var(--purple);
  text-align: left;
}

.txt small {
  font-size: smaller;
}

.txt h3 {
  font-weight: 700;
  scroll-margin-top: 0;
}

.txt a {
  color: inherit;
  text-decoration: underline;
}

.list {
  margin: 6px 0 0;
  padding: 0;
  list-style-type: square;
}

.list:first-child {
  margin-top: 0;
}

.list:last-child {
  margin-bottom: 0;
}

.list > li {
  margin: 6px 0 0 20px;
  font-family: var(--font-text);
  font-size: 12pt;
  color: var(--purple);
}

.list > li:first-child {
  margin-top: 0;
}

.list > li.l1 { margin-left: 15pt; }
.list > li.l2 { margin-left: 30pt; }
.list > li.l3 { margin-left: 45pt; }

.list > li p {
  margin: 0;
}

.s10 { font-size: 10pt; }
.s11 { font-size: 11pt; }
.s12 { font-size: 12pt; }
.c2 { color: var(--blue-2); }
.c3 { color: var(--green); }
.c4 { color: var(--black); }
.tnr { font-family: 'Times New Roman', Arial; }
.pre { white-space: pre; }
.new { color: var(--green); font-family: var(--font-text); font-size: 11pt; font-style: italic; font-weight: 700; }
.n { font-weight: 400; }

/* ---- Wide screens: menu is always visible ------------------------------ */

@media (min-width: 1280px) {
  /* The menu is as wide as its longest entry (including entries of
     collapsed groups), so the gap between the menu text and the page text
     equals the gap between the page text and the picture gallery. */
  body {
    display: flex;
    align-items: flex-start;
  }

  .sitenav {
    position: sticky;
    flex: none;
    height: 100vh;
    width: max-content;
    max-width: none;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .sitenav .navrow {
    padding-right: 0;
  }

  .sitenav .sub {
    display: block;
    height: 0;
    overflow: hidden;
    visibility: hidden;
  }

  .sitenav .expand:checked ~ .sub {
    height: auto;
    overflow: visible;
    visibility: visible;
  }

  /* The menu reserves room for bold text (the current page) in its width.
     The page moves back by that reserve so the gap measured from the
     regular menu text is the same as the gap to the gallery. */
  .page {
    flex: 1 1 0;
    min-width: 0;
    margin-left: -0.5em;
  }
}

/* ---- Below 1280px: menu opens from the hamburger button --------------- */

@media (max-width: 1279px) {
  .nav-button {
    display: block;
  }

  .sitenav {
    left: -100%;
    padding-top: 56px;
    visibility: hidden;
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.5s;
  }

  .nav-toggle:checked ~ .sitenav {
    left: 0;
    visibility: visible;
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
  }

  .nav-toggle:focus-visible ~ .nav-button {
    outline: 2px solid var(--menu-ink);
  }

  .nav-scrim {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    width: 0;
    height: 100%;
    background: #000000;
    opacity: 0;
    transition: opacity 0.5s, width 0s 0.5s;
  }

  .nav-toggle:checked ~ .nav-scrim {
    width: 100%;
    opacity: 0.6;
    transition: opacity 0.5s;
  }

  .txt h3 {
    scroll-margin-top: 56px;
  }
}

/* ---- Columns --------------------------------------------------------- */

@media (min-width: 768px) {
  .cols {
    padding-left: 48px;
    padding-right: 48px;
  }

  section.band {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .col {
    width: calc(100% * var(--d) / 12);
  }

  .col-in {
    padding-left: calc(15% / max(var(--d), var(--t), var(--m)));
    padding-right: calc(15% / max(var(--d), var(--t), var(--m)));
  }

  .hero .blk {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .blk.first,
  .blk.last {
    padding-top: 0;
    padding-bottom: 0;
  }

  .hero .blk.first,
  .hero .blk.last {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .blk.gap,
  .blk.gap.first {
    padding-top: calc(30% / var(--d));
  }

  .hero .blk.gap {
    padding-top: calc(30% / var(--d));
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .cols {
    justify-content: center;
  }

  .col {
    width: calc(100% * var(--t) / 6);
  }

  .col-in {
    padding-left: calc(15% / max(var(--t), var(--m)));
    padding-right: calc(15% / max(var(--t), var(--m)));
  }
}

@media (max-width: 479px) {
  .cols {
    justify-content: center;
  }

  .col {
    width: calc(100% * var(--m) / 4);
  }
}

@media (max-width: 767px) {
  section.band {
    padding-top: 0;
    padding-bottom: 0;
  }

  /* below 768px the old blocks are flex items, so there is no line-height strut */
  .blk > .txt,
  .blk > .pic,
  .blk > .card,
  .blk > .embed {
    display: block;
  }
}

/* a narrow spacer column that only exists on screens 768px and wider */
@media (max-width: 767px) {
  .col.wide-only {
    display: none;
  }
}

/* Link preview boxes (OpenOffice download) */

.card {
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 2px;
  background-color: rgba(255, 255, 255, 0.12);
  overflow: auto;
}

.card a {
  color: inherit;
  text-decoration: none;
}

.card img {
  width: 100%;
  height: auto;
  background-color: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.card .card-text {
  display: block;
  overflow: hidden;
  padding: 0 8px 8px 8px;
  font-family: var(--font-text);
  line-height: 1.5;
  color: var(--purple);
}

.card .card-text a {
  display: inline;
  text-decoration: underline;
}

/* Collapsible groups (Our Workplace): closed until opened */

.fold > summary {
  display: block;
  position: relative;
  border-bottom: 1px solid #5e5e5e;
  cursor: pointer;
  list-style: none;
}

.fold > summary::-webkit-details-marker {
  display: none;
}

.fold > summary .txt {
  padding-right: 48px;
}

.fold-icon {
  position: absolute;
  top: 50%;
  right: 0;
  z-index: 1;
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: rgba(0, 0, 0, 0.54);
  transform: translateY(-50%);
}

.fold-icon svg {
  display: block;
  width: 24px;
  height: 24px;
  margin: 12px;
  fill: currentColor;
}

.fold-icon:hover {
  background-color: rgba(95, 99, 104, 0.04);
}

.fold-close,
.fold[open] .fold-open {
  display: none;
}

.fold[open] .fold-close {
  display: block;
}

.txt li > h3,
.txt li > p {
  margin: 0;
}

/* Our Team: each person's photo or photos start level with that person's entry;
   the pictures on the right run alongside all five entries */

@media (min-width: 768px) {
  .team .cols {
    display: grid;
    grid-template-columns: 33.3333% 41.6667% 25%;
    align-items: start;
    row-gap: 48px;
  }

  .team .col {
    width: auto;
  }

  .team .photos {
    grid-column: 1;
  }

  .team .entry {
    grid-column: 2;
  }

  .team .gallery {
    grid-column: 3;
    grid-row: 1 / span 5;
  }
}

.team .entry .txt {
  padding-top: 0;
}

/* Wide screens: the space between the menu and the text equals the space between the text
   and the pictures on the right (about 32px). The content sits next to the menu. */

@media (min-width: 1280px) {
  .cols {
    margin-left: 0;
    padding-left: 12px;
    padding-right: 48px;
  }
}

/* Wide screens: the right-hand column (pictures or address) keeps its width and the content
   stretches to fill the rest. Paddings stay the same size so the gaps stay the same. */

@media (min-width: 1280px) {
  :root {
    --side-w: 242.5px;
    --pad-unit: 12.125px;
    --photo-w: 323.3333px;
  }

  .cols,
  .blk {
    max-width: none;
  }

  .cols.fluid > .col {
    width: calc((100% - var(--side-w)) * var(--d) / 9);
  }

  .cols.fluid > .col.side {
    width: var(--side-w);
  }

  .cols.fluid .col-in {
    padding-left: calc(var(--pad-unit) * var(--d) / max(var(--d), var(--t), var(--m)));
    padding-right: calc(var(--pad-unit) * var(--d) / max(var(--d), var(--t), var(--m)));
  }

  .team .cols.fluid {
    grid-template-columns: var(--photo-w) minmax(0, 1fr) var(--side-w);
  }

  .team .cols.fluid > .col {
    width: auto;
  }
}

/* Internal links: the heading you jump to is highlighted for a few seconds */

@keyframes target-highlight {
  from {
    background-color: var(--baby-yellow);
  }

  to {
    background-color: rgba(253, 254, 162, 0);
  }
}

.txt h3 {
  scroll-margin-top: 24px;
}

.txt h3:target {
  animation: target-highlight 3s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .txt h3:target {
    animation: none;
    background-color: var(--baby-yellow);
  }
}

/* ---- Tables ---------------------------------------------------------- */

.tablewrap {
  max-width: 100%;
  overflow-x: auto;
}

table.grid {
  border-collapse: collapse;
  border: 1px solid var(--purple);
  color: var(--purple);
  font-family: var(--font-text);
  font-size: 12pt;
  line-height: 1.38;
  text-align: left;
}

table.grid caption {
  padding-bottom: 8px;
  text-decoration: underline;
}

table.grid th,
table.grid td {
  padding: 4px 12px;
  border: 1px solid var(--purple);
  font-weight: 400;
  vertical-align: top;
}

table.grid thead th {
  font-weight: 400;
  text-align: center;
  text-decoration: underline;
}

table.grid.cal .grp th {
  text-decoration: underline;
}

table.grid.cal .gh th {
  padding-left: 27px;
}

table.grid.cal .gh2 th {
  padding-left: 42px;
}

table.grid.cal .d1 th {
  padding-left: 27px;
}

table.grid.cal .d2 th {
  padding-left: 42px;
}

table.grid.cal .d3 th {
  padding-left: 57px;
}

table.grid.cal td,
table.grid.cal th[scope="row"] {
  white-space: nowrap;
}

table.grid.contacts th[scope="row"],
table.grid.contacts td {
  min-width: 9em;
}

table.grid.contacts a {
  color: inherit;
  white-space: nowrap;
}

/* Gallery next to "Mark Your Calendar": only as many pictures as fit beside
   the table, so the gap below the table equals the gap between the other
   sections (the table is shorter than the full gallery). */
@media (min-width: 1280px) {
  .col.trim .blk:nth-child(n+7) { display: none; }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .col.trim .blk:nth-child(n+6) { display: none; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .col.trim .blk:nth-child(n+9) { display: none; }
}
