/* ============================================================
   grants.css — Támogatási Pályázatfigyelő (/palyazatfigyelo/)
   Only what notices.css, service-subpages.css and editorial.css lack:
   the filter row, the keret meter, the facts list, badges, the suspended
   group and the state panels. Rows reuse .notice-row, .notice-when,
   .notice-deadline, .notice-days, .notice-badge, .notice-title and
   .notice-link from notices.css.

   A separate stylesheet for the same reason as notices.css: js/grants.js
   builds the rows, so PurgeCSS never sees these classes in the built HTML.
   No backdrop blur anywhere.
   ============================================================ */

.grants-card {
  max-width: 820px;
}

/* ---------- Filters ---------- */

/* Row 1: "Ki pályázna?" dropdown and the keyword field side by side.
   Row 2: the loan toggle. One column on phones. The select reuses .form-select
   from components.css, the same box as the keyword's .form-input. */
.grant-search-row {
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  gap: 0.9rem 1.25rem;
  align-items: end;
}

.grant-group .form-label {
  display: block;
  margin-bottom: 0.4rem;
}

/* Same box height for both fields, the select otherwise sits 1px taller. */
.grant-search-row .form-select,
.grant-search-row .form-input {
  height: 2.9rem;
}

.grant-group .form-select {
  cursor: pointer;
}

.grant-group .form-select:disabled {
  cursor: default;
  opacity: 0.6;
}

.grant-search .form-label {
  display: block;
  margin-bottom: 0.4rem;
}

.grant-loan {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  grid-column: 1 / -1;
  justify-self: start;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--color-ink);
  cursor: pointer;
  padding-bottom: 0.35rem;
}

.grant-loan input {
  margin-top: 0.2rem;
  flex: none;
}

.grant-loan small {
  display: block;
  font-size: 0.78rem;
  color: rgba(15, 23, 42, 0.62);
}

.grant-list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 1rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--color-rule);
}

.grant-list-head .notices-status,
.grant-fresh {
  margin: 0;
}

.grant-fresh {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: rgba(15, 23, 42, 0.6);
}

/* Reserve the list's height while the JSON loads, so the CTA band below does
   not jump (CLS). Cleared once rows are in. */
.grants-results:empty {
  min-height: 24rem;
}

.grants-results[hidden] {
  display: none;
}

/* "Mutass még 5-öt": the notices page's outline button (.notices-more in
   notices.css), sized to its text and centred under the list. */
.notices-more.grant-more {
  width: auto;
  margin: 1.25rem auto 0;
  padding: 0.7rem 1.6rem;
}

.notices-more.grant-more:focus-visible {
  outline: 2px solid var(--color-cobalt);
  outline-offset: 2px;
}

/* A call revealed by the button takes focus (tabindex -1). */
.grant-row[tabindex="-1"]:focus {
  outline: none;
}

.grant-row[tabindex="-1"]:focus-visible {
  outline: 2px solid var(--color-cobalt);
  outline-offset: 2px;
}

/* ---------- Rows ---------- */

.grant-row .notice-when {
  gap: 0.15rem;
}

.grant-when-label {
  font-size: 0.72rem;
  line-height: 1.35;
  color: rgba(15, 23, 42, 0.6);
}

.grant-row .notice-title {
  font-size: 1rem;
  margin: 0 0 0.15rem;
}

.grant-code {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: rgba(15, 23, 42, 0.6);
  margin: 0 0 0.45rem;
}

.grant-who,
.grant-region {
  font-size: 0.86rem;
  line-height: 1.45;
  color: rgba(15, 23, 42, 0.78);
  margin: 0 0 0.45rem;
}

.grant-region {
  font-weight: 600;
}

.grant-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.5rem;
  margin: 0 0 0.6rem;
  font-size: 0.88rem;
}

.grant-facts__item {
  display: flex;
  gap: 0.35rem;
}

.grant-facts dt {
  color: rgba(15, 23, 42, 0.6);
  font-weight: 400;
}

.grant-facts dd {
  margin: 0;
  font-weight: 600;
  color: var(--color-ink);
}

/* Badges: programme neutral, Új filled, Módosult outlined, loan ink. */
.grant-badge {
  text-transform: none;
  letter-spacing: 0.02em;
  border: 1px solid rgba(15, 23, 42, 0.16);
  color: rgba(15, 23, 42, 0.78);
  background: #ffffff;
}

.grant-badge--new {
  background: var(--color-cobalt);
  border-color: var(--color-cobalt);
  color: #ffffff;
}

