/* ==========================================================================
   AYUTTHAYA FC — SITE-WIDE REDESIGN STYLESHEET
   Load this AFTER the existing /style.css?fin11 on every page
   (homepage, all articles, board index) so it can override the
   legacy forum-theme rules that are currently misapplied to content.
   ========================================================================== */


/* --------------------------------------------------------------------------
   0. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Brand palette — deep pitch navy + club gold accent */
  --color-primary:        #0B1F3A;   /* deep navy — headings, header bar */
  --color-primary-dark:   #071427;
  --color-accent:         #D4A017;   /* gold — links, accents, CTAs */
  --color-accent-dark:    #B0820F;

  /* Neutrals */
  --color-bg:             #F4F6F9;   /* page background */
  --color-surface:        #FFFFFF;   /* card / content surface */
  --color-border:         #E3E7EE;
  --color-text:           #202634;
  --color-text-subtle:    #5B6472;
  --color-text-on-primary:#FFFFFF;

  /* Typography */
  --font-heading: 'Georgia', 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --fs-h1: clamp(1.9rem, 4vw, 2.75rem);
  --fs-h2: clamp(1.4rem, 2.6vw, 1.9rem);
  --fs-h3: clamp(1.15rem, 2vw, 1.4rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9rem;
  --lh-body: 1.75;
  --lh-heading: 1.25;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4.5rem;

  /* Layout */
  --content-max-width: 860px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  /* Shadow & motion */
  --shadow-card: 0 4px 12px rgba(11, 31, 58, 0.06), 0 1px 3px rgba(11, 31, 58, 0.08);
  --shadow-hover: 0 10px 24px rgba(11, 31, 58, 0.12);
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}


/* --------------------------------------------------------------------------
   1. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  /* Kill the legacy forum banner image + tight margins */
  background: var(--color-bg) !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-5) 0;
}

/* The page wraps everything in <div align="center">; let it breathe */
body > div[align="center"] {
  display: block;
  width: 100%;
  padding: var(--space-4) var(--space-3);
  background: linear-gradient(45deg, #0D5DCE, #002456) !important;
}


/* --------------------------------------------------------------------------
   2. SITE HEADER BANNER — uses the club's original /images/intro.jpg
   ( sits ABOVE the content card. Add this markup once at the top of
     body > div[align="center"] on every page:
     <div class="site-header">
       <a href="/" class="site-header__brand">Ayutthaya FC</a>
       <nav class="site-nav"><ul>
         <li><a href="/">Home</a></li>
         <li><a href="/news">News</a></li>
         <li><a href="/board">Board</a></li>
         <li><a href="/contact">Contact</a></li>
       </ul></nav>
     </div> )
   -------------------------------------------------------------------------- */
.site-header {
  position: relative;
  background: linear-gradient(180deg, rgba(7,20,39,0.15) 0%, rgba(7,20,39,0.75) 100%),
              url('/images/intro.jpg') center center / cover no-repeat;
  min-height: 260px;
  max-width: var(--content-max-width);
  margin: 0 auto;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  overflow: hidden;
}

.site-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--color-accent);
  z-index: 2;
}

.site-header__brand {
  align-self: flex-start;
  color: var(--color-text-on-primary) !important;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  text-shadow: 0 2px 6px rgba(0,0,0,0.45);
  border-bottom: none !important;
  position: relative;
  z-index: 2;
}
.site-header__brand:hover { color: var(--color-accent) !important; }

.site-header__title {
  position: relative;
  z-index: 2;
  color: var(--color-text-on-primary);
  font-family: var(--font-heading);
  font-size: var(--fs-h1);
  line-height: var(--lh-heading);
  margin: 0;
  text-shadow: 0 2px 10px rgba(0,0,0,0.55);
  max-width: 34ch;
}

/* Horizontal nav — always a single row, wraps rather than stacks vertically */
.site-nav { position: relative; z-index: 2; align-self: flex-start; }

.site-nav ul {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li { margin: 0; }

.site-nav a {
  display: inline-block;
  color: var(--color-text-on-primary);
  font-weight: 600;
  font-size: var(--fs-small);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: var(--space-2) var(--space-3);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: var(--radius-sm);
  background: rgba(11,31,58,0.35);
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.site-nav a:hover,
.site-nav a.is-active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-primary-dark);
  text-decoration: none;
}


/* --------------------------------------------------------------------------
   3. MAIN CONTENT CONTAINER
   ( .header-bg is the ONLY wrapper class present on every template —
     the legacy theme used it as a 154px forum banner; we repurpose it
     as the primary article/page card, sitting directly under .site-header,
     and strip its old background. )
   -------------------------------------------------------------------------- */
.header-bg {
  background: var(--color-surface) !important;
  background-image: none !important;
  height: auto !important;
  max-width: var(--content-max-width);
  margin: 0 auto var(--space-6) auto;
  padding: var(--space-6) var(--space-5);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-card);
  text-align: left;
}



/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  line-height: var(--lh-heading);
  font-weight: 700;
  margin: 0 0 var(--space-3) 0;
}

h1 {
  font-size: var(--fs-h1);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-4);
}

/* First h1 on the page acts as the article title */
.header-bg > h1:first-child {
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

h2 {
  font-size: var(--fs-h2);
  margin-top: var(--space-6);
  padding-top: var(--space-2);
  position: relative;
}

/* Small accent tick before each section heading */
h2::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--color-accent);
  border-radius: 2px;
  margin-right: var(--space-2);
  transform: translateY(-1px);
}

h3 {
  font-size: var(--fs-h3);
  margin-top: var(--space-5);
  color: var(--color-primary-dark);
}

p {
  margin: 0 0 var(--space-4) 0;
  color: var(--color-text);
  max-width: 72ch;
}

