/* ============================================================
   zipcodes.com.ng — style.css
   Single flat stylesheet. No imports. No preprocessor.
   All colour values via CSS custom properties only.
   ============================================================ */


/* ------------------------------------------------------------
   Font faces
   ------------------------------------------------------------ */

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/inter-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}


/* ------------------------------------------------------------
   Design tokens
   ------------------------------------------------------------ */

:root {
  --bg:            #FFFFFF;
  --surface:       #F5F5F7;
  --surface-2:     #E8E8ED;
  --border:        #D2D2D7;
  --border-focus:  #1B4FFF;
  --text:          #1D1D1F;
  --text-2:        #6E6E73;
  --text-3:        #AEAEB2;
  --accent:        #1B4FFF;
  --accent-hover:  #0035E0;
  --accent-subtle: #EEF1FF;
  --success:       #1A7F37;
  --error:         #CF222E;
}


/* ------------------------------------------------------------
   Reset
   ------------------------------------------------------------ */

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

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

p {
  margin: 0;
}

ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  display: block;
}


/* ------------------------------------------------------------
   Page-level layout
   body > nav, main, and footer share a centred column.
   The breadcrumb nav is inside main — excluded via child combinator.
   ------------------------------------------------------------ */

body > nav,
main,
footer {
  max-width: 720px;
  margin-inline: auto;
  padding-inline: 24px;
}

@media (min-width: 768px) {
  body > nav,
  main,
  footer {
    padding-inline: 48px;
  }
}


/* ------------------------------------------------------------
   Site nav
   ------------------------------------------------------------ */

body > nav {
  padding-block: 20px;
  border-bottom: 1px solid var(--border);
}

.site-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.site-name:hover {
  color: var(--accent);
}


/* ------------------------------------------------------------
   Main
   ------------------------------------------------------------ */

main {
  padding-block-end: 64px;
}


/* ------------------------------------------------------------
   Breadcrumb
   ------------------------------------------------------------ */

.breadcrumb {
  display: block;
  font-size: 0.875rem;
  color: var(--text-3);      /* separator " / " inherits this */
  margin-top: 24px;
  margin-bottom: 16px;
  padding: 0;
  border: none;
  background: none;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.breadcrumb span {           /* current page — not a link */
  color: var(--text);
  font-weight: 500;
}


/* ------------------------------------------------------------
   Headings
   ------------------------------------------------------------ */

h1 {
  font-size: 1.5rem;         /* 24px — state and LGA pages */
  margin-bottom: 8px;
}

h2 {
  font-size: 1.25rem;        /* 20px — section subheadings */
  margin-top: 40px;
  margin-bottom: 16px;
}

h2:first-child {
  margin-top: 0;
}

/* Locality page title — 28px, applied by the Function template */
.locality-title {
  font-size: 1.75rem;
}


/* ------------------------------------------------------------
   Intro paragraph
   ------------------------------------------------------------ */

.intro {
  font-size: 1rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-top: 8px;
  margin-bottom: 32px;
}


/* ------------------------------------------------------------
   LGA list  (state pages)
   ------------------------------------------------------------ */

.lga-list {
  margin-bottom: 8px;
}

.lga-list li,
.other-areas li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.lga-list li:last-child,
.other-areas li:last-child {
  border-bottom: none;
}

.lga-list a,
.other-areas a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.lga-list a:hover,
.other-areas a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.lga-count {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-3);
  margin-left: 8px;
}


/* ------------------------------------------------------------
   Other Areas section  (state pages — localities with no LGA)
   ------------------------------------------------------------ */

.other-areas {
  margin-top: 8px;
}


/* ------------------------------------------------------------
   Locality table  (LGA pages)
   ------------------------------------------------------------ */

.locality-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-bottom: 32px;
}

.locality-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-3);
  padding: 0 0 8px;
  border-bottom: 1px solid var(--border);
}

.locality-table th:last-child {
  text-align: right;
}

.locality-table td {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
  line-height: 1.4;
}

.locality-table tr:last-child td {
  border-bottom: none;
}

.locality-table td a {
  color: var(--accent);
  text-decoration: none;
}

.locality-table td a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.locality-table td.postcode {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
  padding-left: 16px;
}


/* ------------------------------------------------------------
   Homepage hero
   ------------------------------------------------------------ */

.hero {
  padding-top: 64px;
  padding-bottom: 48px;
}

@media (min-width: 768px) {
  .hero {
    padding-top: 96px;
    padding-bottom: 64px;
  }
}

.hero h1 {
  font-size: 1.75rem;        /* 28px on mobile */
  margin-bottom: 8px;
}

@media (min-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 0;
}


/* ------------------------------------------------------------
   Search input
   ------------------------------------------------------------ */

.search-wrap {
  margin-top: 24px;
}

#search-input {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s ease;
}

#search-input::placeholder {
  color: var(--text-3);
}

#search-input:focus {
  border-color: var(--border-focus);
}


/* ------------------------------------------------------------
   Search results  (populated by search.js)
   ------------------------------------------------------------ */

#search-results {
  margin-top: 4px;
}

#search-results ul {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

#search-results li {
  border-bottom: 1px solid var(--border);
}

#search-results li:last-child {
  border-bottom: none;
}

#search-results a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
}

#search-results a:hover {
  background: var(--surface);
}

#search-results .result-locality {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

#search-results .result-postcode {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  flex-shrink: 0;
}

#search-results .result-lga {
  font-size: 0.75rem;
  color: var(--text-3);
  flex-shrink: 0;
  white-space: nowrap;
}


/* ------------------------------------------------------------
   State grid  (homepage)
   ------------------------------------------------------------ */

.states-section {
  margin-top: 48px;
}

.states-section h2 {
  margin-top: 0;
  margin-bottom: 16px;
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

.state-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.state-card:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

.state-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.state-count {
  font-size: 0.75rem;
  color: var(--text-3);
}


/* ------------------------------------------------------------
   Ad slot
   ------------------------------------------------------------ */

.ad-slot {
  margin: 32px 0;
}


/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */

footer {
  padding-block: 32px;
  border-top: 1px solid var(--border);
}

footer p {
  font-size: 0.875rem;
  color: var(--text-3);
}

footer a {
  color: var(--text-3);
  text-decoration: none;
}

footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}


/* ------------------------------------------------------------
   Postcode answer card
   Speculative — used by the Cloudflare Function locality pages.
   Class names to be referenced in the Function HTML template.
   ------------------------------------------------------------ */

.answer-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-top: 32px;
  margin-bottom: 32px;
}

.answer-postcode {
  display: block;
  font-size: 3.5rem;         /* 56px */
  font-weight: 600;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
}

.answer-label {
  display: block;
  font-size: 0.875rem;       /* 14px */
  color: var(--text-2);
}


/* ------------------------------------------------------------
   New postcode system notice  (locality pages)
   ------------------------------------------------------------ */

.new-system-note {
  margin: 24px 0;
  padding: 16px;
  background: var(--accent-subtle);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text-2);
}

.new-system-note a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.new-system-note a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}
