/* Reusable components. One block per component, BEM-style names. */

/* Icon (inline SVG sprite) */
.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100%;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-4);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: var(--space-3) var(--space-5);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font: 600 var(--text-base) / 1.2 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--dur-micro),
    color var(--dur-micro),
    border-color var(--dur-micro),
    transform var(--dur-small) var(--ease-out);
}

.button:active {
  transform: translateY(1px);
}

.button--primary {
  background: var(--color-primary);
  color: var(--gray-0);
}

.button--primary:hover {
  background: var(--color-primary-hover);
  color: var(--gray-0);
}

.button--secondary {
  background: var(--color-surface);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.button--secondary:hover {
  background: var(--color-surface-brand);
  color: var(--color-primary-hover);
}

.button--light {
  background: var(--gray-0);
  color: var(--navy-900);
}

.button--light:hover {
  background: var(--blue-100);
  color: var(--navy-900);
}

.button--ghost {
  background: transparent;
  color: var(--color-text);
  padding-inline: var(--space-3);
}

.button--ghost:hover {
  background: var(--color-surface-brand);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Announcement bar */
.announcement {
  padding-block: var(--space-2);
  background: var(--color-surface-brand);
  color: var(--navy-900);
  font-size: var(--text-sm);
  text-align: center;
}

.announcement--warning {
  background: var(--amber-50);
  color: var(--amber-700);
}

.announcement a {
  color: inherit;
  font-weight: 600;
}

/* Open / closed badge */
.status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--gray-50);
  color: var(--gray-900);
  font-size: var(--text-sm);
  font-weight: 600;
}

.status::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--gray-500);
}

.status--open {
  background: var(--green-50);
  color: var(--green-700);
}

.status--open::before {
  background: var(--green-500);
  box-shadow: 0 0 0 3px rgb(76 184 72 / 0.25);
}

/* Home hero */
.hero {
  background: var(--color-surface);
  padding-block: var(--space-6) var(--space-7);
}

.hero h1 {
  font-size: var(--text-display);
  letter-spacing: var(--tracking-display);
  line-height: var(--leading-display);
  font-weight: 500;
  margin-bottom: var(--space-5);
}

.hero__inner {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}

@media (min-width: 960px) {
  .hero {
    padding-block: var(--space-8);
  }

  .hero__inner {
    grid-template-columns: 1.25fr 1fr;
    gap: var(--space-7);
  }
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  color: var(--color-primary);
  font-weight: 600;
}

.hero__lead {
  max-width: 34rem;
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

.hero__media {
  position: relative;
}

.hero__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12rem 12rem var(--radius-lg) var(--radius-lg); /* shopfront arch */
  box-shadow: var(--shadow);
}

.hero__badge {
  position: absolute;
  left: var(--space-4);
  bottom: calc(-1 * var(--space-5));
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: var(--text-sm);
}

.hero__badge strong {
  display: block;
  color: var(--navy-900);
  font-family: var(--font-heading);
  font-size: var(--text-lg);
}

.hero__badge .icon {
  width: 2rem;
  height: 2rem;
  color: var(--color-primary);
}

/* Action cards (prescription / transfer / vaccine) */
.action-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}

@media (hover: hover) {
  .action-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
  }
}

/* Press feedback, so a tap on a phone visibly lands. */
.action-card:active {
  transform: scale(0.985);
}

/* Home: three ways to get help. First is the main job, so it leads. */
@media (min-width: 960px) {
  .action-list {
    grid-template-columns: 1.4fr 1fr 1fr;
    align-items: stretch;
  }

  .action-list .action-card:first-child {
    background: var(--navy-900);
    border-color: var(--navy-900);
    color: var(--gray-0);
    padding: var(--space-6);
  }

  .action-list .action-card:first-child h3,
  .action-list .action-card:first-child .action-card__link,
  .action-list .action-card:first-child p,
  .action-list .action-card:first-child .action-card__more {
    color: var(--gray-0);
  }

  .action-list .action-card:first-child h3 {
    font-size: var(--text-2xl);
  }
}

.action-card h3 {
  margin: 0;
  font-size: var(--text-lg);
}

.action-card p {
  margin: 0;
  color: var(--color-text-muted);
}

.action-card__link {
  color: inherit;
  text-decoration: none;
}

/* Whole card is clickable via the heading link */
.action-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.action-card__more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: auto;
  color: var(--color-primary);
  font-weight: 600;
}

.icon-tile {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius);
  background: var(--color-surface-brand);
  color: var(--color-primary);
}

