/* One text size at every window width. (The template's 14px below 768px made Ctrl+ zoom shrink
   the text again once the zoomed window counted as "narrow".) */
html {
  font-size: 16px;
}

/* The page fills the same share of the window at any zoom, like the old site's 90%-wide tables,
   so Ctrl+ makes the text bigger and re-wraps it rather than stepping down to a narrower column. */
.site-width {
  padding-left: max(0.75rem, 5%);
  padding-right: max(0.75rem, 5%);
}

/* The keyboard-focus ring in the site's dark green rather than Bootstrap's blue. */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #336666;
}

.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: #336666;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ---- The old Stories of Arda look (soa.css and header.asp), carried over ----
   Pale leaf-pattern background, Verdana, teal links that turn dark red on hover, the vine rule
   above and below the menu, small bullets between menu items, leaf bullets on story lists. */

:root {
  --soa-teal: #336666;
  --soa-red: #993333;
  --soa-ground: #E9ECE9;
  --bs-body-font-family: Verdana, Geneva, Tahoma, Arial, sans-serif;
  --bs-link-color: var(--soa-teal);
  --bs-link-color-rgb: 51, 102, 102;
  --bs-link-hover-color: var(--soa-red);
  --bs-link-hover-color-rgb: 153, 51, 51;

  /* How heavy and dark the text reads (testers, 2026-11-02: the old site was easier to read).
     Verdana has only regular and bold, so Bootstrap's "medium" (500) headings and story titles
     fell back to regular; the old site had them bold. Its text was black, not Bootstrap's grey. */
  --soa-heading-weight: bold;
  --bs-body-color: #000;
  --bs-body-color-rgb: 0, 0, 0;
  --bs-heading-color: #000;
  /* The detail lines (rating, chapters, dates) and other quiet text: darker than Bootstrap's grey. */
  --bs-secondary-color: #3f463f;
  --bs-secondary-color-rgb: 63, 70, 63;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-weight: var(--soa-heading-weight);
}

.blockquote-footer {
  color: var(--bs-secondary-color);
}

body {
  background-color: var(--soa-ground);
  background-image: url("../images/background.jpg");
  font-size: 0.95rem;
}

a {
  color: var(--soa-teal);
}

/* Buttons in the site's dark green, red on hover like the links: Bootstrap's blue is a colour
   the old site never had. */
.btn-primary {
  --bs-btn-bg: var(--soa-teal);
  --bs-btn-border-color: var(--soa-teal);
  --bs-btn-hover-bg: var(--soa-red);
  --bs-btn-hover-border-color: var(--soa-red);
  --bs-btn-active-bg: var(--soa-red);
  --bs-btn-active-border-color: var(--soa-red);
  --bs-btn-disabled-bg: var(--soa-teal);
  --bs-btn-disabled-border-color: var(--soa-teal);
}

.btn-outline-primary {
  --bs-btn-color: var(--soa-teal);
  --bs-btn-border-color: var(--soa-teal);
  --bs-btn-hover-bg: var(--soa-red);
  --bs-btn-hover-border-color: var(--soa-red);
  --bs-btn-active-bg: var(--soa-red);
  --bs-btn-active-border-color: var(--soa-red);
  --bs-btn-disabled-color: var(--soa-teal);
  --bs-btn-disabled-border-color: var(--soa-teal);
}

/* The pager's hover and focus, and admin badges, which Bootstrap also makes blue. */
.pagination {
  --bs-pagination-hover-color: var(--soa-red);
  --bs-pagination-focus-color: var(--soa-red);
  --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(51, 102, 102, 0.35);
}

.badge.text-bg-primary {
  background-color: var(--soa-teal) !important;
}

a:hover {
  color: var(--soa-red);
  text-decoration: none;
}

.site-header .navbar {
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-image: url("../images/vine.png") 10 0 round;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.site-nav .nav-link,
.site-nav .btn-link.nav-link {
  color: var(--soa-teal);
  font-weight: bold;
  text-decoration: none;
}

.site-nav .nav-link:hover,
.site-nav .btn-link.nav-link:hover {
  color: var(--soa-red);
}

/* The little bullet between menu items, as on the old header. */
@media (min-width: 768px) {
  .site-nav .nav-item + .nav-item::before,
  .site-nav .navbar-nav + .navbar-nav > .nav-item:first-child::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 0 0.15rem;
    vertical-align: middle;
    background: url("../images/bullet-nav.png") no-repeat center;
  }

  .site-nav .nav-item {
    display: flex;
    align-items: center;
  }
}

/* The account button (pen name, top right): a leaf instead of the menu dot, and an outlined
   button with a menu icon instead of Bootstrap's small arrow, so it reads as a menu. */
.site-nav .navbar-nav > .nav-item.account-menu::before {
  content: none !important;
}

.site-nav .account-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem !important;
  border: 1px solid var(--soa-teal);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.6);
}

.site-nav .account-button:hover,
.site-nav .account-button[aria-expanded="true"] {
  border-color: var(--soa-red);
  color: var(--soa-red);
}

.site-nav .account-button::after {
  display: none; /* Bootstrap's small arrow; the menu icon replaces it */
}

.account-leaf {
  object-fit: contain;
}

