/**
 * assets/css/style.css — FPO public site theme.
 *
 * DESIGN TOKENS (derived from the client's actual logo — extracted via
 * pixel sampling, not guessed):
 *   ink    #1a1917  charcoal (near-black from the logo, deepened for
 *                    body-text contrast)
 *   cream  #fdf3e6  warm background (logo's cream/peach field)
 *   yellow #ffe224  signal yellow (logo's dominant accent)
 *   taupe  #8a8578  warm secondary gray for muted text/rules
 *   red    #c81e3a  reserved for errors AND the FPO "Red Pin" award —
 *                    the only accent with a narrative reason to exist
 *
 * SIGNATURE MOTIF: a film-sprocket perforation strip (.film-strip) marks
 * every major section boundary — literal to the subject (analogue film)
 * without illustrating anything on top of the content.
 *
 * Typefaces: Fraunces (display, characterful serif — used with
 * restraint, headings only), Inter (body/UI), JetBrains Mono (numbers —
 * member IDs, patronage numbers, prices, dates — reads as "official
 * document" register, fitting a federation that issues numbered
 * distinctions and certificates).
 */

/* =======================================================================
   Tokens
   ======================================================================= */
:root {
  --ink:          #1a1917;
  --ink-soft:     #322f2b;
  --cream:        #fdf3e6;
  --cream-dim:    #f6e8d4;
  --cream-deep:   #efdcc0;
  --paper:        #ffffff;
  --yellow:       #ffe224;
  --yellow-deep:  #e0c400;
  --taupe:        #8a8578;
  --taupe-light:  #c9c2b2;
  --red:          #c81e3a;
  --red-bg:       #fbe6ea;
  --green:        #3f7d4a;
  --green-bg:     #e6f2e8;
  --blue:         #2f5fa8;
  --blue-bg:      #e7eef8;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 16px;

  --gap-xs: 8px;
  --gap-sm: 12px;
  --gap-md: 20px;
  --gap-lg: 32px;
  --gap-xl: 56px;

  --shadow-card: 0 1px 2px rgba(26,25,23,0.06), 0 4px 16px rgba(26,25,23,0.05);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* =======================================================================
   Reset & base
   ======================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--ink);
}
h1 { font-size: clamp(2.1rem, 1.6rem + 2.2vw, 3.4rem); font-weight: 600; }
h2 { font-size: clamp(1.5rem, 1.3rem + 1vw, 2.1rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }

table { border-collapse: collapse; }
input, select, textarea, button { font-family: var(--font-body); font-size: 1rem; }

:focus-visible {
  outline: 3px solid var(--yellow-deep);
  outline-offset: 2px;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =======================================================================
   Signature motif — film sprocket strip
   ======================================================================= */
.film-strip {
  height: 16px;
  background-image: radial-gradient(circle, var(--ink) 2.6px, transparent 2.8px);
  background-size: 26px 16px;
  background-repeat: repeat-x;
  background-position: center;
  opacity: 0.16;
}
.film-strip--light {
  background-image: radial-gradient(circle, var(--cream) 2.6px, transparent 2.8px);
  opacity: 0.35;
}

/* =======================================================================
   Header
   ======================================================================= */
.site-header { background: var(--cream); }

.header-top { padding: 10px 0; border-bottom: 1px solid var(--cream-deep); }
.header-top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--gap-sm);
}
.org-logo-slot { display: inline-flex; align-items: center; }
.org-logo-slot img { height: 130px; width: auto; }

.header-cta-buttons { display: flex; gap: var(--gap-xs); flex-wrap: wrap; }

.header-user-slot { display: flex; align-items: center; gap: var(--gap-sm); }
.header-profile-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}
.header-profile-thumb {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--yellow);
}

.site-nav { background: var(--ink); }
.site-nav .container { display: flex; align-items: center; justify-content: space-between; }
.nav-toggle {
  display: none;
  background: none; border: none; color: var(--cream);
  font-size: 1.5rem; cursor: pointer; padding: 12px 0;
}
.nav-menu {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0; padding: 0;
  flex-wrap: wrap;
}
.nav-menu li a {
  display: block;
  padding: 16px 14px;
  text-decoration: none;
  color: var(--cream);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-bottom: 3px solid transparent;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.nav-menu li a:hover { color: var(--yellow); }
.nav-menu li a.active { color: var(--yellow); border-bottom-color: var(--yellow); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    padding-bottom: 8px;
  }
  .nav-menu.is-open { display: flex; }
  .nav-menu li a { padding: 12px 4px; border-bottom: 1px solid rgba(253,243,230,0.1); }
  .site-nav .container { flex-wrap: wrap; }
}

