/* ============================================
   AI-förbundet — Site Skin for PGEU System
   Inspired by postgresql.eu design patterns.
   ============================================ */

/* --- Custom Properties --- */
:root {
  --color-red: #D71920;
  --color-red-dark: #A31419;
  --color-red-light: #FDE8E8;
  --color-text: #333333;
  --color-heading: #1A1A1A;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F7F8FA;
  --color-secondary: #6C757D;
  --color-border: #DEE2E6;
  --color-link: #D71920;
  --font-body: 'Open Sans', system-ui, -apple-system, sans-serif;
  --font-heading: 'Maven Pro', 'Open Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-width: 1140px;
  --gutter: 24px;
  --header-height: 64px;
  --card-radius: 6px;
  --card-shadow: 0 1px 4px rgba(0,0,0,0.08);
  --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
}

/* --- Base --- */
body {
  font-family: var(--font-body) !important;
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  padding-top: var(--header-height);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

body.menu-open { overflow: hidden; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-heading);
  margin-top: 0.5em;
}

a { color: var(--color-link); font-weight: 600; text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-red-dark); text-decoration: underline; }

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--color-bg);
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  color: var(--color-heading) !important;
  flex-shrink: 0;
}

.logo-icon-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--color-red);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-mono);
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* --- Main Nav --- */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav > a,
.main-nav .nav-dropdown-trigger {
  color: var(--color-text) !important;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.main-nav > a:hover,
.main-nav .nav-dropdown-trigger:hover {
  background: var(--color-bg-alt);
  color: var(--color-red) !important;
}

/* --- Nav Dropdowns --- */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger { cursor: pointer; }
.nav-dropdown-trigger i { margin-left: 3px; font-size: 10px; transition: transform 0.2s; }
.nav-dropdown:hover .nav-dropdown-trigger i { transform: rotate(180deg); }

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 6px 0;
  min-width: 210px;
  z-index: 1001;
  margin-top: 2px;
}

.nav-dropdown:hover .nav-dropdown-menu { display: block; }

.nav-dropdown-menu a {
  display: block !important;
  padding: 8px 16px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--color-text) !important;
  white-space: nowrap;
  border-radius: 0 !important;
}

.nav-dropdown-menu a:hover {
  background: var(--color-bg-alt) !important;
  color: var(--color-red) !important;
  text-decoration: none !important;
}

/* --- Hamburger & Mobile --- */
.hamburger {
  display: none;
  background: none; border: none; cursor: pointer; padding: 8px; z-index: 2000;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--color-text); margin: 5px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-menu {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--color-bg); z-index: 1500;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; overflow-y: auto; padding: 80px 24px 40px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-size: 18px; font-weight: 600; color: var(--color-text);
  text-decoration: none; padding: 8px 24px;
}
.mobile-menu a:hover { color: var(--color-red); }
.mobile-menu-divider { width: 50px; height: 1px; background: var(--color-border); }