.grant-badge--mod {
  border-color: var(--color-cobalt);
  color: var(--color-cobalt);
}

.grant-badge--loan {
  border-color: var(--color-ink);
  color: var(--color-ink);
}

.grant-badge--susp {
  border-color: var(--color-ink);
  color: var(--color-ink);
  background: #f1f5f9;
}

.grant-badge--soon {
  border-color: #b45309;
  color: #92400e;
}

/* ---------- Keret meter ---------- */

.grant-keret {
  max-width: 34rem;
  margin: 0 0 0.25rem;
}

.grant-keret__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.84rem;
  margin-bottom: 0.3rem;
  color: rgba(15, 23, 42, 0.78);
}

.grant-keret__head strong {
  font-weight: 600;
  color: var(--color-ink);
}

.grant-keret__info {
  flex: none;
  font: inherit;
  font-size: 0.8rem;
  background: none;
  border: 0;
  padding: 0;
  color: var(--color-cobalt);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.grant-keret__info:focus-visible {
  outline: 2px solid var(--color-cobalt);
  outline-offset: 2px;
}

.grant-keret__track {
  position: relative;
  height: 6px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 1px;
  overflow: hidden;
}

.grant-keret__fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--color-primary-blue, #1e40af);
}

/* At or over the budget: amber, and said in words, not by colour alone. */
.grant-keret--over .grant-keret__fill {
  background: #b45309;
}

.grant-keret--over .grant-keret__head strong {
  color: #92400e;
}

/* ---------- Suspended group ---------- */

.grant-suspended {
  border-top: 1px solid var(--color-rule);
  padding: 0.9rem 0 0.2rem;
  margin-top: 0.25rem;
}

.grant-suspended[hidden] {
  display: none;
}

.grant-suspended summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-primary-blue, #1e40af);
}

.grant-suspended summary:focus-visible {
  outline: 2px solid var(--color-cobalt);
  outline-offset: 2px;
}

.grant-suspended__note {
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(15, 23, 42, 0.72);
  margin: 0.6rem 0 0;
  max-width: 64ch;
}

.notice-row--suspended {
  color: rgba(15, 23, 42, 0.78);
}

.notice-row--suspended .notice-deadline {
  color: rgba(15, 23, 42, 0.7);
}

/* ---------- States ---------- */

.grant-state {
  border: 1px solid var(--color-rule);
  background: var(--color-cream);
  border-radius: 4px;
  padding: 1rem 1.15rem;
  margin: 1rem 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

.grant-state[hidden] {
  display: none;
}

.grant-state p {
  margin: 0 0 0.5rem;
}

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

.grant-state--stale {
  border-left: 3px solid #b45309;
  background: #fffbeb;
}

.grant-state__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

/* ---------- Sections below the list ---------- */

/* Audiences, "Ki pályázna?": native <details>, no JS. Kicker, H3 and chevron
   in the summary, the ledger's type styles for the text. */
.grants-audience-list {
  border-top: 1px solid var(--color-rule);
}

.grants-audience {
  border-bottom: 1px solid var(--color-rule);
}

.grants-audience__summary {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr) auto;
  column-gap: 2.5rem;
  align-items: start;
  padding: 1.35rem 0.75rem 1.35rem 1rem;
  cursor: pointer;
  list-style: none;
  transition: background-color 0.2s ease;
}

.grants-audience__summary::-webkit-details-marker {
  display: none;
}

.grants-audience__summary::marker {
  content: "";
}

.grants-audience__summary:hover {
  background: rgba(37, 99, 235, 0.04);
}

.grants-audience__summary:focus-visible {
  outline: 2px solid var(--color-cobalt);
  outline-offset: -2px;
}

.grants-audience__summary .alternatives-ledger__title {
  margin: 0;
}