/* =======================================================================
   Buttons
   ======================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease);
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--cream-deep);
  color: var(--ink);
  border-color: transparent;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.5), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s var(--ease);
}
.btn-primary:hover { background: var(--cream-deep); border-color: transparent; }
.btn-primary:hover::after { left: 125%; }

/* Paler, quieter variant — for calls-to-action that repeat many times in
   a list (e.g. "Become a member" on every non-member row of Top
   Authors), so they don't visually dominate the page the way a full
   btn-primary repeated 50 times would. */
.btn-light { background: var(--cream-dim); color: var(--ink-soft); border-color: var(--cream-deep); }
.btn-light:hover { background: var(--cream-deep); color: var(--ink); }

/* No border line, background one step darker than the page (still
   reads as a button without a hard black outline), gently rounded,
   with a subtle shine sweep on hover instead of any movement/color
   jump. Applies to every .btn-outline site-wide (not just the header
   CTAs it started on). */
.btn-outline {
  background: var(--cream-deep);
  color: var(--ink);
  border-color: transparent;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.btn-outline::after {
  content: '';
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.5), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s var(--ease);
}
.btn-outline:hover { background: var(--cream-deep); color: var(--ink); }
.btn-outline:hover::after { left: 125%; }

/* Outline buttons sitting on the dark nav/footer need a light-on-dark
   version of the same idea (a shade lighter than the dark background,
   not darker-than-cream, since there's no cream background to play
   against there). */
.site-footer .btn-outline, .site-nav .btn-outline {
  background: rgba(253, 243, 230, 0.14);
  color: var(--cream);
}
.site-footer .btn-outline:hover, .site-nav .btn-outline:hover {
  background: rgba(253, 243, 230, 0.22);
  color: var(--cream);
}

.btn-small { padding: 7px 14px; font-size: 0.82rem; }
.btn-large { padding: 16px 30px; font-size: 1.05rem; }

.inline-form { display: inline-block; margin: 0 0 0 8px; }

/* =======================================================================
   Flash messages
   ======================================================================= */
.flash-container { padding-top: var(--gap-md); }
.flash {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--gap-sm);
  font-size: 0.94rem;
  border-left: 4px solid var(--taupe);
  background: var(--paper);
}
.flash p:last-child { margin-bottom: 0; }
.flash-success { border-left-color: var(--green); background: var(--green-bg); }
.flash-error   { border-left-color: var(--red);   background: var(--red-bg); }
.flash-info    { border-left-color: var(--blue);  background: var(--blue-bg); }

.form-errors {
  background: var(--red-bg);
  border-left: 4px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: var(--gap-md);
  font-size: 0.9rem;
  color: var(--ink);
}
.form-errors ul { margin: 0; padding-left: 1.2em; }
.err { color: var(--red); font-size: 0.82rem; display: block; margin-top: 4px; }

/* =======================================================================
   Main content wrapper
   ======================================================================= */
.site-main { padding: var(--gap-lg) 0 var(--gap-xl); }
.site-main > .container > h1:first-child { margin-bottom: var(--gap-sm); }

/* =======================================================================
   Hero (index.php)
   ======================================================================= */
.hero {
  padding: var(--gap-xl) 0 var(--gap-lg);
  text-align: left;
  max-width: 880px;
}
.hero h1 { margin-bottom: 0.4em; }
.hero-lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 640px;
  margin-bottom: 1.2em;
}
.tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--ink);
  margin: 0;
}

.tagline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap-md);
  padding: var(--gap-lg) 0;
}
.tagline-card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: var(--gap-md);
  box-shadow: var(--shadow-card);
  border-top: 3px solid var(--yellow);
}
.tagline-card h2 { font-size: 1.25rem; margin-bottom: 0.4em; }
.tagline-card p { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 0; }

