/* ============================================================
   Design tokens
   ============================================================ */
:root {
  /* Colors */
  --color-bg:               #faf9f7;
  --color-fg:               #1c1917;
  --color-muted:            #78716c;
  --color-card:             #ffffff;
  --color-border:           #e7e5e4;
  --color-primary:          #2d6a4f;
  --color-primary-fg:       #ffffff;
  --color-primary-faint:    rgba(45, 106, 79, 0.07);
  --color-primary-subtle:   rgba(45, 106, 79, 0.10);
  --color-primary-dim:      rgba(45, 106, 79, 0.15);

  /* Typography */
  --font-body:    system-ui, -apple-system, sans-serif;
  --font-display: Georgia, 'Times New Roman', serif;

  /* Spacing & shape */
  --radius:      0.5rem;
  --nav-height:  4rem;

  /* Hero overlay — darkens bottom of image so text is legible */
  --hero-gradient: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.62) 0%,
    rgba(0, 0, 0, 0.18) 50%,
    transparent        100%
  );
}


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

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

ul {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}


/* ============================================================
   Base
   ============================================================ */
body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}


/* ============================================================
   Page layout
   ============================================================ */
main {
  max-width: 32rem;           /* mirrors Tailwind max-w-lg */
  margin-inline: auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-height) + 1.5rem);
}


/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  height: 18rem;              /* h-72 */
  overflow: hidden;
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--hero-gradient);
}

.hero-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.25rem;
}

.hero-text h1 {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--color-primary-fg);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  line-height: 1.2;
}

.hero-text p {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.82);
}


/* ============================================================
   Quick Access section
   ============================================================ */
section {
  padding: 1.25rem 1rem 0.75rem;
}

section h2 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

section ul {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Card link */
.card-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.15s ease, transform 0.1s ease;
}

.card-link:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
}

.card-link:active {
  transform: scale(0.98);
}

/* Icon bubble */
.icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--color-primary-subtle);
  color: var(--color-primary);
}

/* Card text block */
.card-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;         /* prevents flex children from overflowing */
}

.card-text strong {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-fg);
}

.card-text span {
  font-size: 0.8125rem;
  color: var(--color-muted);
}


/* ============================================================
   Welcome aside
   ============================================================ */
aside {
  margin: 0.75rem 1rem 0;
  padding: 1rem;
  background: var(--color-primary-faint);
  border: 1px solid var(--color-primary-dim);
  border-radius: var(--radius);
}

aside h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

aside p {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--color-muted);
}


/* ============================================================
   Bottom navigation
   ============================================================ */
nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  /* Respect the iOS home-indicator safe area */
  padding-bottom: env(safe-area-inset-bottom, 0);
}

nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius);
  color: var(--color-muted);
  font-size: 0.6875rem;       /* 11px */
  font-weight: 500;
  transition: color 0.15s ease;
}

nav a:hover {
  color: var(--color-fg);
}

nav a[aria-current="page"] {
  color: var(--color-primary);
}


/* ============================================================
   Food & Groceries page
   ============================================================ */

/* Wrapper that spaces the two category sections apart */
.food-sections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0 1rem;
}

/* Strip the broad `section` padding inside this layout */
.food-sections section {
  padding: 0;
}

/* Bare icon + heading row (no bubble — icon sits inline with text) */
.food-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  color: var(--color-primary);   /* colours the SVG stroke */
}

/* Keep the h2 text dark; cancel margin-bottom from the broad `section h2` rule */
.food-heading h2 {
  color: var(--color-fg);
  margin-bottom: 0;
}

/* Tighter gap than the broad `section ul` rule (space-y-2 = 0.5rem) */
.place-list {
  gap: 0.5rem;
}


/* ============================================================
   Page header (inner pages without a hero image)
   ============================================================ */
.page-header {
  padding: 1.5rem 1rem 1rem;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.page-header p {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--color-muted);
}


/* ============================================================
   Info cards
   ============================================================ */
