/* Mawsim · shared styles for the reflection resources (Seven Reflections, Path of Return, Knowledge to Transformation).
   Builds on /ramadan/styles.css, /dua/dua.css, /khushu/khushu.css and /speak/speak.css. */
.hr-page .ar { font-family: 'Amiri', 'Noto Naskh Arabic', 'Scheherazade New', 'Geeza Pro', 'Times New Roman', sans-serif; font-size: 1.35rem; line-height: 1.9; }
.hr-page p.ar { margin: 0 0 8px; text-align: right; }
.hr-page .arline { color: var(--muted); margin: 0 0 8px; }
.hr-page .arline .ar { color: var(--ink); font-size: 1.25rem; }
.ibq { margin: 0; }
.ibq blockquote { margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--ink); }
.ibq blockquote p { font: 1.08rem/1.6 var(--serif); margin: 0; }
.ibq figcaption { color: var(--muted); font-size: .88rem; margin-top: 8px; }
.card.care { border-style: dashed; }
.apply { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.apply p:last-child { margin-bottom: 0; }
.hr-page textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 96px; resize: vertical; }
.hr-page input[type="text"] { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 44px; }
.hr-page .field { display: block; margin: 8px 0; }
.hr-page .field > span:not(.sr) { display: block; font-weight: 600; margin-bottom: 4px; }
.hr-page p.big { font-size: 1.12rem; line-height: 1.6; }
.reflist a { white-space: nowrap; }
/* Section cards on the home page: number, Arabic, title, one line. */
.secgrid { display: grid; gap: 10px; margin-top: 8px; }
.sec { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; color: inherit; text-decoration: none; min-height: 96px; }
.sec .n { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sec strong { font: 600 1.15rem/1.25 var(--serif); }
.sec .ar { font-size: 1.1rem; line-height: 1.6; color: var(--muted); }
.sec span.line { color: var(--muted); font-size: .92rem; }
.sec:hover, .sec:focus-visible { border-color: var(--ink); }
.sec.noted::after { content: 'Your note saved'; font-size: .78rem; color: var(--muted); }
@media (min-width: 640px) { .secgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .secgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .secgrid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 960px) { .hr-page main > :is(.secgrid, .cols, .masonry, .playwrap) { grid-column: 1 / -1; } }
/* Step cards: the last row is always filled evenly, whatever the number of steps.
   Two columns: an odd last card spans the row. Three columns (built from six halves): one leftover spans the row; two leftovers share it. */
@media (min-width: 640px) and (max-width: 959.98px) { .secgrid:not(.four) > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (min-width: 960px) {
  .secgrid:not(.four) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .secgrid:not(.four) > * { grid-column: span 2; }
  .secgrid:not(.four) > :last-child:nth-child(3n+1) { grid-column: 1 / -1; }
  .secgrid:not(.four) > :nth-last-child(2):nth-child(3n+1), .secgrid:not(.four) > :last-child:nth-child(3n+2) { grid-column: span 3; }
}
/* Breathing room: section navigation never sits flush against a card. */
.hr-page .secnav { margin: 32px 0 40px; }
.hr-page .cols + .card, .hr-page .cols + section.card { margin-top: 8px; }
.hr-page main > section.card.wide + .secnav { margin-top: 32px; }
.hr-page main > .secgrid { margin-bottom: 28px; }
.hr-page main > .secgrid + .hint { margin-top: 8px; }
.hr-page section.card.wide .secgrid { margin-bottom: 0; }
/* Phone: the two columns stack; keep air between them. */
@media (max-width: 959px) { .hr-page .cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; } }

/* Print the reading, never the private reflections typed on the page. */
@media print {
  label.field, #noteHint, .secnav, .crumb, footer .more { display: none !important; }
  .card, blockquote { break-inside: avoid; }
}

/* Download / restore a copy (data page) */
.hr-page section.card.wide.io { margin-top: 20px; }
.hr-page .io-warn { border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; color: var(--ink); }
.hr-page .io input[type="file"] { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 44px; }
.hr-page .io input[type="file"]::file-selector-button { font: inherit; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; margin-right: 12px; cursor: pointer; }
.hr-page .io #ioStatus { margin: 12px 0 0; min-height: 1.4em; }

/* "Need help now?": one quiet grey box at the bottom of every page, same wording everywhere. */
.helpbox { background: color-mix(in srgb, var(--ink) 6%, var(--bg)); border: 1px solid var(--line); border-radius: var(--radius, 14px); padding: 18px 20px; margin: 40px 0 8px; grid-column: 1 / -1; scroll-margin-top: 16px; }
.helpbox h2 { font-size: 1rem; margin: 0 0 6px; }
.helpbox p { margin: 4px 0; color: var(--muted); font-size: .95rem; line-height: 1.55; }
.helpbox a { color: var(--ink); text-underline-offset: 3px; }
@media print { .helpbox { display: none; } }

/* "Related on Mawsim": link cards to other tools at the end of a step (relatedBox in heart.js). Monochrome, with room above and below. */
.related { grid-column: 1 / -1; margin: 32px 0 24px; }
.related-h { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.related-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.related-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 44px 14px 16px; border: 1px solid var(--line); border-radius: var(--radius, 14px); background: var(--bg); color: var(--ink); text-decoration: none; transition: background .15s, border-color .15s; }
.related-card:hover, .related-card:focus-visible { background: color-mix(in srgb, var(--ink) 5%, var(--bg)); border-color: color-mix(in srgb, var(--ink) 40%, var(--bg)); }
.related-t { font-weight: 600; }
.related-n { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.related-go { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); transition: transform .15s; }
.related-card:hover .related-go { transform: translate(3px, -50%); color: var(--ink); }
@media print { .related { display: none; } }

/* Compact page header on step pages: crumb, step label and title sit close together; the rail follows with modest room. */
.hr-page .crumb { margin: 8px 0 4px; }
.hr-page .intro .arline { margin-bottom: 4px; }
.hr-page main .steprail { margin-top: 12px !important; margin-bottom: 20px !important; }
/* "About this tool" (aboutBox in heart.js): same card family as Related, a little quieter. */
.about { margin-top: 40px; }
.info-card { padding-top: 12px; padding-bottom: 12px; }
.info-card .related-t { font-weight: 600; font-size: .95rem; }
.info-plain { padding-right: 16px; border-style: dashed; background: transparent; }
@media print { .about { display: none; } }

/* Opt-in engine options (heart.js). None of these selectors match a tool that sets no option. */
/* learnFold: "Read more" under the first part of the Learn card; evPrimary: folded extra sources. */
.hr-page details.learnmore { margin: 8px 0 0; }
.hr-page details.learnmore > summary, .hr-page details.evprimary > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; padding: 8px 4px; color: var(--muted); font-size: .92rem; line-height: 1.4; }
.hr-page details.learnmore > summary:hover, .hr-page details.evprimary > summary:hover { color: var(--ink); }
.hr-page details.learnmore > summary:focus-visible, .hr-page details.evprimary > summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; color: var(--ink); }
.hr-page details.learnmore[open] > summary { margin-bottom: 8px; }
.hr-page details.evprimary { margin: 8px 0 4px; }
/* The small label at a private writing field: where what you write goes. */
.hr-page .fieldtag { display: block; width: fit-content; margin: 0 0 6px; padding: 2px 10px; border: 1px solid var(--line, currentColor); border-radius: 999px; color: var(--muted); font-size: .8rem; line-height: 1.5; }
/* planSeparate: the one line under the Reflect box. */
.hr-page .planhint { margin: 6px 0 0; }
/* reflectFirst (phone): the two column wrappers dissolve so cards can be ordered; a "Please read" care card stays on top, then Reflect and Act, then Learn. Desktop keeps the two-column grid untouched. */
@media (max-width: 959px) {
  .hr-page .cols.reflectfirst > div { display: contents; }
  .hr-page .cols.reflectfirst .rf-care { order: 0; }
  .hr-page .cols.reflectfirst .rf-reflect { order: 1; }
  .hr-page .cols.reflectfirst .rf-act { order: 2; }
  .hr-page .cols.reflectfirst .rf-learn { order: 3; }
  .hr-page .cols.reflectfirst .rf-quote { order: 4; }
  .hr-page .cols.reflectfirst .rf-ev { order: 5; }
}
/* railLabels: numbered rail with each step's short title. One row, scrolls inside itself, never widens the page. */
.hr-page .steprail.railx { display: flex; flex-wrap: nowrap; gap: 8px; padding: 6px; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
@media (min-width: 960px) { .hr-page main > .steprail.railx { grid-column: 1 / -1; } }
.hr-page .steprail.railx a { flex: 0 0 auto; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); text-decoration: none; font-size: .95rem; background: transparent; }
.hr-page .steprail.railx a:hover { border-color: var(--ink); color: var(--ink); }
.hr-page .steprail.railx a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.hr-page .steprail.railx a[aria-current="step"] { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }
.hr-page .steprail.railx .rn { font-variant-numeric: tabular-nums; }
@media (max-width: 639px) { .hr-page .steprail.railx .rl { display: none; } .hr-page .steprail.railx a[aria-current="step"] .rl { display: inline; } }
@media print { .hr-page .steprail.railx { display: none !important; } }
