/* ==========================================================================
 * style.css - dark by default. This gets read outdoors, one-handed, at 6am.
 * ========================================================================== */

:root{
  --bg:#0b1720; --panel:#132430; --panel2:#0f1d27; --line:#223846;
  --ink:#e8f1f6; --dim:#8fa9b8; --faint:#5c7484;
  --good:#3ddc97; --ok:#ffd166; --bad:#ef6461; --accent:#5bc0eb;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}

*{box-sizing:border-box}

body{
  margin:0;background:var(--bg);color:var(--ink);
  font:15px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  -webkit-text-size-adjust:100%;
  /* iOS paints a grey box over anything tappable. Every summary on this page is
   * tappable, so the default reads as the page flickering. */
  -webkit-tap-highlight-color:transparent;
}

/* The left/right insets matter in LANDSCAPE on a notched phone: without them the
 * first character of every line slides under the notch. `viewport-fit=cover` in
 * index.html is what puts the page under there in the first place. */
.wrap{
  max-width:760px;margin:0 auto;
  padding:14px calc(14px + env(safe-area-inset-right)) 60px calc(14px + env(safe-area-inset-left));
}

h1{font-size:17px;margin:0;letter-spacing:.02em}
h2{font-size:12px;letter-spacing:.13em;text-transform:uppercase;color:var(--faint);
   margin:26px 0 9px;font-weight:600}

header{display:flex;align-items:baseline;justify-content:space-between;gap:10px;
   padding-bottom:12px;border-bottom:1px solid var(--line)}

.sub,.faint{font-size:11px;color:var(--faint)}
.faint{font-weight:400}

.card{background:var(--panel);border:1px solid var(--line);border-radius:12px;
   padding:14px;margin-top:12px}

/* 44px minimum on anything you tap. This is read one-handed, outdoors, often
 * with wet or cold hands - the case the 44px guideline exists for. The button
 * still LOOKS small; the hit area is what grew. */
.rf{background:var(--panel);color:var(--dim);border:1px solid var(--line);
   border-radius:7px;padding:0 14px;min-height:44px;font-size:11px;cursor:pointer;
   flex:0 0 auto;font-family:inherit;display:inline-flex;align-items:center;
   text-decoration:none}
.rf:active{background:var(--panel2)}

/* ---------------------------- HEADLINE ----------------------------- */

.headline{margin:14px 0 4px;font-size:15px;line-height:1.45;color:var(--ink)}
.headline b{color:var(--accent)}

/* --------------------------- SPOT CARDS ---------------------------- */

.spot{margin-top:10px;border:1px solid var(--line);border-radius:12px;
   background:var(--panel);overflow:hidden}
.spot.top{border-color:var(--accent)}
.spot > summary{display:flex;align-items:center;gap:11px;padding:12px 13px;
   cursor:pointer;user-select:none;list-style:none;
   text-transform:none;letter-spacing:0;font-size:15px;color:var(--ink);font-weight:400}
.spot > summary::-webkit-details-marker{display:none}
.spot .rank{flex:0 0 auto;width:20px;font:700 12px/1 var(--mono);color:var(--faint)}
.spot .sname{flex:1 1 auto;font-weight:600}
.spot .sscore{flex:0 0 auto;font:700 22px/1 var(--mono)}

.conf{font-size:9px;letter-spacing:.06em;text-transform:uppercase;padding:1px 5px;
   border-radius:4px;border:1px solid currentColor;margin-left:6px;
   vertical-align:middle;font-weight:600;cursor:help;white-space:nowrap}
.conf.med{color:var(--dim)}
.conf.low{color:var(--faint)}

.sbody{padding:0 13px 12px;border-top:1px solid var(--line)}
.swin{font:600 12px/1.4 var(--mono);color:var(--dim);margin:10px 0 6px}
.sreason{font-size:13px;line-height:1.5;color:var(--ink);margin-bottom:9px}
.schar{font-size:12px;color:var(--dim);margin-top:9px;line-height:1.45}
.sshelter{font-size:11.5px;color:var(--faint);margin:4px 0 0;line-height:1.45}
/* The confidence caveat, printed rather than hidden in a title attribute that a
 * phone cannot show. Set apart so it reads as a warning about the number above
 * it, not as more description of the spot. */
.sconf{font-size:11.5px;color:var(--faint);line-height:1.45;margin:7px 0 9px;
   padding-left:8px;border-left:2px solid var(--line);font-style:italic}
.spark{width:100%;height:22px;display:block;margin:6px 0 2px}

.scroller{overflow-x:auto;-webkit-overflow-scrolling:touch;margin-top:6px}
table{width:100%;border-collapse:collapse;font-family:var(--mono);font-size:11.5px}
td,th{padding:4px 6px;text-align:left;white-space:nowrap}
th{font-size:9px;letter-spacing:.09em;color:var(--faint);text-transform:uppercase;
   font-weight:600;border-bottom:1px solid var(--line);
   font-family:-apple-system,BlinkMacSystemFont,sans-serif}
tbody tr{border-bottom:1px solid rgba(34,56,70,.4)}
tbody tr:last-child{border-bottom:0}
tr.hot{background:rgba(61,220,151,.09)}
td.sc{font-weight:700;width:38px}

.tag{font-size:9px;padding:1px 4px;border-radius:4px;border:1px solid currentColor;opacity:.9}
.g{color:var(--good)} .o{color:var(--ok)} .b{color:var(--bad)} .d{color:var(--faint)}

/* ---------------------------- DISCLOSURE --------------------------- */

details{margin-top:12px;border:1px solid var(--line);border-radius:12px;
   background:var(--panel);overflow:hidden}
/* 44px tap target, via padding rather than flex: `display:flex` on a <summary>
 * suppresses the disclosure triangle in Chrome, and these sections need it -
 * without the marker they read as dead headings rather than as things to tap. */
summary{padding:15px 14px;cursor:pointer;font-size:12px;letter-spacing:.1em;
   text-transform:uppercase;color:var(--dim);font-weight:600;user-select:none;
   min-height:44px}
details .body{padding:0 14px 14px;font-size:13px;color:var(--dim);line-height:1.6}
details .body b{color:var(--ink)}
details .body p{margin:0 0 11px}
details table{font-size:11.5px;margin-top:8px}
details td{padding:3px 10px 3px 0;white-space:normal;vertical-align:top}

code{font-family:var(--mono);font-size:11.5px;background:var(--panel2);
   padding:1px 4px;border-radius:3px}
a{color:var(--accent)}

.err{background:rgba(239,100,97,.12);border:1px solid var(--bad);color:#ffd9d8;
   padding:11px 13px;border-radius:9px;font-size:13px;margin-top:12px}

.warn{background:rgba(255,209,102,.10);border:1px solid var(--ok);color:var(--ink);
   padding:10px 13px;border-radius:9px;font-size:12.5px;line-height:1.5;margin-top:12px}

/* ------------------------- OBSERVED BUOYS -------------------------- */
/* Sits directly under the headline, above the forecast list, because it is the
 * only measured thing on the page and it is what tells you whether to believe
 * the rest of it. Horizontal so it reads in one glance one-handed. */

#buoys:empty{display:none}
#buoys{margin-top:12px}

.bhead{font-size:9px;letter-spacing:.13em;text-transform:uppercase;color:var(--faint);
   font-weight:600;margin-bottom:6px}
.bhead .faint{letter-spacing:0;text-transform:none;font-size:10px}

/* align-items:stretch (the default) is doing real work: the third cell's caption
 * wraps to two lines at 320px while the buoy cells stay on one, and without
 * equal heights the row reads as broken rather than as three cells. */
.brow{display:flex;gap:8px;align-items:stretch;overflow-x:auto;
   -webkit-overflow-scrolling:touch;padding-bottom:2px}
.bcell{flex:1 1 0;min-width:88px;background:var(--panel);border:1px solid var(--line);
   border-radius:10px;padding:9px 11px;display:flex;flex-direction:column}
.bcell .bsub{margin-top:auto}
.bcell.bratio{border-color:var(--accent)}

.blabel{font-size:10px;color:var(--faint);white-space:nowrap;overflow:hidden;
   text-overflow:ellipsis}
.bval{font:700 21px/1.15 var(--mono);color:var(--ink);margin-top:2px}
.bval.g{color:var(--good)} .bval.b{color:var(--bad)}
.bunit{font-size:11px;font-weight:400;color:var(--faint);margin-left:2px}
.bsub{font:400 10px/1.3 var(--mono);color:var(--faint);margin-top:2px;min-height:13px}

footer{margin-top:28px;padding-top:14px;border-top:1px solid var(--line);
   font-size:11px;color:var(--faint);line-height:1.7}

/* Light mode only if the device explicitly asks for it. */
@media (prefers-color-scheme: light){
  :root{
    --bg:#f4f7f9; --panel:#ffffff; --panel2:#eef3f6; --line:#d3dee5;
    --ink:#10222d; --dim:#4a6b7d; --faint:#7d95a3;
    --good:#0f9d63; --ok:#b07d10; --bad:#c0392b; --accent:#1c7ea8;
  }
  tr.hot{background:rgba(15,157,99,.10)}
}

/* ------------------------- WHEN IT WORKS --------------------------- */
/* Replaces the prose spot description. Same vocabulary as the table
 * headers above it, so the two can be checked against each other. */

.works{margin:9px 0 0}
.works table{font-family:var(--mono);font-size:11.5px;width:100%}
.works th{width:44px;text-align:left;vertical-align:top;padding:2px 8px 2px 0;
   color:var(--faint);font-weight:600;font-size:9px;letter-spacing:.09em;
   text-transform:uppercase;border:0;
   font-family:-apple-system,BlinkMacSystemFont,sans-serif}
.works td{padding:2px 0;color:var(--dim);white-space:normal;line-height:1.5}

/* Tied ranks. "=2" rather than a fake 2 and 3. */
.teq{color:var(--faint);font-weight:400;margin-right:1px}

/* ----------------------------- CAM LOG ----------------------------- */

.log{margin-top:12px;padding-top:11px;border-top:1px solid var(--line)}
.loghead{font-size:9px;letter-spacing:.13em;text-transform:uppercase;color:var(--faint);
   font-weight:600;margin-bottom:7px}
.loghead .faint{letter-spacing:0;text-transform:none;font-size:10px;font-weight:400}

.calls{display:flex;gap:6px;margin-bottom:7px}
.calls .call{flex:1 1 0;min-height:44px;background:var(--panel2);color:var(--dim);
   border:1px solid var(--line);border-radius:8px;font-size:12px;cursor:pointer;
   font-family:inherit}
.calls .call.on{border-color:var(--accent);color:var(--accent);background:var(--panel)}
.calls .call:active{background:var(--panel)}

.lognote{width:100%;min-height:44px;background:var(--panel2);color:var(--ink);
   border:1px solid var(--line);border-radius:8px;padding:10px 11px;
   /* 16px stops iOS zooming the whole page when the field is focused. */
   font-size:16px;font-family:inherit;margin-bottom:7px}
.lognote::placeholder{color:var(--faint)}

.logsave{min-height:44px;padding:0 18px;background:var(--panel);color:var(--ink);
   border:1px solid var(--accent);border-radius:8px;font-size:13px;cursor:pointer;
   font-family:inherit}
.logsave:active{background:var(--panel2)}

.logmsg{font-size:11.5px;color:var(--dim);margin-top:7px;min-height:14px;line-height:1.45}

#logsummary:empty{display:none}
.logsum textarea{width:100%;background:var(--panel2);color:var(--dim);border:1px solid var(--line);
   border-radius:8px;padding:9px;font-family:var(--mono);font-size:11px;margin-top:9px;
   resize:vertical}

/* ------------------------------ POSTER ----------------------------- */


#posterout:empty{display:none}
#posterout{margin-top:14px}
.posterimg{width:100%;height:auto;display:block;border-radius:10px;
   border:1px solid var(--line)}
.posterbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:9px}
.posterbar a.rf{color:var(--dim)}
.posterbar .faint{flex:1 1 100%}

