* {
  box-sizing: border-box;
  /* border: 1px solid green !important; */
}

:root {
  --color-lighter-black: #303030;
  --color-primary: 0, 0%, 75%;
  --color-secondary: 208, 100%, 62%;
  --color-tertiary: 208, 100%, 42%;
  --content-width: 620px; /* A rough estimate to keep 16px Open Sans text < 80 char*/
}

body,
button,
input {
  /* background-color: hsl(191, 54%, 92%); */
  font-family: "Open Sans", sans-serif;
  letter-spacing: 0.03rem;
  color: var(--color-lighter-black);
}

h1,
h2 {
  text-align: center;
}

img {
  max-width: 100%;
}

p,
ul {
  max-width: var(--content-width);
  line-height: 1.45em;
}

/* || SIDEBAR */

.sidebar-btn {
  position: fixed;
  top: 5px;
  left: 3px;
  z-index: 1;
}

.sidebar-btn__bars {
  color: #5d5e60;
}

.sidebar-btn__circle {
  color: #ebebeb;
  opacity: 0;
}

.sidebar-btn:hover .sidebar-btn__circle {
  opacity: 1;
}

.sidebar {
  width: 12vw;
  min-width: 150px;
  height: 100vh;
  background-color: var(--color-lighter-black);
  color: #fcfcfc;
  box-shadow: 4px 0 10px 0 hsla(0, 0%, 0%, 0.4);

  display: none;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;

  position: fixed;
  z-index: 2;
}

.sidebar__close-btn {
  position: absolute;
  top: 5px;
  right: 3px;
}

.close-btn__circle {
  color: #5d5e60;
  opacity: 0;
}

.sidebar__close-btn:hover .close-btn__circle {
  opacity: 1;
}

.sidebar__header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  margin-top: 50px;
  min-height: 16vh;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  font-size: 1.2em;
  min-height: 20vh;
}

.sidebar__social {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  grid-row: repeat(2, max-content);
  gap: 15px 10px;
  align-items: center;
  margin-bottom: 50px;
}

.sidebar__logo {
  height: 25px;
  margin-bottom: 15px;
}

.sidebar__equation {
  max-width: 85%;
  min-width: 120px;
}

.sidebar__hr {
  border: 0;
  border-top: 1px solid #d4d4d4;
  width: 75%;
}

.sidebar__link {
  display: block;
  text-decoration: none;
  color: #fcfcfc;
  cursor: pointer;
}

.sidebar__link:hover {
  color: #d4d4d4;
}

.nav__link {
  position: relative;
}

.nav__link:after {
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  margin: auto;
  width: 0%;
  content: ".";
  color: transparent;
  background: #fcfcfc;
  height: 1px;
  transition: all 0.25s;
}

.nav__link:hover:after {
  width: 100%;
}

/* .social__link:hover {
  text-decoration: underline;
} */

/* || START SECTION */

.start-section {
  height: 100%;
  background-image: url("images/hourglass-banner.png");
  background-size: cover;
  background-position: bottom;

  display: grid;
  grid-template-columns: 2fr 5fr 5fr;
}

