/* ================================================================
   style.css — Dr Wayne Aubrey's website
   ----------------------------------------------------------------
   This single file controls the appearance of ALL pages on the
   site. Edit it here and every page updates automatically.

   CONTENTS
   ----------------------------------------------------------------
   1.  CSS Custom Properties (colours, fonts, spacing)
   2.  Reset & Base
   3.  Typography
   4.  Navigation bar
   5.  Page layout (.container)
   6.  Header — home page (with avatar)
   7.  Header — inner pages (simpler, no avatar)
   8.  Badge links (header quick-access buttons)
   9.  Main content & sections
   10. About section
   11. Module cards
   12. Research areas list
   13. Links / Interests grid
   14. PhD student cards        (research.html)
   15. Publications list        (research.html)
   16. Footer
   17. Responsive (small screens)
   ================================================================ */


/* ================================================================
   1. CSS CUSTOM PROPERTIES
   ----------------------------------------------------------------
   These are site-wide variables. Change a value once here and it
   updates everywhere on the site.
   ================================================================ */
:root {
  /* --- Colours --- */
  --colour-bg:          #f7f5f0;   /* warm off-white page background    */
  --colour-surface:     #ffffff;   /* white card / section backgrounds  */
  --colour-border:      #ddd8cf;   /* subtle border colour              */
  --colour-accent:      #2c5f8a;   /* main accent blue (nav, links)     */
  --colour-accent-dark: #1a3f60;   /* darker blue for hover states      */
  --colour-text:        #2a2a2a;   /* main body text colour             */
  --colour-muted:       #6b6560;   /* secondary / caption text colour   */
  --colour-heading:     #1a1a1a;   /* heading text colour               */

  /* --- Fonts --- */
  --font-heading: 'Lora', Georgia, serif;              /* serif for headings */
  --font-body:    'Source Sans 3', Arial, sans-serif;  /* sans for body text */

  /* --- Layout --- */
  --max-width: 860px;   /* max content width — increase to widen the site  */
  --spacing:   2rem;    /* base spacing unit used throughout                */
}


/* ================================================================
   2. RESET & BASE
   ================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth; /* smooth scroll when anchor links are clicked */
}

body {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--colour-text);
  background-color: var(--colour-bg);
}


/* ================================================================
   3. TYPOGRAPHY
   ================================================================ */
h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--colour-heading);
  line-height: 1.25;
}

h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--colour-accent); /* coloured rule under section titles */
}

h3 {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
  color: var(--colour-accent-dark);
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--colour-accent);
  text-decoration: none;
}

a:hover {
  color: var(--colour-accent-dark);
  text-decoration: underline;
}


/* ================================================================
   4. NAVIGATION BAR
   ----------------------------------------------------------------
   Sticky bar that stays at the top when scrolling.
   To change the background colour, edit --colour-accent above.
   ================================================================ */
nav {
  background-color: var(--colour-accent);
  position: sticky;
  top: 0;
  z-index: 100; /* keeps nav above all other content */
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;       /* wraps onto multiple lines on small screens */
  justify-content: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing);
}

