/* ============================================================
   home-cards.css — Σκακιστικές κάρτες στην αρχική (έκδοση 4)
   ------------------------------------------------------------
   Κάθε ενότητα είναι ένα σκακιστικό αντικείμενο, σε ήπιους,
   διακριτικούς τόνους:

   ΟΜΑΔΑ      → τρία κομμάτια σε βάθρο: ίππος (παίκτες),
                 βασίλισσα (προπονητές), βασιλιάς (διοίκηση).
   ΜΑΘΗΜΑΤΑ   → απλές κάρτες με το κομμάτι κάθε τμήματος σε
                 μικρό τετράγωνο: πιόνι → ίππος → πύργος → βασίλισσα.
   ΤΟΥΡΝΟΥΑ   → η ημερομηνία σαν οθόνη σκακιστικού ρολογιού.
   ΙΣΤΟΡΙΑ    → λεπτή πλακέτα με βασιλιά και τη χρονιά.

   Όλες οι κάρτες έχουν την ίδια βάση: ανοιχτό χαρτί, λεπτό
   περίγραμμα, απαλή σκιά. Το σκάκι μπαίνει σε μία λεπτομέρεια.

   Τα κομμάτια είναι τα SVG του admin (assets/pieces/).
   Επηρεάζει ΜΟΝΟ την αρχική (#home). Για να γυρίσει όπως ήταν,
   σβήνεις τη γραμμή του από το index.html.
   ============================================================ */

#home {
  --hc-wood: #8a6446;
  --hc-wood-dark: #6f4e36;
  --hc-ink: #3a2a1e;
  --hc-soft: #7a6552;
  --hc-light-sq: #f7eedd;
  --hc-dark-sq: #e2cba8;
  --hc-shadow: 0 8px 20px rgba(60, 40, 20, .1);
}


/* ============================================================
   0. ΟΜΑΔΑ — κομμάτια σε βάθρο
   ============================================================ */
#home #home-team > .team-cat-card {
  --piece: url('assets/pieces/bN.svg');

  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-height: 230px;
  padding: 126px 18px 30px;
  border: 1px solid #e6d8bf;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf8 0%, #f6ecda 100%);
  color: var(--hc-ink);
  box-shadow: var(--hc-shadow);
  text-align: center;
}
#home #home-team > .team-cat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(60, 40, 20, .14);
}

#home #home-team > .team-cat-card[data-opentab="team-players"] { --piece: url('assets/pieces/bN.svg'); }
#home #home-team > .team-cat-card[data-opentab="team-coaches"] { --piece: url('assets/pieces/bQ.svg'); }
#home #home-team > .team-cat-card[data-opentab="team-board"]   { --piece: url('assets/pieces/bK.svg'); }

/* Το παλιό εικονίδιο δίνει τη θέση του στο κομμάτι */
#home #home-team > .team-cat-card > i { display: none; }

/* Το κομμάτι */
#home #home-team > .team-cat-card::before {
  content: '';
  position: absolute;
  top: 22px;
  left: 50%;
  width: 88px;
  height: 88px;
  transform: translateX(-50%);
  background: var(--piece) center bottom / contain no-repeat;
  filter: drop-shadow(0 6px 5px rgba(0, 0, 0, .18));
}

/* Το βάθρο: μια λωρίδα σκακιέρας στη βάση της κάρτας */
#home #home-team > .team-cat-card::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: -1;
  height: 12px;
  background: repeating-conic-gradient(var(--hc-dark-sq) 0 25%, var(--hc-light-sq) 0 50%) 0 0 / 24px 24px;
  opacity: .9;
}

#home #home-team > .team-cat-card h3 {
  margin: 0;
  font-size: 1.5rem;
  color: #5e1916;
  text-shadow: none;
}
#home #home-team > .team-cat-card p {
  margin: 0;
  font-size: .92rem;
  color: var(--hc-soft);
}


/* ============================================================
   1. ΜΑΘΗΜΑΤΑ — απλές κάρτες με ένα κομμάτι σε τετράγωνο
   ------------------------------------------------------------
   Κάθε τμήμα είναι ξεχωριστή κάρτα (όσα κι αν είναι, δεν
   μένει κενό). Το σκάκι φαίνεται μόνο στο μικρό τετράγωνο
   με το κομμάτι και στη λεπτή λωρίδα σκακιέρας στη βάση.
   ============================================================ */
#home #home-academy > .class-card {
  --square: var(--hc-light-sq);
  --piece: url('assets/pieces/bP.svg');

  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 190px;
  padding: 22px 20px 26px;
  border: 1px solid #e6d8bf;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf8 0%, #f8f0e2 100%);
  color: var(--hc-ink);
  box-shadow: 0 4px 14px rgba(60, 40, 20, .07);
}
#home #home-academy > .class-card:nth-child(even) { --square: var(--hc-dark-sq); }

#home #home-academy > .class-card:nth-child(4n+1) { --piece: url('assets/pieces/bP.svg'); }
#home #home-academy > .class-card:nth-child(4n+2) { --piece: url('assets/pieces/bN.svg'); }
#home #home-academy > .class-card:nth-child(4n+3) { --piece: url('assets/pieces/bR.svg'); }
#home #home-academy > .class-card:nth-child(4n+4) { --piece: url('assets/pieces/bQ.svg'); }

/* Το κομμάτι, σε ένα μικρό τετράγωνο σκακιέρας */
#home #home-academy > .class-card::before {
  content: '';
  position: absolute;
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  border-radius: 9px;
  background: var(--piece) center / 30px no-repeat, var(--square);
  box-shadow: inset 0 0 0 1px rgba(138, 100, 70, .15);
  opacity: .9;
}

