@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@600;700&display=swap');

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

:root {
  --teal: #0891b2;
  --teal-dark: #0e7490;
  --teal-light: #e0f2fe;
  --orange: #f97316;
  --orange-dark: #ea580c;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --white: #ffffff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
}

body { font-family: 'Inter', system-ui, sans-serif; color: var(--gray-900); background: var(--white); font-size: 16px; line-height: 1.6; }

/* ── Typography ── */
h1,h2,h3,h4,h5 { font-family: 'Poppins', sans-serif; line-height: 1.25; color: var(--gray-900); }
h1 { font-size: clamp(1.6rem,4vw,2.25rem); font-weight: 700; }
h2 { font-size: clamp(1.3rem,3vw,1.75rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p { margin-bottom: .75rem; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
.page-wrap { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

/* ── Header ── */
.site-header { background: var(--teal); color: var(--white); padding: .75rem 0; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-md); }
.header-inner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.site-logo { font-family: 'Poppins', sans-serif; font-size: 1.2rem; font-weight: 700; color: var(--white); white-space: nowrap; }
.site-logo span { color: #bae6fd; }
.header-search { flex: 1; min-width: 220px; }
.header-search input { width: 100%; padding: .55rem .9rem; border-radius: 8px; border: none; font-size: .95rem; background: rgba(255,255,255,.15); color: var(--white); }
.header-search input::placeholder { color: rgba(255,255,255,.7); }
.header-search input:focus { outline: 2px solid rgba(255,255,255,.5); background: rgba(255,255,255,.2); }
.header-nav { display: flex; gap: .5rem; }
.header-nav a { color: rgba(255,255,255,.9); font-size: .9rem; padding: .3rem .6rem; border-radius: 6px; transition: background .15s; }
.header-nav a:hover { background: rgba(255,255,255,.15); text-decoration: none; }

/* ── Hero ── */
.hero { background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 60%, #0ea5e9 100%); color: var(--white); padding: 3rem 1rem 3.5rem; text-align: center; }
.hero h1 { color: var(--white); margin-bottom: .75rem; }
.hero p { color: rgba(255,255,255,.85); max-width: 560px; margin: 0 auto 1.5rem; font-size: 1.05rem; }
.hero-search-box { max-width: 560px; margin: 0 auto; display: flex; gap: .5rem; }
.hero-search-box input { flex: 1; padding: .85rem 1.1rem; border-radius: 10px; border: none; font-size: 1rem; }
.hero-search-box button { padding: .85rem 1.4rem; background: var(--orange); color: var(--white); border: none; border-radius: 10px; font-weight: 600; cursor: pointer; font-size: 1rem; white-space: nowrap; transition: background .15s; }
.hero-search-box button:hover { background: var(--orange-dark); }
.search-results { max-width: 560px; margin: .5rem auto 0; background: var(--white); border-radius: 10px; box-shadow: var(--shadow-md); overflow: hidden; text-align: left; display: none; }
.search-results.visible { display: block; }
.search-result-item { padding: .7rem 1rem; border-bottom: 1px solid var(--gray-100); cursor: pointer; }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--gray-50); }
.search-result-item .sr-name { font-weight: 600; color: var(--gray-900); font-size: .95rem; }
.search-result-item .sr-loc { color: var(--gray-500); font-size: .85rem; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .75rem 1.25rem; border-radius: 10px; font-weight: 600; font-size: .95rem; cursor: pointer; border: none; transition: background .15s, transform .1s; min-height: 44px; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--teal); color: var(--white); }
.btn-primary:hover { background: var(--teal-dark); text-decoration: none; }
.btn-orange { background: var(--orange); color: var(--white); }
.btn-orange:hover { background: var(--orange-dark); text-decoration: none; }
.btn-outline { background: transparent; color: var(--teal); border: 2px solid var(--teal); }
.btn-outline:hover { background: var(--teal); color: var(--white); text-decoration: none; }
.btn-full { width: 100%; justify-content: center; }

/* ── Map ── */
.map-wrap { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); margin-bottom: 1.5rem; }
.map-wrap iframe { display: block; width: 100%; height: 320px; border: none; }

/* ── Restroom card (city listing) ── */
.restroom-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 1.5rem 0; }
@media(min-width:640px){ .restroom-grid { grid-template-columns: 1fr 1fr; } }
@media(min-width:900px){ .restroom-grid { grid-template-columns: 1fr 1fr 1fr; } }