nav ul li a {
  display: block;
  padding: 0.9rem 1.1rem;
  color: #ffffff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Hover state AND active page highlight (set class="active" in HTML) */
nav ul li a:hover,
nav ul li a.active {
  background-color: var(--colour-accent-dark);
  text-decoration: none;
}


/* ================================================================
   5. PAGE LAYOUT — .container
   ----------------------------------------------------------------
   Wrap any content in <div class="container"> to centre it and
   apply consistent side padding.
   ================================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing);
}


/* ================================================================
   6. HEADER — HOME PAGE (index.html)
   ----------------------------------------------------------------
   Displays avatar (initials circle), name, subtitle, and badges.
   ================================================================ */
header {
  background-color: var(--colour-surface);
  border-bottom: 1px solid var(--colour-border);
  padding: 3rem var(--spacing) 2.5rem;
}

header .container {
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Initials circle — swap for an <img> tag if you have a photo.
   See the comment in index.html for instructions. */
.avatar {
  flex-shrink: 0;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background-color: var(--colour-accent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

header h1 {
  font-size: 2.2rem;
  margin-bottom: 0.2rem;
}

.header-subtitle {
  color: var(--colour-muted);
  font-size: 1rem;
  margin-bottom: 0.8rem;
}

.header-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}


/* ================================================================
   7. HEADER — INNER PAGES (research.html etc.)
   ----------------------------------------------------------------
   Simpler header used on pages other than the home page.
   Uses the same <header> element but with extra helper classes.
   ================================================================ */

/* "← Back to home" link above the page title */
.breadcrumb {
  font-size: 0.88rem;
  color: var(--colour-muted);
  margin-bottom: 0.75rem;
}

.breadcrumb a {
  font-weight: 600;
}

/* Slightly smaller h1 for inner pages */
.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}


/* ================================================================
   8. BADGE LINKS
   ----------------------------------------------------------------
   Small pill-shaped buttons used in the header for quick links
   (Google Scholar, LinkedIn, Email etc.).
   ================================================================ */
.badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  background-color: var(--colour-bg);
  border: 1px solid var(--colour-border);
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--colour-accent);
  transition: background-color 0.2s;
}

.badge:hover {
  background-color: var(--colour-accent);
  color: #fff;
  text-decoration: none;
  border-color: var(--colour-accent);
}


/* ================================================================
   9. MAIN CONTENT & SECTIONS
   ================================================================ */
main {
  padding: calc(var(--spacing) * 1.5) 0;
}

section {
  margin-bottom: calc(var(--spacing) * 2);
}


/* ================================================================
   10. ABOUT SECTION
   ================================================================ */
.about-text {
  font-size: 1.05rem;
  color: var(--colour-text);
}


/* ================================================================
   11. MODULE CARDS
   ----------------------------------------------------------------
   Used in index.html. Copy a .module-card block to add a module.
   ================================================================ */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.module-card {
  background-color: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-top: 3px solid var(--colour-accent); /* coloured top accent edge */
  padding: 1.4rem 1.5rem;
  border-radius: 2px;
}

.module-card .module-code {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--colour-muted);
  margin-bottom: 0.25rem;
}

.module-card p {
  font-size: 0.95rem;
  color: var(--colour-muted);
  margin-bottom: 0.75rem;
}

.module-card a {
  font-size: 0.88rem;
  font-weight: 600;
}


/* ================================================================
   12. RESEARCH AREAS LIST
   ----------------------------------------------------------------
   Bulleted list with an accent arrow. Used on both pages.
   ================================================================ */
.research-areas {
  list-style: none;
  padding: 0;
  margin-bottom: 1rem;
}

.research-areas li {
  padding: 0.5rem 0 0.5rem 1.2rem;
  border-bottom: 1px solid var(--colour-border);
  position: relative;
}

/* The ▸ arrow bullet */
.research-areas li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--colour-accent);
}


/* ================================================================
   13. LINKS / INTERESTS GRID
   ----------------------------------------------------------------
   Used in index.html. Copy a .link-card block to add a link.
   ================================================================ */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.link-card {
  background-color: var(--colour-surface);
  border: 1px solid var(--colour-border);
  padding: 1.2rem 1.4rem;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.link-card .link-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--colour-muted);
}

.link-card a {
  font-weight: 600;
  font-size: 1rem;
}

.link-card p {
  font-size: 0.88rem;
  color: var(--colour-muted);
  margin: 0;
}


/* ================================================================
   14. PHD STUDENT CARDS
   ----------------------------------------------------------------
   Used in research.html. Copy a .student-card block to add a
   student. The coloured left border distinguishes them visually.
   ================================================================ */
.student-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.student-card {
  background-color: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-left: 4px solid var(--colour-accent); /* coloured left accent edge */
  padding: 1.2rem 1.4rem;
  border-radius: 2px;
}

.student-card h3 {
  margin-bottom: 0.2rem;
}

