:root {
  color-scheme: light;
  --ink: #17312d;
  --muted: #667771;
  --paper: #fbfaf6;
  --card: #ffffff;
  --forest: #173b36;
  --forest-soft: #e8f0ec;
  --gold: #c99943;
  --line: #e5e7df;
  --shadow: 0 18px 44px rgba(25, 52, 47, 0.1);
  --radius-lg: 26px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 3%, rgba(201, 153, 67, 0.12), transparent 25rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.skip-link {
  position: fixed;
  z-index: 50;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  color: white;
  background: var(--forest);
  border-radius: 999px;
  transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.35rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 15px;
  color: white;
  background: var(--forest);
  box-shadow: 0 8px 20px rgba(23, 59, 54, 0.2);
}

.brand-mark::before {
  content: "";
  position: absolute;
  width: 1px;
  height: 58%;
  left: 50%;
  top: 13%;
  background: rgba(255, 255, 255, 0.48);
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 34%;
  height: 1px;
  left: 33%;
  top: 35%;
  background: rgba(255, 255, 255, 0.48);
}

.brand-mark span { position: relative; z-index: 1; font: 700 0.72rem/1 Georgia, serif; letter-spacing: 0.05em; }
.brand-copy { display: grid; gap: 0.12rem; }
.brand-copy strong { font: 600 1.07rem/1.1 Georgia, "Times New Roman", serif; }
.brand-copy small { color: var(--muted); font-size: 0.72rem; }

.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  color: var(--forest);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.icon-button:hover { transform: translateY(-1px); background: white; }
.icon-button:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid rgba(201, 153, 67, 0.5); outline-offset: 3px; }
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button.is-saved { color: white; background: var(--forest); border-color: var(--forest); }
.icon-button.is-spinning svg { animation: spin 700ms linear infinite; }

main { width: min(1120px, calc(100% - 2.5rem)); margin: 0 auto; }

.welcome {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(2.2rem, 7vw, 5.6rem);
  border-radius: var(--radius-lg);
  color: white;
  background:
    linear-gradient(102deg, rgba(17, 49, 44, 0.99) 0%, rgba(27, 68, 61, 0.94) 54%, rgba(26, 64, 57, 0.76) 100%),
    url("https://pastorhogg.net/wp-content/uploads/2023/11/pexels-photo-261579.jpeg") center/cover;
  box-shadow: var(--shadow);
}

.welcome::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: clamp(-7rem, -3vw, -2rem);
  top: 50%;
  width: 19rem;
  height: 19rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 0 3.4rem rgba(255, 255, 255, 0.028), 0 0 0 7rem rgba(255, 255, 255, 0.02);
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.welcome h1 {
  max-width: 720px;
  margin: 0;
  font: 500 clamp(2.25rem, 6vw, 4.35rem)/0.98 Georgia, "Times New Roman", serif;
  letter-spacing: -0.035em;
}

.welcome > p:not(.eyebrow) {
  max-width: 610px;
  margin: 1rem 0 1.65rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(0.96rem, 2vw, 1.08rem);
  line-height: 1.65;
}

.primary-button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 1.1rem 0.8rem 1.25rem;
  color: var(--forest);
  background: #f7efe0;
  border: 0;
  border-radius: 999px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(5, 17, 15, 0.18);
}

.primary-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.reader-section { padding: clamp(3.8rem, 8vw, 6.3rem) 0 4rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.5rem; }
.section-heading h2 { margin: 0; font: 500 clamp(1.9rem, 4vw, 2.75rem)/1.05 Georgia, "Times New Roman", serif; letter-spacing: -0.025em; }
.feed-status { margin: 0 0 0.25rem; color: var(--muted); font-size: 0.82rem; }

