/* TSS Entry Year Calculator
   Self-contained component: everything is scoped under .eyc so it can drop
   into a Craft template without touching the site's own styles.

   On the live site the block sits inside .common-content-sec / .common-contentDiv
   and Bootstrap's .table-responsive, whose rules (label size, select arrow,
   table padding/borders, stacked mobile rows) out-rank single-class selectors.
   Selectors below that compete with those carry an extra .eyc to win. */

.eyc {
  --eyc-gold: #a29061;
  --eyc-gold-light: #d2af7d;
  --eyc-gold-line: rgba(210, 175, 125, 0.5);
  --eyc-navy: #00275d;
  --eyc-ink: #000;
  --eyc-muted: #5c5c5c;
  --eyc-field-bg: #f3f0e9;
  --eyc-highlight-bg: #f7f3ea;
  --eyc-beige: #e3ddcf;
  --eyc-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --eyc-sans: "Aileron", "Helvetica Neue", Arial, sans-serif;

  font-family: var(--eyc-sans);
  color: var(--eyc-ink);
  background: #fff;
  padding: 80px 0;
}

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

.eyc__inner {
  max-width: 1290px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Inside the site's .container the gutter and max-width already exist */
.eyc .container .eyc__inner {
  max-width: none;
  padding: 0;
}

/* Header */

.eyc__eyebrow {
  margin: 0 0 14px;
  font-family: var(--eyc-sans);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--eyc-navy);
}

.eyc__title {
  margin: 0 0 20px;
  font-family: var(--eyc-serif);
  font-size: clamp(30px, 4.2vw, 48px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--eyc-gold);
}

.eyc__intro {
  max-width: 860px;
  margin: 0 0 44px;
  font-size: 18px;
  font-style: italic;
  line-height: 30px;
}

/* Fields */

.eyc__form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 48px;
  margin: 0;
}

.eyc__field {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.eyc .eyc__label {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.3;
}

.eyc .eyc__select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 64px;
  margin: 0;
  padding: 0 56px 0 20px;
  font-family: var(--eyc-sans);
  font-size: 18px;
  color: var(--eyc-ink);
  background-color: var(--eyc-field-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 14'%3E%3Cpath d='M0 0h24L12 14z' fill='%23a29061'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 22px center;
  background-size: 18px 11px;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* "Please Select" placeholder reads as a hint until a value is chosen */
.eyc .eyc__select:invalid {
  color: var(--eyc-muted);
}

.eyc .eyc__select option {
  color: var(--eyc-ink);
}

.eyc .eyc__select:hover {
  border-color: var(--eyc-gold-line);
}

.eyc .eyc__select:focus {
  outline: none;
  border-color: var(--eyc-gold-light);
  box-shadow: 0 0 0 3px rgba(162, 144, 97, 0.2);
}

.eyc .eyc__select:focus-visible {
  border-color: var(--eyc-gold);
}

/* Results */

.eyc__results {
  margin-top: 56px;
  animation: eyc-fade 0.35s ease-out;
}

.eyc__results[hidden],
.eyc__table[hidden],
.eyc__message[hidden] {
  display: none;
}

.eyc .eyc__summary {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--eyc-gold);
}

.eyc .eyc__table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
}
.eyc .eyc__table thead{
	border-top:0 !important;
}
.eyc .eyc__table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* [scope] lifts these past `.common-content-sec table tr th:first-child` */
.eyc .eyc__table thead th[scope] {
  padding: 0 20px 14px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1px;
  text-align: left;
  text-transform: uppercase;
  color: var(--eyc-navy);
  background: none;
  border: 0;
  /*border-bottom: 2px solid var(--eyc-gold);*/
  box-shadow: none;
}

.eyc .eyc__table thead th[scope]:last-child {
  text-align: right;
}

/* Bootstrap's .table-responsive stacks rows into columns below 768px */
.eyc .eyc__table .eyc__row {
  display: table-row;
}

.eyc .eyc__table .eyc__row th,
.eyc .eyc__table .eyc__row td {
  padding: 18px 20px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--eyc-gold-line);
  box-shadow: none;
  vertical-align: middle;
}

.eyc .eyc__table .eyc__level {
  font-size: 18px;
  font-weight: 400;
  text-align: left;
}

.eyc .eyc__table .eyc__year {
  text-align: right;
  white-space: nowrap;
}

.eyc__year-value {
  font-family: var(--eyc-serif);
  font-size: 24px;
  line-height: 1;
  /* Playfair defaults to old-style figures, which make years bounce */
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--eyc-navy);
}

.eyc .eyc__table .eyc__row--current th,
.eyc .eyc__table .eyc__row--current td {
  background: var(--eyc-highlight-bg);
}

.eyc .eyc__table .eyc__row--current th {
  box-shadow: inset 4px 0 0 var(--eyc-gold);
  font-weight: 600;
}

.eyc__badge {
  display: inline-block;
  margin-left: 14px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  vertical-align: middle;
  color: #fff;
  background: var(--eyc-gold);
  border-radius: 3px;
}

.eyc .eyc__message {
  margin: 0;
  padding: 24px 28px;
  font-size: 18px;
  line-height: 30px;
  background: var(--eyc-highlight-bg);
  box-shadow: inset 4px 0 0 var(--eyc-gold);
}

.eyc__note {
  max-width: 860px;
  margin: 32px 0 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--eyc-muted);
}

@keyframes eyc-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .eyc__results { animation: none; }
  .eyc .eyc__select { transition: none; }
}

@media (max-width: 767px) {
  .eyc {
    padding: 48px 0;
  }

  .eyc__intro {
    margin-bottom: 32px;
    font-size: 16px;
    line-height: 26px;
  }

  .eyc__form {
    grid-template-columns: 1fr;
  }

  .eyc .eyc__label,
  .eyc .eyc__select,
  .eyc .eyc__table .eyc__level {
    font-size: 16px;
  }

  .eyc .eyc__select {
    height: 56px;
  }

  .eyc__results {
    margin-top: 40px;
  }

  .eyc .eyc__table thead th[scope],
  .eyc .eyc__table .eyc__row th,
  .eyc .eyc__table .eyc__row td {
    padding-left: 12px;
    padding-right: 12px;
  }

  .eyc .eyc__table .eyc__row th,
  .eyc .eyc__table .eyc__row td {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .eyc__year-value {
    font-size: 20px;
  }

  /* Badge drops under the year so the row stays narrow */
  .eyc__badge {
    display: block;
    width: max-content;
    margin: 6px 0 0 auto;
  }
}