.gallery-slider {
  overflow: hidden;
  margin: var(--gap-lg) calc(50% - 50vw) 0;
  padding: var(--gap-md) 0;
  background: var(--ink);
}
.gallery-track {
  display: flex;
  gap: var(--gap-sm);
  width: max-content;
  animation: gallery-scroll 32s linear infinite;
  padding: 0 var(--gap-sm);
}
.gallery-track img {
  height: 220px;
  width: 300px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  border: 3px solid var(--paper);
}
@keyframes gallery-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-track { animation: none; overflow-x: auto; }
}

.tagline-closing {
  text-align: center;
  padding: var(--gap-xl) 0;
  max-width: 700px;
  margin: 0 auto;
}
.tagline-closing .tagline { font-size: 1.6rem; margin-bottom: 0.3em; }
.tagline-closing p:not(.tagline) { color: var(--ink-soft); }

/* =======================================================================
   Generic cards / grids
   ======================================================================= */
.card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: var(--gap-md);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--gap-md);
}
.two-column {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap-lg);
}
.column { min-width: 0; }

.info-box {
  background: var(--cream-dim);
  border-left: 4px solid var(--taupe);
  border-radius: var(--radius-sm);
  padding: var(--gap-sm) var(--gap-md);
  font-size: 0.92rem;
  margin-bottom: var(--gap-md);
}

.hint, .field-hint {
  color: var(--taupe);
  font-size: 0.85rem;
  display: block;
  margin-top: 4px;
}

/* =======================================================================
   Patronage packages / pricing
   ======================================================================= */
.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap-md);
  margin: var(--gap-md) 0;
}
.package-card {
  background: var(--paper);
  border: 2px solid var(--cream-deep);
  border-radius: var(--radius);
  padding: var(--gap-md);
  text-align: center;
  transition: border-color 0.15s var(--ease);
}
.package-card:hover { border-color: var(--yellow); }
.package-price {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink);
  display: block;
  margin: 8px 0;
}
.package-note { color: var(--taupe); font-size: 0.82rem; }

.price-summary {
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--radius);
  padding: var(--gap-md);
  font-family: var(--font-mono);
}
.price-summary strong { color: var(--yellow); }

.patronage-cta {
  background: var(--cream-dim);
  border-radius: var(--radius);
  padding: var(--gap-lg);
  text-align: center;
  margin: var(--gap-lg) 0;
}

/* =======================================================================
   Medals / distinctions
   ======================================================================= */
.medal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--gap-md);
  text-align: center;
  margin: var(--gap-md) 0;
}
.medal-box {
  padding: var(--gap-sm);
}
.medal-box img {
  width: 100%;
  border-radius: var(--radius);
}
.medal-box figcaption { margin-top: 8px; font-weight: 600; }
.medal-box .medal-icon {
  width: 56px; height: 56px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--yellow);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; color: var(--ink);
  position: relative;
}
.medal-box .medal-icon::after {
  content: '';
  position: absolute;
  bottom: -8px; left: 50%; transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 10px solid var(--red);
}
.medal-box.is-inactive .medal-icon { background: var(--taupe-light); opacity: 0.6; }
.medal-box.is-inactive .medal-icon::after { border-top-color: var(--taupe-light); opacity: 0.6; }
.medal-box span { display: block; font-size: 0.82rem; font-weight: 600; }

.distinction-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: var(--ink);
  color: var(--yellow);
  padding: 3px 9px;
  border-radius: 20px;
  margin-left: 6px;
  vertical-align: middle;
}

.progress-bar {
  background: var(--cream-deep);
  border-radius: 20px;
  height: 38px;
  overflow: hidden;
  margin: 10px 0 4px;
}
.progress-bar-fill {
  background: linear-gradient(to right, var(--yellow), var(--red));
  height: 100%;
  border-radius: 20px;
  transition: width 0.3s var(--ease);
}

/* =======================================================================
   Profile
   ======================================================================= */
.profile-header {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  margin-bottom: var(--gap-lg);
  flex-wrap: wrap;
}
.profile-photo-large {
  width: 240px; height: 240px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--yellow);
  flex-shrink: 0;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gap-sm);
}
@media (max-width: 780px) {
  .portfolio-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 460px) {
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}
.portfolio-slot img {
  width: 100%; aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--cream-deep);
}
.portfolio-empty {
  aspect-ratio: 1;
  border: 2px dashed var(--taupe-light);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--taupe);
  font-size: 0.8rem;
  text-align: center;
  padding: 8px;
}

