/* Countries v3 — light shell, hero, index, FAQ (scoped to country page types) */

:is(body.page-type-countries, body.page-type-countrycity, body.page-type-countries-index) {
  --countries-bg: #f8fafc;
  --countries-fg: #0f172a;
  --countries-muted: #64748b;
  --countries-accent: #0d9488;
  --countries-card: #ffffff;
  --countries-border: #e2e8f0;
  --countries-secondary: #f1f5f9;
  background: var(--countries-bg) !important;
  color: var(--countries-fg);
}

:is(body.page-type-countries, body.page-type-countrycity, body.page-type-countries-index)
  #content {
  color: var(--countries-fg);
}

:is(body.page-type-countries, body.page-type-countrycity) #mainContainer {
  display: none !important;
}

:is(body.page-type-countries, body.page-type-countrycity, body.page-type-countries-index)
  #locationSuggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 40rem;
  margin: 1.5rem auto 0;
  padding: 0 1rem;
}

/* Related locations: chip is the link only — neutralize legacy .locationSuggestion card */
:is(body.page-type-countries, body.page-type-countrycity, body.page-type-countries-index)
  #locationSuggestions
  .locationSuggestion {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: default;
}

:is(body.page-type-countries, body.page-type-countrycity, body.page-type-countries-index)
  #locationSuggestions
  .locationSuggestion:hover {
  border: none;
  background: transparent;
  transform: none;
  box-shadow: none;
}

:is(body.page-type-countries, body.page-type-countrycity, body.page-type-countries-index)
  #locationSuggestions
  .locationSuggestionTitle {
  margin: 0;
  padding: 0;
  font-size: inherit;
}

:is(body.page-type-countries, body.page-type-countrycity, body.page-type-countries-index)
  #locationSuggestions
  .locationSuggestionLink {
  cursor: pointer;
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--countries-fg);
  background: var(--countries-card);
  border: 1px solid var(--countries-border);
  border-radius: 9999px;
  text-decoration: none;
}

:is(body.page-type-countries, body.page-type-countrycity, body.page-type-countries-index)
  #locationSuggestions
  .locationSuggestionLink:hover {
  border-color: var(--countries-accent);
  color: var(--countries-accent);
}

:is(body.page-type-countries, body.page-type-countrycity, body.page-type-countries-index)
  #searchBar {
  max-width: 40rem;
  margin: 1.5rem auto 0;
  padding: 0 1rem;
}

/* Hero */
.country-hero {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 2.5rem;
  border-radius: 1rem;
  border: 1px solid var(--countries-border);
  background: var(--countries-card);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 24px -12px rgba(15, 23, 42, 0.08);
}

.country-hero__title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--countries-fg);
}

@media (min-width: 640px) {
  .country-hero__title {
    font-size: 1.5rem;
  }
}

.country-hero__accent {
  color: var(--countries-accent);
}

.country-hero__subline {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--countries-muted);
}

.country-hero__clock-row {
  display: flex;
  justify-content: center;
  margin-top: 1.25rem;
}

/*
 * Instrument hero clock — must beat global #secondTime { font-size: 1.8rem } in style.css
 * (ID beats a lone class). Scope with page type + .country-hero + #secondTime.
 */
:is(body.page-type-countries, body.page-type-countrycity)
  .country-hero
  #secondTime.country-hero__time {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 0.05em;
  font-size: clamp(4rem, 22vw, 8rem) !important;
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "lnum";
  color: var(--countries-fg) !important;
  min-height: 0.92em;
}

:is(body.page-type-countries, body.page-type-countrycity)
  .country-hero
  #secondTime.country-hero__time
  .hero-clock-hm {
  font-size: 1em;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  color: inherit;
}

:is(body.page-type-countries, body.page-type-countrycity)
  .country-hero
  #secondTime.country-hero__time
  .hero-clock-sec {
  font-size: 0.44em;
  font-weight: 600;
  letter-spacing: -0.02em;
  opacity: 0.5;
  color: var(--countries-muted);
}

:is(body.page-type-countries, body.page-type-countrycity)
  .country-hero
  #secondDate.country-hero__date {
  margin: 0.5rem 0 0;
  font-size: 0.875rem !important;
  color: var(--countries-muted) !important;
  text-align: center;
}

.country-hero__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.5rem;
  margin-top: 1.5rem;
  font-size: 0.8125rem;
}

.country-hero__chip {
  padding: 0.25rem 0.5rem;
  font-weight: 500;
  border-radius: 0.375rem;
  border: 1px solid var(--countries-border);
  background: rgba(241, 245, 249, 0.6);
  color: var(--countries-fg);
  font-variant-numeric: tabular-nums;
}

.country-hero__chip--dst-active {
  background: rgba(13, 148, 136, 0.1);
  border-color: transparent;
  color: var(--countries-accent);
  font-size: 0.75rem;
}

