/*
 * Avista Care theme — what theme.json cannot express.
 * Values follow the Avista Core design system (see theme.json for the palette):
 * hairlines over shadows, 4px controls, 10px cards.
 */

/* Full-height page: the footer sits at the bottom even when the content is short. */
.wp-site-blocks {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.wp-site-blocks > .avc-main {
  flex: 1 0 auto;
}

.avc-main {
  padding-top: var(--wp--preset--spacing--70);
  padding-bottom: var(--wp--preset--spacing--80);
}

/* Paper: a single document on a white card (legal pages, single posts, 404). */
.avc-paper,
.avc-card {
  background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 10px;
  box-sizing: border-box;
}

.avc-paper {
  padding: var(--wp--preset--spacing--70);
}

.avc-paper > .wp-block-post-title:first-child,
.avc-paper > .wp-block-heading:first-child,
.avc-paper > .wp-block-post-content:first-child > :first-child,
.avc-paper > .wp-block-post-date:first-child + .wp-block-post-title {
  margin-top: 0;
}

/* Timeline cards (What's new, archives, search). */
.avc-timeline .wp-block-post-template {
  display: flex;
  flex-direction: column;
  gap: var(--wp--preset--spacing--40);
  margin-top: var(--wp--preset--spacing--60);
  padding: 0;
  list-style: none;
}

.avc-card {
  padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--60);
}

.avc-card > * {
  margin-top: 0;
}

.avc-card > * + * {
  margin-top: var(--wp--preset--spacing--20);
}

.avc-card .wp-block-post-title a {
  color: inherit;
  text-decoration: none;
}

.avc-card .wp-block-post-title a:hover {
  color: var(--wp--preset--color--accent);
}

/* Expandable rows (core/details): hairline-separated, + / − marker on the right. */
.wp-site-blocks .wp-block-details {
  border-bottom: 1px solid var(--wp--preset--color--line);
  padding: var(--wp--preset--spacing--30) 0;
  margin-top: 0;
}

.wp-site-blocks :not(.wp-block-details) + .wp-block-details {
  border-top: 1px solid var(--wp--preset--color--line);
}

.wp-site-blocks .wp-block-details summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--wp--preset--spacing--30);
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.wp-site-blocks .wp-block-details summary::-webkit-details-marker {
  display: none;
}

.wp-site-blocks .wp-block-details summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--wp--preset--color--muted);
  font-weight: 400;
  font-size: 1.25em;
  line-height: 1;
}

.wp-site-blocks .wp-block-details[open] summary::after {
  content: "\2212";
}

.wp-site-blocks .wp-block-details summary:hover {
  color: var(--wp--preset--color--accent);
}

.wp-site-blocks .wp-block-details > :not(summary) {
  margin-top: var(--wp--preset--spacing--20);
  color: var(--wp--preset--color--muted);
}

/* Back link above a page title. */
.avc-back a {
  color: var(--wp--preset--color--muted);
  text-decoration: none;
}

.avc-back a::before {
  content: "\2190\00a0";
}

.avc-back a:hover {
  color: var(--wp--preset--color--accent);
}

/* Header */
.avc-logo img {
  border-radius: 8px;
}

.avc-header .wp-block-site-title a {
  text-decoration: none;
}

.avc-header__cta .wp-block-button__link {
  padding: 8px 14px;
}

/* Footer links */
.avc-footer__nav a {
  text-decoration: none;
}

.avc-footer__nav a:hover {
  color: var(--wp--preset--color--accent);
}

/* Long legal text: keep tables and long compounds inside the card. */
.avc-paper .wp-block-post-content {
  overflow-wrap: break-word;
}

.avc-paper table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--wp--preset--font-size--small);
}

.avc-paper th,
.avc-paper td {
  border: 1px solid var(--wp--preset--color--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--wp--preset--color--accent);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  /* Long Icelandic and legal titles: keep them to a few lines on a phone.
     Scoped to .wp-site-blocks so the AvistaCareHub app pages, which load this
     stylesheet too but render their own document, are never resized. */
  .wp-site-blocks h1 {
    font-size: 28px;
  }

  .wp-site-blocks .has-x-large-font-size {
    font-size: 28px !important;
  }

  .wp-site-blocks .has-large-font-size {
    font-size: 20px !important;
  }

  .avc-main {
    padding-top: var(--wp--preset--spacing--50);
    padding-bottom: var(--wp--preset--spacing--60);
  }

  .avc-paper {
    padding: var(--wp--preset--spacing--50);
  }

  .avc-card {
    padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
  }

  .avc-header__cta .wp-block-button__link {
    padding: 6px 10px;
  }
}