.start-section__inner {
  grid-column: 2/3;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.start-section__title {
  position: relative;
  margin-left: 3.5rem; /* = left offset of logo so that logo & text together look centered */
}

.title__logo {
  height: 8.2rem; /* rem since we need to scale it as per font size of title */
  position: absolute;
  left: -3.5rem;
  top: -1rem;
}

.title__text {
  font-size: 4.6rem;
  font-weight: 600 !important;
  font-family: "Titillium Web", sans-serif;
  white-space: nowrap; /* prevent text from wrapping */
  margin: 0; /* remove margin of h1 tag */
}

.start-section__content {
  margin-top: 8vh;
  margin-bottom: 10vh;
}

.input-form {
  display: grid;
  grid-template-columns: max-content 145px;
  grid-template-rows: repeat(3, max-content);
  gap: 15px 20px;
  align-items: center;
}

.input-form__control {
  /* min-width: 150px; */
  height: 1.8rem;
  font-size: 0.85rem;
  padding: 0px 4px;
  border: 1px solid #d4d4d4;
  border-radius: 4px;
}

.input-form__btn {
  background-color: #5d5e60;
  border: none;
  border-radius: 4px;
  color: #fcfcfc;
  text-align: center;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 12px 16px;

  grid-column: 1/3;
  justify-self: center;
  margin-top: 20px;
}

.input-form__btn:hover {
  opacity: 0.8;
}

.btn__icon {
  margin-left: 4px;
}

/* || LIFE GRID EMPTY PROMPT (Temporary Section) */

.life-grid-empty {
  display: flex;
  justify-content: center;
  align-items: center;

  position: absolute; /* so that it don't affect layout of main life-grid section */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.life-grid-empty__img {
  height: 65vh;
  border-radius: 8px;
  box-shadow: 0 4px 8px 0 hsla(0, 0%, 0%, 0.2);
}

.life-grid-empty__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;

  color: #fcfcfc;
  font-size: 1.3em;
}

.life-grid-empty__p {
  max-width: 70%;
  font-weight: 600;
  text-align: center;
  margin: 0;
}

.life-grid-empty__btn {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
  border: 2px solid;
  border-radius: 10px;
  padding: 8px 20px;
  margin-top: 30px;
  background-color: hsla(220, 2%, 37%, 0.35);
}

.life-grid-empty__btn:hover {
  background-color: hsl(220, 2%, 37%);
}

/* || LIFE GRID SECTION (Main) */

.life-grid-section {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  visibility: hidden; /* so that it can still be used in JS layout computations */
}

.card {
  background-color: #fcfcfc;
  padding: 2em;
  border-radius: 5px;
  box-shadow: 0 4px 8px 0 hsla(0, 0%, 0%, 0.2);

  /* To make cards fit responsively within viewport height (vh),
  use a vh aware font-size here and then use em in child components. 
  16px font-size makes all info-cards lay out nicely when vh is 950px, so
  scale font-size by 16/950 of total vh, but restrict it within 12px & 18px */
  font-size: clamp(12px, 16 / 950 * 100vh, 18px);
}

/* == Info Cards */

.info-cards-column {
  display: flex;
  flex-direction: column;
}

.info-card {
  margin-left: 3em;
  margin-bottom: 3em;
  width: 33em; /* in em so that width scale uniformly with height as vh changes */
  position: relative;
}

.info-card__more-context {
  display: flex;
  justify-content: center;
  align-items: center;

  position: absolute;
  top: 0px;
  right: 0px;
  width: 2.5em;
  height: 2.5em;
}

.more-context__icon {
  color: #5d5e60;
  text-shadow: 2px 2px 2px hsla(0, 0%, 0%, 0.2);
}

.info-card__p {
  margin: 0;
}

.info-card__p--margined {
  margin-bottom: 1em;
}

.info-card__p--larger {
  text-align: center;
  font-size: 1.1em;
  font-weight: 500;
}

.week-stats {
  padding-bottom: 0;
}

.week-stats__selected-box {
  text-align: center;
  font-size: 1.35em;
  margin-bottom: 0.9em;
}

.selected-box__number {
  font-size: 1.15em;
  font-family: "Titillium Web", sans-serif;
}

.selected-box__ordinal-suffix {
  font-size: 0.65em;
}

.week-stats__info {
  font-size: 0.5em;
}

.week-stats__inner {
  width: 24em;
  margin: 0 auto;

  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: 2fr 4fr;
}

.week-stats__text {
  text-align: center;
  font-size: 0.91em;
  margin: 0;
}

.week-stats__number {
  font-family: "Titillium Web", sans-serif;
  font-size: 2.8em;
  line-height: 1.1;
  text-align: center;
  margin: 0;
}

.week-stats__date-range {
  grid-column: 1/6;
  font-size: 1.2em;
  margin: auto;
}

.week-stats__week-count {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;

  grid-column: 1/3;
}

.week-count__number {
  font-size: 2.35em;
}

.week-count__number--total {
  color: hsl(0, 0%, 70%);
}

.week-stats__life-progress {
  width: 80%;
  justify-self: center;
  position: relative;

  grid-column: 3/6;
  justify-items: center;
  align-items: center;
}

.life-progress__bar {
  position: absolute;
}

.life-progress__arc {
  stroke: hsl(var(--color-secondary));
}

.life-progress__value {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  /* Position it in horizontal centre, and quite above the vertical centre of
  the progress arc's circle by sticking it to bottom week-stats__life-progress*/
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

.week-stats__number--small {
  font-size: 0.62em;
}

.week-stats__extra-info {
  font-size: 0.81rem;
  text-align: right;
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
}

.calendar {
  margin-bottom: 0;
  padding-bottom: 0;
  position: relative;
}

.calendar__help-btn {
  cursor: pointer;
}

.calendar__help-btn:hover {
  opacity: 0.8;
}

.calendar__download {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1.45em;
  margin-bottom: 2em; /* Same as padding of info__card */
}

.calendar__download-btn {
  background-color: hsl(var(--color-tertiary));
  border: none;
  border-radius: 4px;
  color: #fcfcfc;
  text-align: center;
  text-decoration: none;
  font-size: 0.95em;
  font-weight: 600;
  padding: 0.55em 0.85em;
  margin-left: 0.6em;
}

.calendar__download-btn:hover {
  background-color: hsl(var(--color-secondary));
}

.download-btn__icon {
  margin-left: 2px;
}

.calendar__extra-info {
  font-size: 0.85em;
  color: hsl(0, 0%, 29%);
  /* width: 400px; */
  margin: 1em auto;
}

.calendar__hr {
  border: 0;
  border-top: 1px solid hsl(0, 0%, 82%);
  margin: 0 auto;
}

.calendar__link {
  color: hsl(var(--color-tertiary));
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid hsla(var(--color-tertiary), 0.8);
}

.calendar__link:hover {
  filter: brightness(0.7);
}

/* == Life Grid */

.life-grid {
  display: grid;
  grid-template-areas:
    ". week-label"
    "age-label main-grid";

  max-width: 720px; /* fixed to prevent consuming whole width on larger screens*/
  max-height: 99vh;
}

.life-grid__label {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1em;
}

.life-grid__week-label {
  grid-area: week-label;
  margin-bottom: 0.5em;
}

.life-grid__age-label {
  grid-area: age-label;
  margin-right: 0.8em;

  /* TO FIX: for unknown reason, width is 0 instead of child width in firefox*/
  width: 1.4em; /* workaround: approx width of child vertical-text */
}

.vertical-text {
  writing-mode: vertical-rl;
  transform: rotate(-180deg);
}

.life-grid__inner {
  grid-area: main-grid;

  display: grid;
  grid-template-columns: repeat(var(--num-col), var(--box-size));
  grid-template-rows: repeat(var(--num-row), var(--box-size));
}

.life-grid__marker {
  display: flex;
  justify-content: flex-end;
  align-items: center;

  font-size: clamp(8px, 1.2 * var(--box-size), 12px);
}

.life-grid__marker--week {
  flex-direction: column;
  line-height: 1; /* To remove space due to default 1.2 line-height of text */
  margin-bottom: 1px;
}

.life-grid__marker--age {
  flex-direction: row;
  margin-right: 2px;
}

.life-grid__box {
  /* It only acts as a container to position the visual box */
  position: relative;
}

.life-grid__box::after {
  /* Pseudo-element is the visual box so all styling properties are applied here.
  It is positioned in a way that apparently there are margins in right & bottom
  but they will still be hoverable because they are part of the life-grid__box*/
  content: "";
  position: absolute;
  top: 0px;
  right: 1px;
  bottom: 1px;
  left: 0px;
  z-index: 1;

  border: 1px solid hsla(var(--color-primary), 0.75);
}

.life-grid__box--filled::after {
  background-color: hsl(var(--color-primary));
}

.life-grid__box--row-start {
  /* Boxes start to fill after 2nd grid line,
  since markers are in 1/2 grid area*/
  grid-column: 2 / 3;
}

.life-grid__box--hovered::before {
  /* This will create an overlay over after element (visual box) i.e. same in
  size and shape but is of different color & border */
  content: "";
  position: absolute;
  top: 0px;
  right: 1px;
  bottom: 1px;
  left: 0px;
  z-index: 2; /* to bring it over after element */

  border: 2px solid hsl(var(--color-secondary));
  background-color: hsla(var(--color-secondary), 0.25);
}

.life-grid__box--clicked::before {
  /* This will create an overlay over after element (visual box) i.e. same in
  size and shape but is of different color & border */
  content: "";
  position: absolute;
  top: 0px;
  right: 1px;
  bottom: 1px;
  left: 0px;
  z-index: 2; /* to bring it over after element */

  border: 2px solid hsl(var(--color-tertiary));
  background-color: hsla(var(--color-tertiary), 0.25);
}

/* || OTHER SECTIONS */

.pg-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: auto;
}

.pg-section__heading {
  font-family: "Titillium Web", sans-serif;
  font-size: 2.4rem;
  font-weight: 600;
  width: max-content;
  margin-top: 0;
  margin-bottom: 0.6rem;
}

.link {
  text-decoration: none;
  color: hsl(var(--color-tertiary));
}

.link:hover {
  border-bottom: 1px solid;
}

/* || INSPIRATION SECTION */

.inspiration {
  width: var(--content-width);
  max-height: 100vh;
}

.inspiration__yt-embed {
  margin-top: 1rem;
  margin-bottom: 1rem;
  width: 100%;
  height: calc((9 / 16) * var(--content-width));
}

/* || FAQ SECTION */

.faq__accordions-list {
  margin: 25px 0;
  box-shadow: 0 4px 8px 0 hsla(0, 0%, 0%, 0.2);
  border-radius: 8px;
}

.accordion {
  width: 750px;
}

.accordion__toggle {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 20px;
  width: 100%;

  background-color: hsl(220, 2%, 37%);
  border: none;
  outline: none;
  border-top: 1px solid hsl(220, 2%, 50%);

  color: #fcfcfc;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;

  transition: 0.4s;
  cursor: pointer;
}

.accordion__toggle--expanded,
.accordion__toggle:hover {
  background-color: hsl(220, 2%, 27%);
}

.accordion__toggle--first {
  border-radius: 8px 8px 0 0;
  border-top: none;
}

.accordion__toggle--last:not(.accordion__toggle--expanded) {
  /* Don't round corners of last accordion if expanded */
  border-radius: 0 0 8px 8px;
}

.accordion__panel {
  padding: 0 calc((100% - var(--content-width)) / 2);
  background-color: #fcfcfc;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
}

.accordion__panel--last {
  border-radius: 0 0 8px 8px;
}

.faq__img {
  border: 1px solid #ebebeb;
}

.gcal-fig {
  margin: 30px 0;
}

.gcal-fig__img-placeholder {
  /* same as gcal-fig__img height to maintain vertical space occupied by image
  when it is absolute positioned on hover */
  height: 380px;
}

.gcal-fig__img {
  display: block;
  margin: 0 auto;
  cursor: zoom-in;
  height: 380px;
}

.gcal-fig__img:hover {
  /* Zoom in image on hover */
  position: absolute;
  z-index: 3;
  transform: scale(1.75);
}

.gcal-fig__caption {
  text-align: center;
  font-size: 0.9rem;
  color: #5d5e60;
}

em {
  font-weight: 600;
}

h4 {
  font-size: 1.05em;
}

/* || FOOTER */

.footer {
  color: #fcfcfc;
  height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.footer__inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 3fr;
  width: 75vw;
  justify-items: center;
  column-gap: 50px;
  margin-top: 45px;
}

.footer__link {
  color: hsl(var(--color-secondary));
}

.footer__p {
  text-align: center;
  max-width: 280px;
}

.footer__icon-btn {
  color: #fcfcfc;
  font-size: 1.5em;
  text-shadow: 3px 4px 3px hsl(0, 0%, 0%);
  align-self: center;
}

.footer__icon-btn:hover {
  color: hsl(var(--color-secondary));
  transform: translateY(2px);
}

.footer__developer-info {
  margin: 0;
  margin-bottom: 30px;
  opacity: 0.9;
  font-size: 1.1em;
}

.footer_icon-developer {
  font-size: inherit;
}