.country-hero__chip-sep {
  color: var(--countries-muted);
}

.country-hero__callout {
  margin-top: 1.25rem;
  padding: 0.625rem 0.75rem;
  border-left: 2px solid var(--countries-accent);
  background: rgba(241, 245, 249, 0.4);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--countries-fg);
}

.country-hero__callout-text {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.country-hero__callout a {
  display: inline-block;
  margin-top: 0.25rem;
  color: var(--countries-accent);
  text-decoration: none;
}

.country-hero__callout a:hover {
  text-decoration: underline;
}

@media (max-width: 639px) {
  .country-hero__chips {
    margin-top: 1rem;
    gap: 0.375rem 0.375rem;
  }

  .country-hero__callout {
    margin-top: 0.5rem;
    padding: 0.375rem 0.5rem;
    font-size: 0.6875rem;
    line-height: 1.3;
  }

  .country-hero__callout-text {
    gap: 0;
  }

  .country-hero__callout + .country-hero__zone-footer {
    margin-top: 0.625rem;
    padding-top: 0.625rem;
  }
}

/* Zone cities — integrated footer inside .country-hero (Archetype B) */
.country-hero__zone-footer {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--countries-border);
}

.country-hero__zone-title {
  margin: 0 0 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--countries-muted);
}

.country-hero__zone-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.country-hero__zone-row {
  display: grid;
  grid-template-columns: 1fr 5.25rem 3.25rem 5.75rem;
  align-items: center;
  column-gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.8125rem;
  border-top: 1px solid var(--countries-border);
}

.country-hero__zone-row:first-child {
  border-top: none;
  padding-top: 0;
}

.country-hero__zone-name {
  font-weight: 500;
  color: var(--countries-fg);
  min-width: 0;
}

.country-hero__zone-time {
  justify-self: end;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--countries-fg);
  white-space: nowrap;
}

.country-hero__zone-abbr {
  justify-self: center;
  padding: 0.125rem 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
  border: 1px solid var(--countries-border);
  border-radius: 0.25rem;
  background: rgba(241, 245, 249, 0.6);
}

.country-hero__zone-offset {
  justify-self: end;
  text-align: right;
  font-size: 0.6875rem;
  color: var(--countries-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 380px) {
  .country-hero__zone-row {
    grid-template-columns: 1fr 4.75rem 2.75rem 5.25rem;
    column-gap: 0.5rem;
  }
}

/* Breadcrumb */
.country-breadcrumb {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem 1.5rem 0;
  font-size: 0.8125rem;
  color: var(--countries-muted);
}

.country-breadcrumb a {
  color: var(--countries-muted);
  text-decoration: none;
}

.country-breadcrumb a:hover {
  color: var(--countries-accent);
}

.country-up-link {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1.5rem 1rem;
  font-size: 0.875rem;
}

.country-up-link a {
  color: var(--countries-accent);
  text-decoration: none;
}

.country-up-link a:hover {
  text-decoration: underline;
}

/* Index */
.countries-index {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.countries-index__title {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

@media (min-width: 640px) {
  .countries-index__title {
    font-size: 2.25rem;
  }
}

.countries-index__subtitle {
  margin: 0.5rem 0 0;
  max-width: 42rem;
  font-size: 0.9375rem;
  color: var(--countries-muted);
}

.countries-index__search {
  width: 100%;
  height: 3rem;
  margin-top: 1.5rem;
  padding: 0 1rem;
  font-size: 0.9375rem;
  border: 1px solid var(--countries-border);
  border-radius: 0.75rem;
  background: var(--countries-card);
  color: var(--countries-fg);
  box-sizing: border-box;
}

.countries-index__search:focus {
  outline: none;
  border-color: var(--countries-accent);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.3);
}

.countries-index__tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-top: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
}

.countries-index__tab {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--countries-border);
  border-radius: 9999px;
  background: var(--countries-card);
  color: var(--countries-fg);
  cursor: pointer;
}

.countries-index__tab[aria-selected="true"] {
  background: var(--countries-fg);
  border-color: var(--countries-fg);
  color: var(--countries-bg);
}

.countries-index__section-label {
  margin: 1.5rem 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--countries-muted);
}

.countries-index__featured {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .countries-index__featured {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .countries-index__featured {
    grid-template-columns: repeat(3, 1fr);
  }
}

.countries-index__layout {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
}

.countries-index__rail {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  width: 2rem;
  flex-shrink: 0;
  position: sticky;
  top: 5rem;
  align-self: flex-start;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
}

@media (min-width: 1024px) {
  .countries-index__rail {
    display: flex;
  }
}

.countries-index__rail a {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--countries-muted);
  text-decoration: none;
  text-align: center;
}

.countries-index__rail a:hover {
  color: var(--countries-accent);
}

.countries-index__grid-wrap {
  flex: 1;
  min-width: 0;
}

