/*
 * Color/typography overrides matching alicesastroinfo.com's WordPress
 * "Blue" theme. Loads after theme.css (Quark2 loads custom.css last).
 * Light mode only — dark mode keeps Quark2's stock palette (see
 * aai-theme.yaml's theme-mode: light default).
 */

:root,
:root[data-theme="light"] {
  --q2-bg: #567e9f;
  --q2-bg-muted: #d7e1ea; /* WP blockquote background */

  --q2-text: #21272c;
  --q2-text-strong: #071218; /* WP blockquote text */
  --q2-text-muted: #6c8193; /* WP visited-link color */

  --q2-border-ring: #758899; /* WP block/sidebar-panel border */
  --q2-border-strong: #9cb5c9; /* WP blockquote/metadata-bar border */
  --q2-divider: #9cb5c9;

  --q2-nav-bg: #668eaf;
  --q2-nav-border: #567e9f;
  }

/* Quark2 has no visited-link state by default. */
:root,
:root[data-theme="light"] {
  --pico-primary: #235976;
  --pico-primary-hover: #2f779d;
}
:root:not([data-theme="dark"]) a:visited {
  color: #6c8193;
}

/* Quark2 defaults all heading levels to one shared color. */
:root,
:root[data-theme="light"] {
  --pico-h1-color: #276282;
  --pico-h2-color: #276282;
  --pico-h3-color: #4f7492;
  --pico-h4-color: #21272c;
  --pico-h5-color: #21272c;
  --pico-h6-color: #21272c;
}

/* Body/heading font. Quark2 default is a sans-serif pairing. */
:root,
:root[data-theme="light"] {
  --pico-font-family-display: Georgia, "Times New Roman", Times, serif;
  --pico-font-family-sans-serif: Georgia, "Times New Roman", Times, serif;
  /* Quark2 default is 16px. */
  --pico-font-size: 13px;
}

/* #header .navbar-brand, .navbar-section a: nav bar link/brand text. */
:root:not([data-theme="dark"]) #header .navbar-brand,
:root:not([data-theme="dark"]) #header .navbar-section a {
  color: #ffffff;
}

/* .dropmenu a: top nav menu items. Quark2 default is 0.9375rem. */
.dropmenu a {
  font-size: 1.125rem;
}

/* .navbar-section.logo / .mobile-logo: Grav's default logo/site-title link
 * (desktop header and mobile overlay respectively). button.theme-toggle:
 * light/dark mode switch button. Hidden entirely — this site has neither. */
.navbar-section.logo,
.mobile-logo,
button.theme-toggle {
  display: none;
}

/* #header .navbar, .desktop-menu: nav content width/alignment. Matches the
 * sheet's own 896px max-width (.columns.aai-three-col below) and
 * left-aligns instead of Quark2's flex-end. */
#header .navbar {
  max-width: 896px;
  margin-inline: auto;
}
.desktop-menu {
  justify-content: flex-start;
}

/* #body-wrapper: gap between nav bar and the white sheet. Quark2 default is
 * clamp(2.5rem, 5vw, 4rem) top and bottom; only top is reduced here. */
#body-wrapper {
  padding-top: clamp(12px, 2vw, 24px);
}

/* .overlay .overlay-menu a: mobile hamburger menu links. Quark2 default
 * (var(--q2-text-strong)) is unreadable against this theme's blue overlay
 * background. :visited needs its own rule to beat the sitewide a:visited
 * rule above on specificity. */
@media (max-width: 860px) {
  .overlay .overlay-menu a,
  .overlay .overlay-menu a:visited,
  .overlay .overlay-menu a:hover {
    color: #ffffff;
  }
}

/* .columns.aai-three-col.has-sidebar: narrower sidebar track than Quark2's
 * own .columns.has-sidebar (minmax(0, 2.5fr) minmax(0, 1fr)). No left-spacer
 * column — #sidebar-left is hidden outright below. */
@media (min-width: 960px) {
  .columns.aai-three-col.has-sidebar {
    grid-template-columns: minmax(0, 3.5fr) minmax(120px, 1fr);
    gap: clamp(12px, 2vw, 19px);
  }
}

/* #sidebar: bled inward to sit close to the sheet's border. */
@media (min-width: 960px) {
  #sidebar {
    margin-right: calc(3px - clamp(6px, 1.5vw, 9px));
  }
}

/* #sidebar-left: WP's left column was a pure visual spacer, never real
 * content. */
#sidebar-left {
  display: none;
}

/* .columns.aai-three-col::before: WP's header banner image
 * (images/Blue-Hair-Transparent-Background-2018.gif, native 890x168), full
 * width above the three columns, inside the sheet's padding/border box. */
