/* ---------------------------------------------
   Basic reset — browsers add their own default
   spacing/fonts, this makes styling predictable.
--------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #14100d;
  color: #f6f2ee;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Pushes .site-footer to the bottom of the viewport even when a page's
   content is short (e.g. few search results, a short deck). Both <main>
   elements (.gallery-page, .detail-page) grow to fill the remaining space.
   width: 100% is required here too: without it, being a flex child makes
   their "margin: 0 auto" centering shrink-to-fit around content instead of
   filling the row, which only becomes visible once that content is small
   (e.g. a zero-result filtered grid), causing the filter bar to shrink and
   wrap. */
.gallery-page,
.detail-page {
  flex: 1;
  width: 100%;
}

/* ---------------------------------------------
   Site header — shown at the top of every page
--------------------------------------------- */
.site-header {
  position: relative;
  text-align: center;
  padding: 3.5rem 1.5rem 2.5rem;
  background: radial-gradient(circle at top, #241d18 0%, #14100d 70%);
}

.site-header a.site-title-link {
  display: inline-block;
}

.header-submit-link {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #ea5328;
  border: 1px solid rgba(234, 83, 40, 0.35);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
}

.header-submit-link:hover {
  background: rgba(234, 83, 40, 0.1);
}

@media (max-width: 600px) {
  .header-submit-link {
    position: static;
    display: inline-block;
    margin-bottom: 1rem;
  }
}

.site-title {
  font-family: "Playfair Display", ui-serif, Georgia, serif;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  color: #f6f2ee;
}

.site-tagline {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: #c4bcb2;
  line-height: 1.6;
  max-width: 640px;
  margin: 0 auto;
}

/* ---------------------------------------------
   Gallery page
--------------------------------------------- */
.gallery-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filter-input,
.filter-select {
  background: #241d18;
  border: 1px solid #3a2e26;
  color: #f6f2ee;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  font-family: inherit;
  /* Some mobile browsers reserve a brief window after the first tap on a
     control to detect a double-tap-to-zoom gesture, which can make that
     first tap feel like it "did nothing." This tells the browser taps on
     these controls should always register immediately as a click. */
  touch-action: manipulation;
}

.filter-input {
  flex: 1 1 240px;
}

.filter-select {
  flex: 0 1 180px;
}

.filter-input:focus,
.filter-select:focus {
  outline: 2px solid #ea5328;
  outline-offset: 1px;
}

/* Mobile: keep the search box full-width on its own row, but let the two
   dropdowns share the row below instead of each stacking on its own line.
   .filter-input is forced to flex-basis:100% so it alone fills row one;
   flex-wrap then pushes both selects onto row two, where flex:1 splits
   the width between them evenly. */
@media (max-width: 600px) {
  .filter-input {
    flex: 1 1 100%;
  }

  .filter-select {
    flex: 1 1 0;
  }
}

.results-count {
  color: #857a70;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.empty-state {
  text-align: center;
  color: #857a70;
  padding: 3rem 0;
  font-size: 1rem;
}

/* ---------------------------------------------
   Card grid
--------------------------------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.card {
  display: block;
  background: #1e1916;
  border: 1px solid #3a2e26;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: #ea5328;
}

.card-thumb {
  aspect-ratio: 16 / 9;
  background: #14100d;
  overflow: hidden;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.card-body {
  padding: 0.85rem 1rem 1.1rem;
}

.card-name {
  font-family: "Playfair Display", ui-serif, Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.card-meta {
  font-size: 0.82rem;
  color: #9a8f85;
}

/* ---------------------------------------------
   Newsletter detail page (two-column layout)
--------------------------------------------- */
.detail-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.back-link {
  display: inline-block;
  color: #9a8f85;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.back-link:hover {
  color: #ea5328;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 800px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }
}

/* Left column: info panel */
.info-heading-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 0.75rem;
  margin-bottom: 1.5rem;
}

.info-panel h1 {
  font-family: "Playfair Display", ui-serif, Georgia, serif;
  font-size: 1.85rem;
  font-weight: 600;
}

.stat-hero {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #2b2019;
}

.stat-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.75rem;
}

.stat-row {
  padding: 0.85rem 0;
  border-bottom: 1px solid #2b2019;
}

.stat-row:first-child {
  padding-top: 0;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8078;
  margin-bottom: 0.4rem;
}

.stat-value {
  display: block;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #e8e2da;
}

.stat-value-lg {
  font-size: 2.25rem;
  font-weight: 700;
  color: #f6f2ee;
  letter-spacing: -0.02em;
}

