/* === CACR Website Styles === */
:root {
  --primary: #4A2C82;
  --primary-dark: #2D1B69;
  --dark: #1a1a1a;
  --light: #F0E6FF;
  --accent: #D4AF37;
  --white: #ffffff;
  --gray: #666;
  --light-gray: #f5f5f5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; color: #333; line-height: 1.6; }
a { text-decoration: none; color: inherit; transition: all 0.2s; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-weight: 700; }

/* === TOP BAR === */
.top-bar { background: var(--primary-dark); color: #ccc; font-size: 0.85rem; padding: 8px 0; }
.top-bar-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.top-left span { margin-right: 16px; }
.top-right a { margin-left: 8px; color: #ccc; }
.top-right a.active { color: #fff; font-weight: 600; }

/* === NAVBAR === */
.navbar { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.06); position: sticky; top: 0; z-index: 1000; }
.nav-inner { display: flex; align-items: center; height: 72px; padding: 0 24px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-img { height: 50px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { padding: 8px 14px; font-size: 0.9rem; font-weight: 500; color: #333; border-radius: 6px; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); background: var(--light); }
.lang-toggle { margin-left: 16px; }
.lang-toggle a { font-size: 0.85rem; padding: 4px 8px; border-radius: 4px; color: #666; }
.lang-toggle a.active { color: var(--primary); font-weight: 600; background: var(--light); }
button { border: none; background: none; padding: 0; margin: 0; -webkit-appearance: none; -moz-appearance: none; appearance: none; border-radius: 0; outline: none; }
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; border-radius: 0; outline: none; -webkit-appearance: none; appearance: none; }
.hamburger span { display: block; width: 24px; height: 2px; background: #333; margin: 5px 0; transition: 0.3s; }

/* === MOBILE MENU === */
.mobile-menu { display: none; position: fixed; top: 72px; left: 0; right: 0; bottom: 0; background: #fff; padding: 16px; z-index: 9999; overflow-y: auto; }
.mobile-menu.open { display: block; }
.mobile-menu > a { display: block; padding: 12px 0; border-bottom: 1px solid var(--light); font-weight: 500; }
.mobile-menu > a.active { color: var(--primary); }

/* === HERO === */
.hero { position: relative; min-height: 500px; display: flex; align-items: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: url('../images/banners/toronto-skyline.jpg') center center / cover no-repeat; }
.hero-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(75,0,130,0.35) 0%, rgba(100,30,160,0.30) 50%, rgba(130,40,190,0.20) 100%); }
.hero-content { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 60px 24px; color: #fff; }
.hero-tag { display: inline-block; background: linear-gradient(90deg, var(--accent), var(--primary)); padding: 6px 20px; border-radius: 20px; font-size: 0.9rem; font-weight: 600; margin-bottom: 20px; }
.hero-content h1 { font-size: 2.8rem; font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.hero-content p { font-size: 1.1rem; opacity: 0.85; margin-bottom: 28px; max-width: 540px; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }

/* === BUTTONS === */
.btn { display: inline-block; padding: 12px 28px; border-radius: 6px; font-weight: 600; font-size: 0.95rem; transition: 0.2s; }
.btn-primary { background: linear-gradient(90deg, var(--accent), var(--primary)); color: #fff; border-radius: 20px; padding: 10px 24px; font-size: 0.9rem; font-weight: 600; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(212,175,55,0.3); filter: brightness(1.1); }
.btn-outline { border: 2px solid var(--accent); color: var(--accent); background: transparent; border-radius: 20px; padding: 10px 24px; font-size: 0.9rem; font-weight: 600; }
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-dark { background: linear-gradient(90deg, var(--accent), var(--primary)); color: #fff; border-radius: 20px; padding: 10px 24px; font-size: 0.9rem; font-weight: 600; }
.btn-dark:hover { filter: brightness(1.1); transform: translateY(-2px); }
.btn-light { background: linear-gradient(90deg, var(--accent), var(--primary)); color: #fff; border-radius: 20px; padding: 10px 24px; font-size: 0.9rem; font-weight: 600; }
.btn-light:hover { transform: translateY(-2px); }
.btn-outline-light { border: 2px solid var(--accent); color: var(--accent); background: transparent; border-radius: 20px; padding: 10px 24px; font-size: 0.9rem; font-weight: 600; }
.btn-outline-light:hover { background: var(--accent); color: #fff; }

/* === SECTION === */
.section-tag { display: inline-block; background: linear-gradient(90deg, var(--accent), var(--primary)); color: #fff; padding: 6px 20px; border-radius: 20px; font-size: 0.9rem; font-weight: 600; margin-bottom: 12px; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: 2rem; color: var(--dark); }
.section-header .view-all { display: block; margin-top: 8px; color: var(--accent); font-size: 0.85rem; }

/* === ABOUT SECTION === */
.about { padding: 80px 0; }
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 60px; align-items: center; }
.about-text h2 { font-size: 2rem; color: var(--dark); margin-bottom: 16px; line-height: 1.3; }
.about-text p { color: #555; margin-bottom: 12px; line-height: 1.8; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 24px 0; }
.feat { text-align: center; padding: 20px 12px; background: #fff; border-radius: 12px; border: 2px solid var(--light); transition: 0.2s; }
.feat:hover { border-color: var(--primary); }
.feat-i { font-size: 2rem; margin-bottom: 8px; }
.feat h4 { font-size: 0.9rem; color: var(--dark); margin-bottom: 4px; }
.feat p { font-size: 0.8rem; color: #666; }
.img-placeholder { background: linear-gradient(135deg, #f0edff, #e8e4f8); border-radius: 16px; height: 340px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.img-placeholder img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; }

/* === NEWS === */
.news { padding: 80px 0; background: var(--light); }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.news-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.06); transition: 0.3s; }
.news-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(108,92,231,0.15); }
.news-img { background: linear-gradient(135deg, var(--primary-dark), var(--accent)); min-height: 200px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.news-img img { width: 100%; height: 100%; object-fit: cover; }
.news-body { padding: 20px; }
.news-meta { display: flex; gap: 12px; font-size: 0.8rem; margin-bottom: 8px; }
.news-meta .cat { color: var(--primary); font-weight: 600; }
.news-meta .date { color: #999; }
.news-body h3 { font-size: 1.05rem; color: var(--dark); margin-bottom: 8px; line-height: 1.4; }
.news-body p { font-size: 0.85rem; color: #666; }
.featured .news-body h3 { font-size: 1.2rem; }

/* === QUICK LINKS === */
.quick-links { padding: 80px 0; background: #fff; border-top: 1px solid var(--light); }
.ql-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 40px; }
.ql-card { background: var(--light); border: 2px solid var(--primary); border-radius: 12px; padding: 32px 24px; text-align: center; color: var(--dark); transition: all 0.3s; }
.ql-card:hover { background: var(--primary); transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.ql-icon { font-size: 2.5rem; margin-bottom: 16px; }
.ql-card h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--primary); }
.ql-card p { font-size: 0.85rem; color: #666; }

/* === CTA === */
.cta { padding: 80px 0; background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%); text-align: center; color: #fff; }
.cta h2 { font-size: 2rem; margin-bottom: 12px; }
.cta p { font-size: 1.05rem; opacity: 0.9; margin-bottom: 28px; }
.cta-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* === FOOTER === */
.footer { background: var(--primary-dark); color: #ccc; padding: 60px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.f-about h4, .f-links h4, .f-contact h4 { color: #fff; font-size: 1rem; margin-bottom: 16px; }
.f-about p { font-size: 0.85rem; line-height: 1.8; margin-bottom: 8px; }
.f-links a { display: block; padding: 4px 0; font-size: 0.9rem; color: #ccc; }
.f-links a:hover { color: var(--accent); }
.f-contact p { font-size: 0.85rem; margin-bottom: 8px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px; display: flex; justify-content: space-between; font-size: 0.8rem; flex-wrap: wrap; gap: 8px; }
.footer-bottom a { color: var(--accent); }

/* === PAGE BANNER === */
.page-banner { position: relative; min-height: 280px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; text-align: center; }
.page-banner-overlay { position: absolute; inset: 0; /* background image set per-page in inline style */ background: rgba(75,0,130,0.15); }
.page-banner h1 { font-size: 2.5rem; font-weight: 800; position: relative; z-index: 1; }
.page-banner .breadcrumb { font-size: 0.9rem; opacity: 0.8; margin-top: 12px; position: relative; z-index: 1; }
.page-banner .breadcrumb a { color: #fff; text-decoration: underline; }

/* === PAGE CONTENT === */
.page-content { padding: 80px 0; }
.content-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 48px; }
.content-main h2 { font-size: 1.8rem; color: var(--primary); margin: 32px 0 16px; }
.content-main h2:first-child { margin-top: 0; }
.content-main p { color: #555; line-height: 1.8; margin-bottom: 12px; }
.content-main ul, .content-main ol { margin: 16px 0; padding-left: 24px; color: #555; }
.content-main li { margin-bottom: 8px; line-height: 1.6; }

/* === SIDEBAR === */
.sidebar-card { background: var(--light); border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.sidebar-card h3 { color: var(--primary); margin-bottom: 16px; font-size: 1.1rem; }
.sidebar-card .motto { font-size: 1.1rem; color: var(--accent); font-weight: 600; margin-bottom: 16px; }
.sidebar-card ul { list-style: none; padding: 0; }
.sidebar-card li { padding: 8px 0; border-bottom: 1px solid var(--light); color: #555; font-size: 0.9rem; }
.sidebar-card li:last-child { border-bottom: none; }
.sidebar-link { display: block; padding: 10px 0; color: var(--primary); font-weight: 500; border-bottom: 1px solid var(--light); }
.sidebar-link:last-child { border-bottom: none; }
.sidebar-link:hover { color: var(--accent); }

/* === TIMELINE === */
.timeline { position: relative; padding-left: 32px; margin: 32px 0; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 3px; background: var(--light); }
.timeline-item { position: relative; margin-bottom: 32px; }
.timeline-item::before { content: ''; position: absolute; left: -28px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--primary); border: 3px solid var(--light); }
.timeline-year { font-size: 1.2rem; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.timeline-content h4 { font-size: 1rem; color: var(--dark); margin-bottom: 4px; }
.timeline-content p { font-size: 0.9rem; color: #666; margin-bottom: 0; }

/* === ORG GRID === */
.org-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 24px 0; }
.org-card { background: #fff; border: 2px solid var(--light); border-radius: 12px; padding: 24px; text-align: center; }
.org-card h4 { color: var(--primary); margin-bottom: 8px; }
.org-card p { font-size: 0.85rem; color: #666; }

/* === TEAM GRID === */
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin: 32px 0; }
.team-card { text-align: center; }
.team-card img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; object-position: center 30%; margin-bottom: 12px; border: 3px solid var(--light); }
.team-card h4 { font-size: 1rem; color: var(--dark); margin-bottom: 4px; }
.team-card p { font-size: 0.85rem; color: #666; }

/* === MEMBERSHIP === */
.membership-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin: 32px 0; }
.membership-card { background: #fff; border: 2px solid var(--light); border-radius: 16px; padding: 32px; }
.membership-card h3 { color: var(--primary); margin-bottom: 16px; }
.membership-card ul { list-style: none; padding: 0; }
.membership-card li { padding: 8px 0; border-bottom: 1px solid var(--light); color: #555; font-size: 0.9rem; }
.membership-card li::before { content: "✓ "; color: var(--accent); font-weight: 600; }
.membership-card .price { font-size: 1.5rem; color: var(--primary); font-weight: 700; margin: 16px 0; }

/* === FORM === */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--dark); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px 16px; border: 2px solid var(--light); border-radius: 8px; font-size: 1rem; transition: 0.2s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); outline: none; }
.form-submit { margin-top: 24px; }

/* === MEDIA === */
.media-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin: 32px 0; }
.media-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.media-card img { width: 100%; height: 200px; object-fit: cover; }
.media-card .media-body { padding: 20px; }
.media-card h3 { font-size: 1.1rem; color: var(--dark); margin-bottom: 8px; }
.media-card p { font-size: 0.9rem; color: #666; }

/* === CONTACT === */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin: 32px 0; }
.contact-info { background: var(--light); border-radius: 12px; padding: 32px; }
.contact-info h3 { color: var(--primary); margin-bottom: 24px; }
.contact-item { margin-bottom: 20px; }
.contact-item h4 { font-size: 0.9rem; color: var(--dark); margin-bottom: 4px; }
.contact-item p { color: #555; }
.social-links { display: flex; gap: 12px; margin-top: 24px; }
.social-links a { display: inline-block; padding: 8px 16px; background: var(--primary); color: #fff; border-radius: 8px; font-size: 0.9rem; }
.social-links a:hover { background: var(--primary-dark); }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .nav-links { gap: 2px; }
  .nav-links a { padding: 8px 10px; font-size: 0.85rem; }
  .about-grid { grid-template-columns: 1fr; }
  .about-img { order: -1; }
  .features { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .ql-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .org-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .membership-cards { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: block; margin-left: auto; }
  .container { padding: 0 16px; }
  .nav-inner { padding: 0 8px; }
  .hero-content h1 { font-size: 1.6rem; white-space: nowrap; }
  .hero { min-height: 400px; }
  .page-banner { min-height: 200px; }
  .page-banner h1 { font-size: 1.8rem; }
  .top-left span:last-child { display: none; }
  .ql-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
}
@media (max-width: 576px) {
  .quick-links { padding: 60px 0; }
  .ql-card { padding: 24px 20px; }
  .hero-btns { flex-direction: column; }
  .cta-btns { flex-direction: column; }
  .footer-bottom { flex-direction: column; }
}

/* === Safari button fixes === */
.hamburger, button.hamburger { -webkit-appearance: none !important; -webkit-tap-highlight-color: transparent !important; border: none !important; background: transparent !important; box-shadow: none !important; outline: none !important; }
.hamburger:focus, .hamburger:focus-visible { outline: none !important; box-shadow: none !important; }

/* === TEAM GRID === */
.team-section { margin: 40px 0; }
.team-section h2 { font-size: 1.8rem; color: var(--primary); margin-bottom: 24px; text-align: center; }
.team-row { display: flex; justify-content: center; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.team-card { text-align: center; width: 140px; }
.team-card img { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; object-position: center 30%; margin: 0 auto 8px; border: 3px solid var(--light); display: block; }
.team-card h4 { font-size: 0.9rem; color: var(--dark); margin-bottom: 2px; }
.team-card .t-title { font-size: 0.75rem; color: var(--primary); font-weight: 600; }
.team-card .t-org { font-size: 0.7rem; color: #888; }
@media (max-width: 768px) { .team-card { width: 100px; } .team-card img { width: 70px; height: 70px; object-position: center 30%; } .team-card h4 { font-size: 0.8rem; } .team-card .t-title, .team-card .t-org { font-size: 0.65rem; } }
/* === GOLD ACCENTS === */

/* Section headers: gold underline */
.section-header h2 { 
  color: var(--dark); 
  position: relative;
  display: inline-block;
}
.section-header h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 8px auto 0;
  border-radius: 2px;
}

/* Page banners: add gold accent line under h1 */
.page-banner h1 {
  position: relative;
}
.page-banner h1::after {
  content: "";
  display: block;
  width: 80px;
  height: 3px;
  background: var(--accent);
  margin: 12px auto 0;
  border-radius: 2px;
}

/* Quick link cards: gold h3 */
.ql-card h3 { color: var(--accent); }

/* Content h2: gold underline */
.content-main h2 {
  position: relative;
  padding-bottom: 8px;
}
.content-main h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background: var(--accent);
  margin-top: 8px;
  border-radius: 2px;
}

/* Sidebar h3: gold */
.sidebar-card h3 { color: var(--accent); }

/* Contact item h4: gold */
.contact-item h4 { color: var(--accent); }

/* Form inputs: gold focus border */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(212,175,55,0.2);
}

/* Membership card hover border: gold */
.membership-card:hover {
  border-color: var(--accent);
}

/* Social links: gold text */
.social-links a {
  display: inline-block;
  padding: 8px 20px;
  margin: 4px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  transition: all 0.2s;
}
.social-links a:hover {
  background: var(--accent);
  color: var(--white);
}

/* Breadcrumb: gold separator */
.page-banner .breadcrumb a:hover {
  color: var(--accent);
}

/* Nav active: gold underline */
.nav-links a.active {
  color: var(--accent);
  background: none;
  border-bottom: 2px solid var(--accent);
  border-radius: 0;
}

/* Section header h2 as capsule (news + quick-links) */
.news .section-header h2,
.quick-links .section-header h2 {
  display: inline-block;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  color: #fff;
  padding: 8px 24px;
  border-radius: 20px;
  font-size: 1.1rem;
  font-weight: 600;
}

/* News section header layout */
/* Capsule header layout: h2 on top, view-all text below centered */
.section-header-capsule {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 48px;
}
.section-header-capsule h2 {
  display: inline-block;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  color: #fff;
  padding: 8px 24px;
  border-radius: 20px;
  font-size: 1.1rem;
  font-weight: 600;
}
.section-header-capsule .view-all {
  display: block;
  margin-top: 12px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 400;
}
.section-header-capsule .view-all:hover {
  text-decoration: underline;
}
.section-header-capsule h2::after { display: none; }