.icon-tile .icon {
  width: 1.5rem;
  height: 1.5rem;
}

.icon-tile--green {
  background: var(--green-50);
  color: var(--green-700);
}

/* Hours table */
.hours-table th,
.hours-table td {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}

.hours-table td {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.section--brand .hours-table th,
.section--brand .hours-table td {
  border-color: rgb(255 255 255 / 0.15);
}

.hours-table__today {
  font-weight: 700;
}

/* Contact list */
.contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-list li {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding-block: var(--space-2);
}

.contact-list .icon {
  margin-top: 0.15em;
  color: var(--color-accent);
}

/* A 44px tap area for phone and email links, without spacing the list out. */
.contact-list a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-block: -0.6rem;
}

/* Map (loads only when asked, so no third-party requests before that) */
.map {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--blue-50);
}

.map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.map__placeholder {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-3);
  height: 100%;
  padding: var(--space-5);
  text-align: center;
  color: var(--navy-900);
}

.map__placeholder p {
  margin: 0;
  max-width: 22rem;
  font-size: var(--text-sm);
}

/* Inner page hero */
.page-hero {
  padding-block: var(--space-7) var(--space-6);
  background: var(--color-surface-brand);
  border-bottom: 1px solid var(--color-border);
}

.page-hero h1 {
  font-size: clamp(2.25rem, 1.4rem + 3.2vw, 3.75rem);
  font-weight: 500;
  letter-spacing: var(--tracking-display);
  line-height: 1.02;
}

.page-hero p {
  max-width: 40rem;
  margin: 0;
  font-size: var(--text-lg);
  color: var(--gray-900);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: var(--space-2);
  color: var(--color-text-muted);
}

/* Callout / notice */
.notice {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius);
  background: var(--color-surface-brand);
  border-left: 4px solid var(--color-primary);
}

.notice > .icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--color-primary);
}

.notice h2,
.notice h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice--success {
  background: var(--green-50);
  border-color: var(--green-700);
}

.notice--success > .icon {
  color: var(--green-700);
}

/* Steps list ("how it works") */
.steps {
  counter-reset: step;
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 3.25rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--gray-0);
  font-family: var(--font-heading);
  font-weight: 800;
}

.steps strong {
  display: block;
  color: var(--navy-900);
}

/* Sticky action bar on phones */
.action-bar {
  position: fixed;
  inset: auto 0 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 16px rgb(14 42 107 / 0.08);
  padding-bottom: env(safe-area-inset-bottom);
}

.action-bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) var(--space-1);
  color: var(--navy-900);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.action-bar a:first-child {
  color: var(--color-primary);
}

.action-bar .icon {
  width: 1.4rem;
  height: 1.4rem;
}

@media (min-width: 640px) {
  .action-bar {
    display: none;
  }
}

/* Home and Advice: pharmacist care, guides and forms. Editorial rows rather than one more
   grid of cards, so the page keeps a varied rhythm. */
.eyebrow {
  margin-bottom: var(--space-3);
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.section--care {
  background: var(--color-surface-brand);
}

.care {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 960px) {
  .care {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-8);
    align-items: start;
  }

  .care__intro {
    position: sticky;
    top: var(--space-6);
  }
}

.care__intro h2 {
  font-size: var(--text-3xl);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.care__lead {
  max-width: 28rem;
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

.care__privacy {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-5);
  color: var(--green-700);
  font-weight: 600;
}

.care__privacy .icon {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
}

/* Rows: a number (optional), a title with a line of text, and an arrow. */
.index-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: index;
  border-top: 1px solid var(--color-border);
}

.section--care .index-list,
.section--care .index-list__item {
  border-color: rgb(14 42 107 / 0.18);
}

.index-list__item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--color-border);
  counter-increment: index;
}

.index-list__item:focus-within {
  background: rgb(14 42 107 / 0.04);
}

.index-list--numbered .index-list__item {
  grid-template-columns: 3rem minmax(0, 1fr) auto;
}

.index-list--numbered .index-list__item::before {
  content: counter(index, decimal-leading-zero);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-primary);
}

/* On phones the number sits above the title, so the title gets the full width. */
@media (max-width: 639px) {
  .index-list--numbered .index-list__item {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: var(--space-2);
  }

  .index-list--numbered .index-list__item::before {
    grid-column: 1 / -1;
    font-size: var(--text-base);
  }
}

.index-list__item h3 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-2xl);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.index-list__item p {
  max-width: 36rem;
  margin: 0;
  color: var(--color-text-muted);
}

