/* Wild Gears Patterns — shared styles
   Palette and type carried over from ronnymariano.com so the standalone
   gallery reads as the same identity, not a generic rebuild. */

:root {
  --paper:      #faf4ea;
  --card:       #f5ebdd;
  --card-open:  #f2e3cf;
  --line:       #e2d1b8;
  --line-soft:  #ece0cd;
  --amber:      #e09b2d;
  --amber-deep: #c87f1a;
  --ink:        #3a322a;
  --ink-soft:   #5c554c;
  --ink-faint:  #8a7f70;
  --brown-btn:  #6e553e;
  --shadow:     0 1px 3px rgba(58,44,28,.08), 0 6px 18px rgba(58,44,28,.06);
  --radius:     12px;
  --maxw:       1200px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1.55;
}

a { color: var(--amber-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

/* ---- Ronny Mariano site masthead (mirrors ronnymariano.com) ---- */
.master-head {
  background: #efe4d1;
  border-bottom: 3px solid #9c3b2e;
  text-align: center;
  padding: 26px 0 16px;
}
.master-name {
  font-family: 'Cormorant Garamond', 'Lora', serif;
  font-size: 2rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  margin: 0; line-height: 1.1;
}
.master-name a { color: #4a3527; text-decoration: none; }
.master-name a:hover { color: var(--amber-deep); text-decoration: none; }
.master-sub {
  font-family: 'Cormorant Garamond', 'Lora', serif;
  font-size: 1.05rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  color: #6e553e; margin: 2px 0 0;
}
.master-nav {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 8px 26px; margin-top: 16px;
  font-size: .78rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
}
.master-nav a { color: #4a3527; }
.master-nav a:hover { color: var(--amber-deep); text-decoration: none; }
@media (max-width: 600px) {
  .master-name { font-size: 1.5rem; }
  .master-nav { gap: 6px 16px; }
}

/* ---- Prose pages (About / FAQ) ---- */
.prose { max-width: 760px; }
.prose h3 {
  font-family: 'Cormorant Garamond', 'Lora', serif;
  font-size: 1.5rem; font-weight: 600; margin: 34px 0 8px;
}
.prose p { margin: 0 0 16px; color: var(--ink); }
.prose ul { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.faq-item {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); margin-bottom: 12px;
  padding: .4rem 1.1rem .5rem;
}
.faq-item[open] { background: var(--card-open); padding-bottom: 1rem; }
.faq-item summary {
  cursor: pointer; font-weight: 600; font-size: 1.02rem;
  list-style: none; display: flex; align-items: center;
  padding: .45rem 0;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "\25B6"; margin-left: auto; font-size: .75rem;
  transition: transform .15s ease; color: var(--ink-faint);
}
.faq-item[open] > summary::after { transform: rotate(90deg); }
.faq-item p { margin: 6px 0 10px; font-size: .95rem; color: var(--ink-soft); }
.faq-item p:last-child { margin-bottom: 4px; }

/* ---- Masthead ---- */
.site-head {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbf6ee, #f7efe2);
}
.site-head .wrap {
  display: flex; align-items: baseline; gap: 18px;
  padding-top: 18px; padding-bottom: 18px; flex-wrap: wrap;
}
.site-title {
  font-family: 'Cormorant Garamond', 'Lora', serif;
  font-weight: 600; font-size: 1.7rem; letter-spacing: .01em;
  color: var(--ink); margin: 0;
}
.site-nav { display: flex; gap: 16px; margin-left: auto; flex-wrap: wrap; font-size: .92rem; }
.site-nav a { color: var(--ink-soft); }
.site-nav a.active { color: var(--amber-deep); font-weight: 600; }

.crumbs { font-size: .85rem; color: var(--ink-faint); margin: 14px 0 0; }
.crumbs a { color: var(--ink-faint); }

/* ---- Page title ---- */
.page-title {
  font-family: 'Cormorant Garamond', 'Lora', serif;
  font-size: 2.4rem; font-weight: 600; margin: 14px 0 2px; line-height: 1.05;
}
.page-sub { color: var(--ink-soft); font-size: .95rem; margin: 0 0 4px; }

/* ---- Filter accordion ---- */
.filter { margin: 16px 0; }
.filter details {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .5rem 1rem .75rem; background: var(--card);
}
.filter details[open] { background: var(--card-open); }
.filter summary {
  cursor: pointer; font-weight: 600; display: flex; align-items: center;
  list-style: none; font-size: 1.02rem;
}
.filter summary::-webkit-details-marker { display: none; }
.filter summary::after {
  content: "\25B6"; margin-left: auto; font-size: .8rem;
  transition: transform .15s ease; color: var(--ink-faint);
}
.filter details[open] > summary::after { transform: rotate(90deg); }

.filter-grid {
  display: grid; gap: .75rem; margin-top: .9rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.filter-grid label { display: block; font-size: .8rem; color: var(--ink-soft); margin-bottom: .2rem; }
.filter-grid select, .filter-grid input[type=number] {
  width: 100%; padding: .4rem .5rem; border: 1px solid #cbbda4;
  border-radius: 6px; background: #fffdf9; font: inherit; font-size: .9rem; color: var(--ink);
}
.filter-grid input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
.filter-grid input[type=number] { -moz-appearance: textfield; }

.filter-actions { display: flex; gap: .5rem; align-items: center; margin-top: .9rem; }

/* ---- Buttons / pills ---- */
.btn {
  display: inline-block; padding: .5rem 1.3rem; border: 1px solid #c8b79d;
  border-radius: 999px; background: transparent; cursor: pointer;
  font: inherit; font-size: .8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--brown-btn); text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #efe2cd; text-decoration: none; }
.btn--primary { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn--primary:hover { background: var(--amber-deep); }

/* ---- View switch ---- */
.viewbar { display: flex; gap: .5rem; flex-wrap: wrap; margin: 8px 0 20px; }
.viewbar .btn.active { background: var(--amber); border-color: var(--amber); color: #fff; }
.viewbar .spacer { margin-left: auto; }

/* ---- Grid of patterns ---- */
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(58,44,28,.12), 0 12px 28px rgba(58,44,28,.10); text-decoration: none; }
.card a { color: inherit; text-decoration: none; display: block; }
.card .thumb { aspect-ratio: 1 / 1; background: #efe6d6; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .meta { padding: 10px 12px 12px; }
.card .name { font-weight: 600; font-size: 1.02rem; line-height: 1.2; }
.card .type { font-size: .78rem; color: var(--ink-faint); margin-top: 2px; }

/* ---- Directory table ---- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.dir { border-collapse: collapse; width: 100%; font-size: .9rem; background: var(--card); }
table.dir th, table.dir td { padding: .55rem .7rem; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.dir thead th { background: #efe2cd; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
table.dir thead th.sortable { cursor: pointer; user-select: none; }
table.dir thead th.sortable:hover { color: var(--amber-deep); }
table.dir thead th .arrow { color: var(--amber-deep); }
table.dir tbody tr:hover { background: #f7efe1; }
table.dir td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Detail layout ---- */
.detail { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; margin-top: 18px; align-items: start; }
.detail .photo { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.detail .photo img { width: 100%; }
.detail .extra { margin-top: 16px; }
.detail .extra figure { margin: 0 0 14px; }
.detail .extra figcaption { font-size: .82rem; color: var(--ink-faint); font-style: italic; margin-top: 4px; }
.caption { font-style: italic; color: var(--ink-soft); margin: 10px 2px 0; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel h3 { font-family: 'Cormorant Garamond','Lora',serif; font-size: 1.3rem; margin: 0 0 10px; font-weight: 600; }
table.kv { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.kv th, table.kv td { padding: .4rem .2rem; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
table.kv th { font-weight: 500; color: var(--ink-soft); width: 52%; }
table.kv td { text-align: right; font-variant-numeric: tabular-nums; }
table.kv tr.group th { background: #efe2cd; font-weight: 600; color: var(--ink); border-radius: 4px; }
table.kv .desc { display: block; font-size: .76rem; color: var(--ink-faint); font-style: italic; }
.familykey { font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace; font-size: .82rem; }

.relatives { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.relatives a {
  display: inline-block; padding: .3rem .7rem; border: 1px solid var(--line);
  border-radius: 999px; background: #fffdf9; font-size: .82rem; color: var(--ink-soft);
}
.relatives a:hover { border-color: var(--amber); color: var(--amber-deep); text-decoration: none; }
.rel-count { font-size: .8rem; color: var(--ink-faint); margin: 2px 0 0; }

.navrow { display: flex; justify-content: space-between; gap: 10px; margin: 18px 0 6px; font-size: .9rem; }
.navrow a.disabled { color: var(--line); pointer-events: none; }

/* ---- Family page ---- */
.family-key-banner { font-family: 'JetBrains Mono', monospace; font-size: .85rem; color: var(--ink-soft); margin: 2px 0 12px; }
.section-h { font-family: 'Cormorant Garamond','Lora',serif; font-size: 1.5rem; font-weight: 600; margin: 26px 0 4px; }
.section-note { font-size: .85rem; color: var(--ink-faint); margin: 0 0 12px; }

/* ---- Compound stages ---- */
.stage { border: 1px solid var(--line); border-radius: 10px; background: #fffdf9; padding: 12px 14px; margin-bottom: 12px; }
.stage h4 { margin: 0 0 8px; font-size: 1rem; }
.stage .stage-note { font-size: .82rem; color: var(--ink-soft); font-style: italic; margin-top: 6px; }

/* ---- Pagination ---- */
.pager { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 26px 0; }
.pager button {
  border: 1px solid var(--line); background: var(--card); border-radius: 6px;
  padding: .35rem .7rem; cursor: pointer; font: inherit; font-size: .85rem; color: var(--ink-soft);
}
.pager button.active { background: var(--amber); border-color: var(--amber); color: #fff; }
.pager button:disabled { opacity: .4; cursor: default; }

.empty { text-align: center; color: var(--ink-faint); padding: 50px 10px; }
.count-line { font-size: .85rem; color: var(--ink-faint); margin: 0 0 12px; }

/* ---- Add forms ---- */
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: .85rem; color: var(--ink-soft); margin-bottom: 4px; font-weight: 600; }
.form-row input[type=text], .form-row input[type=number], .form-row input[type=password],
.form-row select, .form-row textarea, .form-row input[type=file] {
  width: 100%; padding: .5rem .6rem; border: 1px solid #cbbda4; border-radius: 6px;
  background: #fffdf9; font: inherit; font-size: .95rem; color: var(--ink);
}
.form-row textarea { min-height: 70px; resize: vertical; }
.field-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.hint { font-size: .78rem; color: var(--ink-faint); font-weight: 400; margin-top: 3px; }
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: .9rem; }
.msg.error { background: #fbe6da; border: 1px solid #e7a07f; color: #8a3a18; }
.msg.ok { background: #e3f0d8; border: 1px solid #9cc278; color: #3f5e22; }
.gear-img-hint { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.gear-img-hint img { width: 46px; height: 46px; border-radius: 6px; border: 1px solid var(--line); }

.site-foot { border-top: 1px solid var(--line); margin-top: 50px; padding: 22px 0; font-size: .82rem; color: var(--ink-faint); }

@media (max-width: 720px) {
  .detail { grid-template-columns: 1fr; }
  body { font-size: 16px; }
  .page-title { font-size: 2rem; }
}

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