/* ------------------------------ POSTER ----------------------------- */
/* The poster is the page. It sits directly under the header at full width,
 * and everything below it is the working-out. */

#posterout{margin-top:14px}
.posterwait{font-size:11px;color:var(--faint);padding:10px 0}

.posterimg{width:100%;height:auto;display:block;border-radius:10px}

.posterbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:9px}
.posterbar a.rf{color:var(--dim)}
.posterbar .faint{flex:1 1 100%}

/* Hours that have already gone by. They stay in the table - dropping them made
 * the whole page morph through the day - but they should not read as options. */
tbody tr.gone{opacity:.42}
tbody tr.gone td{text-decoration:line-through;text-decoration-thickness:1px}

/* Link from the poster page to everything else. Made a big obvious block
 * rather than a text link: on the front page it is the only navigation there
 * is, and the last time something important was an 11px chip nobody found it. */
a.more{display:block;margin-top:16px;padding:14px;border:1px solid var(--line);
   border-radius:12px;background:var(--panel);text-decoration:none;min-height:44px}
a.more:active{background:var(--panel2)}
.mtitle{display:block;font-size:14px;font-weight:600;color:var(--accent)}
.msub{display:block;font-size:12px;color:var(--dim);line-height:1.45;margin-top:3px}
header a.rf{text-decoration:none}
