/* LatinTime site stylesheet — responsive, works in Safari, Chrome & Firefox */

:root {
  --bg: #ffffff;
  --bg-alt: #f8f4e9;
  --text: #1f2328;
  --muted: #59606a;
  --accent: #7a5c15;        /* sundial bronze */
  --accent-soft: #8a6a1c;
  --border: #e2d9c2;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181d;
    --bg-alt: #1f2229;
    --text: #e6e4df;
    --muted: #a5a29b;
    --accent: #d9b45f;
    --accent-soft: #e3c47c;
    --border: #363a43;
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

/* ---------- Header & navigation ---------- */

header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.site-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-decoration: none;
  margin-right: auto;
}

.site-name span {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.9rem;
  display: block;
  line-height: 1.2;
}

nav {
  flex-basis: 100%;
}

nav ul {
  list-style: none;
  margin: 0.25rem 0 0.35rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 0.35rem;
}

nav a {
  display: block;
  padding: 0.3rem 0.55rem;
  border-radius: 0.4rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

nav a:hover {
  background: var(--border);
}

nav a[aria-current="page"] {
  background: var(--accent);
  color: #fff;
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
}

.nav-toggle-label {
  display: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border);
  line-height: 0;
}

.nav-toggle-label svg {
  width: 1.4rem;
  height: 1.4rem;
  stroke: var(--text);
}

@media (max-width: 700px) {
  .nav-toggle-label {
    display: inline-block;
  }
  header nav {
    display: none;
  }
  .nav-toggle:checked ~ nav {
    display: block;
  }
  header nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.25rem 0 0.5rem;
  }
  header nav a {
    padding: 0.55rem 0.55rem;
    white-space: normal;
  }
}

/* ---------- Content ---------- */

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0.5rem 0 1rem;
}

h2 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.005em;
  line-height: 1.3;
  margin: 2.2rem 0 0.7rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 1.6rem 0 0.4rem;
}

p {
  margin: 0 0 1rem;
  overflow-wrap: break-word;
}

ul,
ol {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}

li {
  margin-bottom: 0.35rem;
}

a {
  color: var(--accent-soft);
}

a:hover {
  color: var(--accent);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  padding: 0.1rem 0.3rem;
  overflow-wrap: anywhere;
}

/* Screenshots: never wider than the column, keep aspect ratio */
main img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.4rem auto;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
}

/* ---------- Footer ---------- */

footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-inner h2 {
  border: none;
  padding-top: 0;
  margin-top: 0;
  font-size: 1.1rem;
  color: var(--text);
}

.footer-inner p {
  margin-bottom: 0.5rem;
}

/* ---------- Phone screenshot floated beside text ---------- */

.shot {
  float: right;
  width: 300px;
  max-width: 46%;
  height: auto;
  margin: 0.2rem 0 1rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  box-shadow: var(--shadow);
}

@media (max-width: 560px) {
  .shot {
    float: none;
    display: block;
    margin: 0 auto 1.5rem;
    max-width: 240px;
  }
}


.shot-left {
  float: left;
  margin: 0.2rem 1.5rem 1rem 0;
}

@media (max-width: 620px) {
  .shot,
  .shot-left {
    float: none;
    display: block;
    margin: 0 auto 1.5rem;
    max-width: 320px;
    width: 100%;
  }
}

/* the menubar clock, shown at its true size inline */
.menubar-shot {
  display: inline-block;
  vertical-align: middle;
  width: 41px;
  height: 23px;
  margin: 0 0.2rem;
  border: none;
  border-radius: 0.2rem;
  box-shadow: none;
}

/* ---------- Inline video clip ---------- */

.clip {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  margin: 1.2rem auto 1.5rem;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
}

/* ---------- Marble background (light & dark) ---------- */
/* Fixed pseudo-element rather than background-attachment:fixed, which iOS
   Safari handles badly. `cover` rather than `repeat` to avoid tile seams.
   Light marble is LatinTime's own (the same stone as the sundial); the dark
   marble comes from LatinCalendar — LatinTime has no true dark marble. */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url(images/marble-light.jpg);
  background-size: cover;
  background-position: 50% 50%;
  background-repeat: no-repeat;
  opacity: 0.85;
  pointer-events: none;
}

/* the reading column sits on a translucent panel so text isn't competing
   with the veining; the marble still frames the page */
main {
  background-color: rgba(255, 255, 255, 0.82);
}

header,
footer {
  background-color: rgba(248, 245, 236, 0.78);
}

@media (prefers-color-scheme: dark) {
  html {
    background-color: #000;
  }

  body {
    background-color: transparent;
  }

  body::before {
    background-image: url(images/marble-dark.jpg);
    opacity: 1;
  }

  main {
    background-color: rgba(8, 10, 12, 0.72);
  }

  header,
  footer {
    background-color: rgba(8, 9, 10, 0.66);
  }
}
