/* -----------------------------------------------------------
   ROOT VARIABLES
   Consolidated and expanded with specific values for consistency.
----------------------------------------------------------- */
:root {
  /* Global Colors */
  --global-font: 'PT Sans', sans-serif; /* Already PT Sans */
  --primary: #ffffff; /* White */
  --secondary: #000000; /* Black */
  --primary_grey: #c9c9c9; /* Light Grey */
  --secondary_grey: #494949; /* Darker Grey */
  --red: #f77272; /* Accent Red */
  --accent: #084b77; /* Accent Blue */

  /* Semantic Colors for Articles/Buttons */
  --article-link-color: #16654a; /* New general article link color (a clear blue) */
  --article-link-hover-color: #4a9d55; /* New hover for general article link */
  --link-hover-blue: #007bff; /* Specific blue for article links/hover (kept for existing article-card styles) */
  --button-blue: #0080ff; /* Button blue */
  --button-blue-hover: #0056b3; /* Button blue hover */
  --button-grey: #83ba50; /* Specific grey button for article back button */
  --button-grey-hover: #95ca57; /* Specific grey button hover */
  --article-text-color: #444; /* Dark grey for article body text */
  --article-meta-color: #777; /* Grey for article metadata */

  /* NEW: Article Button Specific Colors */
  --in-article-button-bg: var(--accent); /* Using your primary accent color */
  --in-article-button-text: var(--primary); /* White text */
  --in-article-button-hover-bg: var(--red); /* Red on hover */


  /* Global UI Properties */
  --global-border-radius: 16px; /* Consistent border-radius for many elements */

  /* Box Shadows (semantic naming for reusability) */
  --box-shadow-light: rgba(0,0,0,0.05);  /* Subtle shadow */
  --box-shadow-medium: rgba(0,0,0,0.08); /* Medium shadow */
  --box-shadow-article-card: rgba(0,0,0,0.1); /* Slightly stronger shadow for article cards/full article */
  --box-shadow-hover: rgba(0,0,0,0.08);  /* Common hover shadow for elements like nav menu */

  /* NEW: Section Separator */
  --section-separator-color: #eee;
}

/* -----------------------------------------------------------
   BASE + RESET
----------------------------------------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--global-font);
  background: var(--accent); /* Default background color */
  color: var(--secondary);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-size: 0.95rem;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--red); }

/* Applies background image if `homepage` class is present on body */
body.homepage {
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  /* Add specific background image here if it's meant to be global for homepage body */
  /* For example: background-image: url('path/to/your/image.jpg'); */
}

/* -----------------------------------------------------------
   HEADER & NAVIGATION
----------------------------------------------------------- */
.header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background: var(--primary);
  box-shadow: 0 1px 3px var(--box-shadow-light);
  position: relative;
}
.header-nav .logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.logo img {
  max-height: 40px;
  width: auto;
  vertical-align: middle;
}
.burger { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--accent); z-index: 1001; }
.nav-links { display: flex; gap: 0.5rem; list-style: none; padding-left: 0; margin: 0; }
.nav-links .button { background: none; color: var(--secondary_grey); border: 1px solid transparent; }
.nav-links .button:hover, .nav-links .button.active { background: var(--accent); color: var(--primary); border-color: var(--accent); }

/* -----------------------------------------------------------
   MAIN CONTENT & WRAPPERS
----------------------------------------------------------- */
main { flex-grow: 1; display: flex; flex-direction: column; align-items: center; }

.content-wrapper {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  width: 100%;
}

/* General h2 style - specific article h2 will override */
h2 {
  font-size: 1.75rem;
  color: var(--secondary);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 1.5rem;
  margin-top: 0.5rem;
}

/* -----------------------------------------------------------
   BUTTONS (General Styles)
----------------------------------------------------------- */
.button {
  display: inline-block;
  border: none;
  outline: none;
  padding: 0.5rem 1.25rem;
  background: var(--accent);
  color: var(--primary);
  border-radius: var(--global-border-radius);
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  margin: 0.25rem;
  transition: background .18s, color .18s, border-color .18s;
  box-shadow: 0 1px 3px var(--box-shadow-light);
  text-decoration: none;
}
.button:hover{
  background: var(--red);
  color: var(--primary);
  text-decoration: none;
}
.button-disabled,
.button-disabled:hover {
    background-color: #e9e9e9;
    color: var(--secondary_grey);
    cursor: not-allowed;
    box-shadow: none;
}

/* -----------------------------------------------------------
   FOOTER
----------------------------------------------------------- */
footer {
  background: var(--primary);
  color: var(--secondary_grey);
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.9rem;
  margin-top: 2rem;
}
footer a { color: var(--accent); text-decoration: none; font-weight: bold; }
footer a:hover { color: var(--red); text-decoration: underline; }

/* -----------------------------------------------------------
   RESPONSIVE COMPACT VIEW (Header Navigation)
----------------------------------------------------------- */
@media (max-width: 1199.98px) {
  .nav-links { display: none; }
  .burger { display: block; }
  .header-nav .logo { position: static; transform: none; flex-grow: 1; text-align: center; }
  .nav-auth { flex-shrink: 0; }
  .nav-links.open {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary);
    border-top: 1px solid #f0f0f0;
    z-index: 1000;
    padding: 1.5rem;
    box-shadow: 0 4px 12px var(--box-shadow-medium);
  }
  .nav-links.open li { margin: 0; text-align: center; }
}