.grants-audience__chevron {
  width: 0.6rem;
  height: 0.6rem;
  margin-top: 0.35rem;
  border-right: 2px solid var(--color-cobalt);
  border-bottom: 2px solid var(--color-cobalt);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.grants-audience[open] .grants-audience__chevron {
  transform: rotate(-135deg);
  margin-top: 0.6rem;
}

.grants-audience[open] .grants-audience__summary .alternatives-ledger__title {
  color: var(--color-cobalt);
}

.grants-audience__body {
  padding: 0 0.75rem 1.5rem calc(1rem + 11rem + 2.5rem);
}

.grants-audience__body .alternatives-ledger__body + .alternatives-ledger__body {
  margin-top: 0.6rem;
}

@media (prefers-reduced-motion: reduce) {
  .grants-audience__chevron,
  .grants-audience__summary {
    transition: none;
  }
}

@media (max-width: 760px) {
  .grants-audience__summary {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 0.3rem;
  }

  .grants-audience__summary .alternatives-ledger__kicker {
    grid-column: 1;
    margin: 0;
  }

  .grants-audience__summary .alternatives-ledger__title {
    grid-column: 1;
  }

  .grants-audience__chevron {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    margin-top: 0;
  }

  .grants-audience[open] .grants-audience__chevron {
    margin-top: 0.3rem;
  }

  .grants-audience__body {
    padding: 0 0.75rem 1.25rem 1rem;
  }
}

.grants-coverage__note {
  margin-top: 1.25rem;
  font-size: 0.95rem;
  color: rgba(15, 23, 42, 0.75);
}

/* ---------- Phones ---------- */

@media (max-width: 600px) {
  .grant-search-row {
    grid-template-columns: 1fr;
  }

  .grant-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .grant-row .notice-when {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0.6rem;
  }

  .grant-row .notice-link {
    display: flex;
    width: 100%;
  }

  .grant-keret__head {
    flex-wrap: wrap;
  }
}

/* ---------- v2: e-mail notifier signup (#ertesito) ----------
   Form column (60%) and the "Így működik" column side by side, stacked on
   phones. Form fields reuse .alert-page-form (service-subpages.css) and
   .gdpr-checkbox (main.css). Solid backgrounds only, no backdrop blur. */

.grants-signup {
  background: #fff;
}

.grants-signup__grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 2.5rem;
  max-width: 980px;
  margin: 2rem auto 0;
  align-items: start;
}

.grants-signup__form.alert-page-form {
  margin: 0;
}

.grants-signup__set {
  border: 0;
  margin: 0 0 1.6rem;
  padding: 0;
  min-width: 0;
}

.grants-signup__set legend {
  padding: 0;
}

.grants-signup__legend-hint {
  margin: -0.25rem 0 0.6rem;
}

.grants-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 1rem;
}

.grants-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-rule);
  border-radius: 2px;
  background: #fff;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--color-ink);
  cursor: pointer;
}

.grants-check input {
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.12rem 0 0;
  accent-color: var(--color-cobalt);
}

.grants-check:has(input:checked) {
  border-color: var(--color-cobalt);
  background: #f5f8fe;
}

.grants-check:has(input:focus-visible) {
  outline: 2px solid var(--color-cobalt);
  outline-offset: 2px;
}

.grants-check--loan {
  border: 0;
  padding: 0;
  background: none;
}

.grants-check--loan:has(input:checked) {
  background: none;
}

.grants-signup__set.is-invalid .grants-check {
  border-color: #dc2626;
}

.grants-field-error {
  margin: 0.45rem 0 0;
  font-size: 0.86rem;
  font-weight: 500;
  color: #991b1b;
}

.grants-signup__more {
  margin: 0 0 1.6rem;
  border: 1px solid var(--color-rule);
  border-radius: 2px;
  background: var(--color-cream, #faf8f3);
}

.grants-signup__more > summary {
  padding: 0.8rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-ink);
  cursor: pointer;
}

.grants-signup__more > summary:focus-visible {
  outline: 2px solid var(--color-cobalt);
  outline-offset: 2px;
}

.grants-signup__more-body {
  padding: 0.25rem 1rem 1.1rem;
}

.grants-signup__more-body .grants-check {
  background: #fff;
}

.grants-signup__after {
  margin: 0;
  text-align: center;
}

.grants-signup__success {
  padding: 1.25rem 1.25rem 1.1rem;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-left: 3px solid var(--color-cobalt);
  border-radius: 2px;
  background: #f5f8fe;
  line-height: 1.6;
}

.grants-signup__success:focus {
  outline: 2px solid var(--color-cobalt);
  outline-offset: 2px;
}

.grants-signup__success p {
  margin: 0 0 0.5rem;
}

.grants-signup__success-title {
  font-size: 1.1rem;
}

