/* Where in the World Is Josh? — road trip / old map aesthetic */

:root {
  --paper: #f6f0e0;
  --paper-dark: #ece2c8;
  --ink: #2e2a24;
  --ink-soft: #6b5f4d;
  --accent: #c1440e;       /* highway-sign orange-red */
  --accent-soft: #e07b39;
  --green: #3d6b45;
  --card: #fffaf0;
  --line: #d8cba9;
  --machine: #4a3f8f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(120,100,60,.05) 34px 35px),
    var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
}

h1, h2, h3 { line-height: 1.15; }
a { color: var(--accent); }

.container { max-width: 1020px; margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 720px; margin-left: auto; margin-right: auto; }

/* header */
.site-header {
  background: var(--ink);
  border-bottom: 4px double var(--accent);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1rem; flex-wrap: wrap; gap: .5rem;
}
.brand {
  display: flex; align-items: center; gap: .5rem;
  color: var(--paper); text-decoration: none;
}
.brand-mark { font-size: 1.8rem; }
.brand-text { font-weight: bold; font-size: .95rem; letter-spacing: .03em; }
.brand-text em { color: var(--accent-soft); font-style: italic; }
.nav-links a {
  color: var(--paper); text-decoration: none; margin-left: 1.1rem;
  font-size: .95rem; padding-bottom: 2px; border-bottom: 2px solid transparent;
}
.nav-links a.active, .nav-links a:hover { border-bottom-color: var(--accent-soft); }
.nav-admin { font-style: italic; }

main.container { padding-top: 1.5rem; padding-bottom: 3rem; min-height: 65vh; }

/* hero */
.hero { text-align: center; margin: 1.5rem 0 2rem; }
.hero-kicker {
  text-transform: uppercase; letter-spacing: .25em; font-size: .75rem;
  color: var(--ink-soft); margin-bottom: .3rem;
}
.hero-title {
  font-size: clamp(1.7rem, 5vw, 2.8rem);
  margin: 0 0 .6rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-shadow: 2px 2px 0 var(--paper-dark);
}
.hero-sub { max-width: 640px; margin: 0 auto; color: var(--ink-soft); }

/* cards */
.card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  box-shadow: 3px 3px 0 rgba(90, 70, 30, .12);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.4rem;
}
.card h2 { margin-top: 0; border-bottom: 2px dashed var(--line); padding-bottom: .4rem; }

.error-card { text-align: center; margin-top: 3rem; }

