/* Species page (flower) - FSOL version 1. Same visual language as team-cards.css; prefix fp- avoids clashes with flora-cards.css. */
.fp-page{ max-width: 1180px; }
.fp-title{
  display: block; width: fit-content; max-width: 100%;
  margin: 0 auto 1rem; text-align: center;
  font-weight: 600; line-height: 1.25;
  font-size: clamp(1.4rem, 4vw, 3rem);
  color: var(--tm-green-dark, #355e4a);
  direction: ltr;                       /* scientific names are Latin */
  white-space: nowrap;                  /* fitted by the script when it does not fit */
}
.fp-title::after{
  content: ""; display: block; width: 100%; height: 5px; margin-top: .6rem;
  border-radius: 3px; background: var(--tm-yellow, #fbf456);
  box-shadow: 0 0 0 1px rgba(53,94,74,.15);
}
.fp-title i{ font-style: italic; }                 /* the scientific meaning of italics is kept */
.fp-title .fp-upright{ font-style: normal; }
.fp-title.is-red, .fp-title.is-red *{ color: #d00000; }   /* not accepted / name changed: red, as before */
.fp-note{ margin: 0 0 1rem; text-align: center; font-weight: 700; color: #111; }
.fp-status{ display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin: 0 0 1.5rem; }
.fp-badge{ padding: .15rem .8rem; border-radius: 999px; background: var(--tm-green, #3e6a55); color: #fff; font-size: .9rem; font-weight: 600; }
.fp-badge.is-na{ background: #c00000; }

/* toolbar */
.fp-toolbar{ display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin: 0 0 1.75rem; }
.fp-btn{
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem 1.05rem; border: 0; border-radius: 999px;
  background: var(--tm-green, #3e6a55); color: #fff;
  font-size: .95rem; font-weight: 600; line-height: 1.3; text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s;
}
.fp-btn:hover, .fp-btn:focus-visible{ background: var(--tm-yellow, #fbf456); color: #1f3a2e; }
.fp-btn--ghost{ background: transparent; color: var(--tm-green-dark, #355e4a); box-shadow: inset 0 0 0 2px var(--tm-green, #3e6a55); }

/* layout: details + a photo column that stays on the LEFT (also in the Arabic, right-to-left page) */
.fp-grid{ display: grid; grid-template-columns: 1fr; gap: 1.75rem; align-items: start; }
.fp-photos{ order: -1; display: grid; gap: 1.25rem; min-width: 0; }      /* phones: photos first, as before */
.fp-details{ display: grid; gap: 1.25rem; min-width: 0; }
@media (min-width: 992px){
  .fp-grid{ grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .fp-page[dir="rtl"] .fp-photos{ order: 2; }        /* rtl: 1st column = right, so photos (2nd) = left */
  .fp-page[dir="ltr"] .fp-grid{ grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .fp-page[dir="ltr"] .fp-photos{ order: 0; }        /* ltr: photos first = left */
  .fp-page[dir="ltr"] .fp-details{ order: 1; }
  .fp-photos{ position: sticky; top: 7rem; }
}

/* cards */
.fp-card{
  padding: 1.15rem 1.25rem 1.25rem;
  background: var(--tm-card, #e8f2cb);
  border-radius: 16px;
  border-inline-start: 6px solid var(--tm-green, #3e6a55);
  box-shadow: 0 8px 22px rgba(38,70,54,.14);
}
.fp-card-title{
  display: flex; align-items: center; gap: .55rem; margin: 0 0 .6rem;
  font-size: 1.1rem; font-weight: 700; color: var(--tm-green-dark, #355e4a);
}
.fp-card-title i{ font-size: 1.25rem; color: var(--tm-green, #3e6a55); }
.fp-text{ margin: 0; line-height: 1.9; color: var(--tm-text, #2c3a32); text-align: start; overflow-wrap: anywhere; font-size: 1.05rem; }

/* flowering months */
.fp-months{ display: flex; flex-wrap: wrap; gap: .4rem; direction: ltr; }
.fp-m{
  min-width: 2.4rem; padding: .35rem .5rem; text-align: center;
  border-radius: 8px; border: 1px solid #8aa596; color: #44574d; background: transparent; font-weight: 600;
}
.fp-m.is-on{ background: var(--tm-green, #3e6a55); border-color: var(--tm-green, #3e6a55); color: #fff; }
.fp-months-text{ margin: .5rem 0 0; font-size: .95rem; color: var(--tm-text, #2c3a32); }

/* distribution links */
.fp-points{ display: flex; flex-wrap: wrap; gap: .4rem .5rem; }
.fp-point{
  border: 0; border-radius: 999px; padding: .3rem .85rem;
  background: #fff; color: #1b5e8a; font: inherit; font-weight: 700; cursor: pointer;
  box-shadow: inset 0 0 0 1.5px #8aa596;
  transition: background .2s, color .2s;
}
.fp-point:hover, .fp-point:focus-visible{ background: var(--tm-green, #3e6a55); color: #fff; }
.fp-point.is-loc{ color: #7a4a00; }
.fp-point.is-loc:hover, .fp-point.is-loc:focus-visible{ color: #fff; }
.fp-legend{ margin: .6rem 0 0; font-size: .85rem; color: var(--tm-text, #2c3a32); }

/* photos */
.fp-photo{
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 8px 22px rgba(38,70,54,.14);
}
.fp-photo a{ display: block; }
.fp-photo img{ display: block; width: 100%; height: auto; }
.fp-caption{ padding: .6rem .8rem; background: var(--tm-green, #3e6a55); color: #fff; text-align: center; font-weight: 600; }
/* reserved place for the distribution map (hidden until a map is plugged in) */
.fp-map[hidden]{ display: none; }
.fp-map .fp-map-canvas{ width: 100%; aspect-ratio: 4 / 3; background: #d2e497; }

/* references */
.fp-refs{ margin: 0; padding-inline-start: 1.4rem; line-height: 1.8; font-size: .95rem; color: var(--tm-text, #2c3a32); direction: ltr; text-align: left; }
.fp-refs li + li{ margin-top: .45rem; }
.fp-empty{ text-align: center; padding: 2rem 1rem; font-weight: 700; color: var(--tm-green-dark, #355e4a); }

/* village / location details window */
.fp-modal{ position: fixed; inset: 0; z-index: 3100; display: none; align-items: center; justify-content: center; padding: 1rem; background: rgba(20,38,30,.72); }
.fp-modal.is-open{ display: flex; }
.fp-modal-box{ width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; background: var(--tm-card, #e8f2cb); border-radius: 16px; border-inline-start: 6px solid var(--tm-green, #3e6a55); box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.fp-modal-head{ display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.25rem; background: var(--tm-green, #3e6a55); color: #fff; border-radius: 10px 10px 0 0; }
.fp-modal-head h3{ margin: 0; font-size: 1.15rem; }
.fp-modal-x{ border: 0; background: transparent; color: #fff; font-size: 1.7rem; line-height: 1; cursor: pointer; }
.fp-modal-body{ padding: 1.1rem 1.25rem .5rem; }
.fp-modal-body p{ margin: 0 0 .55rem; color: var(--tm-text, #2c3a32); }
.fp-modal-body b{ color: var(--tm-green-dark, #355e4a); }
.fp-modal-body bdi{ unicode-bidi: isolate; }
.fp-modal-foot{ padding: .4rem 1.25rem 1.2rem; text-align: end; }

/* print preview */
.fp-prev{ position: fixed; inset: 0; z-index: 3000; display: none; flex-direction: column; background: #23382e; }
.fp-prev.is-open{ display: flex; }
.fp-prev-bar{ display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1rem; background: #355e4a; color: #fff; }
.fp-prev-bar span{ font-weight: 700; }
.fp-prev-tools{ display: flex; flex-wrap: wrap; gap: .5rem; }
.fp-prev-scroll{ flex: 1; overflow: auto; padding: 1.25rem .75rem 2rem; }
.fp-sheet{
  box-sizing: border-box; width: 100%; max-width: 794px;  /* A4 portrait at 96dpi */
  margin: 0 auto; padding: 28px 32px; background: #fff; color: #111;
  box-shadow: 0 6px 30px rgba(0,0,0,.45); font-size: 13px; line-height: 1.7;
}
.fp-sheet-head{ display: flex; align-items: center; gap: 14px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 3px solid #fbf456; }
.fp-sheet-head img{ height: 50px; width: auto; }
.fp-sheet-head span{ font-size: 15px; font-weight: 700; color: #355e4a; }
.fp-sheet-name{ margin: 0 0 4px; font-size: 24px; font-weight: 600; direction: ltr; text-align: center; }
.fp-sheet-name i{ font-style: italic; }
.fp-sheet-name .fp-upright{ font-style: normal; }
.fp-sheet-name.is-red, .fp-sheet-name.is-red *{ color: #d00000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.fp-sheet-note{ text-align: center; margin: 0 0 8px; font-weight: 700; }
.fp-sheet-main{ display: grid; grid-template-columns: 1fr 200px; gap: 16px; margin-top: 12px; align-items: start; }
.fp-sheet-main.no-img{ grid-template-columns: 1fr; }
.fp-sheet-img img{ width: 100%; height: auto; border: 1px solid #8aa596; border-radius: 6px; }
.fp-sheet-img p{ margin: 4px 0 0; font-size: 11px; text-align: center; }
.fp-sheet table{ width: 100%; border-collapse: collapse; }
.fp-sheet th, .fp-sheet td{ border: 1px solid #8aa596; padding: 4px 8px; vertical-align: top; text-align: start; }
.fp-sheet th{ width: 28%; background: #dcedc1; color: #1a3329; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.fp-sheet h4{ margin: 16px 0 6px; font-size: 14px; color: #355e4a; }
.fp-sheet .fp-ptable th{ width: auto; }
.fp-sheet tr{ break-inside: avoid; page-break-inside: avoid; }
.fp-sheet-foot{ margin: 14px 0 0; font-size: 10px; color: #444; }
.fp-sheet ol{ margin: 0; padding-inline-start: 1.4rem; direction: ltr; text-align: left; font-size: 12px; }

@media print{
  @page{ size: A4 portrait; margin: 12mm; }
  body.fp-printing{ margin: 0 !important; padding: 0 !important; background: #fff !important; }
  body.fp-printing > *:not(#fpPreview){ display: none !important; }
  body.fp-printing #fpPreview{ position: static !important; display: block !important; background: #fff !important; }
  body.fp-printing .fp-prev-bar{ display: none !important; }
  body.fp-printing .fp-prev-scroll{ overflow: visible !important; padding: 0 !important; }
  body.fp-printing .fp-sheet{ box-shadow: none !important; max-width: none !important; padding: 0 !important; }
}

/* print-sheet header: site name + small initiative line */
.fp-sheet-brand{ display: flex; flex-direction: column; line-height: 1.35; }
.fp-sheet-head .fp-sheet-brand span{ font-size: 15px; font-weight: 700; color: #355e4a; }
.fp-sheet-brand small{ font-size: 11px; font-weight: 400; color: #444; }

/* title effects (tm-fx-1..3 from team-cards.css): the title is measured/fitted by a script, so the blur effect
   must not use letter-spacing (it would widen the text during the animation and shrink it too much) */
.fp-page .tm-fx-2{ animation-name: tm-focus-ar; }
@media (prefers-reduced-motion: reduce){
  .fp-title[class*="tm-fx-"], .fp-title[class*="tm-fx-"]::after{ animation: none !important; }
}