.tabs { display: inline-flex; gap: 0.2rem; padding: 0.27rem; margin-bottom: 1.3rem; background: #eceee8; border-radius: 999px; }
.tab { min-height: 40px; padding: 0.55rem 1rem; color: var(--muted); background: transparent; border: 0; border-radius: 999px; font-weight: 700; cursor: pointer; }
.tab.is-active { color: var(--forest); background: white; box-shadow: 0 2px 8px rgba(23, 49, 45, 0.08); }
.count-badge { min-width: 1.3rem; display: inline-grid; place-items: center; margin-left: 0.3rem; padding: 0.08rem 0.3rem; color: white; background: var(--forest); border-radius: 999px; font-size: 0.68rem; }

.feed { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.post-card { min-width: 0; overflow: hidden; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 5px 22px rgba(25, 52, 47, 0.055); transition: transform 180ms ease, box-shadow 180ms ease; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-card:first-child { grid-column: span 2; }

.card-image-button { position: relative; width: 100%; height: 185px; display: block; overflow: hidden; padding: 0; border: 0; background: var(--forest-soft); cursor: pointer; }
.post-card:first-child .card-image-button { height: 265px; }
.card-image { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 400ms ease; }
.post-card:hover .card-image { transform: scale(1.025); }
.image-shade { position: absolute; inset: auto 0 0; height: 40%; background: linear-gradient(transparent, rgba(7, 25, 22, 0.34)); }

.card-content { flex: 1; display: flex; flex-direction: column; padding: 1.15rem 1.15rem 1.05rem; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.card-content h3 { margin: 0.65rem 0; font: 500 1.45rem/1.15 Georgia, "Times New Roman", serif; letter-spacing: -0.015em; }
.post-card:first-child h3 { font-size: clamp(1.55rem, 3vw, 2rem); }
.card-content h3 button { padding: 0; color: inherit; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.excerpt { margin: 0 0 1.05rem; color: var(--muted); font-size: 0.91rem; line-height: 1.58; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: auto; }
.read-button, .text-button { padding: 0; color: var(--forest); background: none; border: 0; font-weight: 750; cursor: pointer; }
.read-button { min-height: 44px; display: inline-flex; align-items: center; gap: 0.35rem; }
.read-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card-icon-actions { display: flex; gap: 0.35rem; }
.card-icon-actions .icon-button { width: 40px; height: 40px; background: transparent; }

.empty-state { padding: 4rem 1.5rem; text-align: center; border: 1px dashed #ccd3cb; border-radius: var(--radius-md); }
.empty-icon { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto 1rem; color: var(--gold); background: #f5eee1; border-radius: 50%; font-size: 1.7rem; }
.empty-state h3 { margin: 0 0 0.45rem; font: 500 1.55rem Georgia, "Times New Roman", serif; }
.empty-state p { max-width: 430px; margin: 0 auto 1rem; color: var(--muted); line-height: 1.55; }

.skeleton { height: 410px; padding: 0; background: white; }
.skeleton-image { height: 52%; background: linear-gradient(100deg, #e9ece6 30%, #f5f6f3 50%, #e9ece6 70%); background-size: 220% 100%; animation: shimmer 1.2s infinite linear; }
.skeleton-lines { width: 78%; height: 82px; margin: 1.3rem; background: repeating-linear-gradient(#eceee8 0 10px, transparent 10px 25px); }

footer { width: min(1120px, calc(100% - 2.5rem)); margin: 0 auto; padding: 1.7rem 0 calc(1.7rem + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--muted); border-top: 1px solid var(--line); font-size: 0.82rem; }
footer a { color: var(--forest); font-weight: 700; text-decoration: none; }

.reader-dialog { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; color: var(--ink); background: var(--paper); border: 0; opacity: 0; transform: translateY(16px); transition: opacity 200ms ease, transform 200ms ease, overlay 200ms ease allow-discrete, display 200ms ease allow-discrete; }
.reader-dialog[open] { opacity: 1; transform: translateY(0); }
@starting-style { .reader-dialog[open] { opacity: 0; transform: translateY(16px); } }
.reader-dialog::backdrop { background: rgba(9, 27, 24, 0.4); backdrop-filter: blur(5px); }
.dialog-shell { min-height: 100%; }
.dialog-header { position: sticky; z-index: 5; top: 0; min-height: 70px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding: 0.7rem max(1rem, env(safe-area-inset-left)); background: rgba(251, 250, 246, 0.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.dialog-header > span { font: 600 1rem Georgia, "Times New Roman", serif; white-space: nowrap; }
.dialog-close { justify-self: start; }
.dialog-actions { justify-self: end; display: flex; gap: 0.45rem; }
.dialog-content { width: min(710px, calc(100% - 2.5rem)); margin: 0 auto; padding: clamp(2.5rem, 8vw, 5.2rem) 0 6rem; }
.article-kicker { color: var(--gold); font-size: 0.75rem; font-weight: 750; letter-spacing: 0.11em; text-transform: uppercase; }
.dialog-content h2 { margin: 0.7rem 0 2rem; font: 500 clamp(2.2rem, 7vw, 4rem)/1.03 Georgia, "Times New Roman", serif; letter-spacing: -0.035em; }
.article-body { color: #293c38; font: 1.06rem/1.86 Georgia, "Times New Roman", serif; }
.article-body p { margin: 0 0 1.45em; }
.article-body h2, .article-body h3, .article-body h4 { margin: 2em 0 0.65em; font-family: Georgia, "Times New Roman", serif; line-height: 1.2; letter-spacing: -0.02em; }
.article-body img { width: 100%; height: auto; margin: 1.4rem 0; border-radius: 14px; }
.article-body blockquote { margin: 2rem 0; padding: 0.2rem 0 0.2rem 1.4rem; color: var(--forest); border-left: 3px solid var(--gold); font-size: 1.18em; font-style: italic; }
.article-body a { color: #246a5d; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.article-body iframe, .article-body form, .article-body script, .article-body style { display: none !important; }
.source-link { min-height: 48px; display: inline-flex; align-items: center; margin-top: 2rem; padding: 0.75rem 1rem; color: var(--forest); border: 1px solid #bfcac2; border-radius: 999px; font-weight: 750; text-decoration: none; }

.toast { position: fixed; z-index: 80; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom)); max-width: calc(100% - 2rem); padding: 0.72rem 1rem; color: white; background: #102e29; border-radius: 999px; font-size: 0.82rem; box-shadow: 0 10px 32px rgba(9, 27, 24, 0.24); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position-x: -220%; } }

@media (max-width: 820px) {
  .feed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-card:first-child { grid-column: span 2; }
}

@media (max-width: 580px) {
  .site-header, main, footer { width: min(100% - 1.25rem, 1120px); }
  .site-header { padding: 0.9rem 0; }
  .brand-copy small { display: none; }
  .brand-mark { width: 42px; height: 42px; border-radius: 13px; }
  .welcome { min-height: 370px; padding: 2.1rem 1.25rem; border-radius: 22px; }
  .welcome h1 { font-size: clamp(2.45rem, 12vw, 3.35rem); }
  .welcome::after { opacity: 0.65; }
  .reader-section { padding-top: 3.4rem; }
  .section-heading { display: block; }
  .feed-status { margin-top: 0.55rem; }
  .tabs { width: 100%; }
  .tab { flex: 1; }
  .feed { grid-template-columns: 1fr; gap: 0.9rem; }
  .post-card:first-child { grid-column: auto; }
  .card-image-button, .post-card:first-child .card-image-button { height: 205px; }
  .post-card:first-child h3 { font-size: 1.55rem; }
  footer { display: grid; padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }
  .dialog-header { grid-template-columns: auto 1fr auto; }
  .dialog-header > span { text-align: center; }
  .dialog-content { width: min(100% - 2rem, 710px); }
  .article-body { font-size: 1rem; line-height: 1.78; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