/* --- Layout --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 60px 0; }
.section--alt { background: var(--color-bg-alt); }
.section--red { background: var(--color-red); color: #fff; }
.text-center { text-align: center; }

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  text-align: center;
  transition: all 0.15s ease;
  line-height: 1.4;
}

.btn--primary { background: var(--color-red); color: #fff !important; border-color: var(--color-red); }
.btn--primary:hover { background: var(--color-red-dark); border-color: var(--color-red-dark); }
.btn--secondary { background: transparent; color: var(--color-red) !important; border-color: var(--color-red); }
.btn--secondary:hover { background: var(--color-red); color: #fff !important; }
.btn--white { background: #fff; color: var(--color-red) !important; border-color: #fff; }
.btn--white:hover { background: var(--color-bg-alt); border-color: var(--color-bg-alt); }
.btn--outline-white { background: transparent; color: #fff !important; border-color: rgba(255,255,255,0.6); }
.btn--outline-white:hover { background: #fff; color: var(--color-red) !important; border-color: #fff; }
.btn--large { font-size: 16px; padding: 14px 32px; }

/* --- Cards --- */
.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  padding: 24px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover { box-shadow: var(--card-shadow-hover); border-color: #ccc; }
.card h3 { margin-top: 0; margin-bottom: 8px; font-size: 17px; color: var(--color-heading); }
.card p { color: var(--color-secondary); margin-bottom: 12px; font-size: 14px; }
.card-link { color: var(--color-link) !important; font-weight: 600; font-size: 13px; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* --- Hero (Homepage) --- */
.hero {
  background: var(--color-red);
  color: #fff;
  padding: 80px 0 64px;
  text-align: center;
}
.hero h1 { font-size: 42px; font-weight: 700; margin-bottom: 16px; line-height: 1.15; color: #fff; }
.hero p { font-size: 18px; max-width: 580px; margin: 0 auto 32px; opacity: 0.95; line-height: 1.6; }
.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* --- Feature Grid --- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 24px 16px; border: 1px solid var(--color-border); border-radius: var(--card-radius);
  background: #fff; text-decoration: none !important; color: var(--color-text) !important;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.feature-card:hover { box-shadow: var(--card-shadow-hover); border-color: #ccc; }
.feature-card i { font-size: 28px; color: var(--color-red); margin-bottom: 12px; }
.feature-card h3 { font-size: 15px; font-weight: 600; margin: 0 0 4px; color: var(--color-heading); }
.feature-card p { font-size: 13px; color: var(--color-secondary); margin: 0; }

/* --- Section Headers --- */
.section-header { margin-bottom: 32px; }
.section-header h2 {
  font-size: 28px; font-weight: 600; margin-bottom: 8px;
  display: flex; flex-direction: row; align-items: center;
}
.section-header.text-center h2 { justify-content: center; }
.section-header h2::after {
  background-color: var(--color-border);
  content: '\a0'; flex-grow: 1; height: 2px;
  position: relative; margin: 0 0 0 0.75em;
}
.section-header.text-center h2::after { display: none; }
.section-footer { margin-top: 32px; text-align: center; }

/* --- News --- */
.news-cards .card { display: flex; flex-direction: column; }
.news-date { font-size: 12px; color: var(--color-secondary); margin-bottom: 6px; }
.news-cards .card h3 { color: var(--color-heading); margin-bottom: 8px; }
.news-cards .card h3 a { color: var(--color-heading); text-decoration: none; }
.news-cards .card h3 a:hover { color: var(--color-red); }
.news-summary { flex: 1; color: var(--color-secondary); margin-bottom: 12px; font-size: 14px; }

/* --- Bottom CTA --- */
.bottom-cta { text-align: center; }
.bottom-cta h2 { margin-bottom: 12px; font-size: 28px; color: #fff; }
.bottom-cta p { font-size: 16px; opacity: 0.9; max-width: 560px; margin: 0 auto 24px; }
.bottom-cta .subtext { font-size: 13px; opacity: 0.7; margin-top: 12px; }

/* --- Footer --- */
.site-footer { background: var(--color-red-dark); color: #fff; padding: 48px 0 24px; }
.footer-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gutter); }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin-bottom: 32px; }
.footer-col h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 12px; opacity: 0.7; font-family: var(--font-body);
}
.footer-col p, .footer-col a { color: rgba(255,255,255,0.8); font-size: 13px; line-height: 1.5; font-weight: 400; }
.footer-col a { display: block; padding: 3px 0; text-decoration: none !important; }
.footer-col a:hover { color: #fff; text-decoration: underline !important; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 16px; font-size: 12px; opacity: 0.6;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* ===========================================
   INNER PAGES — PGEU content styling
   =========================================== */

/* Hide default PGEU navbar/footer */
.container-fluid { padding: 0 !important; }
#footer { display: none; }
.navbar { display: none !important; }

/* Inner page container */
.container-fluid > .row {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px var(--gutter);
}

/* --- Sidebar Navigation (from navbase.html) --- */
#sidenav {
  padding: 24px 20px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
}

#sidenav h2 {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-red);
  margin: 0 0 10px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-border);
  display: block;
}