/* Λεπτή λωρίδα σκακιέρας στη βάση, όπως στις κάρτες της ομάδας */
#home #home-academy > .class-card::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: -1;
  height: 8px;
  background: repeating-conic-gradient(var(--hc-dark-sq) 0 25%, var(--hc-light-sq) 0 50%) 0 0 / 16px 16px;
  opacity: .8;
}

#home #home-academy > .class-card h3 {
  margin: 0;
  padding-right: 58px;
  font-size: 1.45rem;
  line-height: 1.15;
  color: #5e1916;
}

#home #home-academy > .class-card .days {
  font-size: .9rem;
  font-weight: 600;
  color: var(--hc-soft);
}
#home #home-academy > .class-card .days i { color: inherit; opacity: .8; }

#home #home-academy > .class-card .hours {
  margin-top: auto;
  font-family: var(--body, 'Inter', system-ui, sans-serif);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.2px;
  line-height: 1.1;
  color: var(--hc-ink);
}

#home #home-academy > .class-card .extra {
  margin-top: auto;
  font-size: .9rem;
  color: var(--hc-soft);
}


/* ============================================================
   2. ΤΟΥΡΝΟΥΑ — η ημερομηνία σαν οθόνη σκακιστικού ρολογιού
   ============================================================ */
#home #home-tournaments > .tournament-card-ribbon {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
  padding: 18px 20px 20px;
  border: 1px solid #e6d8bf;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf8 0%, #f8f0e2 100%);
  box-shadow: 0 4px 14px rgba(60, 40, 20, .07);
  backdrop-filter: none;
  color: var(--hc-ink);
}
#home #home-tournaments > .tournament-card-ribbon::before,
#home #home-tournaments > .tournament-card-ribbon::after { content: none; }

#home #home-tournaments > .tournament-card-ribbon h3 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.22;
  color: var(--hc-ink);
}

#home #home-tournaments > .tournament-card-ribbon .meta {
  margin: 0;
  font-size: .9rem;
  color: var(--hc-soft);
}
#home #home-tournaments > .tournament-card-ribbon .meta i { color: var(--hc-wood); }

/* Η ημερομηνία στην οθόνη του ρολογιού */
#home #home-tournaments > .tournament-card-ribbon .meta:first-of-type {
  order: -1;
  align-self: flex-start;
  margin-bottom: 2px;
  padding: 5px 11px;
  border-radius: 5px;
  background: #e6ebd6;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12);
  color: #34402a;
  font-weight: 700;
  font-size: .88rem;
}
#home #home-tournaments > .tournament-card-ribbon .meta:first-of-type i { color: #5b6a45; }

#home #home-tournaments > .tournament-card-ribbon .tourn-link,
#home #home-tournaments > .tournament-card-ribbon .related-announcement {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 6px;
  color: #5e1916;
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(94, 25, 22, .3);
}
#home #home-tournaments > .tournament-card-ribbon .tourn-link + .related-announcement { margin-top: 2px; }
#home #home-tournaments > .tournament-card-ribbon .tourn-link:hover,
#home #home-tournaments > .tournament-card-ribbon .related-announcement:hover {
  border-bottom-color: #5e1916;
}


/* ============================================================
   3. ΙΣΤΟΡΙΑ — διακριτική πλακέτα
   ============================================================ */
#home #home-history > .history-mini {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-height: 200px;
  padding: 50px 20px 22px;
  text-align: center;
  border: 1px solid #e6d8bf;
  border-radius: 14px;
  /* λεπτό εσωτερικό πλαίσιο, σαν αναμνηστική πλακέτα */
  background: linear-gradient(180deg, #fffdf8 0%, #f8f0e2 100%);
  box-shadow: inset 0 0 0 6px #fffdf8, inset 0 0 0 7px #eadcc3, 0 4px 14px rgba(60, 40, 20, .07);
  backdrop-filter: none;
}

/* Ο βασιλιάς πάνω στην πλακέτα */
#home #home-history > .history-mini::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  width: 32px;
  height: 32px;
  transform: translateX(-50%);
  background: url('assets/pieces/bK.svg') center / contain no-repeat;
  opacity: .45;
}

#home #home-history > .history-mini .year-badge {
  display: block;
  padding: 0;
  background: none;
  border-radius: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 2px;
  color: #5b4320;
}

#home #home-history > .history-mini h3 {
  margin: 4px 0 0;
  font-size: 1.2rem;
  line-height: 1.22;
  color: var(--hc-ink);
}

#home #home-history > .history-mini p {
  margin: 2px 0 0;
  max-width: 32ch;
  font-size: .9rem;
  line-height: 1.5;
  color: #66543c;
}


/* ============================================================
   ΚΙΝΗΤΑ ΚΑΙ ΠΡΟΣΒΑΣΙΜΟΤΗΤΑ
   ============================================================ */
@media (max-width: 600px) {
  #home #home-team > .team-cat-card { min-height: 210px; padding-top: 112px; }
  #home #home-team > .team-cat-card::before { width: 78px; height: 78px; }

  #home #home-academy > .class-card { min-height: 170px; }
  #home #home-academy > .class-card h3 { font-size: 1.3rem; }

  #home #home-tournaments > .tournament-card-ribbon h3 { font-size: 1.18rem; }

  #home #home-history > .history-mini .year-badge { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  #home #home-team > .team-cat-card:hover { transform: none; }
}