/* AOU CENTRALIZED PATHS: edit in repo, then aou-deploy */
/* PATH: aou/core/static/css/styles.css
   AOU CLEAN CSS — consolidated & organized (2025-10-04)
   - Site-wide styles (EXCLUDES header + footer)
*/

/* ===== Theme tokens ===== */
:root {
  --aou-red:  #7D0F1E;
  --aou-blue: #002D72;
  --aou-gold: #F4A300;
}

/* ===== Base ===== */
* { box-sizing: border-box; }
body { margin:0; font-family: system-ui, Arial, sans-serif; background:#f7f7fb; color:#111; }

/* ===== Layout & Containers ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.main-content { padding: 40px 0; min-height: 60vh; }

/* ========================================================================== */
/*  BUTTONS / ACTIONS                                                         */
/* ========================================================================== */
.auth-actions { display:flex; gap:10px; align-items:center; }
.btn {
  display:inline-block; padding:10px 16px; border-radius:999px; text-decoration:none;
  cursor:pointer; font-weight:700; letter-spacing:.2px; border:2px solid transparent;
  transition: all .2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #4f9aff, #1a6bff); color:#fff;
  box-shadow: 0 8px 20px rgba(1,63,190,.35);
}
.btn-primary:hover { box-shadow: 0 10px 24px rgba(1,63,190,.5); }
.btn-outline { background:transparent; color:#fff; border-color:#9fc2ff; }
.btn-outline:hover { background: rgba(255,255,255,.12); }

/* ========================================================================== */
/*  CARDS / CONTENT                                                           */
/* ========================================================================== */
.card {
  background:#fff; border-radius:12px; padding:24px; margin:20px 0;
  border:1px solid #ececec; box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.card-title { margin:0 0 12px; font-size:1.25rem; font-weight:600; color:var(--aou-blue); }
.card-text  { margin:0 0 12px; line-height:1.6; }

/* Headings */
.h1 { font-size:2.2rem; font-weight:700; color:var(--aou-blue); margin:0 0 1rem; line-height:1.2; }
.section-title {
  font-size:1.5rem; font-weight:600; color:var(--aou-blue);
  margin:0 0 1.5rem; border-bottom:2px solid var(--aou-gold); padding-bottom:.5rem;
}

/* ========================================================================== */
/*  ABOUT PAGE                                                                */
/* ========================================================================== */
.hero-card { display:grid; grid-template-columns:160px 1fr; gap:24px; align-items:start; }
.hero-media { display:flex; align-items:center; justify-content:center; }
.avatar-hero {
  width:160px; height:160px; border-radius:50%; object-fit:cover; box-shadow:0 12px 24px rgba(0,0,0,.15);
}
.avatar-hero.placeholder {
  display:grid; place-items:center; background:#e7eefc; color:#1a2a5a; font-weight:800; font-size:28px;
  border-radius:50%; width:160px; height:160px;
}
.hero-body .lead { font-size:1.1rem; margin:.5rem 0 .75rem; line-height:1.6; }

.profile-card { text-align:center; padding:20px; }
.profile-card .avatar {
  width:96px; height:96px; border-radius:50%; object-fit:cover; margin:0 auto 12px; box-shadow:0 8px 16px rgba(0,0,0,.1);
}
.profile-card .avatar.placeholder { display:grid; place-items:center; background:#f0f4ff; color:#1a2a5a; font-weight:800; }
.profile-card .em { font-style:italic; color:#333; }

/* Brands grid */
.brand-grid { display:grid; gap:20px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.brand-tile {
  display:block; text-decoration:none; color:inherit; background:#fff; border:1px solid #e9e9ef;
  border-radius:12px; padding:20px; transition: all .3s ease;
}
.brand-tile:hover { transform: translateY(-2px); box-shadow:0 10px 22px rgba(0,0,0,.15); border-color: var(--aou-blue); }
.brand-tile img { width:100%; height:64px; object-fit:contain; }
.brand-name { font-weight:700; margin-top:12px; color:var(--aou-blue); }
.brand-blurb { color:#555; font-size:.9rem; margin-top:8px; }

/* ========================================================================== */
/*  GRID HELPERS / UTILITIES                                                  */
/* ========================================================================== */
.grid { display:grid; gap:20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.muted { color:#666; font-style:italic; }
.lead  { font-size:1.1rem; line-height:1.6; color:#333; }
.link { color:var(--aou-blue); text-decoration:none; }
.link:hover { text-decoration:underline; color:var(--aou-red); }
.badge { display:inline-block; font-size:.75rem; background:var(--aou-gold); color:#111; padding:4px 10px; border-radius:999px; margin-right:8px; }

/* ========================================================================== */
/*  RESPONSIVE (max-width: 1024px) — general                                  */
/* ========================================================================== */
@media (max-width: 1024px) {
  .auth-actions { justify-content:flex-start; }
  .container { padding: 0 16px; }
  .main-content { padding: 20px 0; }
  .h1 { font-size: 1.8rem; }

  /* Stack common grids */
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero-card { grid-template-columns: 1fr; text-align:center; }
  .brand-grid { grid-template-columns: 1fr; }
}

/* ========================================================================== */
/*  A11y: visible keyboard focus (non-header)                                  */
/* ========================================================================== */
/* Add page-specific focus styles here as needed */

/* === AOU: NEWS CARDS === */
/* === AOU NEWS CARD IMG STANDARD 2025-10-11 === */
.news-card .card-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: clamp(160px, 28vw, 240px);
  object-fit: cover;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
.section-latest-news { margin-top: 20px; }
.section-latest-news .grid { 
  /* keep 2-up on wide, stack nicely on narrow */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.news-card { 
  padding: 0; 
  overflow: hidden; 
}

.news-card .news-body { 
  padding: 16px 20px 20px; 
}
.news-card .card-title { 
  margin: 0 0 6px; 
  font-size: 1.1rem; 
}
.news-card .muted { 
  margin: 0 0 10px; 
}

/* responsive tweak */
@media (max-width: 1024px) {
  
}

/* === Latest News layout (homepage) === */
.section-latest-news { margin: 28px 0; }
.section-latest-news .grid-2 { grid-template-columns: repeat(2, 1fr); gap: 24px; }
.news-card { padding: 0; overflow: hidden; }


.news-card .card-title { padding: 16px 20px 4px; margin:0; }
.news-card .muted      { padding: 0 20px 6px; }
.news-card .card-text  { padding: 0 20px 20px; }

/* Smaller screens: stack to 1 column and reduce image height */
@media (max-width: 1024px) {
  .section-latest-news .grid-2 { grid-template-columns: 1fr; }
  
}
@media (max-width: 640px) {
  
}

/* === AOU NEWS IMAGE FIX 2025-10-11 ===
   Ensure news images never render oversized and scale nicely on all screens.
   We keep object-fit:cover, but use clamp() for height and force max-width. */


/* === AOU NEWS DETAIL STANDARD 2025-10-11 ===
   - Comfortable reading width for article
   - Sensibly capped hero image (works across zooms and large monitors)
   - Readable line height and spacing
*/
.news-detail .card { 
  max-width: 860px;     /* classic reading width */
  margin: 0 auto; 
}
.news-detail .h1 { 
  margin-bottom: .25rem;
}
.news-detail .muted { 
  color: #666;
  margin-bottom: .75rem;
}
.news-detail .card-text { 
  line-height: 1.7; 
  font-size: 1rem;
}

/* Centered hero with sane caps for both width and height */
.news-hero { 
  display: flex; 
  justify-content: center; 
  margin: 16px 0 20px; 
}
.news-hero-img {
  display: block;
  width: min(100%, 680px);          /* cap width for large screens */
  height: auto;
  max-height: clamp(220px, 45vh, 420px); /* avoid towering images at low zoom */
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}

/* Mobile refinement */
@media (max-width: 640px) {
  .news-detail .card { max-width: 94vw; }
  .news-hero-img { width: 100%; max-height: 320px; border-radius: 12px; }
}