/* Remove the default pgeu.css ::after line on sidenav h2 */
#sidenav h2::after { display: none !important; }

#sidenav ul { list-style: none; padding: 0; margin: 0 0 16px 0; }
#sidenav li { margin-bottom: 1px; }
#sidenav a {
  color: var(--color-text) !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  display: block;
  border-radius: 3px;
}
#sidenav a:hover { background: rgba(215, 25, 32, 0.08); color: var(--color-red) !important; }

/* --- Content Area --- */
.contentwrap {
  min-height: 300px;
}

.contentwrap h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--color-heading);
}

.contentwrap h2 {
  font-size: 22px;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
}

.contentwrap h2::after {
  background-color: var(--color-border);
  content: '\a0'; flex-grow: 1; height: 2px;
  position: relative; margin: 0 0 0 0.75em;
}

.contentwrap h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 8px;
}

.contentwrap h4 {
  font-size: 15px;
  font-weight: 600;
  margin-top: 16px;
  margin-bottom: 6px;
}

/* Tables */
.contentwrap table {
  width: 100%; border-collapse: collapse; margin-bottom: 1.5em; font-size: 14px;
}
.contentwrap table th,
.contentwrap table td {
  padding: 8px 12px; border-bottom: 1px solid var(--color-border); text-align: left;
}
.contentwrap table th { font-weight: 600; background: var(--color-bg-alt); font-size: 13px; }
.contentwrap table tr:hover td { background: #fafbfc; }

/* Forms */
.contentwrap form input[type="text"],
.contentwrap form input[type="email"],
.contentwrap form input[type="password"],
.contentwrap form input[type="number"],
.contentwrap form input[type="url"],
.contentwrap form select,
.contentwrap form textarea {
  font-family: var(--font-body);
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 8px 12px;
  transition: border-color 0.15s;
}
.contentwrap form input:focus,
.contentwrap form select:focus,
.contentwrap form textarea:focus {
  outline: none;
  border-color: var(--color-red);
  box-shadow: 0 0 0 2px rgba(215, 25, 32, 0.12);
}

/* Submit buttons */
.contentwrap input[type="submit"],
.contentwrap button[type="submit"] {
  background: var(--color-red); color: #fff; border: none;
  padding: 8px 20px; border-radius: 4px;
  font-family: var(--font-body); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background 0.15s;
}
.contentwrap input[type="submit"]:hover,
.contentwrap button[type="submit"]:hover { background: var(--color-red-dark); }

/* News content styling */
div.newscontent h1, div.newscontent h2, div.newscontent h3,
div.newscontent h4, div.newscontent h5, div.newscontent h6 {
  font-size: small;
}

/* Event listings */
dl.eventlist { padding-left: 1em; }
dl.eventlist dd { padding-left: 1em; margin-bottom: 1em; }

/* Bootstrap button overrides for PGEU skin */
.btn-primary { background-color: var(--color-red) !important; border-color: var(--color-red) !important; }
.btn-primary:hover { background-color: var(--color-red-dark) !important; border-color: var(--color-red-dark) !important; }
.btn-outline-dark { color: var(--color-red) !important; border-color: var(--color-red) !important; }
.btn-outline-dark:hover { background-color: var(--color-red) !important; color: #fff !important; }

/* Pagination */
.pagination .page-link { color: var(--color-red); }
.pagination .page-item.active .page-link { background-color: var(--color-red); border-color: var(--color-red); }

/* ===========================================
   RESPONSIVE
   =========================================== */

@media (max-width: 1024px) {
  .main-nav { display: none; }
  .hamburger { display: block; }
  .card-grid, .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .hero h1 { font-size: 36px; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 14px; }
  .hero { padding: 56px 0 48px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 16px; }
  .section { padding: 40px 0; }
  .card-grid, .feature-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .section-header h2 { font-size: 22px; }
  .bottom-cta h2 { font-size: 24px; }
  .btn--large { font-size: 15px; padding: 12px 24px; }
  .card { padding: 20px; }
  .contentwrap h1 { font-size: 24px; }
  .contentwrap h2 { font-size: 18px; }
}
