/* The GFASchool front page (D-052), in the owner's look since D-109 (`for_main_platform.html`): a white head in two
   rows (the brand with its line and the join action; the page's sections as a strip that stays at the top), the
   owner's picture of a school's people in its hall across the page, and under it everything the page says on white:
   the join form, the plan of a school whose rooms are the parts the system runs, the schedule of rooms, the plots,
   the notes. Ink for words, teal for what acts, a blue rule under the current link; the coral find-dot still marks
   the entrance and nothing else. Tajawal served from the project (SIL OFL 1.1); a monospace only for the address and
   the drawing's numbers. */

@font-face { font-family: "Tajawal"; font-weight: 400; font-display: swap;
  src: url("../vendor/tajawal/Tajawal-Regular.d11e9f3094b8.ttf") format("truetype"); }
@font-face { font-family: "Tajawal"; font-weight: 700; font-display: swap;
  src: url("../vendor/tajawal/Tajawal-Bold.ef7c3dc2a2b8.ttf") format("truetype"); }
@font-face { font-family: "Tajawal"; font-weight: 800; font-display: swap;
  src: url("../vendor/tajawal/Tajawal-ExtraBold.6ae16db8693a.ttf") format("truetype"); }

html { scrollbar-color: #9fb9b6 #f4f8f8; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body.front {
  --ink: #102b3a;
  --text: #2c4553;
  --text-2: #4f6672;
  --teal: #168b82;
  --teal-ink: #0f766e;        /* the teal that words and a filled button can carry (4.5:1 on white and on --soft) */
  --teal-press: #0b5f58;
  --blue: #168bca;
  --line: #e8edf0;
  --line-strong: #c8d4d9;
  --line-control: #7c939d;
  --soft: #e9f7f5;
  --panel: #f6fbfa;
  --coral: #FF6B57;
  --bad: #b3261e;
  --read: "Tajawal", "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --pad: clamp(18px, 5vw, 80px);
  --frame: 1240px;

  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--read);
  font-size: 1.0625rem;
  line-height: 1.75;
  background: #fff;
  caret-color: var(--teal);
  -webkit-font-smoothing: antialiased;
}
.front *, .front *::before, .front *::after { box-sizing: border-box; }
.front ::selection { background: var(--teal-ink); color: #fff; }
.front a { color: var(--teal-ink); text-underline-offset: .3em; text-decoration-thickness: 1px; }
.front a:hover { color: var(--ink); }
.front :focus-visible { outline: 2px solid var(--teal-ink); outline-offset: 3px; border-radius: 4px; }
.front h1, .front h2, .front h3 { font-family: var(--read); font-weight: 800; color: var(--ink); margin: 0;
  line-height: 1.4; text-wrap: balance; }
.front p { margin: 0; }
.front .num { unicode-bidi: isolate; direction: ltr; display: inline-block; font-variant-numeric: tabular-nums; }
.front .mark { --mark-ground: #fff; }
.front .skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 9; background: var(--teal-ink);
  color: #fff; padding: 10px 18px; border-radius: 13px; font-weight: 700; text-decoration: none; }
.front .skip:focus { top: 12px; }

/* ---------------------------------------------------------------- the head: brand and join action; the sections' strip */
.topbar { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px 20px;
  padding: 10px var(--pad); background: #fff; border-bottom: 1px solid var(--line); }
.front .brand { display: flex; align-items: center; gap: 14px; min-width: 0; color: var(--ink); text-decoration: none; }
.brand__line { padding-inline-start: 14px; border-inline-start: 1px solid var(--line-strong); font-size: 1.125rem;
  line-height: 1.4; color: var(--ink); }
.front .portal { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px;
  border-radius: 13px; background: var(--soft); color: var(--teal-ink); font-size: 1.125rem; font-weight: 700;
  line-height: 1.3; text-decoration: none; transition: background-color .2s var(--ease), color .2s var(--ease); }
.front .portal:hover { background: var(--teal-ink); color: #fff; }
.navbar { position: sticky; top: 0; z-index: 6; min-height: 58px; display: flex; align-items: center;
  gap: clamp(20px, 4vw, 62px); padding: 0 clamp(18px, 7vw, 120px); background: #fff;
  border-bottom: 1px solid var(--line); }
.front .navbar a { padding: 15px 0 12px; border-bottom: 3px solid transparent; color: var(--ink); font-size: 1rem;
  line-height: 1.6; white-space: nowrap; text-decoration: none; transition: border-color .2s var(--ease); }
.front .navbar a:hover { border-bottom-color: var(--line-strong); }
.front .navbar a[aria-current="true"] { font-weight: 700; border-bottom-color: var(--blue); }

/* ---------------------------------------------------------------- the picture: whole, nothing written over it; on a
   short window it gives up its floor so the first screen ends where the picture does */
.hero { background: #eef2f3; }
.hero img { display: block; width: 100%; height: auto; max-height: max(480px, calc(100svh - 129px));
  object-fit: cover; object-position: 50% 0; }

/* ---------------------------------------------------------------- the join form beside the plan */
.first, .rooms, .plots, .notes, .close { width: min(var(--frame), 100% - 2 * var(--pad)); margin-inline: auto; }
.first { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 40px; align-items: stretch;
  padding-block: 64px; }
.titleblock { display: grid; grid-template-rows: auto 1fr auto; gap: 22px; }
.tb-head h1 { font-size: clamp(1.75rem, 2.5vw, 2.3rem); line-height: 1.45; }
.tb-head p { margin-top: 12px; color: var(--text-2); max-width: 44ch; }
.tb-form, .tb-done { align-self: start; padding: 22px; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 10px 30px rgba(16, 43, 58, .06); }
.tb-form { display: grid; gap: 14px; }
.tb-form__title { font-size: 1.1875rem; font-weight: 800; color: var(--ink); line-height: 1.4; }
.tb-error { color: var(--bad); background: #fdeeeb; border: 1px solid #e9aca2; border-radius: 10px; padding: 8px 12px;
  font-size: .9375rem; font-weight: 700; }
.cells { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cell { display: grid; gap: 4px; align-content: start; }
.cell--wide { grid-column: 1 / -1; }
.cell label { font-size: .875rem; font-weight: 700; color: var(--ink); line-height: 1.5; }
.cell .req { color: var(--teal-ink); margin-inline-start: 3px; }
.cell input { font: inherit; font-size: 1rem; color: var(--ink); background: #fff; border: 1px solid var(--line-control);
  border-radius: 10px; padding: 8px 12px; min-height: 46px; width: 100%;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.cell input::placeholder { color: #5d7480; }
.cell input:hover { border-color: var(--teal); }
.cell input:focus { outline: none; border-color: var(--teal-ink); box-shadow: 0 0 0 3px rgba(22, 139, 130, .22); }
.cell--bad input { border-color: var(--bad); }
.cell__error { color: var(--bad); font-size: .875rem; font-weight: 700; }
.trap { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.front .go { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 28px;
  background: var(--teal-ink); color: #fff; font-family: var(--read); font-size: 1.0625rem; font-weight: 700;
  border: 0; border-radius: 13px; text-decoration: none; cursor: pointer; transition: background-color .2s var(--ease); }
.front .go:hover { background: var(--teal-press); color: #fff; }
.tb-form .go { justify-self: start; margin-top: 2px; }
.tb-done { display: grid; gap: 8px; background: var(--soft); border-color: transparent; box-shadow: none; }
.tb-done__title { font-size: 1.375rem; font-weight: 800; color: var(--ink); }
.tb-foot { display: flex; flex-wrap: wrap; gap: 4px 18px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: .875rem; color: var(--text-2); }
.front .tb-foot a { margin-inline-start: auto; color: var(--text-2); }
.front .tb-foot a:hover { color: var(--ink); }

.plan { margin: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto auto auto; gap: 8px; min-width: 0;
  padding: 18px 22px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
/* the drawing takes whatever the panel leaves above the caption, the note and the schedule: its frame claims no height
   of its own, so a longer schedule or note shrinks the plan instead of stretching the panel */
.plan__frame { contain: size; min-height: 380px; }
.plan__svg { display: block; width: 100%; height: 100%; }
.dims path { fill: none; stroke: #9fb3bb; stroke-width: 1; }
.dims text { fill: #56707c; font-family: var(--mono); font-size: 14px; text-anchor: middle; }
.address-line, .tb-jump { display: none; }
.axes path { fill: none; stroke: #cfdbdf; stroke-width: 1; stroke-dasharray: 10 6 2 6; }
.bubble circle { fill: #fff; stroke: #9fb3bb; stroke-width: 1.2; r: 15px; }
.bubble text { fill: #56707c; font-family: var(--read); font-size: 16px; font-weight: 700; text-anchor: middle; }
/* the yard, ringed by its gallery: the roof edge dashed as an overhead line, the columns cut solid */
.yard { fill: rgba(22, 139, 130, .06); stroke: #7fb5af; stroke-width: 1; stroke-dasharray: 10 5; }
.columns { fill: var(--ink); }
.tree circle { fill: rgba(22, 139, 130, .08); stroke: var(--teal); stroke-width: 1.3; stroke-dasharray: 3 4; }
.yard__label { fill: var(--text-2); font-family: var(--read); font-size: 18px; font-weight: 700; }
.room__floor { fill: rgba(255, 255, 255, .001); transition: fill .2s var(--ease); }
.room__name { fill: var(--ink); font-family: var(--read); font-size: 17px; font-weight: 700; }
.tag rect { fill: #fff; stroke: #9fb3bb; stroke-width: 1; }
.tag text { fill: #48626e; font-family: var(--mono); font-size: 15px; text-anchor: middle; }
/* a chosen room fills with the page's teal */
.room:hover .room__floor, .room:focus-visible .room__floor, .room--lit .room__floor { fill: url(#lamp); }
.room--lit .tag rect, .room:hover .tag rect { stroke: var(--teal-ink); }
.room--lit .tag text, .room:hover .tag text { fill: var(--teal-ink); }
.room { text-decoration: none; }   /* an SVG link's own underline would paint in its default black fill */
.room:focus { outline: none; }
.room:focus-visible .room__name { text-decoration: underline; }
/* the walls: two faces with the hatched poché between them */
.walls use { fill: none; }
.w-face { stroke: var(--ink); stroke-width: 11; }
.w-face--outer { stroke-width: 16; }
.w-core { stroke: var(--panel); stroke-width: 7; }
.w-core--outer { stroke-width: 12; }
.w-hatch { stroke: url(#hatch); stroke-width: 7; }
.w-hatch.w-core--outer { stroke-width: 12; }
.doors .door-gap { stroke: var(--panel); stroke-width: 18; }
.door-leaf { stroke: var(--ink); stroke-width: 2.2; }
.door-swing { fill: none; stroke: #7d98a2; stroke-width: 1.2; stroke-dasharray: 4 3; }
.win-cut { fill: none; stroke: var(--panel); stroke-width: 17; }
.win-line { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.entrance { fill: var(--coral); }
.leader { fill: none; stroke: var(--coral); stroke-width: 1.4; }
.address { fill: var(--ink); font-family: var(--mono); font-size: 17px; }
.address__label { fill: var(--text-2); font-family: var(--read); font-size: 18px; font-weight: 700; }
.north path { fill: var(--ink); }
.north text { fill: var(--ink); font-family: var(--read); font-size: 15px; font-weight: 700; }
.plan figcaption { color: var(--text-2); font-size: .9375rem; }
/* the note's height is reserved for the longest note at each width, so choosing a room changes light and words only */
.room-note { --lines: 2; height: calc(var(--lines) * 1.65em + 18px); overflow: hidden; font-size: .9375rem; line-height: 1.65; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; color: var(--text); }
.room-note b { font-family: var(--mono); color: var(--teal-ink); font-weight: 400; margin-inline-end: 4px; }
.room-note__name { font-weight: 800; color: var(--ink); }
/* as many columns as the longest entry allows: five under a wide plan, so fourteen rooms keep three lines */
.schedule { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 18px; font-size: .875rem; line-height: 1.6; }
.front .schedule a { color: var(--text-2); text-decoration: none; display: block; padding: 2px 0; }
.front .schedule a:hover, .front .schedule a:focus-visible, .front .schedule a[aria-current="true"] { color: var(--ink); font-weight: 700; }
.schedule .num { font-family: var(--mono); color: var(--teal-ink); min-width: 2.6em; font-weight: 400; }
.first:has(.schedule a[data-room="101"]:is(:hover, :focus-visible)) .room[data-room="101"] .room__floor,
.first:has(.schedule a[data-room="102"]:is(:hover, :focus-visible)) .room[data-room="102"] .room__floor,
.first:has(.schedule a[data-room="103"]:is(:hover, :focus-visible)) .room[data-room="103"] .room__floor,
.first:has(.schedule a[data-room="104"]:is(:hover, :focus-visible)) .room[data-room="104"] .room__floor,
.first:has(.schedule a[data-room="105"]:is(:hover, :focus-visible)) .room[data-room="105"] .room__floor,
.first:has(.schedule a[data-room="106"]:is(:hover, :focus-visible)) .room[data-room="106"] .room__floor,
.first:has(.schedule a[data-room="107"]:is(:hover, :focus-visible)) .room[data-room="107"] .room__floor,
.first:has(.schedule a[data-room="108"]:is(:hover, :focus-visible)) .room[data-room="108"] .room__floor,
.first:has(.schedule a[data-room="109"]:is(:hover, :focus-visible)) .room[data-room="109"] .room__floor,
.first:has(.schedule a[data-room="110"]:is(:hover, :focus-visible)) .room[data-room="110"] .room__floor,
.first:has(.schedule a[data-room="111"]:is(:hover, :focus-visible)) .room[data-room="111"] .room__floor,
.first:has(.schedule a[data-room="112"]:is(:hover, :focus-visible)) .room[data-room="112"] .room__floor,
.first:has(.schedule a[data-room="113"]:is(:hover, :focus-visible)) .room[data-room="113"] .room__floor,
.first:has(.schedule a[data-room="114"]:is(:hover, :focus-visible)) .room[data-room="114"] .room__floor { fill: url(#lamp); }

/* ---------------------------------------------------------------- below: the schedule of rooms, the plots, the notes */
.rooms, .plots, .notes { padding-block: 64px; border-top: 1px solid var(--line); }
.rooms h2, .plots h2, .notes h2, .close h2 { font-size: clamp(1.5rem, 2.3vw, 2rem); }
.lead { margin-top: 6px; color: var(--text-2); }
.rooms__list { margin-top: 26px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr));
  border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 3.8rem 1fr; gap: 2px 16px; padding: 20px 0; border-bottom: 1px solid var(--line);
  scroll-margin-top: 80px; }
.rooms__list .row:nth-child(odd) { padding-inline-end: 28px; }
.rooms__list .row:nth-child(even) { padding-inline-start: 28px; border-inline-start: 1px solid var(--line); }
.row:target { background: var(--soft); }
.row__no { grid-row: span 3; align-self: start; justify-self: start; margin-top: 2px; padding: 2px 9px; border-radius: 8px;
  background: var(--soft); font-family: var(--mono); color: var(--teal-ink); font-size: .9375rem; }
.row h3 { font-size: 1.1875rem; }
.row__note { color: var(--text); max-width: 62ch; text-wrap: pretty; }
.row__who { color: var(--text-2); font-size: .9375rem; }
.plots { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: center; }
.plots__text { display: grid; gap: 14px; max-width: 60ch; }
.plots__svg { width: 100%; height: auto; }
.street { fill: #eef3f5; }
.street__name { fill: var(--text-2); font-family: var(--read); font-size: 15px; font-weight: 700; }
.parcel { fill: none; stroke: #8aa1ab; stroke-width: 1.6; stroke-dasharray: 14 5 3 5; }
.bldg { fill: #fff; stroke: var(--ink); stroke-width: 5; }
.plot text { fill: var(--text-2); font-family: var(--read); font-size: 15px; font-weight: 700; }
.plot .plot__addr { font-family: var(--mono); font-size: 13px; font-weight: 400; fill: #56707c; }
.plot .plot__host { font-size: 16px; }
.plot--yours .parcel { stroke: var(--teal); fill: rgba(22, 139, 130, .05); }
.plot--yours .bldg { fill: var(--soft); }
.plot--yours text { fill: var(--ink); }
.plot--yours .plot__addr { fill: var(--teal-ink); }
.notes ul { margin: 22px 0 0; padding: 0; list-style: none; display: grid; border-top: 1px solid var(--line); }
.notes li { padding: 13px 0; border-bottom: 1px solid var(--line); max-width: 80ch; position: relative; padding-inline-start: 26px; }
.notes li::before { content: ""; position: absolute; inset-inline-start: 4px; top: 1.45em; width: 8px; height: 8px;
  border-radius: 50%; background: var(--teal); }
.close { display: grid; gap: 12px; justify-items: start; margin-bottom: 64px; padding: clamp(28px, 4vw, 48px);
  background: var(--soft); border-radius: 16px; }
.close p { color: var(--text); }
.foot { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 28px; padding: 22px var(--pad) 30px;
  border-top: 1px solid var(--line); color: var(--text-2); font-size: .9375rem; }
.front .foot a { margin-inline-start: auto; color: var(--text-2); }
.front .foot a:hover { color: var(--ink); }

/* the longest note's lines as the plan's column narrows (measured at each width) */
@media (max-width: 1350px) { .room-note { --lines: 3; } }
@media (max-width: 1180px) { .room-note { --lines: 4; } }

/* ---------------------------------------------------------------- narrow screens: the words, the plan, then the form */
@media (max-width: 1100px) {
  .first { grid-template-columns: minmax(0, 1fr); gap: 0; padding-block: 40px; }
  .plan__frame { contain: none; min-height: 0; }
  .plan__svg { height: auto; }
  .titleblock { display: contents; }
  .tb-head { order: 1; }
  .plan { order: 2; margin-block: 24px; }
  .tb-form, .tb-done { order: 3; }
  .tb-foot { order: 4; margin-top: 22px; }
  .front .tb-jump { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; font-weight: 700; }
  .address, .address__label, .leader { display: none; }
  .address-line { display: block; font-size: .9375rem; color: var(--text-2); }
  .address-line .num { font-family: var(--mono); color: var(--ink); border-bottom: 2px solid var(--coral); }
  .room__name { font-size: 27px; transform: translateY(6px); }   /* clear of the grown tag above it and the walls */
  .room-note { --lines: 2; }
  /* the drawing's small print: the tags grow, the dimension figures go (their ticks stay) */
  .tag { transform-box: fill-box; transform-origin: center; transform: scale(1.7); }
  .dims text { display: none; }
  .rooms, .plots, .notes { padding-block: 44px; }
  .plots { grid-template-columns: minmax(0, 1fr); }
  .rooms__list .row:nth-child(n) { padding-inline: 0; border-inline-start: 0; }
}
@media (max-width: 840px) { .room-note { --lines: 3; } }
@media (max-width: 640px) { .room-note { --lines: 4; } }
@media (max-width: 520px) { .room-note { --lines: 5; } }
@media (max-width: 380px) { .room-note { --lines: 6; } }
@media (max-width: 340px) { .room-note { --lines: 7; } }
@media (max-width: 900px) {
  /* the strip scrolls sideways, its far end fading where more waits */
  .navbar { overflow-x: auto; gap: 24px; padding-inline: var(--pad); scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 32px); mask-image: linear-gradient(to right, transparent 0, #000 32px); }
}
@media (max-width: 700px) {
  .topbar { min-height: 0; }
  .brand__line { display: none; }
  .topbar { gap: 10px; }
  .front .brand .lockup { gap: 8px; }
  .front .brand .mark { width: 46px; }
  .front .brand .wordmark { font-size: 16px; }
  .front .portal { font-size: .9375rem; padding: 8px 12px; }
  .front .navbar a { font-size: .9375rem; }
  .hero img { height: 300px; max-height: none; object-position: 44% 0; }
}
@media (max-width: 560px) {
  /* the street drawn at phone width would shrink its addresses below reading size: the sheet is cropped to your plot
     and its neighbour's edge instead */
  .plots { overflow: hidden; }
  .plots__svg { width: 175%; max-width: none; justify-self: start; }
  .tb-form, .tb-done { padding: 18px 16px; }
  .plan { padding: 12px; }
  .schedule { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: 3.4rem 1fr; }
  .close { margin-bottom: 40px; }
}
@media (max-width: 380px) {
  .cells { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .room__floor, .front .go, .cell input, .front .portal, .front .navbar a { transition: none; }
}