:root:not([data-theme="dark"]) .columns.aai-three-col::before {
  content: "";
  display: block;
  grid-column: 1 / -1;
  height: clamp(60px, 15vw, 168px);
  margin-inline: calc(-1 * clamp(6px, 1.5vw, 9px));
  background-image: url("../images/Blue-Hair-Transparent-Background-2018.gif");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
}

/* .content-title h1.p-name / h2.p-name / a.u-url: the post/page title
 * (h1 on a single post, h2 in the homepage's stacked listing — both styled
 * identically, matching WP). Color #1B445A is WP's specific title color,
 * distinct from the generic --pico-h1-color used for in-content headings.
 * font-size/text-decoration have no Quark2 default for this element. */
.content-title {
  padding: 0;
}

:root:not([data-theme="dark"]) .content-title h1.p-name,
:root:not([data-theme="dark"]) .content-title h1.p-name a.u-url,
:root:not([data-theme="dark"]) .content-title h2.p-name,
:root:not([data-theme="dark"]) .content-title h2.p-name a.u-url {
  color: #1b445a;
  font-variant: small-caps;
}
.content-title h1.p-name,
.content-title h2.p-name {
  font-size: 31px;
}
.content-title h1.p-name a.u-url,
.content-title h2.p-name a.u-url {
  text-decoration: none;
}

/* WP's images/PostHeaderIcon.png — decorative icon before every post/page
 * title. Native 72x72, shown at WP's rendered 29x29. */
.content-title h1.p-name a.u-url::before,
.content-title h2.p-name a.u-url::before {
  content: "";
  display: inline-block;
  width: 29px;
  height: 29px;
  margin-right: 0.4em;
  vertical-align: middle;
  background-image: url("../images/PostHeaderIcon.png");
  background-size: contain;
  background-repeat: no-repeat;
}

/* .blog-date: WP's "Pretty Printout" date box — block-level and full post
 * width, matching WP's markup. */
:root:not([data-theme="dark"]) .content-title .blog-date {
  display: block;
  background-color: #cad7e2;
  padding: 3px;
  border-radius: var(--q2-radius-sm);
}
:root:not([data-theme="dark"]) .content-title .blog-date,
:root:not([data-theme="dark"]) .content-title .blog-date time {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 12px;
  color: #364049;
}

/* .columns.aai-three-col: the white "sheet" behind the whole 3-column area
 * (WP's .Sheet). max-width 896px = header banner's native 890px + this
 * element's own 2x3px border. Padding is plain px, not rem, since
 * --pico-font-size: 13px above also drives the root font-size rem scales
 * from. Must stay in sync with the header banner's and #sidebar's own
 * negative-margin bleed values above. */
:root:not([data-theme="dark"]) .columns.aai-three-col {
  background: #ffffff;
  border: 3px solid #333333;
  border-radius: var(--q2-radius-md);
  padding: 1.25rem clamp(6px, 1.5vw, 9px);
  max-width: 896px;
  margin-inline: auto;
}

/* .content-item: the post/page body's own box within the sheet. The
 * sidebar does not get this treatment. */
:root:not([data-theme="dark"]) .content-item {
  background: #f2f2f2;
  border: 2px solid #cccccc;
  border-radius: var(--q2-radius-md);
  padding: 1rem clamp(8px, 1.5vw, 12px);
}

/* Gap between stacked posts on the homepage. */
.content-item + .content-item {
  margin-top: 24px;
}

/* .e-content h1-h6: in-content headings, distinct from the page/post title
 * above. Quark2's own heading rule shares one color across all levels and
 * never references --pico-hN-color, so those variables have no effect
 * here — direct rules instead. WP headings never underline their own
 * links. */
:root:not([data-theme="dark"]) .e-content h1,
:root:not([data-theme="dark"]) .e-content h1 a,
:root:not([data-theme="dark"]) .e-content h2,
:root:not([data-theme="dark"]) .e-content h2 a {
  color: #276282;
}
:root:not([data-theme="dark"]) .e-content h3,
:root:not([data-theme="dark"]) .e-content h3 a {
  color: #4f7492;
}
:root:not([data-theme="dark"]) .e-content h4,
:root:not([data-theme="dark"]) .e-content h4 a,
:root:not([data-theme="dark"]) .e-content h5,
:root:not([data-theme="dark"]) .e-content h5 a,
:root:not([data-theme="dark"]) .e-content h6,
:root:not([data-theme="dark"]) .e-content h6 a {
  color: #21272c;
}
.e-content h1 a,
.e-content h2 a,
.e-content h3 a,
.e-content h4 a,
.e-content h5 a,
.e-content h6 a {
  text-decoration: none;
}

/* WP's per-level heading sizes. font-weight: normal matches WP; Quark2's
 * own per-level weights vary (h1:400, h2:700, h3/h4:600). */