.countries-index__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .countries-index__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .countries-index__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .countries-index__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.country-index-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border: 1px solid var(--countries-border);
  border-radius: 0.75rem;
  background: var(--countries-card);
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.country-index-card:hover {
  border-color: rgba(13, 148, 136, 0.4);
  background: rgba(241, 245, 249, 0.3);
}

.country-index-card--featured {
  border-color: rgba(13, 148, 136, 0.25);
}

.country-index-card__live {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--countries-muted);
}

.country-index-card__live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--countries-accent);
}

.country-index-card__body {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.country-index-card__name {
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-index-card__capital {
  font-size: 0.8125rem;
  color: var(--countries-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-index-card__time {
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.country-index-card__abbr {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--countries-muted);
  text-align: right;
}

.country-index-card__foot {
  display: flex;
  justify-content: space-between;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--countries-muted);
  font-variant-numeric: tabular-nums;
}

.country-index-card__view {
  color: var(--countries-accent);
  opacity: 0;
  transition: opacity 0.15s;
}

.country-index-card:hover .country-index-card__view {
  opacity: 1;
}

.countries-index__empty {
  padding: 2rem;
  text-align: center;
  border: 1px dashed var(--countries-border);
  border-radius: 0.75rem;
  background: var(--countries-card);
  color: var(--countries-muted);
}

.countries-index__letter-anchor {
  scroll-margin-top: 5rem;
  grid-column: 1 / -1;
  height: 0;
  margin: 0;
  padding: 0;
}

.countries-index__letter-heading {
  grid-column: 1 / -1;
  margin: 1.5rem 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--countries-muted);
}

/* FAQ — light accordion on country pages */
:is(body.page-type-countries, body.page-type-countrycity)
  .localInfoContainer.converter-faq-section {
  max-width: 40rem;
  margin: 2rem auto 2.5rem;
  padding: 0 1rem;
  box-sizing: border-box;
}

:is(body.page-type-countries, body.page-type-countrycity)
  .converter-faq-heading.localInfoTitle {
  width: 100%;
  text-align: left;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--countries-fg);
  margin: 0 0 0.75rem 0.25rem;
}

:is(body.page-type-countries, body.page-type-countrycity)
  .converter-faq-card.localInfoList {
  width: 100% !important;
  max-width: none;
  margin: 0;
  padding: 0 1rem;
  background: var(--countries-card);
  border: 1px solid var(--countries-border);
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

:is(body.page-type-countries, body.page-type-countrycity)
  .converter-faq-item.outerLocalInfo {
  display: flex !important;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0 0.5rem;
  margin: 0 !important;
  padding: 0;
  border-bottom: 1px solid var(--countries-border);
}

:is(body.page-type-countries, body.page-type-countrycity)
  .converter-faq-item.outerLocalInfo:last-child {
  border-bottom: none;
}

:is(body.page-type-countries, body.page-type-countrycity)
  .converter-faq-question.localKey {
  flex: 1 1 0;
  min-width: 0;
  color: var(--countries-fg);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  margin: 0;
  padding: 1rem 0 1rem 0;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

:is(body.page-type-countries, body.page-type-countrycity)
  .converter-faq-toggle.accordion-toggle {
  flex: 0 0 auto;
  align-self: flex-start;
  margin: 0.85rem 0 0 0;
  padding: 0.35rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  color: var(--countries-muted) !important;
  border: none !important;
  border-radius: 0.5rem;
  cursor: pointer;
  transform: none !important;
  font-size: 0 !important;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

:is(body.page-type-countries, body.page-type-countrycity)
  .converter-faq-toggle.accordion-toggle:hover,
:is(body.page-type-countries, body.page-type-countrycity)
  .converter-faq-toggle.accordion-toggle:focus-visible {
  background: var(--countries-secondary) !important;
  color: var(--countries-fg) !important;
}

:is(body.page-type-countries, body.page-type-countrycity)
  .converter-faq-toggle.accordion-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.22);
}

/* Visually hide "Read more/less" — chevron + question row handle toggle */
:is(body.page-type-countries, body.page-type-countrycity)
  .converter-faq-toggle-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:is(body.page-type-countries, body.page-type-countrycity)
  .converter-faq-toggle::after {
  content: "";
  display: block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

:is(body.page-type-countries, body.page-type-countrycity)
  .converter-faq-toggle.accordion-toggle[aria-expanded="true"]::after {
  transform: rotate(-135deg);
  margin-top: 0.15rem;
}

:is(body.page-type-countries, body.page-type-countrycity)
  .converter-faq-answer.localValue {
  flex: 1 1 100%;
  width: 100%;
  margin: 0 !important;
  padding: 0 0 1rem 0;
  color: var(--countries-muted);
  font-size: 0.875rem;
  line-height: 1.65;
}

:is(body.page-type-countries, body.page-type-countrycity)
  .converter-faq-answer.localValue.collapsed {
  display: none;
}