/* banners + flashes */
.banner-machine {
  background: var(--machine);
  color: #fff; text-align: center;
  border-radius: 10px; padding: 1.2rem;
  border: 3px dashed #fff;
  margin-bottom: 1.5rem;
  animation: stamp-in .35s ease-out;
}
.banner-machine h2 { margin: 0; letter-spacing: .08em; }
.machine-line { font-size: 1.4rem; letter-spacing: .18em !important; }
@keyframes stamp-in {
  from { transform: scale(1.15) rotate(-2deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}

.flash { padding: .7rem 1rem; border-radius: 6px; margin: .8rem 0; }
.flash-ok  { background: #e4efe2; border: 1px solid var(--green); }
.flash-err { background: #fbe6df; border: 1px solid var(--accent); }

.winner-banner {
  margin-top: .8rem; padding: .7rem 1rem;
  background: #f4ead2; border: 2px dashed var(--accent);
  border-radius: 6px;
}

/* decision meta */
.meta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .8rem; margin: .5rem 0;
}
.meta-label {
  display: block; text-transform: uppercase; font-size: .7rem;
  letter-spacing: .12em; color: var(--ink-soft);
}
.meta-value { font-size: 1.05rem; }

.pill {
  display: inline-block; padding: .15rem .7rem; border-radius: 999px;
  font-size: .78rem; font-weight: bold; letter-spacing: .06em; text-transform: uppercase;
}
.pill-open { background: #dcead8; color: var(--green); border: 1px solid var(--green); }
.pill-closed { background: #eee6d6; color: var(--ink-soft); border: 1px solid var(--ink-soft); }
.pill-veto { background: #f7e3d3; color: var(--accent); border: 1px solid var(--accent); }
.pill-done { background: #e3e0ef; color: var(--machine); border: 1px solid var(--machine); }

/* choice cards */
.choices {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.2rem; margin: 1.5rem 0;
}
.choice-card {
  position: relative;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  box-shadow: 4px 4px 0 rgba(90, 70, 30, .14);
  padding: 1.1rem 1.2rem;
  display: flex; flex-direction: column;
}
.choice-card:hover { transform: translateY(-2px); transition: transform .15s; }
.choice-winner { border-color: var(--accent); border-width: 2.5px; }
.ribbon {
  position: absolute; top: -12px; right: -8px;
  background: var(--accent); color: #fff;
  font-size: .72rem; font-weight: bold; letter-spacing: .15em;
  padding: .2rem .8rem; border-radius: 4px;
  transform: rotate(4deg);
  box-shadow: 2px 2px 0 rgba(0,0,0,.2);
}
.choice-title { margin: 0 0 .2rem; font-size: 1.2rem; }
.choice-dest { color: var(--accent); font-weight: bold; margin: 0 0 .5rem; }
.choice-desc { margin: .3rem 0; }
.choice-why, .choice-acts, .choice-caveats { font-size: .92rem; color: var(--ink-soft); }
.choice-facts {
  list-style: none; padding: 0; margin: .6rem 0; display: flex; flex-wrap: wrap; gap: .4rem;
}
.choice-facts li {
  background: var(--paper-dark); border: 1px solid var(--line);
  border-radius: 999px; font-size: .78rem; padding: .1rem .6rem;
}
.choice-votebox { margin-top: auto; padding-top: .8rem; border-top: 2px dashed var(--line); }
.vote-count { margin-top: .6rem; font-size: .9rem; color: var(--ink-soft); }
.vote-number { font-size: 1.3rem; font-weight: bold; color: var(--ink); }
.vote-bar {
  height: 8px; background: var(--paper-dark); border-radius: 999px;
  overflow: hidden; margin-top: .3rem;
}
.vote-bar-fill { height: 100%; background: var(--accent-soft); border-radius: 999px; }

/* buttons */
.btn {
  display: inline-block; padding: .55rem 1.1rem;
  border-radius: 6px; border: none; cursor: pointer;
  font-family: inherit; font-size: .95rem; text-decoration: none; text-align: center;
  background: var(--ink); color: var(--paper);
}
.btn:hover { filter: brightness(1.15); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-vote { background: var(--accent); }
.btn-secondary { background: transparent; color: var(--ink); border: 1.5px solid var(--ink-soft); }
.btn-danger { background: #8f2f16; }
.btn-machine { background: var(--machine); font-size: .85rem; line-height: 1.3; }
.btn-link {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-family: inherit; font-size: .88rem; text-decoration: underline; padding: .2rem .3rem;
}
.btn-link.danger { color: #8f2f16; }
.btn.is-loading { opacity: .75; cursor: progress; pointer-events: none; }
.spinner {
  display: inline-block; width: .95em; height: .95em;
  vertical-align: -.12em; margin-right: .1rem;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* forms */
.stacked-form label { display: block; margin: .8rem 0 .25rem; font-weight: bold; font-size: .92rem; }
.stacked-form.compact label { margin-top: .5rem; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="url"], input[type="datetime-local"], select, textarea {
  width: 100%; padding: .55rem .7rem;
  border: 1.5px solid var(--line); border-radius: 6px;
  background: #fff; font-family: inherit; font-size: .95rem; color: var(--ink);
}
textarea { resize: vertical; }
.field-row { display: flex; gap: .8rem; flex-wrap: wrap; }
.field-row > div { flex: 1 1 150px; }
.check-label { display: flex; align-items: center; gap: .5rem; font-weight: bold; margin: .9rem 0; }
.check-label input { width: auto; transform: scale(1.2); }

.inline-controls { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin: .6rem 0; }
.inline-form { display: inline-block; }

/* admin */
.admin-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.4rem; }
@media (max-width: 800px) { .admin-grid { grid-template-columns: 1fr; } }

.admin-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.admin-table th {
  text-align: left; text-transform: uppercase; font-size: .72rem; letter-spacing: .1em;
  color: var(--ink-soft); border-bottom: 2px solid var(--line); padding: .4rem .5rem;
}
.admin-table td { padding: .5rem; border-bottom: 1px dashed var(--line); vertical-align: top; }
@media (max-width: 700px) {
  .admin-table thead { display: none; }
  .admin-table tr { display: block; margin-bottom: .8rem; border: 1px dashed var(--line); border-radius: 6px; }
  .admin-table td { display: block; border: none; }
  .admin-table td::before {
    content: attr(data-label) ": "; font-weight: bold; color: var(--ink-soft);
    text-transform: uppercase; font-size: .72rem;
  }
}

.add-candidate { margin-top: 1.2rem; }
.add-candidate summary { cursor: pointer; font-weight: bold; color: var(--accent); }

.rule-dashed { border: none; border-top: 2px dashed var(--line); margin: 1.1rem 0; }

/* trips */
.trip-list { list-style: none; padding: 0; }
.trip-list li { border-bottom: 1px dashed var(--line); padding: .5rem 0; }
.trip-link { text-decoration: none; color: inherit; display: block; }
.trip-link:hover .trip-dest { color: var(--accent); }
.trip-date {
  display: inline-block; font-size: .78rem; letter-spacing: .1em;
  color: var(--ink-soft); text-transform: uppercase; margin-right: .6rem;
}
.arrow { color: var(--accent); font-weight: bold; }
.trip-card h3 { margin: .2rem 0; }
.trip-card h3 a { text-decoration: none; color: var(--ink); }
.trip-card h3 a:hover { color: var(--accent); }
.trip-date-stamp {
  display: inline-block; background: var(--paper-dark); border: 1px dashed var(--ink-soft);
  border-radius: 4px; padding: .1rem .5rem; font-size: .8rem;
}
.plain-list { list-style: none; padding: 0; }
.plain-list li { padding: .25rem 0; }
.winner-line { background: #f4ead2; border-radius: 6px; padding: .35rem .6rem !important; }
.links-list li { margin: .3rem 0; }
.narrative {
  font-size: 1.05rem; font-style: italic;
  border-left: 4px solid var(--accent-soft);
  padding: .3rem 0 .3rem 1rem; margin: 1rem 0;
}
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .7rem; }
.photo-grid img { width: 100%; border-radius: 6px; border: 1px solid var(--line); }

.muted { color: var(--ink-soft); }
.small { font-size: .82rem; }

/* Where Is Josh? */
.whereis-card h2 { border-bottom: 2px dashed var(--line); }
.map-panel {
  height: 280px; max-height: 45vh;
  border: 1.5px solid var(--line); border-radius: 8px;
  background: var(--paper-dark);
}
@media (min-width: 700px) { .map-panel { height: 300px; } }
.whereis-status { font-size: 1.15rem; font-style: italic; margin: .8rem 0 .3rem; }
.whereis-wink { color: var(--accent); font-style: normal; }

/* admin location panel */
.loc-status-box {
  padding: .6rem .9rem; border-radius: 6px;
  background: var(--paper-dark); border: 1px dashed var(--ink-soft);
  min-height: 2.2em; margin: .5rem 0;
}
.loc-auto-note { display: none; color: var(--accent); font-weight: bold; }
.loc-auto-note.active { display: inline; }

/* media layer */
.video-embed {
  position: relative; width: 100%; padding-top: 56.25%;
  background: var(--ink); border-radius: 8px; overflow: hidden;
}
.video-embed iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
.featured-video-card .video-embed { max-width: 720px; margin: 0 auto; }
.more-videos { margin-top: .8rem; }
.more-videos summary { cursor: pointer; color: var(--accent); font-weight: bold; }
.video-grid-small { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 1rem; margin-top: .7rem; }

.trip-cover { margin: 0 auto 1.4rem; max-width: 900px; }
.trip-cover img { width: 100%; border-radius: 10px; border: 1.5px solid var(--line); box-shadow: 4px 4px 0 rgba(90,70,30,.14); }
.trip-cover figcaption { text-align: center; font-style: italic; color: var(--ink-soft); padding-top: .4rem; }

.photo-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .8rem;
}
.gallery-item { margin: 0; }
.gallery-item img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--line);
}
.gallery-item figcaption { font-size: .78rem; color: var(--ink-soft); padding-top: .2rem; }

.video-block { max-width: 700px; margin: 1.2rem 0; }
.video-title { margin: .5rem 0 0; }

.trip-card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); margin-bottom: .5rem; }
.trip-card-fallback {
  display: flex; align-items: center; justify-content: center;
  height: 110px; margin-bottom: .5rem; text-decoration: none; font-size: 3rem;
  background: var(--paper-dark); border: 2px dashed var(--line); border-radius: 6px;
}

.media-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: .8rem 0; }
.upload-btn { cursor: pointer; position: relative; overflow: hidden; }
.visually-hidden-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; font-size: 0;
}
.media-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .9rem; margin: 1rem 0;
}
.media-item { margin: 0; }
.media-thumb-wrap { position: relative; }
.media-thumb-wrap img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 6px; border: 1.5px solid var(--line);
}
.is-cover .media-thumb-wrap img { border-color: var(--accent); border-width: 2.5px; }
.small-ribbon { top: -8px; right: -4px; font-size: .62rem; padding: .12rem .5rem; }
.caption-form { display: flex; gap: .25rem; align-items: center; margin-top: .35rem; }
.caption-form input[type="text"] { padding: .3rem .45rem; font-size: .82rem; }
.media-controls { gap: .3rem; }
.video-pinned { border-left: 5px solid var(--accent); }
.video-file { width: 100%; max-height: 420px; border-radius: 8px; background: var(--ink); }

/* deletion */
.danger-zone {
  border-color: #c1440e;
  border-style: dashed;
}
.confirm-card h2 { color: var(--accent); }
.confirm-list { padding-left: 1.2rem; }
.confirm-list li { margin: .35rem 0; }
a.danger { color: #8f2f16; font-size: .85rem; margin-left: .5rem; }
@media (max-width: 700px) {
  a.danger { display: inline-block; margin-left: 0; }
}

/* footer */
.site-footer {
  background: var(--ink); color: var(--paper);
  padding: 1.5rem 0 2rem; text-align: center;
  border-top: 4px double var(--accent);
  font-style: italic;
}
.footer-small { font-size: .8rem; opacity: .7; font-style: normal; }