.grants-signup__side {
  padding: 1.4rem 1.4rem 1.5rem;
  border: 1px solid var(--color-rule);
  border-radius: 2px;
  background: var(--color-cream, #faf8f3);
}

.grants-signup__side h3 {
  margin: 0 0 0.8rem;
  font-size: 1.15rem;
}

.grants-signup__how {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.grants-signup__how li {
  position: relative;
  padding: 0.4rem 0 0.4rem 1.2rem;
  border-top: 1px solid var(--color-rule);
  font-size: 0.93rem;
  line-height: 1.45;
}

.grants-signup__how li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 6px;
  height: 6px;
  background: var(--color-cobalt);
}

.grants-signup__sample {
  padding: 0.9rem 1rem;
  border: 1px solid var(--color-rule);
  border-left: 3px solid var(--color-cobalt);
  border-radius: 2px;
  background: #fff;
  font-size: 0.88rem;
  line-height: 1.5;
}

.grants-signup__sample p {
  margin: 0 0 0.45rem;
}

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

.grants-signup__sample-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.6);
}

.grants-signup__sample-kind {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0 0.4rem;
  border: 1px solid var(--color-cobalt);
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-cobalt);
}

.grants-signup__sample .grant-code {
  display: inline;
  font-size: 0.8rem;
}

.grant-state__alert {
  text-decoration: none;
}

@media (max-width: 860px) {
  .grants-signup__grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

@media (max-width: 600px) {
  .grants-checks {
    grid-template-columns: 1fr;
  }
}

/* .prose-section p sets a larger body size, the sample stays compact. */
.grants-signup .grants-signup__sample p {
  font-size: 0.9rem;
  line-height: 1.5;
}

.grants-signup .grants-signup__sample .grants-signup__sample-label {
  margin-bottom: 0.55rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  line-height: 1.4;
}

.grants-signup .grants-signup__success p {
  font-size: 1rem;
}

.grants-signup .grants-field-error {
  margin: 0.45rem 0 0;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.4;
  color: #991b1b;
}

/* ---------- Hero quick setup (#grantQuick) ----------
   The notifier's first step in the hero side: heading, the four "Így működik"
   points, an e-mail field and "Tovább a feliratkozáshoz". It sends nothing:
   js/grant-alerts.js hands the address and the list filters to #grantAlertForm.
   White card with a cobalt top rule, like the other hero signup cards
   (.alert-hub--hero, .ertesites-start). Kept short by its wording (owner,
   2026-11-18): three one-line points, no rules between them, field and button
   on one row from 1024px, stacked below. The label is visually hidden, the
   placeholder names the field. Solid background, no backdrop blur. */

.page-hero .page-hero-image .grant-quick {
  width: 100%;
  max-width: 31rem;
}

.grant-quick {
  background: #fff;
  border: 1px solid var(--color-rule);
  border-top: 3px solid var(--color-cobalt);
  border-radius: 2px;
  padding: 1.5rem 1.5rem 1.4rem;
  text-align: left;
  color: var(--color-ink);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}

.page-hero .grant-quick p {
  margin: 0;
  text-shadow: none;
}

.page-hero .grant-quick .grant-quick__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-ink);
  margin: 0 0 0.75rem;
}

.grant-quick__how {
  margin: 0 0 1.15rem;
  padding: 0;
  list-style: none;
}

.grant-quick__how li {
  position: relative;
  padding: 0.3rem 0 0.3rem 1.2rem;
  font-size: 0.93rem;
  line-height: 1.45;
  color: rgba(15, 23, 42, 0.82);
}

.grant-quick__how li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 6px;
  height: 6px;
  background: var(--color-cobalt);
}

.grant-quick__row {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.grant-quick__field {
  flex: 1 1 auto;
  min-width: 0;
}

.grant-quick__field .form-input {
  width: 100%;
  margin: 0;
  padding: 11px 14px;
  font-size: 1rem;
  line-height: 1.4;
}

.page-hero .grant-quick .grant-quick__go {
  display: block;
  padding: 11px 18px;
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  box-shadow: none;
}

@media (min-width: 1024px) {
  .grant-quick__row {
    flex-direction: row;
    align-items: stretch;
  }

  .page-hero .grant-quick .grant-quick__go {
    flex: 0 0 auto;
  }
}

/* Without JavaScript the field would be a dead input: the card is the four
   points and a jump link to #ertesito. */
html:not(.js-enabled) .grant-quick__field {
  display: none;
}

@media (max-width: 1023px) {
  .page-hero .page-hero-image .grant-quick {
    max-width: 34rem;
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .grant-quick {
    padding: 1.25rem 1.1rem 1.15rem;
  }

  .page-hero .grant-quick .grant-quick__title {
    font-size: 1.2rem;
  }
}