/* Filled slot — wraps the image so the remove "×" can be positioned
   as a small overlay in the corner instead of a separate button below. */
.portfolio-thumb { position: relative; }
.portfolio-remove-form { position: absolute; top: 6px; left: 6px; margin: 0; }
.portfolio-remove-btn {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(26, 25, 23, 0.72);
  color: var(--cream);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s var(--ease);
}
.portfolio-remove-btn:hover { background: var(--red); }

/* Empty slot — the whole box is a <label> for a hidden file input, so
   clicking anywhere opens the file picker (no separate "Upload" button);
   selecting a file auto-submits via main.js. */
.portfolio-upload-form { margin: 0; }
.portfolio-upload-slot {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--taupe-light);
  border-radius: var(--radius-sm);
  color: var(--taupe);
  font-size: 1.8rem;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}
.portfolio-upload-slot:hover {
  border-color: var(--yellow-deep);
  color: var(--ink);
  background: var(--cream-dim);
}
.portfolio-upload-input {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  opacity: 0;
}

/* =======================================================================
   Lightbox — click a portfolio thumbnail to view it full size (the
   stored file is already the full 1920px-longest-side image; the grid
   just displays it cropped to a square, so the lightbox needs no extra
   image variant, only a way to see the whole frame uncropped).
   ======================================================================= */
.lightbox-trigger { cursor: zoom-in; transition: opacity 0.15s var(--ease); }
.lightbox-trigger:hover, .lightbox-trigger:focus-visible { opacity: 0.85; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 25, 23, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 40px;
  cursor: zoom-out;
}
.lightbox-overlay.is-hidden { display: none; }
.lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 28px;
  color: var(--cream);
  font-size: 2.2rem;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 10px;
}
.lightbox-close:hover { color: var(--yellow); }

.org-logo-preview {
  max-width: 160px;
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-sm);
  padding: 6px;
  background: var(--paper);
}

/* =======================================================================
   Forms
   ======================================================================= */
.auth-form, .patronage-form {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  max-width: 640px;
}

/* Two-column variant (currently: Be Member registration) — the shared
   .auth-form flex layout above stays untouched for login.php and other
   single-column forms; this only applies where .auth-form-grid is
   explicitly added alongside it. */
.auth-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-sm) var(--gap-md);
  max-width: 720px;
  align-items: start;
}
.auth-form-grid .form-field { display: flex; flex-direction: column; gap: 6px; }
.auth-form-grid .form-field label { margin-bottom: 0; }
.auth-form-grid .form-field-full { grid-column: 1 / -1; }
@media (max-width: 600px) {
  .auth-form-grid { grid-template-columns: 1fr; }
}
.auth-form label, .patronage-form label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: -6px;
}
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="number"],
.auth-form input[type="date"],
.auth-form input[type="file"],
.auth-form select,
.auth-form textarea,
.patronage-form input[type="text"],
.patronage-form input[type="email"],
.patronage-form input[type="password"],
.patronage-form input[type="number"],
.patronage-form input[type="date"],
.patronage-form input[type="file"],
.patronage-form select,
.patronage-form textarea {
  padding: 11px 13px;
  border: 1.5px solid var(--cream-deep);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  width: 100%;
}
.auth-form input:focus, .auth-form select:focus, .auth-form textarea:focus,
.patronage-form input:focus, .patronage-form select:focus, .patronage-form textarea:focus {
  outline: none;
  border-color: var(--yellow-deep);
  box-shadow: 0 0 0 3px rgba(255,226,36,0.35);
}
.auth-form textarea, .patronage-form textarea { resize: vertical; min-height: 100px; }

/* Native file inputs default to a jarring OS-styled button — restyle
   the browser's own "Choose file" button to match the site's quieter,
   rounded button language instead of leaving it looking unstyled. */
