/*
Theme Name:  TwitcherDeck
Theme URI:   https://twitcherdeck.co.uk
Description: Official theme for TwitcherDeck -- British Bird Journal
Version:     1.0.0
Author:      Go Select Limited
Author URI:  https://workdeck.co.uk
License:     GPL-2.0+
Text Domain: twitcherdeck
*/

/* -- CSS CUSTOM PROPERTIES ---------------------------------- */
:root {
  --dawn:    #FF9A5C;
  --sky:     #5BC4E8;
  --leaf:    #4BAE72;
  --dusk:    #7E5BAF;
  --bark:    #2D1F0E;
  --cream:   #FDF8F2;
  --paper:   #F7F1E8;
  --mist:    #EAE4DA;
  --ink:     #1C1510;
  --mid:     #6B5E52;
  --white:   #FFFFFF;

  --font-serif: 'Lora', Georgia, serif;
  --font-sans:  'DM Sans', system-ui, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-sm: 0 2px 8px rgba(45,31,14,0.08);
  --shadow-md: 0 8px 30px rgba(45,31,14,0.12);
  --shadow-lg: 0 20px 60px rgba(45,31,14,0.16);

  --max-width: 1100px;
  --nav-height: 68px;
}

/* -- RESET -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--leaf); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--bark); }
button { cursor: pointer; font-family: var(--font-sans); }

/* -- TYPOGRAPHY --------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--bark);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.4rem, 5vw, 4.5rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3vw, 3rem);   font-weight: 700; }
h3 { font-size: clamp(1.3rem, 2vw, 1.8rem); font-weight: 600; }
h4 { font-size: 1.15rem; font-weight: 600; }
p  { margin-bottom: 1rem; color: var(--mid); }
em { font-style: italic; color: var(--dawn); }

/* -- LAYOUT ------------------------------------------------- */
.td-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}
.td-section {
  padding: 6rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}
.td-section-full {
  padding: 6rem 2rem;
}

/* -- BUTTONS ------------------------------------------------ */
.td-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-sans);
}
.td-btn-primary  { background: var(--bark);  color: var(--cream); }
.td-btn-primary:hover { background: var(--leaf); color: white; transform: translateY(-2px); }
.td-btn-leaf     { background: var(--leaf);  color: white; }
.td-btn-leaf:hover { background: #3A9D62; transform: translateY(-2px); }
.td-btn-outline  { background: transparent; color: var(--bark); border: 1.5px solid rgba(45,31,14,0.2); }
.td-btn-outline:hover { border-color: var(--bark); color: var(--bark); }
.td-btn-ghost    { background: transparent; color: var(--mid); padding: 0; }
.td-btn-ghost:hover { color: var(--bark); }

/* -- LABELS / BADGES ---------------------------------------- */
.td-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--leaf);
  font-weight: 600;
  display: block;
  margin-bottom: 0.75rem;
}

.td-rarity-badge {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
}
.td-rarity-badge.common    { background: rgba(91,196,232,0.15);  color: var(--sky);  }
.td-rarity-badge.uncommon  { background: rgba(75,174,114,0.15);  color: var(--leaf); }
.td-rarity-badge.rare      { background: rgba(255,154,92,0.15);  color: var(--dawn); }
.td-rarity-badge.legendary { background: rgba(126,91,175,0.15);  color: var(--dusk); }

/* -- CARDS -------------------------------------------------- */
.td-card {
  background: white;
  border: 1px solid rgba(45,31,14,0.08);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: transform 0.25s, box-shadow 0.25s;
}
.td-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* -- SPECIES GRID ------------------------------------------- */
.td-species-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.td-species-card {
  background: var(--paper);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(45,31,14,0.07);
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
}
.td-species-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.td-species-card .td-card-header {
  padding: 0.7rem 0.9rem;
  display: flex; justify-content: space-between; align-items: center;
}
.td-rarity-common .td-card-header    { background: rgba(91,196,232,0.12);  }
.td-rarity-uncommon .td-card-header  { background: rgba(75,174,114,0.12);  }
.td-rarity-rare .td-card-header      { background: rgba(255,154,92,0.12);  }
.td-rarity-legendary .td-card-header { background: rgba(126,91,175,0.12);  }
.td-card-img {
  height: 120px; display: flex;
  align-items: center; justify-content: center;
  font-size: 3.5rem;
  background: var(--paper);
}
.td-card-img img { width: 100%; height: 100%; object-fit: contain; padding: 0.5rem; }
.td-card-body    { padding: 0.85rem 0.9rem; background: white; }
.td-card-name    { font-family: var(--font-serif); font-size: 0.95rem; font-weight: 600; color: var(--bark); margin-bottom: 0.15rem; }
.td-card-latin   { font-size: 0.65rem; color: var(--mid); font-style: italic; }