strong, b { color: var(--color-primary); font-weight: 700; }

/* First paragraph after the H1 reads as the lede — slightly larger/lighter */
.header-bg > h1:first-child + p {
  font-size: 1.15rem;
  color: var(--color-text-subtle);
}


/* --------------------------------------------------------------------------
   4. LINKS
   -------------------------------------------------------------------------- */
a {
  color: var(--color-accent-dark);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

a:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  text-decoration: none;
}

a:visited { color: var(--color-accent-dark); }


/* --------------------------------------------------------------------------
   5. LISTS
   ( covers both in-article bullet lists and the homepage "latest
     articles" <ul id="..."> feed )
   -------------------------------------------------------------------------- */
ul, ol {
  margin: 0 0 var(--space-4) 0;
  padding-left: var(--space-4);
}

li { margin-bottom: var(--space-2); }

/* Homepage article feed list — turn plain <li><a>...</a> - date</li>
   into readable "card row" entries */
.header-bg > div > ul,
ul[id] {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.header-bg > div > ul li,
ul[id] li {
  padding: var(--space-3) var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
  font-size: var(--fs-small);
  color: var(--color-text-subtle);
}

.header-bg > div > ul li:hover,
ul[id] li:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--color-accent);
}

.header-bg > div > ul li a,
ul[id] li a {
  color: var(--color-primary);
  font-weight: 600;
  font-family: var(--font-body);
}


/* --------------------------------------------------------------------------
   6. TABLES
   ( used sparingly, e.g. the "info@ahfaa.org" contact box )
   -------------------------------------------------------------------------- */
table {
  width: 100%;
  max-width: 320px;
  border-collapse: collapse;
  margin: var(--space-4) 0;
  font-size: var(--fs-small);
}

table td, table th {
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
}


/* --------------------------------------------------------------------------
   7. IMAGES / BUTTON-STYLE LINKS
   ( homepage "go_web1.png" / "go_board1.png" images )
   -------------------------------------------------------------------------- */
.style2 {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  margin: var(--space-2) var(--space-2) var(--space-2) 0;
}

.style2:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* Kill the huge stack of <br> the homepage uses for spacing before images */
.header-bg br + br { display: none; }


/* --------------------------------------------------------------------------
   8. PAGE TITLE LINK BLOCK (.h1 — the Thai/EN site title link on homepage)
   -------------------------------------------------------------------------- */
.h1 {
  font-size: 1.1rem !important;
  font-family: var(--font-heading);
  color: var(--color-primary);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.h1 a { color: var(--color-primary); font-weight: 700; }


/* --------------------------------------------------------------------------
   8b. SITE FOOTER — expanded, multi-column, not a cramped 2-row block
   ( wrap the existing contact table plus any additional link groups in:
     <footer class="site-footer">
       <div class="site-footer__col">
         <h4>Ayutthaya FC</h4>
         <p>info@ahfaa.org</p>
       </div>
       <div class="site-footer__col">
         <h4>Explore</h4>
         <ul><li><a href="/">Home</a></li><li><a href="/board">Board</a></li></ul>
       </div>
       <div class="site-footer__col">
         <h4>Latest Articles</h4>
         <ul><li><a href="...">...</a></li></ul>
       </div>
     </footer> )
   -------------------------------------------------------------------------- */
.site-footer {
  max-width: var(--content-max-width);
  margin: var(--space-6) auto 0 auto;
  background: var(--color-primary);
  color: rgba(255,255,255,0.85);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5) var(--space-6);
}

.site-footer__col h4 {
  color: var(--color-accent);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin: 0 0 var(--space-3) 0;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid rgba(255,255,255,0.18);
}

.site-footer__col p {
  color: rgba(255,255,255,0.75);
  font-size: var(--fs-small);
  margin-bottom: var(--space-2);
  max-width: none;
}

.site-footer__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.site-footer__col li { margin: 0; }

.site-footer__col a {
  color: rgba(255,255,255,0.75);
  font-size: var(--fs-small);
  border-bottom: 1px solid transparent;
}

.site-footer__col a:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* The legacy contact table, if it lands inside the footer, should blend in */
.site-footer table {
  max-width: none;
  background: transparent;
  border: none;
}
.site-footer table td, .site-footer table th {
  background: transparent;
  border: none;
  padding: 0;
  color: rgba(255,255,255,0.75);
  font-size: var(--fs-small);
}

.site-footer__bottom {
  grid-column: 1 / -1;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255,255,255,0.18);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--fs-small);
  color: rgba(255,255,255,0.6);
}


/* --------------------------------------------------------------------------
   9. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .header-bg {
    padding: var(--space-4) var(--space-3);
    border-radius: var(--radius-md);
  }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.25rem; }

  .site-header { min-height: 200px; padding: var(--space-3) var(--space-4); }
  .site-nav a { padding: var(--space-1) var(--space-2); font-size: 0.8rem; }

  .site-footer {
    grid-template-columns: 1fr 1fr;
    padding: var(--space-4);
  }
}

@media (max-width: 480px) {
  body > div[align="center"] { padding: var(--space-2); }
  .header-bg { padding: var(--space-3); }
  .header-bg:first-child::before { margin-bottom: var(--space-3); }

  .site-header { min-height: 170px; }
  .site-header__title { font-size: 1.5rem; }

  .site-footer { grid-template-columns: 1fr; }
}


/* --------------------------------------------------------------------------
   10. PRINT
   -------------------------------------------------------------------------- */
@media print {
  body { background: #fff !important; }
  .header-bg {
    box-shadow: none;
    border: none;
    max-width: 100%;
  }
  a { color: var(--color-text); border-bottom: none; }
}