/* Design tokens and the header block below are copied verbatim (same
   selectors, same values) from thecoder.cafe's own static site
   (github.com/teivah/thecodercafe-website, local copy at
   ~/idea/thecodercafe-website/style.css) so barista.thecoder.cafe's header
   is pixel-identical to thecoder.cafe's, not just similarly styled. The
   .subnav-* rules below are new -- they're this site's own second bar,
   not present on thecoder.cafe.

   One deliberate deviation: thecoder.cafe's own html{} is white, but this
   site's pages are usually shorter than the viewport, which let that white
   show through as a visibly different-colored band below a short page's
   content. html{} here matches body{}'s cream instead, and body{} gets a
   min-height of a full viewport, so there's never a second-colored band at
   all. */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: #f8ede3;
}

body {
    min-height: 100vh;
    background-color: #f8ede3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
}

a {
    color: #8d493a;
}

h1, h2 {
    color: #555;
    letter-spacing: -0.5px;
    font-weight: 700;
}

/* Avoid a single word stranded on its own last line ("daily." / "in.").
   Browsers without support just keep their default wrapping. */
h1, h2, h3 {
    text-wrap: balance;
}

p, li {
    text-wrap: pretty;
}

/* Short centered copy (landing, message pages) reads best with lines of
   even length rather than a short tail. */
.page-card:not(.page-card-left) p {
    text-wrap: balance;
}

/* --- Header: copied from thecoder.cafe, do not diverge --- */

.header {
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border-bottom: 2px solid #e5d5c3;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.logo-section {
    flex-shrink: 0;
}

.header-logo {
    max-height: 45px;
    width: auto;
    display: block;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 35px;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 16px;
    padding: 8px 0;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #666;
}

.nav-link.active {
    border-bottom: 2px solid #333;
}

/* --- Subnav: barista.thecoder.cafe's own second bar, account-area links
   (settings / log out, logged-in only) -- not part of thecoder.cafe's header.
   Styled after read.thecoder.cafe's own Substack nav strip (muted links,
   bold+underlined active item, same background as the page below it so
   the bar reads as part of the page rather than a separate band). --- */

.subnav {
    background-color: #f8ede3;
    border-bottom: 1px solid #e5d5c3;
}

.subnav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 36px;
}