.student-card .student-meta {
  font-size: 0.85rem;
  color: var(--colour-muted);
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem;
}

.student-card p {
  font-size: 0.95rem;
  margin-bottom: 0;
}


/* ================================================================
   15. PUBLICATIONS LIST
   ----------------------------------------------------------------
   Used in research.html. Auto-numbered by CSS counters — you do
   not need to type numbers. Copy a .pub-item block to add a paper.

   HOW TO LINK A PDF:
     Set href="papers/your-file.pdf" on the .pub-link anchor.

   HOW TO LINK A DOI:
     Set href="https://doi.org/10.XXXX/XXXXX" on the .pub-link.
   ================================================================ */
.pub-list {
  list-style: none;
  padding: 0;
  counter-reset: pub-counter; /* resets the auto-number to 1 */
}

.pub-item {
  counter-increment: pub-counter;
  display: flex;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--colour-border);
}

/* The auto-generated number shown before each publication */
.pub-item::before {
  content: counter(pub-counter) ".";
  flex-shrink: 0;
  width: 1.8rem;
  font-weight: 600;
  color: var(--colour-muted);
  padding-top: 0.05rem;
}

.pub-content {
  flex: 1;
}

.pub-content .pub-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--colour-heading);
  margin-bottom: 0.2rem;
  display: block;
}

/* If the title is wrapped in an <a> tag it gets a hover effect */
.pub-content .pub-title a {
  color: var(--colour-heading);
}

.pub-content .pub-title a:hover {
  color: var(--colour-accent);
}

.pub-content .pub-authors {
  font-size: 0.92rem;
  color: var(--colour-text);
  margin-bottom: 0.15rem;
}

.pub-content .pub-venue {
  font-size: 0.88rem;
  color: var(--colour-muted);
  font-style: italic;
  margin-bottom: 0.4rem;
}

/* PDF / DOI badge links on each publication */
.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pub-link {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--colour-border);
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--colour-accent);
  background-color: var(--colour-bg);
  transition: background-color 0.2s;
}

.pub-link:hover {
  background-color: var(--colour-accent);
  color: #fff;
  border-color: var(--colour-accent);
  text-decoration: none;
}


/* ================================================================
   16. FOOTER
   ================================================================ */
footer {
  background-color: var(--colour-surface);
  border-top: 1px solid var(--colour-border);
  padding: 1.5rem var(--spacing);
  text-align: center;
  font-size: 0.88rem;
  color: var(--colour-muted);
}


/* ================================================================
   17. RESPONSIVE — SMALL SCREENS
   ----------------------------------------------------------------
   Styles inside @media only apply when the screen is 600px wide
   or narrower (phones and small tablets).
   ================================================================ */
@media (max-width: 600px) {

  /* Stack the avatar above the name on the home page header */
  header .container {
    flex-direction: column;
    text-align: center;
  }

  .header-links {
    justify-content: center;
  }

  /* Slightly smaller headings */
  h2 {
    font-size: 1.35rem;
  }

  header h1 {
    font-size: 1.8rem;
  }

  .page-header h1 {
    font-size: 1.6rem;
  }

  /* Stack publication number above content on narrow screens */
  .pub-item {
    flex-direction: column;
    gap: 0.3rem;
  }

  .pub-item::before {
    width: auto;
  }
}


/* ================================================================
   18. LANGUAGE TOGGLE BAR
   ----------------------------------------------------------------
   Sits above the navigation bar on every page.
   Click a flag button to switch between English and Welsh.
   The currently active language button is highlighted.
   ================================================================ */

/* The thin bar that holds the buttons — sits flush at very top */
.lang-toggle {
  background-color: var(--colour-accent-dark);  /* slightly darker than the nav */
  display: flex;
  justify-content: flex-end;                     /* buttons sit on the right */
  padding: 0.3rem 1rem;
  gap: 0.5rem;
}

/* Each flag button */
.lang-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background-color 0.15s;
}

.lang-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

/* The active (currently selected) language button */
.lang-btn.active {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
}