.e-content h1 {
  font-size: 33px;
  font-weight: normal;
}
.e-content h2 {
  font-size: 31px;
  font-weight: normal;
}
.e-content h3 {
  font-size: 20px;
  font-weight: normal;
}
.e-content h4 {
  font-size: 18px;
  font-weight: normal;
}
.e-content h5 {
  font-size: 15px;
  font-weight: normal;
}
.e-content h6 {
  font-size: 13px;
  font-weight: normal;
}
/* Removes Quark2's decorative h2 accent bar. */
.e-content h2::before {
  content: none;
}

/* --q2-link: referenced by Quark2's base link rule but never defined
 * there, so links render in the inherited text color until set here. */
:root,
:root[data-theme="light"] {
  --q2-link: #235976;
}

/* .e-content table/th/td: Quark2 has no table styling of its own (default
 * is a bottom border and white cell background). Black borders are a
 * deliberate departure from WP's own lighter #758899. */
.e-content table,
.e-content th,
.e-content td {
  border: 1px solid #000000;
  border-collapse: collapse;
}
.e-content th,
.e-content td {
  background-color: #f2f2f2;
  padding: 4px 8px;
}

/* Column widths for the sunset-watches-style 6-column time/date table
 * (the only tables in the migrated corpus at this column count). Widths
 * (5/35/20/20/10/10%) and padding are the original author's own inline
 * style values from WordPress. td gets white-space: nowrap; th keeps
 * overflow-wrap: normal (Pico's base :root sets break-word globally). */
.e-content table:has(thead tr > :nth-child(6)):not(:has(thead tr > :nth-child(7))) {
  table-layout: fixed;
}
.e-content
  table:has(thead tr > :nth-child(6)):not(:has(thead tr > :nth-child(7)))
  td {
  white-space: nowrap;
}
.e-content
  table:has(thead tr > :nth-child(6)):not(:has(thead tr > :nth-child(7)))
  th {
  overflow-wrap: normal;
  word-break: normal;
}
.e-content
  table:has(thead tr > :nth-child(6)):not(:has(thead tr > :nth-child(7)))
  :is(th, td):nth-child(1) {
  width: 5%;
}
.e-content
  table:has(thead tr > :nth-child(6)):not(:has(thead tr > :nth-child(7)))
  :is(th, td):nth-child(2) {
  width: 35%;
}
.e-content
  table:has(thead tr > :nth-child(6)):not(:has(thead tr > :nth-child(7)))
  :is(th, td):nth-child(3) {
  width: 20%;
}
.e-content
  table:has(thead tr > :nth-child(6)):not(:has(thead tr > :nth-child(7)))
  :is(th, td):nth-child(4) {
  width: 20%;
}
.e-content
  table:has(thead tr > :nth-child(6)):not(:has(thead tr > :nth-child(7)))
  :is(th, td):nth-child(5) {
  width: 10%;
}
.e-content
  table:has(thead tr > :nth-child(6)):not(:has(thead tr > :nth-child(7)))
  :is(th, td):nth-child(6) {
  width: 10%;
}
.e-content
  table:has(thead tr > :nth-child(6)):not(:has(thead tr > :nth-child(7)))
  :is(th, td) {
  padding: 2px 4px;
}

/* Same table, narrow viewports only: makes it horizontally scrollable
 * instead of squeezing nowrap cells into overlapping text. thead/tbody
 * carry the fixed layout at a set pixel width since table-layout only
 * applies to a table-display box, and the outer <table> is now block. */