/* Long pen names end in "..." rather than pushing the menu icon off the bar. */
.site-nav .account-button > span {
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The account menu (pen name, top right): teal links like the rest of the site. */
.account-menu .dropdown-menu {
  --bs-dropdown-link-color: var(--soa-teal);
  --bs-dropdown-link-hover-color: var(--soa-red);
  --bs-dropdown-header-color: #6c757d;
  font-size: 0.95rem;
}

/* The home page's Tolkien quote: bold dark red, the source in italics (the old .quote and .ref). */
/* The ownership notice at the top of the home page, as on the old one. */
.site-disclaimer {
  font-size: 0.875rem;
  text-align: justify;
}

/* Indented on both sides like the old page's blockquote; no bar, so it doesn't box up against
   the announcement below it. */
.quote-of-the-day {
  margin-left: 2.5rem;
  margin-right: 2.5rem;
}

.quote-of-the-day .blockquote-footer {
  text-align: right;
}

@media (max-width: 575.98px) {
  .quote-of-the-day {
    margin-left: 0.5rem;
    margin-right: 0;
  }
}

.quote-of-the-day .blockquote {
  font-size: 1.05rem;
  font-weight: bold;
  color: #660000;
}

.quote-of-the-day .blockquote-footer {
  color: #660000;
  font-style: italic;
}

/* The admins' announcement on the home page, between the quote and the story list. */
.site-announcement,
.soft-box {
  background-color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(51, 102, 102, 0.35);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
}

.soft-box h2 {
  font-size: 1.25rem;
}

.site-announcement > :last-child,
.soft-box > :last-child {
  margin-bottom: 0;
}

/* The funnel beside a story list's heading, and the sort-and-filter panel it opens. Red when
   something other than the default view is chosen. */
.story-filter-toggle {
  padding: 0 0.25rem;
  vertical-align: baseline;
  color: var(--soa-teal);
}

.story-filter-toggle:hover,
.story-filter-toggle.is-set {
  color: var(--soa-red);
}

.story-filter {
  margin-bottom: 1rem;
}


.story-filter > .row {
  background-color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(51, 102, 102, 0.35);
  border-radius: 0.75rem;
  padding: 0.25rem 0.75rem 0.75rem;
  margin: 0;
}

/* The row of links under a member's name: Stories, Favourite stories, Favourite authors, Links. */
.author-nav .list-inline-item + .list-inline-item::before {
  content: "\00B7";
  margin-right: 0.5rem;
  color: var(--bs-secondary-color);
}

/* Ordinary lists use the old small bullet; menus, pagers and unstyled lists don't. */
main ul:not(.list-unstyled):not(.nav):not(.pagination):not(.navbar-nav) {
  list-style-image: url("../images/bullet.png");
}

/* Story lists: a leaf beside each story, cycling through the old site's three leaves. */
.story-list > li {
  padding-left: 46px;
  background-repeat: no-repeat;
  background-position: 6px 0.2rem;
}

.story-list > li:nth-child(3n+1) { background-image: url("../images/leaf1.png"); }
.story-list > li:nth-child(3n+2) { background-image: url("../images/leaf2.png"); }
.story-list > li:nth-child(3n+3) { background-image: url("../images/leaf3.png"); }

/* Tables (Your stories, chapters, admin lists) in the page's light green rather than Bootstrap's
   white, which was hard on the eyes against the leaves; the heading row a shade darker. */
.table {
  --bs-table-bg: var(--soa-ground);
  --bs-table-border-color: #c9d1c9;
}

.table > thead {
  --bs-table-bg: #dde3dd;
}

/* Site pages (About, the admin guide, ...): tables lose their classes when cleaned. The old pages
   (About, Guidelines, Resources, News) are laid out in borderless tables, so only a table with a
   heading row (the admin guide's) gets lines and padding. */
.info-page table {
  margin-bottom: 1rem;
  border-collapse: collapse;
}

.info-page td {
  vertical-align: top;
}

.info-page table:has(> thead) th,
.info-page table:has(> thead) td {
  padding: 0.4rem 0.6rem;
  border: 1px solid #c9d1c9;
}

.info-page table:has(> thead) th {
  background-color: rgba(255, 255, 255, 0.6);
}

/* In the admin guide a blockquote is a "take care" note, not a quotation. */
.admin-guide blockquote {
  background-color: rgba(255, 255, 255, 0.6);
  border-left: 4px solid var(--soa-teal);
  padding: 0.5rem 1rem;
}

.admin-guide blockquote > :last-child {
  margin-bottom: 0;
}

.footer a {
  color: var(--soa-teal);
}

/* Plain-text fields (summaries, bios, reviews) keep the author's line breaks. */
.plain-text {
  white-space: pre-line;
}

.chapter-text {
  max-width: 45rem;
  line-height: 1.6;
}

.chapter-text .text-justify {
  text-align: justify;
}

.chapter-text img {
  max-width: 100%;
  height: auto;
}

/* The chapter editor's writing area (chapter-editor.js). */
.editor-surface {
  min-height: 25rem;
  max-height: 70vh;
  overflow-y: auto;
  resize: vertical;
  max-width: none;
}

.editor-surface blockquote,
.chapter-text blockquote {
  margin-left: 2rem;
}