.index-list__link {
  color: var(--color-heading);
  text-decoration: none;
}

/* The whole row is the link, as with the action cards. */
.index-list__link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.index-list__arrow {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--color-primary);
  transition: transform var(--dur-small) var(--ease-out);
}

@media (hover: hover) {
  .index-list__item:hover .index-list__arrow {
    transform: translateX(6px);
  }

  .index-list__item:hover .index-list__link {
    color: var(--color-primary);
  }
}

/* Advice tiles on the home page */
.advice-grid {
  display: grid;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 720px) {
  .advice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  .advice-grid {
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  }
}

.advice-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.advice-tile h3 {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 500;
}

.advice-tile h3 a {
  color: var(--color-heading);
  text-decoration: none;
}

.advice-tile h3 a:hover {
  text-decoration: underline;
}

.advice-tile p {
  margin: 0;
  color: var(--color-text-muted);
}

.advice-tile__links {
  display: grid;
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}

.advice-tile__links a {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  border-top: 1px solid var(--color-border);
  font-weight: 500;
}

/* Advice page: a heading and blurb beside each category's guides */
.advice-group {
  display: grid;
  gap: var(--space-5);
  padding-block: var(--space-6);
  border-top: 1px solid var(--color-border);
  scroll-margin-top: var(--space-5);
}

.advice-group:first-child {
  padding-top: 0;
  border-top: 0;
}

@media (min-width: 960px) {
  .advice-group {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: var(--space-8);
  }
}

.advice-group__head h2 {
  margin-bottom: var(--space-2);
  font-size: var(--text-2xl);
}

.advice-group__head p {
  color: var(--color-text-muted);
}

.advice-help {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 960px) {
  .advice-help {
    grid-template-columns: 2fr 1fr;
    gap: var(--space-8);
    align-items: start;
  }
}

.advice-help h2 {
  font-size: var(--text-2xl);
}

.advice-help p {
  max-width: 36rem;
}

/* Home: the services the help cards don't already cover, as slim rows */
.service-list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 960px) {
  .service-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-5);
  }
}

.service-row {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition:
    border-color var(--dur-small) var(--ease-out),
    background-color var(--dur-micro) var(--ease-out);
}

.service-row h3 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-lg);
}

.service-row p {
  margin: 0;
  color: var(--color-text-muted);
}

.service-row__link {
  color: var(--color-heading);
  text-decoration: none;
}

/* The whole row is the link, as with the action cards. */
.service-row__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.service-row:focus-within {
  border-color: var(--color-primary);
}

.service-row:active {
  background: var(--color-surface-alt);
}

@media (hover: hover) {
  .service-row:hover {
    border-color: var(--color-primary);
  }

  .service-row:hover .service-row__link {
    color: var(--color-primary);
  }
}

/* Opening hours in a card, where there's no map to fill the space. It sits inside the navy
   Visit us section, so it sets its own text and border colours. */
.hours-card {
  align-self: start;
  padding: var(--space-5);
  background: var(--color-surface-brand);
  border-radius: var(--radius-lg);
  color: var(--color-text);
}

.hours-card p {
  margin: 0;
}

.hours-card h2,
.hours-card h3 {
  margin: var(--space-4) 0 var(--space-2);
  color: var(--color-heading);
  font-size: var(--text-xl);
}

.hours-card .hours-table {
  width: 100%;
}

.hours-card .hours-table th,
.hours-card .hours-table td {
  border-color: rgb(14 42 107 / 0.15);
}

.hours-card .hours-table tr:last-child th,
.hours-card .hours-table tr:last-child td {
  border-bottom: 0;
}

/* A slim band pointing to the useful forms page */
.forms-band {
  padding-block: var(--space-7);
}

.forms-band__inner {
  display: grid;
  gap: var(--space-5);
  align-items: center;
}

@media (min-width: 960px) {
  .forms-band__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-8);
  }
}

.forms-band h2 {
  margin-bottom: var(--space-2);
  font-size: var(--text-2xl);
}

.forms-band p {
  max-width: 40rem;
  margin: 0;
  color: var(--color-text-muted);
}

/* Error pages */
.error-page {
  padding-block: var(--space-8);
  text-align: center;
}

.error-page .button-row {
  justify-content: center;
}

/* Calm entrance: opacity and a small lift, once. Removed for reduced motion. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity var(--dur-medium) var(--ease-out),
    transform 600ms var(--ease-out);
}

.js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (forced-colors: active) {
  .button {
    border-color: ButtonText;
  }
}