@media (max-width: 860px) {
  .e-content table:has(thead tr > :nth-child(6)):not(:has(thead tr > :nth-child(7))) {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .e-content
    table:has(thead tr > :nth-child(6)):not(:has(thead tr > :nth-child(7)))
    thead,
  .e-content
    table:has(thead tr > :nth-child(6)):not(:has(thead tr > :nth-child(7)))
    tbody {
    display: table;
    width: 600px;
    table-layout: fixed;
  }
}

/* .e-content img: WP's real rule for plain post-body images. Higher
 * specificity than .aligncenter alone, which is why aligncenter images
 * don't render centered (matches WP). .wp-caption img below needs equal
 * specificity and later source order to override this for captions. */
.e-content img {
  border: 0 none;
  margin: 1em;
}

/* .wp-caption / .wp-caption-text: WP's classic Caption shortcode markup,
 * preserved as raw HTML by the migration script. Values ported from WP. */
.wp-caption {
  border: 1px solid #dddddd;
  text-align: center;
  background-color: #f3f3f3;
  padding-top: 4px;
  margin: 10px;
}
.wp-caption img {
  margin: 0;
  padding: 0;
  border: 0 none;
}
.wp-caption p.wp-caption-text {
  font-size: 11px;
  line-height: 17px;
  padding: 0 4px 5px;
  margin: 0;
}

/* Some captions carry a hardcoded WordPress inline pixel width wider than
 * a narrow viewport. */
@media (max-width: 860px) {
  .wp-caption {
    max-width: 100%;
  }
}

/* .e-content ul/li: WP's custom bullet (images/PostBullets.png, 43x15) as
 * a per-<li> background image. list-style-type: none is needed on both ul
 * and li — Quark2's base CSS sets it directly on li, which a parent-level
 * ul rule alone doesn't override. Scoped to .e-content so nav/sidebar
 * lists are unaffected. */
.e-content ul,
.e-content ul li {
  list-style-type: none;
}
.e-content ul {
  margin: 0;
  padding: 0;
}
.e-content ul li {
  background-image: url("../images/PostBullets.png");
  background-repeat: no-repeat;
  background-position: 0 0.3em;
  padding: 0 0 0 50px;
  margin: 0.5em 0;
  line-height: 1.2em;
}

/* .aligncenter/.alignleft/.alignright: WP's own classes, values ported
 * as-is. .e-content img above overrides .aligncenter's centering for
 * plain post-body images (matches WP); this rule still applies to a
 * caption-wrapped image or non-.e-content usage. */
.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.alignleft {
  float: left;
}
.alignright {
  float: right;
}
.alignright img,
img.alignright {
  margin: 1em;
  margin-right: 0;
}
.alignleft img,
img.alignleft {
  margin: 1em;
  margin-left: 0;
}

/* .aai-panel / .aai-panel-header / .aai-panel-body: sidebar panel chrome
 * (Socials/Auroras/Sunsets/Events), approximating WP's own 9-slice
 * .Block/.BlockHeader/.BlockContent with flat CSS. Colors sampled from
 * WP's real images: header gradient stops match --q2-bg; body background
 * matches --q2-bg-muted. Border/header text colors are WP's own values. */
.aai-panel {
  border-radius: var(--q2-radius-sm);
  overflow: hidden;
  margin: 0 0 14px;
}
.aai-panel:last-child {
  margin-bottom: 0;
}

.aai-panel-header {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0 8px;
  height: 30px;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 15px;
  font-variant: small-caps;
  font-weight: normal;
}

/* WP's images/BlockHeaderIcon.png — decorative arrow before every panel
 * title, native 15x22. */
.aai-panel-header::before {
  content: "";
  flex: 0 0 auto;
  width: 15px;
  height: 22px;
  margin-right: 6px;
  background-image: url("../images/BlockHeaderIcon.png");
  background-repeat: no-repeat;
  background-position: left center;
  background-size: contain;
}

.aai-panel-body {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 13px;
  padding: 8px;
}
.aai-panel-body p:first-child {
  margin-top: 0;
}
.aai-panel-body p:last-child {
  margin-bottom: 0;
}

:root:not([data-theme="dark"]) .aai-panel {
  border: 1px solid #758899;
}
:root:not([data-theme="dark"]) .aai-panel-header {
  color: #272e35;
  background: linear-gradient(
    to bottom,
    var(--q2-bg) 0%,
    #7b9cb7 17%,
    #6f94b1 50%,
    var(--q2-bg) 100%
  );
}
:root:not([data-theme="dark"]) .aai-panel-body {
  background: var(--q2-bg-muted);
  color: var(--q2-text);
}
:root:not([data-theme="dark"]) .aai-panel-body a:link,
:root:not([data-theme="dark"]) .aai-social-icons a {
  color: var(--q2-link);
  text-decoration: none;
}
:root:not([data-theme="dark"]) .aai-panel-body a:visited {
  color: var(--q2-text-muted);
  text-decoration: none;
}
:root:not([data-theme="dark"]) .aai-panel-body a:hover,
:root:not([data-theme="dark"]) .aai-social-icons a:hover {
  color: var(--pico-primary-hover);
  text-decoration: underline;
}

/* .aai-social-icons: Socials panel icon row. Font Awesome 7 brand icons
 * instead of WP's downloaded PNG button images. */
.aai-social-icons {
  font-size: 20px;
  line-height: 1;
}
.aai-social-icons a {
  display: inline-block;
  margin: 0 10px 0 0;
}
:root:not([data-theme="dark"]) .aai-social-note {
  color: var(--q2-text-muted);
}
.aai-social-note {
  font-size: 11px;
}

/* .aai-panel-body--calendar: Events panel's Google Calendar embed. WP's
 * original iframe had a fixed 145px width; this sidebar column is fluid,
 * so width is 100% instead. */
.aai-panel-body--calendar {
  padding: 8px 0;
}
.aai-panel-body--calendar iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
}