@media (max-width: 767px) {
  .header-nav { padding: 0.75rem 1rem; }
  .nav-links.open { grid-template-columns: 1fr; } /* Single column for nav links on very small mobile */
}

/* -----------------------------------------------------------
   ARTICLE LISTING PAGE (articles.php)
----------------------------------------------------------- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive grid for cards */
    gap: 30px; /* Space between article cards */
    padding: 20px;
    max-width: 1200px; /* Max width for the grid container */
    margin: 0 auto; /* Center the grid */
}

.article-card {
    background-color: var(--primary);
    border: 1px solid var(--primary_grey); /* Using primary_grey for border */
    border-radius: var(--global-border-radius);
    box-shadow: 0 4px 8px var(--box-shadow-article-card);
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease-in-out;
}

.article-card:hover {
    transform: translateY(-5px);
}

.article-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.5em;
}

.article-card h3 a {
    color: var(--secondary_grey); /* Using dark grey for link */
    text-decoration: none;
    transition: color 0.2s;
}

.article-card h3 a:hover {
    color: var(--link-hover-blue);
}

.article-card .article-meta {
    font-size: 0.9em;
    color: var(--article-meta-color);
    margin-bottom: 15px;
}

.article-card p {
    font-size: 1em;
    line-height: 1.6;
    color: var(--secondary_grey);
    flex-grow: 1;
}

.read-more-button {
    display: inline-block;
    background-color: var(--button-blue);
    color: var(--primary);
    padding: 10px 15px;
    border-radius: var(--global-border-radius);
    text-decoration: none;
    margin-top: 20px;
    align-self: flex-start;
    transition: background-color 0.2s;
}

.read-more-button:hover {
    background-color: var(--button-blue-hover);
}

/* -----------------------------------------------------------
   INDIVIDUAL ARTICLE PAGES (e.g., articles/welcome_article.php)
----------------------------------------------------------- */
.full-article {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background-color: var(--primary);
    border-radius: var(--global-border-radius);
    box-shadow: 0 4px 10px var(--box-shadow-article-card);
    /* NEW: Apply PT Sans font to the full article for consistency */
    font-family: var(--global-font);
}

.full-article h2 {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: var(--secondary_grey); /* Dark grey for title */
    text-align: left;
}

.full-article .article-meta {
    font-size: 0.95em;
    color: var(--article-meta-color);
    margin-bottom: 30px;
    border-bottom: 1px solid var(--primary_grey); /* Using primary_grey for separator */
    padding-bottom: 15px;
}

.full-article .article-content p {
    font-size: 1.1em;
    line-height: 1.8;
    color: var(--article-text-color);
    margin-bottom: 20px;
    /* NEW: Justify text */
    text-align: justify;
}

.full-article .article-content h3 {
    font-size: 1.8em;
    margin-top: 35px; /* Increased top margin for more breathing room */
    margin-bottom: 15px;
    color: var(--secondary_grey);
}

.full-article .article-content h4 {
    font-size: 1.4em;
    margin-top: 25px;
    margin-bottom: 10px;
    color: var(--secondary_grey);
}

.full-article .article-content ul,
.full-article .article-content ol {
    margin-bottom: 20px;
    padding-left: 30px;
}

.full-article .article-content li {
    font-size: 1.1em;
    line-height: 1.6;
    color: var(--article-text-color);
    margin-bottom: 10px;
}

/* NEW: General Article Link Style (different from main site links) */
.full-article .article-content a {
    color: var(--article-link-color); /* Use new variable */
    text-decoration: underline; /* Keep underline for clarity */
}

.full-article .article-content a:hover {
    color: var(--article-link-hover-color); /* Use new variable for hover */
    text-decoration: none;
}


.full-article .article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 30px auto;
    border-radius: var(--global-border-radius);
    box-shadow: 0 2px 5px var(--box-shadow-light); /* Lighter shadow for image */
}

/* Back to Articles Button specific styling */
.full-article .button {
    margin-top: 30px;
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--button-grey); /* Use specific grey button color */
    color: var(--primary);
    border-radius: var(--global-border-radius);
    text-decoration: none;
    transition: background-color 0.2s;
}

.full-article .button:hover {
    background-color: var(--button-grey-hover); /* Use specific grey button hover color */
}

/* NEW: Custom Style for Buttons *within* the article content */
.full-article .article-content .article-button {
    display: inline-flex; /* Use flex for icon alignment */
    align-items: center;
    gap: 8px; /* Space between icon and text */
    padding: 0.15rem 0.6rem; /* Smaller padding */
    background-color: var(--in-article-button-bg);
    color: var(--in-article-button-text);
    border-radius: var(--global-border-radius); /* Use global radius */
    font-size: 0.7rem; /* Slightly smaller font */
    font-weight: bold;
    cursor: pointer;
    text-decoration: none; /* No underline */
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* Subtle shadow */
    white-space: nowrap; /* Prevent wrapping for compact buttons */
}

.full-article .article-content .article-button:hover {
    background-color: var(--in-article-button-hover-bg);
    color: var(--primary); /* Keep text white */
    transform: translateY(-1px); /* Slight lift */
    text-decoration: none; /* Ensure no underline on hover */
}

/* NEW: Separator style */
.article-separator {
    display: block;
    width: 100%; /* Full width */
    height: 1px; /* Thin line */
    background-color: var(--section-separator-color); /* Light grey line */
    margin: 40px auto; /* More space above/below, centered */
    border: none; /* Remove default hr border */
}