.info-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 1rem;
}

.info-card {
  padding: 1rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.info-card-header h2 {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
}

/* Key-value pairs — two-column grid keeps labels and values aligned */
.info-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.info-card dt {
  font-weight: 600;
  color: var(--color-fg);
}

.info-card dd {
  color: var(--color-muted);
}

.info-card p {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--color-muted);
}

/* Extra breathing room when a paragraph follows a definition list */
.info-card dl + p {
  margin-top: 0.625rem;
}

/* Contact links (tel, sms, mailto) inside a card body */
.info-card a {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
}

.info-card a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Spacing between adjacent paragraphs, and between a link and a paragraph */
.info-card p + p,
.info-card a + p,
.info-card p + a {
  margin-top: 0.375rem;
}

/* Links embedded inside paragraphs or list items must stay inline */
.info-card p a,
.info-card li a {
  display: inline;
}

/* Content lists inside card body */
.info-card ul,
.info-card ol {
  padding-left: 1.25rem;
  margin-top: 0.5rem;
}

.info-card ul {
  list-style: disc;
}

.info-card ol {
  list-style: decimal;
}

.info-card li {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--color-muted);
}

.info-card li + li {
  margin-top: 0.375rem;
}


/* ============================================================
   Accordion (details / summary)
   ============================================================ */

/* Remove browser default disclosure marker */
details > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

/* ---- Info-card accordion ---- */

/* Remove bottom margin when collapsed; restore when open */
details.info-card > summary {
  margin-bottom: 0;
}

details.info-card[open] > summary {
  margin-bottom: 0.75rem;
}

/* Chevron — sits at far right of the flex header row */
.info-card-header::after {
  content: '';
  flex-shrink: 0;
  margin-left: auto;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1.5px solid var(--color-muted);
  border-bottom: 1.5px solid var(--color-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

details[open] > .info-card-header::after {
  transform: rotate(-135deg);
}

/* ---- Food / Activities section accordion ---- */

/* Remove bottom margin when collapsed; restore when open */
details.food-accordion > summary {
  margin-bottom: 0;
}

details.food-accordion[open] > summary {
  margin-bottom: 0.75rem;
}

/* Chevron — sits at far right of the flex heading row */
.food-heading::after {
  content: '';
  flex-shrink: 0;
  margin-left: auto;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1.5px solid var(--color-primary);
  border-bottom: 1.5px solid var(--color-primary);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

details[open] > .food-heading::after {
  transform: rotate(-135deg);
}


/* ============================================================
   Wider screens — centre the app column, pin nav to it
   ============================================================ */
@media (min-width: 32rem) {
  nav {
    /* Align nav to the same column as main */
    left: 50%;
    right: auto;
    width: 32rem;
    transform: translateX(-50%);
    border-inline: 1px solid var(--color-border);
    border-radius: var(--radius) var(--radius) 0 0;
  }
}


/* ============================================================
   Install-to-home-screen banner
   ============================================================ */
.install-banner {
  position: fixed;
  bottom: var(--nav-height);
  left: 0;
  right: 0;
  z-index: 48;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--color-fg);
  color: var(--color-primary-fg);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.18);
}

.install-banner[hidden] { display: none; }

.install-banner-icon {
  display: flex;
  flex-shrink: 0;
  opacity: 0.8;
}

.install-banner-msg {
  flex: 1;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
}

.install-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.install-accept-btn {
  padding: 0.375rem 0.875rem;
  background: var(--color-primary);
  color: var(--color-primary-fg);
  border: none;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.install-accept-btn:active {
  opacity: 0.85;
}

.install-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius);
}

.install-close-btn:hover {
  color: rgba(255, 255, 255, 0.9);
}

@media (min-width: 32rem) {
  .install-banner {
    left: 50%;
    right: auto;
    width: 32rem;
    transform: translateX(-50%);
    border-inline: 1px solid rgba(255, 255, 255, 0.08);
  }
}