.subnav-link {
    text-decoration: none;
    color: #6b5b4f;
    font-weight: 500;
    font-size: 15px;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.subnav-link:hover {
    color: #333;
}

.subnav-link.active {
    color: #333;
    font-weight: 700;
    border-bottom-color: #333;
}

.page-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.page-card {
    background-color: white;
    max-width: 440px;
    width: 100%;
    padding: 40px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.page-card .muted {
    font-size: 14px;
}

.page-card p {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
}

.btn {
    display: inline-block;
    background-color: #8d493a;
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 40px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn:hover {
    background-color: #6a352b;
}

/* Form pages (settings, signup confirm) read top to bottom, so their card
   is left-aligned; the landing and message pages stay centered. */
.page-card-left {
    text-align: left;
}

.page-card h1 + p {
    margin-top: 8px;
}

.page-card-left h1 {
    text-align: center;
    margin-bottom: 24px;
}

/* The landing page's single email field + button. */
.start-form {
    margin: 28px 0 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.start-form input {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
}

.field {
    text-align: left;
    margin-bottom: 20px;
}

.field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.field input, .field textarea, .field select {
    width: 100%;
    background-color: white;
    color: #333;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
}

.page-card .field-hint {
    font-size: 13px;
    color: #888;
    margin-top: 6px;
}

.field select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* Posts per day, right after the paid plan activates. */
.field select.field-highlight {
    border-color: #2d6a3e;
    box-shadow: 0 0 0 3px #eaf6ec;
}

/* The free plan's upgrade offer, centered under posts per day. */
.page-card .upsell {
    text-align: center;
    margin-top: 12px;
}

/* A secondary action: brand-colored outline, quieter than .btn. */
.btn.btn-secondary {
    background-color: white;
    color: #8d493a;
    border: 1px solid #8d493a;
    padding: 8px 14px;
    font-size: 14px;
}

.btn.btn-secondary:hover {
    background-color: #f8ede3;
}

/* The plan line under the account email. Its Manage link is
   brand-colored without underline, so it doesn't read like Delete
   account. */
.page-card .account-plan {
    text-align: center;
    font-size: 13px;
    color: #6b5b4f;
    margin-top: 4px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.plan-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: #8d493a;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.plan-link:hover {
    text-decoration: underline;
}

.page-card .footer-hint {
    text-align: left;
}

.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    vertical-align: -1px;
    border: 2px solid #d9c6b5;
    border-top-color: #6b5b4f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* A checkbox sits inline before its label text instead of taking the
   full-width block layout .field gives text inputs. */
.field.field-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
}

.field.field-checkbox input {
    width: auto;
    padding: 0;
    margin: 0;
}

.page-card .field-error {
    text-align: left;
    font-size: 13px;
    color: #a33a3a;
    margin-top: 6px;
}

.start-form .field-error {
    margin-top: -4px;
}

.muted {
    font-size: 14px;
    color: #888;
}

.subnav-form {
    display: flex;
    margin: 0;
}

/* .subnav-button resets a <button> inside the logout <form> to look
   exactly like the <a class="subnav-link"> items next to it -- the
   logout action has to be a POST form (not a plain link) but should be
   visually indistinguishable from one. */
.subnav-button {
    background: none;
    border: none;
    text-decoration: none;
    color: #6b5b4f;
    font-weight: 500;
    font-size: 15px;
    font-family: inherit;
    padding: 0 0 4px 0;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.subnav-button:hover {
    color: #333;
}

.page-card .form-error {
    text-align: left;
    background-color: #fdecea;
    color: #8d2d2d;
    border: 1px solid #f3c6c6;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    margin: 20px 0;
}

.page-card .form-success {
    text-align: left;
    background-color: #eaf6ec;
    color: #2d6a3e;
    border: 1px solid #c6e6cc;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    margin: 20px 0;
}

.page-card .notice {
    background-color: #f8ede3;
    color: #6b5b4f;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    margin: 20px 0;
}

.notice-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* A <button> (pause/resume/delete must be POST forms) that looks like a
   plain text link -- secondary actions stay quiet next to the one real
   button on the page. */
.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 14px;
    color: #8d493a;
    text-decoration: underline;
    cursor: pointer;
}

.link-muted {
    color: #6b5b4f;
}

.link-danger {
    color: #c0392b;
}

.confirm-form {
    margin-top: 24px;
}

.field.field-centered label {
    justify-content: center;
}

/* Lines a checkbox's hint up with its label text, past the box itself. */
.page-card .checkbox-hint {
    margin-top: 2px;
    padding-left: 21px;
}

/* Settings' account line + footer: who's signed in, then the two quiet
   account actions pushed to opposite ends so neither is clicked by
   mistake for the other. */
.page-card .account-email {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    font-size: 13px;
    color: #999;
}

/* Belt and braces for browsers that ignore format-detection and still
   wrap the address in a link: it's the viewer's own email, nothing to
   click. */
.page-card .account-email a {
    color: inherit;
    text-decoration: none;
    pointer-events: none;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
}

.account-plan + .card-footer {
    margin-top: 20px;
}

.card-footer form {
    margin: 0;
}

.footer {
    border-top: 1px solid #e5d5c3;
    padding: 24px 40px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 28px;
}

.footer-link {
    text-decoration: none;
    color: #6b5b4f;
    font-size: 13px;
}

.footer-link:hover {
    color: #333;
}

/* legal.html's card is prose, not a narrow form -- wider than the default
   .page-card and left-aligned rather than centered. */
.legal-card {
    max-width: 760px;
    text-align: left;
}

.legal-card h2 {
    margin-top: 28px;
    margin-bottom: 10px;
}

.legal-card h3 {
    margin-top: 18px;
    margin-bottom: 6px;
    color: #555;
}

.legal-card p, .legal-card li {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
}

.legal-card ul {
    margin-left: 20px;
    margin-bottom: 10px;
}

/* message.html's optional call-to-action under its one paragraph. */
.page-card p + .btn {
    margin-top: 24px;
}

.btn-block {
    display: block;
    width: 100%;
}