.td-species-card.locked .td-card-img { filter: grayscale(1); opacity: 0.35; }
.td-species-card.locked .td-card-name { color: var(--mid); }

/* -- PROGRESS BAR ------------------------------------------- */
.td-progress-wrap { margin: 1.5rem 0; }
.td-progress-label {
  display: flex; justify-content: space-between;
  font-size: 0.8rem; color: var(--mid); font-weight: 500; margin-bottom: 0.5rem;
}
.td-progress-bar {
  height: 8px; background: rgba(45,31,14,0.08);
  border-radius: 4px; overflow: hidden;
}
.td-progress-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--leaf), var(--sky));
  transition: width 1s ease;
}

/* -- FORMS -------------------------------------------------- */
.td-field { margin-bottom: 1.25rem; }
.td-field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--bark); margin-bottom: 0.4rem; }
.td-field input,
.td-field textarea,
.td-field select {
  width: 100%; padding: 0.7rem 0.9rem;
  border: 1.5px solid rgba(45,31,14,0.15);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 0.9rem; color: var(--ink);
  background: white; transition: border-color 0.2s;
}
.td-field input:focus,
.td-field textarea:focus { outline: none; border-color: var(--leaf); }
.td-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.td-checkbox { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--mid); cursor: pointer; }
.td-checkbox input { width: auto; }
.td-autocomplete {
  position: absolute; background: white; border: 1px solid rgba(45,31,14,0.12);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  max-height: 280px; overflow-y: auto; z-index: 100; width: 100%;
}
.td-autocomplete-item {
  padding: 0.75rem 1rem; cursor: pointer; display: flex; align-items: center; gap: 0.75rem;
  transition: background 0.15s;
}
.td-autocomplete-item:hover { background: var(--paper); }
.td-autocomplete-item .td-ac-name { font-weight: 600; font-size: 0.9rem; color: var(--bark); }
.td-autocomplete-item .td-ac-latin { font-size: 0.72rem; color: var(--mid); font-style: italic; }