.topic-badge {
  display: inline-block;
  background: rgba(234, 83, 40, 0.12);
  border: 1px solid rgba(234, 83, 40, 0.35);
  color: #ea5328;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

.info-description-block {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #2b2019;
}

.info-description {
  color: #d4cdc3;
  line-height: 1.7;
  font-size: 0.95rem;
  margin-top: 0.4rem;
}

/* Right column: deck viewer */
.deck-viewer {
  background: #1e1916;
  border: 1px solid #3a2e26;
  border-radius: 12px;
  padding: 1.25rem;
}

.year-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.year-tab {
  background: #241d18;
  border: 1px solid #3a2e26;
  color: #9a8f85;
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
}

.year-tab:hover {
  border-color: #ea5328;
  color: #f6f2ee;
}

.year-tab.active {
  background: #ea5328;
  border-color: #ea5328;
  color: #f6f2ee;
  font-weight: 600;
}

.deck-image-wrap {
  position: relative;
  background: #14100d;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70vh;
  max-height: 750px;
  min-height: 320px;
}

.deck-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none; /* blocks right-click-and-save via image context menu on some browsers */
}

.deck-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 1rem;
}

.deck-nav-btn {
  background: #241d18;
  border: 1px solid #3a2e26;
  color: #f6f2ee;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
}

.deck-nav-btn:hover:not(:disabled) {
  border-color: #ea5328;
}

.deck-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.deck-page-indicator {
  color: #9a8f85;
  font-size: 0.9rem;
  min-width: 70px;
  text-align: center;
}

.not-found {
  text-align: center;
  color: #9a8f85;
  padding: 4rem 0;
}

.info-actions {
  margin-top: 1.5rem;
}

.text-link {
  font-size: 0.85rem;
  color: #8a8078;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.text-link:hover {
  color: #ea5328;
}

/* ---------------------------------------------
   Site footer — shown at the bottom of every page
--------------------------------------------- */
.site-footer {
  border-top: 1px solid #241c16;
  background: #0d0906;
  padding: 3rem 1.5rem 2rem;
  margin-top: 3rem;
}

.footer-top {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #241c16;
}

.footer-about {
  max-width: 420px;
}

.footer-tagline {
  color: #e8e2da;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.footer-submit-link {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #a89f95;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.footer-submit-link:hover {
  color: #ea5328;
}

.footer-promo {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.75rem 0;
  border-bottom: 1px solid #241c16;
}

.footer-promo-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: #1e1916;
  border: 1px solid #2b2019;
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
}

.footer-promo-content {
  flex: 1 1 360px;
}

.footer-promo-headline {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f6f2ee;
  line-height: 1.45;
  margin-bottom: 0.4rem;
}

.footer-promo-body {
  font-size: 0.9rem;
  color: #c7bfb5;
  line-height: 1.6;
}

.footer-promo-cta {
  flex: 0 0 auto;
  display: inline-block;
  background: #ea5328;
  color: #f6f2ee;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.75rem 1.4rem;
  border-radius: 8px;
  white-space: nowrap;
  text-align: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.footer-promo-cta:hover {
  background: #ff7a4d;
  transform: translateY(-1px);
}

.footer-promo-mobile {
  display: none;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.25rem;
  text-align: center;
  font-size: 0.82rem;
  color: #8a8078;
}

.footer-bottom a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-bottom a:hover {
  color: #ea5328;
}

.footer-divider {
  margin: 0 0.6rem;
  color: #4a3f36;
}

@media (max-width: 600px) {
  .site-footer {
    padding: 2rem 1.25rem 1.5rem;
    margin-top: 2rem;
  }

  .footer-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    padding-bottom: 2rem;
  }

  .footer-promo {
    padding: 2rem 0;
  }

  .footer-promo-card {
    display: none;
  }

  .footer-promo-mobile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .footer-promo-headline-mobile {
    font-size: 1rem;
    font-weight: 700;
    color: #f6f2ee;
    line-height: 1.4;
  }

  .footer-promo-body-mobile {
    font-size: 0.88rem;
    color: #c7bfb5;
    line-height: 1.6;
  }

  .footer-promo-cta-mobile {
    display: inline-block;
    background: #ea5328;
    color: #f6f2ee;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    white-space: nowrap;
    transition: background 0.15s ease, transform 0.15s ease;
  }

  .footer-promo-cta-mobile:hover {
    background: #ff7a4d;
  }

  .footer-bottom {
    padding-top: 1rem;
  }
}
