/* HHCBC Club Blog — modern large-print theme for older members */

:root {
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 40px rgba(28, 25, 23, 0.08);
  --shadow-hover: 0 14px 36px rgba(28, 25, 23, 0.12);
  --focus: 0 0 0 3px color-mix(in srgb, var(--amber) 50%, transparent);
  --ease: 160ms ease;
  --tap: 52px;
}

html[data-theme="light"],
html:not([data-theme]) {
  color-scheme: light;
  --bg: #f3f0eb;
  --bg-2: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f6f3ee;
  --ink: #1c1917;
  --ink-soft: #44403c;
  --muted: #57534e;
  --line: #e8e2d8;
  --amber: #c2410c;
  --amber-strong: #9a3412;
  --header-bg: #fffcf8;
  --header-ink: #1c1917;
  --header-muted: #57534e;
  --header-border: #ece6dc;
  --ok-bg: #ecfdf3;
  --ok-ink: #065f46;
  --ok-line: #a7f3d0;
  --warn-bg: #fef3c7;
  --warn-ink: #78350f;
  --warn-line: #fcd34d;
  --err-bg: #fef2f2;
  --err-ink: #991b1b;
  --err-line: #fecaca;
  --danger: #b42318;
  --danger-text: #fffaf8;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10100e;
  --bg-2: #161512;
  --surface: #1c1b18;
  --surface-2: #25231f;
  --ink: #f5f0e8;
  --ink-soft: #d6d0c6;
  --muted: #c4b8a8;
  --line: #3a3732;
  --amber: #f0b429;
  --amber-strong: #f5c85a;
  --header-bg: #141311;
  --header-ink: #f5f0e8;
  --header-muted: #c4b8a8;
  --header-border: #2c2925;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.5);
  --ok-bg: #0f2a22;
  --ok-ink: #d1fae5;
  --ok-line: #1f6b54;
  --warn-bg: #2a2110;
  --warn-ink: #fde68a;
  --warn-line: #7c5c12;
  --err-bg: #2a1414;
  --err-ink: #fecaca;
  --err-line: #7f1d1d;
  --danger: #e11d48;
  --danger-text: #fffaf8;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    color-scheme: dark;
    --bg: #10100e;
    --bg-2: #161512;
    --surface: #1c1b18;
    --surface-2: #25231f;
    --ink: #f5f0e8;
    --ink-soft: #d6d0c6;
    --muted: #c4b8a8;
    --line: #3a3732;
    --amber: #f0b429;
    --amber-strong: #f5c85a;
    --header-bg: #141311;
    --header-ink: #f5f0e8;
    --header-muted: #c4b8a8;
    --header-border: #2c2925;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.5);
    --ok-bg: #0f2a22;
    --ok-ink: #d1fae5;
    --ok-line: #1f6b54;
    --warn-bg: #2a2110;
    --warn-ink: #fde68a;
    --warn-line: #7c5c12;
    --err-bg: #2a1414;
    --err-ink: #fecaca;
    --err-line: #7f1d1d;
    --danger: #e11d48;
    --danger-text: #fffaf8;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  font-size: 22px;
  margin: 0;
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-optical-sizing: auto;
  font-size: 1rem;
  line-height: 1.55;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

[hidden] { display: none !important; }

h1, h2, h3 {
  font-family: var(--font);
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--ink);
}

a {
  color: var(--amber-strong);
  font-weight: 650;
  text-underline-offset: 0.15em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 20;
  background: var(--ink);
  color: var(--surface);
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-weight: 700;
}
.skip-link:focus { top: 0.75rem; }

/* Header */

.site-header {
  background: var(--header-bg);
  color: var(--header-ink);
  border-bottom: 1px solid var(--header-border);
}

.header-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.1rem 1.25rem 1.15rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.brand:hover { text-decoration: none; }

.logo-slot {
  flex: 0 0 auto;
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
}

.logo-img {
  width: auto;
  height: auto;
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(28, 25, 23, 0.14));
}

html[data-theme="dark"] .logo-img {
  filter:
    drop-shadow(0 0 1px rgba(255, 248, 230, 0.7))
    drop-shadow(0 0 14px rgba(255, 228, 180, 0.45));
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .logo-img {
    filter:
      drop-shadow(0 0 1px rgba(255, 248, 230, 0.7))
      drop-shadow(0 0 14px rgba(255, 228, 180, 0.45));
  }
}

.brand-abbrev {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  color: var(--amber);
  text-transform: uppercase;
}

.brand-name {
  margin: 0.12rem 0 0.2rem;
  font-size: clamp(1.2rem, 3.2vw, 1.7rem);
  line-height: 1.15;
  color: var(--header-ink);
}

