/* Food Locator styles. Colours and type follow the legacy foodbank.css. */

:root {
  --green: #68ab4d;
  --dark-green: #53883d;
  --deep-green: #066132;
  --orange: #f4b136;
  --brown: #504a34;
  --taupe: #6f6b6b;
  --line: #ddd;
  --info-bg: #f0f7fd; --info-border: #d0e3f0; --info-text: #31708f;
  --warn-bg: #fefbed; --warn-border: #f1e7bc; --warn-text: #8a6d3b;
  --danger-bg: #fcf2f2; --danger-border: #dfb5b4; --danger-text: #a94442;
  --sans: "azo-sans-web", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "adelle", Georgia, serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--taupe);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  background: #fff;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--serif); color: var(--brown); font-weight: 300; margin: 0.6em 0 0.4em; }
h1, h2, h3 { overflow-wrap: break-word; }
h1 { font-size: 2.2rem; line-height: 1.1; }
h2 { font-size: 1.75rem; line-height: 1.15; }
h3 { font-size: 1.4rem; line-height: 1.25; }
h4 { font-size: 1.2rem; }
a { color: var(--dark-green); }
img { max-width: 100%; }
[hidden] { display: none !important; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
main.container { min-height: 60vh; padding-bottom: 32px; outline: none; }
.text-center { text-align: center; }
.narrow { max-width: 640px; margin-left: auto; margin-right: auto; }
.dark-green, .home h2, .home h3, .faq h2 { color: var(--dark-green); }
.muted { color: var(--taupe); font-size: 0.9rem; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 2000; }

/* Shown on every deployment except the production host (see config.productionHosts) */
.test-banner { background: #a94442; color: #fff; text-align: center; padding: 8px 16px; font-size: .95rem; }
.test-banner a { color: #fff; }

/* Header */
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sfmfb-logo { width: 145px; height: auto; margin: 20px 0; display: block; }
.header-nav { display: flex; align-items: center; gap: 16px; }
.start-over { text-decoration: none; }
.orange-bar { height: 4px; background: var(--orange); margin-bottom: 20px; }

.lang-menu { position: relative; }
.lang-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; color: var(--dark-green); padding: 6px; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-list { position: absolute; right: 0; top: 100%; z-index: 1000; margin: 4px 0 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 12px rgba(0,0,0,.18); min-width: 160px; }
.lang-list button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 16px; font: inherit; color: #333; cursor: pointer; }
.lang-list button:hover, .lang-list button:focus { background: #f5f5f5; }
.lang-list button[aria-current="true"]::after { content: " ✓"; color: var(--dark-green); }

@media (max-width: 600px) {
  .sfmfb-logo { width: 110px; margin: 10px 0; }
}

/* Buttons */
.btn {
  display: inline-block; padding: 8px 14px; font: inherit; font-size: 1rem; line-height: 1.4;
  color: #333; background: #fff; border: 1px solid #ccc; border-radius: 4px;
  cursor: pointer; text-decoration: none; text-align: center; white-space: normal;
}
.btn:hover, .btn:focus { background: #e6e6e6; border-color: #adadad; }
.btn-lg { padding: 12px 18px; font-size: 1.15rem; }
.btn-success { color: #fff; background: #5cb85c; border-color: #4cae4c; }
.btn-success:hover, .btn-success:focus { background: #449d44; border-color: #398439; }
.btn-primary { color: #fff; background: var(--deep-green); border-color: var(--deep-green); }
.btn-primary:hover, .btn-primary:focus { background: #04492a; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-link { background: none; border: 0; color: var(--dark-green); text-decoration: underline; padding: 6px 0; font: inherit; font-size: 1rem; cursor: pointer; }
.btn-link:hover, .btn-link:focus { background: none; }
.btn-stack { display: flex; flex-direction: column; gap: 0; max-width: 480px; margin: 12px auto; }
.btn-stack > .btn { border-radius: 0; margin-top: -1px; }
.btn-stack > .btn:first-child { border-radius: 4px 4px 0 0; margin-top: 0; }
.btn-stack > .btn:last-child { border-radius: 0 0 4px 4px; }
.btn-stack > .btn:only-child { border-radius: 4px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0; }
.segmented { display: inline-flex; }
.segmented .btn { border-radius: 0; }
.segmented .btn:first-child { border-radius: 4px 0 0 4px; }
.segmented .btn:last-child { border-radius: 0 4px 4px 0; margin-left: -1px; }
.segmented .btn[aria-pressed="true"] { color: #fff; background: #5cb85c; border-color: #4cae4c; }

/* Callouts */
.callout { margin: 20px 0; padding: 15px 20px; border-left: 3px solid #eee; }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }
.callout-info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-text); }
.callout-warning { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.callout-danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger-text); }
.callout a { color: inherit; font-weight: bold; }

/* Questionnaire */
.home { padding-bottom: 40px; }
.zip-input { font-size: 1.4rem; padding: 10px 12px; width: 100%; max-width: 280px; border: 1px solid #ccc; border-radius: 4px; }
.zip-input:focus { outline: 2px solid var(--green); border-color: var(--green); }
.zip-input.valid { border-color: #3c763d; }
.zip-input.invalid { border-color: var(--warn-text); }
.checks { list-style: none; padding: 0; margin: 0; border-top: 1px solid #eee; }
.checks li { border-bottom: 1px solid #eee; }
.checks label { display: flex; align-items: center; gap: 16px; padding: 14px 4px; cursor: pointer; font-family: var(--serif); font-size: 1.3rem; color: var(--dark-green); }
.checks input { width: 28px; height: 28px; flex: none; accent-color: #3c763d; }
.privacy-note { margin-top: 24px; font-size: .9rem; text-align: center; }
.more-links { list-style: none; padding: 16px 0 0; margin: 24px 0 0; border-top: 1px solid #eee; text-align: center; }
.more-links li { margin: 4px 0; }
.more-links .btn-link { font-size: inherit; }

/* Results */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--deep-green); margin: 24px 0 16px; padding: 0; list-style: none; }
.tabs li { flex: 1 1 0; min-width: 120px; }
.tabs button {
  width: 100%; padding: 10px 8px; font: inherit; font-size: 1rem; cursor: pointer;
  background: #ddd; color: var(--deep-green); text-decoration: underline;
  border: 1px solid #fff; border-bottom: 0; border-radius: 25px 25px 0 0;
}
.tabs button[aria-selected="true"] { background: #fff; border-color: var(--deep-green); font-weight: bold; text-decoration: none; margin-bottom: -1px; }
@media (max-width: 600px) {
  .tabs { flex-direction: column; border-bottom: 0; }
  .tabs button { border-radius: 4px; border: 1px solid #ccc; }
  .tabs button[aria-selected="true"] { border-color: var(--deep-green); margin: 0; }
}

.list-heading { text-align: center; }
.sort-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: center; margin: 8px 0 16px; }
.sort-bar select { font: inherit; padding: 6px 8px; }

.site-card { border-bottom: 1px solid #eee; padding: 8px 0 20px; }
.site-card h2 { margin-bottom: 4px; }
.site-card h2 small { font-size: 0.65em; color: var(--taupe); }
.site-card h2 small span { white-space: nowrap; }
.card-actions { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 6px 0 4px; }
.card-actions a { text-decoration: none; }
.card-actions a:hover { text-decoration: underline; }
.card-body { display: grid; grid-template-columns: 7fr 5fr; gap: 24px; align-items: start; }
@media (max-width: 760px) { .card-body { grid-template-columns: 1fr; } }

.resource-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.resource-table th, .resource-table td { text-align: left; vertical-align: top; padding: 6px; border-top: 1px solid var(--line); color: var(--brown); font-weight: normal; }
.resource-table th { width: 45%; font-weight: bold; }
.resource-table ul { list-style: none; margin: 0; padding: 0; }
.resource-table td.status-wait { background: var(--warn-bg); color: var(--warn-text); }
.resource-table td.status-closed { background: var(--danger-bg); color: var(--danger-text); font-weight: bold; }

.map-col { text-align: center; }
.static-map { position: relative; display: block; width: 100%; max-width: 320px; height: 180px; margin: 10px auto 6px; overflow: hidden; background: #e8e8e8; border: 1px solid var(--line); }
.static-map img { position: absolute; width: 256px; height: 256px; max-width: none; }
.static-map .pin { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -22px 0 0 -11px; background: #d9342b; border: 2px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.static-map .credit { position: absolute; right: 0; bottom: 0; font-size: 10px; background: rgba(255,255,255,.8); padding: 0 4px; color: #333; }
.map-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 16px; }

.more-row { text-align: center; margin: 16px 0; }
.survey-link { background: var(--deep-green); color: #fff; padding: 15px; text-align: center; margin-top: 16px; }
.survey-link a { color: #fff; }
.phone-cta { font-size: 1.3rem; }

/* FAQ / content */
.content-html { color: var(--brown); }
.content-html img { height: auto; }

/* Staff map */
.map-page h1 { font-size: 1.8rem; }
.map-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 10px; }
.map-controls select { font: inherit; padding: 6px 8px; }
#resource-map { height: 70vh; min-height: 420px; border: 1px solid var(--line); }
.leaflet-popup-content { font-size: 14px; }
.leaflet-popup-content h3 { font-size: 1.1rem; margin: 0 0 4px; }

/* Footer */
.site-footer { background: var(--green); color: #c0edae; margin-top: 40px; position: relative; }
.herringbone-top, .herringbone-bottom { height: 12px; background: url("../images/sfmfb-herringbone-white.png") repeat-x; }
.herringbone-bottom { transform: rotate(180deg); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; padding-top: 20px; padding-bottom: 20px; }
.site-footer h4 { color: #fff; font-family: var(--sans); text-transform: uppercase; letter-spacing: .05em; font-size: 1rem; }
.site-footer a { color: #c0edae; }
.site-footer a:hover { color: #f1fbed; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 4px; }

/* Print: just the listings */
.print-only { display: none; }
@media print {
  .test-banner { background: none; color: #000; border: 2px solid #000; }
  .no-print, .tabs, .sort-bar, .card-actions, .more-row, .btn, .btn-row, .survey-link, .map-links { display: none !important; }
  .print-only { display: block; }
  body { font-size: 11pt; color: #000; }
  h2 { font-size: 14pt; }
  .site-card { page-break-inside: avoid; }
  .card-body { grid-template-columns: 2fr 1fr; }
  .static-map { height: 140px; }
  a[href]::after { content: ""; }
}