.restroom-card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); transition: box-shadow .15s, border-color .15s; }
.restroom-card:hover { box-shadow: var(--shadow-md); border-color: var(--teal); }
.card-name { font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 1rem; margin-bottom: .3rem; }
.card-name a { color: var(--gray-900); }
.card-name a:hover { color: var(--teal); }
.card-addr { color: var(--gray-500); font-size: .85rem; margin-bottom: .6rem; }
.card-badges { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .75rem; }
.badge { font-size: .78rem; padding: .2rem .55rem; border-radius: 20px; font-weight: 500; background: var(--gray-100); color: var(--gray-700); }
.badge-free { background: #dcfce7; color: #15803d; }
.badge-accessible { background: #dbeafe; color: #1d4ed8; }
.badge-rating { background: #fef3c7; color: #92400e; }
.badge-hours { background: #f3e8ff; color: #7e22ce; }
.card-actions { display: flex; gap: .5rem; }
.card-actions a { flex: 1; text-align: center; padding: .5rem; border-radius: 8px; font-size: .85rem; font-weight: 600; min-height: 44px; display: flex; align-items: center; justify-content: center; }

/* ── Top 5 ranking ── */
.top5 { background: var(--teal-light); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 2rem; }
.top5 h3 { color: var(--teal-dark); margin-bottom: 1rem; }
.top5-item { display: flex; align-items: center; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid rgba(8,145,178,.15); }
.top5-item:last-child { border-bottom: none; }
.top5-rank { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 1.25rem; color: var(--teal); min-width: 2rem; }
.top5-info { flex: 1; }
.top5-info a { font-weight: 600; color: var(--gray-900); }
.top5-rating { font-size: .85rem; color: var(--gray-500); }

/* ── Detail page ── */
.detail-layout { display: grid; gap: 1.5rem; }
@media(min-width:768px){ .detail-layout { grid-template-columns: 1fr 340px; } }
.detail-main {}
.detail-sidebar {}

.info-block { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.info-block h3 { margin-bottom: .75rem; font-size: 1rem; color: var(--teal-dark); }
.info-row { display: flex; gap: .75rem; padding: .45rem 0; border-bottom: 1px solid var(--gray-200); }
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--gray-500); font-size: .85rem; min-width: 90px; }
.info-value { font-weight: 500; font-size: .9rem; }

.hours-table { width: 100%; font-size: .9rem; }
.hours-table tr { border-bottom: 1px solid var(--gray-200); }
.hours-table tr:last-child { border-bottom: none; }
.hours-table td { padding: .4rem 0; }
.hours-table td:last-child { text-align: right; color: var(--gray-700); }

.directions-btn { width: 100%; margin-bottom: 1rem; font-size: 1.05rem; padding: 1rem; }

/* ── Breadcrumbs ── */
.breadcrumbs { font-size: .85rem; color: var(--gray-500); margin: 1rem 0 1.5rem; display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.breadcrumbs a { color: var(--teal); }
.breadcrumbs span { color: var(--gray-300); }

/* ── Hub stats ── */
.hub-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.stat-box { background: var(--teal-light); border-radius: var(--radius); padding: 1rem; text-align: center; }
.stat-num { font-family: 'Poppins', sans-serif; font-size: 1.75rem; font-weight: 700; color: var(--teal-dark); }
.stat-lbl { font-size: .8rem; color: var(--gray-500); margin-top: .2rem; }

/* ── State grid ── */
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; margin: 1.5rem 0; }
.state-card { border: 1px solid var(--gray-200); border-radius: 10px; padding: .9rem 1.1rem; background: var(--white); transition: box-shadow .15s, border-color .15s; }
.state-card:hover { box-shadow: var(--shadow-md); border-color: var(--teal); }
.state-card a { color: var(--gray-900); font-weight: 600; }
.state-card a:hover { color: var(--teal); text-decoration: none; }
.state-card .sc-count { color: var(--gray-500); font-size: .85rem; }

/* ── Articles ── */
.articles-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 1.5rem 0; }
@media(min-width:640px){ .articles-grid { grid-template-columns: 1fr 1fr; } }
@media(min-width:900px){ .articles-grid { grid-template-columns: 1fr 1fr 1fr; } }

.article-card { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.25rem; background: var(--white); }
.article-card h3 { font-size: 1rem; margin-bottom: .5rem; }
.article-card h3 a { color: var(--gray-900); }
.article-card h3 a:hover { color: var(--teal); }
.article-card p { color: var(--gray-500); font-size: .875rem; margin: 0; }
.article-meta { font-size: .8rem; color: var(--gray-500); margin-bottom: .5rem; }

.article-body h2 { margin: 1.5rem 0 .75rem; }
.article-body h3 { margin: 1.25rem 0 .5rem; }
.article-body ul, .article-body ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.article-body li { margin-bottom: .4rem; }
.tip-box { background: #fff7ed; border-left: 4px solid var(--orange); border-radius: 0 var(--radius) var(--radius) 0; padding: 1rem 1.25rem; margin: 1.25rem 0; }
.tip-box strong { color: var(--orange-dark); }

/* ── AdSense ── */
.ad-slot { background: var(--gray-50); border: 1px dashed var(--gray-200); text-align: center; padding: 1rem; border-radius: 8px; overflow: hidden; }

/* ── Footer ── */
.site-footer { background: var(--gray-900); color: rgba(255,255,255,.7); padding: 2.5rem 0 1.5rem; margin-top: 3rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 2rem; }
.footer-section h4 { color: var(--white); font-family: 'Poppins', sans-serif; margin-bottom: .75rem; font-size: .95rem; }
.footer-section a { color: rgba(255,255,255,.6); display: block; margin-bottom: .35rem; font-size: .875rem; }
.footer-section a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.25rem; font-size: .8rem; text-align: center; }

/* ── Search overlay ── */
#search-overlay { display: none; position: fixed; top: 56px; left: 0; right: 0; background: var(--white); z-index: 99; box-shadow: var(--shadow-md); max-height: 70vh; overflow-y: auto; }
#search-overlay.active { display: block; }
.so-item { padding: .75rem 1rem; border-bottom: 1px solid var(--gray-100); display: flex; gap: .75rem; align-items: center; cursor: pointer; }
.so-item:hover { background: var(--gray-50); }
.so-item-info .name { font-weight: 600; }
.so-item-info .loc { color: var(--gray-500); font-size: .85rem; }

/* ── Utilities ── */
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.section-title { margin-bottom: 1.25rem; }
.city-list { list-style: none; columns: 2; column-gap: 1.5rem; }
@media(min-width:640px){ .city-list { columns: 3; } }
.city-list li { margin-bottom: .4rem; break-inside: avoid; }
.city-list a { font-size: .9rem; }