.brand-tag {
  margin: 0;
  color: var(--header-muted);
  font-size: 1rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.site-nav form { display: contents; }

.who {
  margin: 0.85rem 0 0;
  color: var(--header-muted);
  font-size: 1rem;
}

/* Buttons — always have words, large tap targets */

.btn,
button.btn,
a.btn {
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 0.7rem 1.25rem;
  min-height: var(--tap);
  min-width: var(--tap);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.25;
  transition: background var(--ease), border-color var(--ease), transform var(--ease), box-shadow var(--ease), color var(--ease);
}

a.btn:hover,
.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-accent,
a.btn-accent,
button.btn-accent {
  background: var(--amber);
  border-color: var(--amber);
  color: #1c1917;
  font-weight: 800;
}

.btn-accent:hover:not(:disabled) { filter: brightness(1.06); }

.btn-ghost {
  background: color-mix(in srgb, var(--header-ink) 6%, transparent);
  border-color: color-mix(in srgb, var(--header-ink) 22%, transparent);
  color: var(--header-ink);
}

.btn-danger,
a.btn-danger,
button.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--danger-text);
}

.btn-write {
  width: 100%;
  margin-top: 1rem;
  min-height: 4.4rem;
  font-size: 1.45rem;
  font-weight: 800;
  border-radius: 18px;
  letter-spacing: -0.02em;
  box-shadow: var(--shadow);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.btn-row .btn { flex: 1 1 12rem; }

/* Page */

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3.2rem;
}

.page-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.7rem, 4vw, 2.3rem);
}

.lead {
  margin: 0 0 1.4rem;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.4rem 1.45rem;
  margin: 0 0 1.2rem;
}

/* Flash / status messages */

.banner {
  border-radius: var(--radius);
  border: 2px solid;
  padding: 1rem 1.15rem;
  margin: 0 0 1.3rem;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
}

.banner-ok { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-line); }
.banner-err { background: var(--err-bg); color: var(--err-ink); border-color: var(--err-line); }
.banner-warn { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }

/* Posts */

.post-list { display: grid; gap: 1.15rem; }

.post-card {
  display: grid;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
}

.post-card:hover { text-decoration: none; box-shadow: var(--shadow-hover); }

.post-card h2 {
  margin: 0;
  font-size: 1.55rem;
}

.post-meta {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.post-excerpt {
  margin: 0;
  color: var(--ink-soft);
}

.post-thumb {
  width: 100%;
  max-height: 16rem;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.post-photo {
  width: 100%;
  border-radius: var(--radius);
  margin: 1rem 0 1.2rem;
  background: var(--surface-2);
}

.post-body {
  font-size: 1.12rem;
  line-height: 1.65;
}
.post-body p { margin: 0 0 1rem; }
.post-body p:last-child { margin-bottom: 0; }

/* Forms */

.form { max-width: 40rem; }

label,
.field-label {
  display: block;
  font-weight: 750;
  margin: 0 0 0.4rem;
  font-size: 1.08rem;
}

.hint {
  display: block;
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="email"],
textarea {
  font: inherit;
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  padding: 0.75rem 0.9rem;
  min-height: var(--tap);
  margin: 0 0 1.15rem;
}

textarea {
  min-height: 16rem;
  line-height: 1.55;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--amber);
}

.optional { font-weight: 500; color: var(--muted); }

.photo-field {
  margin: 0 0 1.3rem;
  padding: 1rem;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.photo-preview {
  margin: 0.8rem 0 0;
  max-width: 100%;
  max-height: 16rem;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* How to post */

.steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps li {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.2rem 1.15rem 5rem;
  margin: 0 0 1rem;
  font-size: 1.12rem;
  min-height: 5rem;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 1rem;
  top: 1.05rem;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  background: var(--amber);
  color: #1c1917;
  font-weight: 800;
  font-size: 1.35rem;
  display: grid;
  place-items: center;
}

/* Admin */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

th, td {
  text-align: left;
  padding: 0.75rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th { font-weight: 750; }

.site-footer {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.25rem 2.8rem;
  color: var(--muted);
  font-size: 1rem;
}

.site-footer p { margin: 0.2rem 0; }

.site-footer a { font-size: 1.05rem; }

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.5rem;
}

@media (max-width: 700px) {
  html { font-size: 20px; }
  .logo-slot { width: 88px; height: 88px; }
  .logo-img { max-width: 88px; max-height: 88px; }
  .header-inner, .page { padding-left: 0.95rem; padding-right: 0.95rem; }
  .site-nav .btn { flex: 1 1 calc(50% - 0.6rem); min-width: calc(50% - 0.6rem); }
  .steps li { padding-left: 4.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
