/* =====================================================================
   CITIES DIRECTORY — builds on modern.css / modern-home.css tokens
   ===================================================================== */

.ct-container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* Serif display headings, like the rest of the site */
.ct-hero h1,
.ct-section-head h2 {
    font-family: var(--font-serif) !important;
    font-weight: 500 !important;
    letter-spacing: -0.02em !important;
    color: var(--ink);
}
.ct-hero h1 em,
.ct-section-head h2 em { font-style: italic; color: var(--brand); }

/* ---------- Hero ---------- */
.ct-hero {
    padding: 28px 0 56px;
    background:
        radial-gradient(45% 70% at 90% 10%, rgba(255, 138, 92, .16) 0%, rgba(255, 138, 92, 0) 70%),
        radial-gradient(40% 70% at 5% 0%, rgba(242, 82, 79, .10) 0%, rgba(242, 82, 79, 0) 70%),
        linear-gradient(180deg, #fffaf8 0%, #fff 100%);
}
.ct-crumbs { display: flex; gap: 8px; font-size: 13.5px; color: var(--muted); margin-bottom: 28px; }
.ct-crumbs a { color: var(--muted); }
.ct-crumbs a:hover { color: var(--brand); text-decoration: none; }
.ct-crumbs [aria-current] { color: var(--ink); font-weight: 600; }
.ct-hero-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.ct-hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); line-height: 1.06; margin: 0 0 16px; }
.ct-lead { font-size: 1.1rem; line-height: 1.7; color: var(--muted); margin: 0 auto 30px; max-width: 600px; }

.ct-search {
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 640px;
    margin: 0 auto;
    padding: 8px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 18px 40px -18px rgba(15, 23, 42, .25), var(--shadow-sm);
    text-align: left;
}
.ct-search-field { position: relative; flex: 1; min-width: 0; }
.ct-search-field i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.ct-search-field input {
    width: 100%;
    height: 50px;
    padding: 0 14px 0 44px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    font-size: 15.5px;
    color: var(--ink);
}
.ct-search-field input:focus { outline: none; background: var(--surface-2); }
.ct-search-divider { width: 1px; height: 32px; background: var(--line); flex-shrink: 0; }
.ct-state { flex: 0 0 210px; }
.ct-state .cb-trigger {
    height: 50px;
    border: 0;
    border-radius: 14px;
    padding-left: 14px;
    line-height: 50px;
    background-color: transparent;
    font-weight: 600;
}
.ct-state .cb-trigger:hover,
.ct-state.is-open .cb-trigger { background-color: var(--surface-2); box-shadow: none; }
.ct-state .cb-panel { left: auto; right: -8px; top: calc(100% + 16px); width: 300px; }
.ct-count { margin: 14px 0 0; font-size: 13.5px; color: var(--muted); }
.ct-count span { font-weight: 700; color: var(--ink); }

/* ---------- Section heads ---------- */
.ct-section-head { margin-bottom: 22px; }
.ct-section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.1; margin: 0; }

/* ---------- Featured ---------- */
.ct-featured { padding: 8px 0 64px; }
.ct-featured[hidden] { display: none; }
.ct-featured-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- Directory ---------- */
.ct-directory { padding: 0 0 96px; }
.ct-az {
    position: sticky;
    top: 72px;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 28px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}
.ct-az a,
.ct-az span {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}
.ct-az a { color: var(--ink); transition: background .15s var(--ease), color .15s var(--ease); }
.ct-az a:hover { background: var(--brand); color: #fff; text-decoration: none; }
.ct-az a.is-dim { color: #cbd5e1; pointer-events: none; }
.ct-az span.is-empty { color: #e2e8f0; }

.ct-group { scroll-margin-top: 150px; margin-bottom: 36px; }
.ct-group[hidden] { display: none; }
.ct-letter {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 16px;
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 1.9rem;
    color: var(--brand);
}
.ct-letter::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.ct-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ct-city {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--ink) !important;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.ct-city[hidden] { display: none; }
.ct-city:hover { border-color: transparent; box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.ct-city-ic {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-50);
    color: var(--brand);
    font-size: 13px;
    transition: background .2s var(--ease), color .2s var(--ease);
}
.ct-city:hover .ct-city-ic { background: var(--brand); color: #fff; }
.ct-city-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.ct-city-text strong { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-city-text small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-city-go { font-size: 11px; color: var(--muted); opacity: 0; transform: translateX(-4px); transition: opacity .2s var(--ease), transform .2s var(--ease); }
.ct-city:hover .ct-city-go { opacity: 1; transform: none; color: var(--brand); }

/* ---------- Empty + missing city ---------- */
.ct-empty {
    padding: 56px 24px;
    border: 1px dashed var(--line);
    border-radius: 24px;
    background: var(--surface-2);
    text-align: center;
}
.ct-empty[hidden] { display: none; }
.ct-empty-ic {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: #fff;
    color: var(--brand);
    font-size: 22px;
    box-shadow: var(--shadow-sm);
}
.ct-empty h3 { margin: 0 0 8px; font-size: 1.3rem; font-weight: 700; color: var(--ink); }
.ct-empty p { margin: 0 auto 22px; max-width: 440px; color: var(--muted); }
.ct-empty-actions { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.ct-empty-actions .theme-btn-one { cursor: pointer; }

.ct-missing {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
    padding: 22px 24px;
    border-radius: 20px;
    border: 1px solid var(--brand-100);
    background: linear-gradient(90deg, var(--brand-50), #fff);
}
.ct-missing-ic {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: var(--shadow-brand);
}
.ct-missing > div { flex: 1; min-width: 0; }
.ct-missing strong { display: block; font-size: 15.5px; color: var(--ink); }
.ct-missing span { font-size: 14px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .ct-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
    .ct-featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ct-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .ct-container { padding: 0 16px; }
    .ct-hero { padding-bottom: 40px; }
    .ct-search { flex-direction: column; align-items: stretch; }
    .ct-search-divider { width: auto; height: 1px; margin: 0 12px; }
    .ct-state { flex: none; }
    .ct-az { top: 120px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .ct-az::-webkit-scrollbar { display: none; }
    .ct-az a, .ct-az span { flex-shrink: 0; }
    .ct-group { scroll-margin-top: 200px; }
    .ct-grid { grid-template-columns: 1fr; }
    .ct-missing { flex-wrap: wrap; }
    .ct-missing .btn-ghost { width: 100%; justify-content: center; }
}

/* Win over the older #city-search and .cb-field rules in modern*.css */
.ct-search #city-search {
    height: 50px !important;
    padding: 0 14px 0 44px !important;
    border: 0 !important;
    border-radius: 14px !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 15.5px !important;
}
.ct-search #city-search:focus { background: var(--surface-2) !important; }
.ct-search .ct-state .cb-trigger {
    border: 0 !important;
    box-shadow: none !important;
    background-color: transparent;
}
.ct-search .ct-state .cb-trigger:hover,
.ct-search .ct-state.is-open .cb-trigger { background-color: var(--surface-2); }
@media (max-width: 767px) { .ct-grid { grid-template-columns: minmax(0, 1fr); } }