input[type="file"]::file-selector-button {
  background: var(--cream-deep);
  color: var(--ink);
  border: none;
  border-radius: var(--radius);
  padding: 8px 14px;
  margin-right: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
input[type="file"]::file-selector-button:hover { background: var(--cream); }

.search-form { display: flex; gap: var(--gap-xs); margin-bottom: var(--gap-md); flex-wrap: wrap; }
.search-input {
  padding: 10px 14px;
  border: 1.5px solid var(--cream-deep);
  border-radius: var(--radius-sm);
  flex: 1;
  min-width: 200px;
}

.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--cream-deep); margin-bottom: var(--gap-md); }
.tab {
  padding: 12px 20px;
  text-decoration: none;
  color: var(--taupe);
  font-weight: 600;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.tab.active { color: var(--ink); border-bottom-color: var(--yellow); }
.tab:hover { color: var(--ink); }

/* =======================================================================
   Tables
   ======================================================================= */
.data-table, .responsive-table {
  width: 100%;
  font-size: 0.9rem;
  margin-bottom: var(--gap-md);
}
.data-table th, .data-table td,
.responsive-table th, .responsive-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--cream-deep);
  vertical-align: top;
}
.data-table th, .responsive-table th {
  background: var(--ink);
  color: var(--cream);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.data-table tbody tr:hover, .responsive-table tbody tr:hover { background: var(--cream-dim); }

@media (max-width: 700px) {
  .responsive-table thead { display: none; }
  .responsive-table tr {
    display: block;
    border: 1px solid var(--cream-deep);
    border-radius: var(--radius-sm);
    margin-bottom: var(--gap-sm);
    padding: 8px 12px;
  }
  .responsive-table td {
    display: flex;
    justify-content: space-between;
    gap: var(--gap-sm);
    border-bottom: 1px solid var(--cream-dim);
    padding: 8px 0;
    text-align: right;
  }
  .responsive-table td:last-child { border-bottom: none; }
  .responsive-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--taupe);
    text-align: left;
  }
}

.status-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-pending   { background: var(--cream-deep); color: var(--ink-soft); }
.status-open      { background: var(--green-bg);   color: var(--green); }
.status-judging   { background: #fff3d6;           color: #8a6300; }
.status-completed { background: var(--blue-bg);    color: var(--blue); }
.status-cancelled { background: var(--red-bg);     color: var(--red); }

.pagination {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: var(--gap-md) 0;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center; justify-content: center;
  min-width: 38px; height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.88rem;
  border: 1.5px solid var(--cream-deep);
  color: var(--ink);
}
.pagination a:hover { border-color: var(--yellow-deep); }
.pagination .current { background: var(--ink); color: var(--yellow); border-color: var(--ink); }

/* =======================================================================
   Footer
   ======================================================================= */
.site-footer { background: var(--ink); color: var(--cream); padding: var(--gap-lg) 0 var(--gap-md); margin-top: var(--gap-xl); }
.footer-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--gap-sm);
  text-align: center;
}
.footer-links { display: flex; justify-content: center; gap: var(--gap-md); flex-wrap: wrap; }
.footer-links a { color: var(--cream); text-decoration: none; font-size: 0.88rem; opacity: 0.85; }
.footer-links a:hover { opacity: 1; color: var(--yellow); }
.footer-copy { width: 100%; text-align: center; color: var(--taupe-light); font-size: 0.8rem; margin: var(--gap-sm) 0 0; }

/* =======================================================================
   Small screens — general tightening
   ======================================================================= */
@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .hero { padding: var(--gap-lg) 0 var(--gap-md); }
  .site-main { padding: var(--gap-md) 0 var(--gap-lg); }
  .profile-header { text-align: center; justify-content: center; }
}

/* =======================================================================
   Article teaser cards — shared by News (index.php, "Latest News") and
   Definitions (definitions.php): both are just articles, distinguished
   only by their `type` column, so both use the identical title+photo
   card design. Explicit 3 columns (not auto-fit) per client request,
   collapsing to fewer on narrower screens.
   ======================================================================= */
.news-teasers { padding: var(--gap-lg) 0; }
.article-teaser-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-md);
}
@media (max-width: 900px) {
  .article-teaser-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .article-teaser-grid { grid-template-columns: 1fr; }
}
.article-teaser-card {
  display: block;
  background: var(--paper);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s var(--ease);
}
.article-teaser-card:hover { transform: translateY(-3px); }
.article-teaser-card img { width: 100%; height: 160px; object-fit: cover; }
.article-teaser-body { padding: var(--gap-sm) var(--gap-md); }
.article-teaser-body h3 { font-size: 1.1rem; margin-bottom: 0.2em; }
.article-teaser-body p:last-child { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 0; }

.news-article-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: var(--gap-md) 0;
}
.news-article-body { font-size: 1.02rem; line-height: 1.7; }
.article-back-link { margin-top: var(--gap-lg); }