/* -- LOG SIGHTING FORM -------------------------------------- */
.td-log-sighting {
  background: white; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); overflow: hidden;
  border: 1px solid rgba(45,31,14,0.07); max-width: 600px;
}
.td-log-header {
  background: linear-gradient(135deg, #2D4A1E, #3D6B35);
  padding: 1.25rem 1.75rem;
}
.td-log-header h3 { font-family: var(--font-serif); font-size: 1.2rem; color: white; margin: 0; }
.td-log-body { padding: 1.75rem; }
.td-log-body .td-field { position: relative; }
#td-log-message { margin-top: 1rem; font-size: 0.85rem; padding: 0.75rem 1rem; border-radius: var(--radius-sm); }
#td-log-message.success { background: rgba(75,174,114,0.1); color: var(--leaf); }
#td-log-message.error   { background: rgba(255,87,34,0.1);  color: #E05030; }

/* -- LIFE LIST ---------------------------------------------- */
.td-lifelist-header { margin-bottom: 2rem; }
.td-lifelist-stats {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.td-stat-box {
  background: white; border: 1px solid rgba(45,31,14,0.08);
  border-radius: var(--radius-md); padding: 1.25rem; text-align: center;
}
.td-stat-num { font-family: var(--font-serif); font-size: 2rem; font-weight: 700; color: var(--bark); display: block; line-height: 1; }
.td-stat-label { font-size: 0.72rem; color: var(--mid); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
.td-filter-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.td-filter-btn {
  padding: 0.4rem 1rem; border-radius: 50px; border: 1.5px solid rgba(45,31,14,0.15);
  background: white; font-size: 0.8rem; font-weight: 600; color: var(--mid);
  cursor: pointer; transition: all 0.2s;
}
.td-filter-btn:hover,
.td-filter-btn.active { background: var(--bark); color: white; border-color: var(--bark); }

/* -- MAP ---------------------------------------------------- */
.td-map-wrap { position: relative; }
.td-map-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

/* -- MILESTONES --------------------------------------------- */
.td-milestones { display: flex; flex-direction: column; gap: 0.75rem; }
.td-milestone {
  display: flex; align-items: center; gap: 1rem;
  background: white; border: 1px solid rgba(45,31,14,0.08);
  border-radius: var(--radius-sm); padding: 0.85rem 1.1rem;
}
.td-milestone.earned { border-left: 3px solid var(--leaf); }
.td-milestone.locked { opacity: 0.45; }
.td-milestone-icon { font-size: 1.4rem; }
.td-milestone-name { font-weight: 600; font-size: 0.9rem; color: var(--bark); }
.td-milestone-date { font-size: 0.72rem; color: var(--mid); }

/* -- DONATE / FLOCK ----------------------------------------- */
.td-flock-tiers {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem; margin: 2rem 0;
}
.td-flock-tier {
  background: white; border: 1px solid rgba(45,31,14,0.08);
  border-radius: var(--radius-md); padding: 1.75rem 1.5rem; text-align: center;
  transition: transform 0.25s, box-shadow 0.25s;
}
.td-flock-tier:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.td-tier-label { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 600; color: var(--bark); margin-bottom: 0.5rem; }
.td-tier-price { font-family: var(--font-serif); font-size: 1.8rem; font-weight: 700; color: var(--dawn); line-height: 1; margin-bottom: 0.25rem; }
.td-tier-entries { font-size: 0.8rem; color: var(--mid); margin-bottom: 1.25rem; }
.td-donate-small { font-size: 0.85rem; color: var(--mid); text-align: center; }
.td-donate-intro { text-align: center; max-width: 500px; margin: 0 auto 2rem; }
.td-donate-intro h3 { font-family: var(--font-serif); font-size: 1.8rem; color: var(--bark); margin-bottom: 0.75rem; }

/* -- NOTICES ------------------------------------------------ */
.td-notice {
  background: rgba(75,174,114,0.1); color: var(--leaf);
  padding: 1rem 1.25rem; border-radius: var(--radius-sm);
  border-left: 3px solid var(--leaf); font-size: 0.9rem;
}

/* -- PAGE HERO ---------------------------------------------- */
.td-page-hero {
  padding: calc(var(--nav-height) + 4rem) 2rem 4rem;
  text-align: center;
  background: var(--paper);
  border-bottom: 1px solid rgba(45,31,14,0.07);
}
.td-page-hero h1 { margin-bottom: 1rem; }
.td-page-hero p  { font-size: 1.05rem; max-width: 520px; margin: 0 auto; }

/* -- PHOTO GALLERY ------------------------------------------ */
.td-photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.td-photo-card {
  background: white; border-radius: var(--radius-md);
  overflow: hidden; border: 1px solid rgba(45,31,14,0.07);
  transition: transform 0.25s, box-shadow 0.25s;
}
.td-photo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.td-photo-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.td-photo-info { padding: 1rem; }
.td-photo-species { font-family: var(--font-serif); font-weight: 600; color: var(--bark); margin-bottom: 0.2rem; }
.td-photo-meta   { font-size: 0.75rem; color: var(--mid); margin-bottom: 0.6rem; }
.td-photo-footer { display: flex; justify-content: space-between; align-items: center; }
.td-like-btn {
  background: none; border: 1.5px solid rgba(45,31,14,0.12);
  border-radius: 50px; padding: 0.3rem 0.85rem;
  font-size: 0.8rem; color: var(--mid); font-family: var(--font-sans);
  transition: all 0.2s; cursor: pointer;
}
.td-like-btn:hover, .td-like-btn.liked { background: rgba(255,154,92,0.1); border-color: var(--dawn); color: var(--dawn); }

/* -- RESPONSIVE --------------------------------------------- */
@media (max-width: 768px) {
  .td-section { padding: 4rem 1.25rem; }
  .td-field-row { grid-template-columns: 1fr; }
  .td-species-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .td-flock-tiers { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .td-flock-tiers { grid-template-columns: 1fr; }
}
