/* Amitié TV — Étape 9C : palette officielle et mise en page adaptative.
   Chargée après les feuilles de style précédentes, sans migration ni dépendance. */
:root {
  color-scheme: dark;
  --bg: #07142e;
  --surface: #0d2450;
  --surface2: #123467;
  --ink: #f6faff;
  --muted: #bdcce4;
  --line: #28528a;
  --coral: #f4434b; /* rouge du logo : appel à l'action */
  --gold: #ffde57;  /* jaune du logo : accent */
  --purple: #7357dd;
  --blue: #38cbf6;  /* cyan du logo : lumière */
  --amitie-cyan: #3ce1fa;
  --amitie-deep-blue: #0a2d77;
}
html { max-width: 100%; }
body { min-width: 0; max-width: 100%; background: var(--bg); }
img, video, svg, iframe { max-width: 100%; }
.container { max-width: 100%; }
:is(h1,h2,h3,p,a,span,button,label) { overflow-wrap: break-word; }
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 3px;
}

/* En-tête : bleu profond / reflet cyan et jaune. */
.utility-bar {
  background: #092458;
  color: #dbecff;
  border-bottom: 1px solid #1b4e92;
}
.site-header {
  background: linear-gradient(110deg,rgba(5,18,52,.98),rgba(9,35,87,.98));
  border-bottom: 1px solid rgba(56,203,246,.4);
  box-shadow: 0 9px 30px rgba(1,8,30,.16);
}
.site-header .header-inner { min-width: 0; gap: 12px; }
.site-header .brand { min-width: 0; }
.site-header .brand img, .site-footer .footer-brand img {
  width: 72px; height: 72px; border-radius: 13px; object-fit: contain;
  background: #092251; border: 1px solid rgba(80,211,250,.37);
}
.site-header .brand-copy small { color: #dbe8ff; font-size: 10px; letter-spacing: .07em; }
.site-header .primary-nav { min-width: 0; }
.site-header .primary-nav>a { transition: background .15s,color .15s; }
.site-header .primary-nav>a:hover,.site-header .primary-nav>a.active { color: var(--gold); }
.site-header .primary-nav>a.nav-donate {
  background: linear-gradient(115deg,#f13b51,#d92138);color:white;
  box-shadow: 0 5px 18px rgba(242,35,68,.2); border: 1px solid #ff6c70;
}
.site-header .primary-nav>a.nav-donate:hover { background: #e02436; color:white; }
.site-header .live-dot { background: #ff495e; box-shadow: 0 0 0 3px rgba(255,73,94,.19); }
.site-header .am-language { flex: 0 0 auto; margin-left: 4px; }
.site-header .am-language select,.am-admin-top-controls .am-language select {
  appearance: auto; color: #fff; background: #124080;
  border: 1px solid #4caada; border-radius: 10px; min-width: 60px;
  min-height: 42px; font-size: 13px; padding: 7px 8px;
}
.site-header .menu-toggle {
  flex-shrink: 0; color: white; background: #123d81;
  border: 1px solid #4694cb; border-radius: 11px;
  width: 46px; height: 44px;
}
.site-header .menu-toggle:hover, .site-header .menu-toggle[aria-expanded="true"] {
  background: #1d5ca7; border-color: var(--amitie-cyan);
}

/* Fond et cartes inspirés du logo, sans surcharge de couleurs vives. */
.hero {
  background: radial-gradient(ellipse at 83% 22%,rgba(39,188,247,.21),transparent 49%),
              radial-gradient(ellipse at 12% 70%,rgba(56,65,174,.13),transparent 55%),
              linear-gradient(125deg,#071536,#0a2c66 65%,#091c48);
  border-bottom: 1px solid #20538f;
}
.hero h1 span { background: linear-gradient(95deg,#ffdf56 5%,#3ce1fa 94%); background-clip:text; -webkit-background-clip:text; color:transparent; }
.hero-screen {
  background: linear-gradient(145deg,#173b8b,#0a2d66 55%,#08163e);
  border-color: rgba(72,207,255,.53);
  box-shadow: 0 28px 75px rgba(0,5,26,.45),inset 0 1px 0 #68bdf733;
}
.hero-screen::after {
  background: radial-gradient(circle at 47% 58%,#27dbfb1c 0,transparent 55%),radial-gradient(circle at 100% 0,#4258f94a 0,transparent 55%);
}
.hero-play { background: linear-gradient(135deg,#ffe768,#ffbb3b); color:#10213f; }
.btn-primary,.button.primary {
  background: linear-gradient(110deg,#ffe365,#ffc237);color:#15223d;
  border-color: #ffe873;
}
.btn-primary:hover,.button.primary:hover { filter: brightness(1.045); }
.text-link,.eyebrow,.section-kicker,.eyebrow-small { color: var(--gold); }
.show-card,.surface-panel,.bible-book-section,.bible-reading,.am-card {
  border-color: #28528a; background-color: #0d2248;
}
.show-card:hover { border-color: var(--blue); }
.split-feature,.bible-intro,.donation-panel,.podcast-player {
  background: linear-gradient(120deg,#102f75,#0a224e 70%,#0d3c7b);
  border-color: rgba(90,200,248,.4);
}
.show-art.theme-violet { background:linear-gradient(140deg,#5138ab,#164a9b); }
.show-art.theme-coral { background:linear-gradient(140deg,#d62e55,#2940a0); }
.show-art.theme-gold { background:linear-gradient(140deg,#d99a13,#1355a8); }
.play-chip { background:#ffdf56;color:#10254a; }
.bible-symbol { background:linear-gradient(135deg,#ffe279,#ffb84d);color:#213254; }
.donation-symbol { background:linear-gradient(135deg,#ffe76b,#f33e50); }
.site-footer { background:linear-gradient(120deg,#050d24,#0a224b); border-top:1px solid #22528d; }
.site-footer .footer-grid { min-width:0; }
.site-footer .footer-grid>div { min-width:0; }
.site-footer .footer-grid>div>a:not(.brand):hover { color:var(--gold); }
.site-footer .am-footer-credit a { color:#ffe071;text-decoration:underline; }
.footer-bottom { border-top-color:#23487e; }
/* Composants complémentaires */
.am-card a:not(.btn),.bible-legal a,.bible-side-home,.bible-reference { color:#ffe071; }
.am9-search-form,.am9-result,.am9-favorite { border-color:#28528a; }
.bible-book,.bible-side,.bible-result { background:#0c2451; border-color:#2d568b; }
.bible-verse-num,.bible-fav-button:hover { color:var(--gold); }
.bible-verse:target { background:rgba(255,222,87,.11); }

/* Sur les écrans habituels : menu déroulant afin que MG/EN/FR ne débordent jamais. */
@media (max-width: 1699px) {
  .site-header .header-inner { position:relative; display:flex; flex-wrap:nowrap; justify-content:space-between; }
  .site-header .brand { order:1; margin-right:auto; }
  .site-header .am-language { order:2; }
  .site-header .menu-toggle { display:flex; order:3; }
  .site-header .primary-nav {
    order:4; position:absolute; top:calc(100% - 1px); left:auto; right:0;
    width:min(390px,calc(100vw - 32px)); max-width:calc(100vw - 32px);
    max-height:min(75dvh,calc(100dvh - 105px));
    overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain;
    padding:12px; margin:0; display:none; flex-direction:column; align-items:stretch;
    gap:2px; font-size:14px; background:#071c45;
    border:1px solid #368fca; border-radius:0 0 15px 15px;
    box-shadow:0 22px 35px rgba(0,7,33,.65); z-index:80;
  }
  .site-header .primary-nav.is-open { display:flex; }
  .site-header .primary-nav>a {
    display:flex; flex:0 0 auto; width:100%; box-sizing:border-box;
    min-height:40px; padding:10px 13px; font-size:14px; line-height:1.4;
    white-space:normal; overflow-wrap:anywhere; border-radius:8px;
  }
  .site-header .primary-nav>a:hover, .site-header .primary-nav>a.active {background:#164c8f;}
  .site-header .primary-nav>a.nav-donate {justify-content:center;margin:8px 0 1px;}
}
/* Très grands écrans : menus sur une ou plusieurs lignes sans débordement. */
@media (min-width: 1700px) {
  .site-header .container { width:min(1650px,calc(100% - 64px)); }
  .site-header .primary-nav {flex:1 1 auto; display:flex; justify-content:flex-end; flex-wrap:wrap; gap:8px 14px; margin-left:auto;}
  .site-header .primary-nav>a { white-space:normal; text-align:center; line-height:1.28; }
  .site-header .menu-toggle {display:none;}
}
@media (max-width: 900px) {
  .hero-grid { gap:30px; }
  .footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap:28px; }
  .card-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .bible-reader-head {flex-wrap:wrap;}
}
@media (max-width: 600px) {
  .site-header .header-inner {min-height:74px;gap:9px;}
  .site-header .brand img { width:57px; height:57px; }
  .site-header .brand-copy {display:none;}
  .site-header .am-language {margin-left:auto;}
  .site-header .am-language select {min-width:58px;min-height:42px;}
  .site-header .primary-nav { width:calc(100vw - 32px); right:0; max-height:calc(100dvh - 113px); }
  .utility-inner { padding:0 4px; }
  .hero h1 {font-size:clamp(33px,10.5vw,48px); overflow-wrap:normal; word-break:normal;}
  .hero-screen-top,.hero-screen-bottom {flex-wrap:wrap;gap:8px;}
  .hero-screen-bottom a {white-space:normal;}
  .hero-actions {width:100%;}
  .footer-grid {grid-template-columns:1fr;}
  .footer-grid>div:first-child {grid-column:auto;}
  .footer-grid h3 {margin-bottom:12px;}
  .footer-bottom {align-items:flex-start;justify-content:flex-start;text-align:left;}
  .bible-book-columns,.bible-chapter-layout {grid-template-columns:minmax(0,1fr);}
  .bible-books-grid {grid-template-columns:repeat(2,minmax(0,1fr));}
  .bible-reading {padding:17px 13px;}
  .bible-verse {grid-template-columns:24px minmax(0,1fr) 32px;gap:8px;}
  .am-card,.donation-panel,.bible-intro {max-width:100%;}
  .am9-search-form>*,.am9-search-form input,.am9-search-form select {max-width:100%; min-width:0;}
}
@media (max-width: 360px) {
  .site-header .header-inner { gap:6px; }
  .site-header .brand img {width:51px;height:51px;}
  .site-header .menu-toggle {width:42px;height:42px;}
  .site-header .primary-nav {max-width:calc(100vw - 24px);width:calc(100vw - 24px);}
  .bible-books-grid {grid-template-columns:1fr;}
}

/* Administration : même identité visuelle, colonnes sans débordement. */
.admin-layout {min-width:0;}
.sidebar { background:linear-gradient(180deg,#071b49,#08112d); border-color:#28528a; min-width:0; }
.sidebar nav a {color:#d9e9ff;overflow-wrap:anywhere;}
.sidebar nav a:hover,.sidebar nav a.active {background:#174581;color:#ffe367;}
.admin-top,.admin-content {min-width:0;}
.admin-top {background:#091c45;border-color:#29548b;}
.admin-top a,.back-link {color:#ffe071;}
.admin-content .panel,.admin-content .stats>div {background:#0d2450;border-color:#27508b;min-width:0;}
.admin-content .stats strong {color:var(--gold);}
.admin-content .button.primary,.login-card .button.primary {background:linear-gradient(110deg,#ffe365,#ffc237);color:#15223d;}
.admin-content .button:not(.primary):not(.danger),.sidebar-bottom button {background:#15366f;border-color:#386ba1;}
.admin-content :is(input,select,textarea) {max-width:100%;}
.admin-logo img {border:1px solid #398cbe;box-shadow:0 8px 18px #0003;}
.admin-content .table-scroll {max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;}
.admin-content .pager {max-width:100%;overflow-x:auto;}
.login-page {background:radial-gradient(circle at 75% 10%,#1459b1,#07152c 65%);}
.login-card {border-color:#3775a7;background:#0e2451;}
.login-brand img {border:1px solid #3f9ed0;}
@media (max-width: 900px) {
  .admin-layout {grid-template-columns:minmax(0,1fr);}
  .sidebar {padding:15px;gap:15px;}
  .sidebar nav {display:flex;gap:6px;flex-wrap:wrap;}
  .sidebar nav a {font-size:12px;padding:9px 11px;}
  .sidebar-bottom {flex-wrap:wrap;}
  .admin-content {padding:20px 15px 36px;}
  .admin-top {padding:14px 15px;flex-wrap:wrap;}
  .admin-top strong {min-width:0;overflow-wrap:anywhere;}
  .am-admin-top-controls {flex-wrap:wrap;justify-content:flex-start;}
}
@media (max-width: 600px) {
  .admin-content .page-title {flex-direction:column;align-items:stretch;}
  .admin-content .stats {grid-template-columns:repeat(2,minmax(0,1fr));}
  .admin-content .stats>div {padding:13px;}
  .admin-content .panel {padding:16px;}
  .admin-content .actions,.admin-content .inline-actions {flex-wrap:wrap;}
  .admin-content table {width:max-content;min-width:100%;}
  .admin-content :is(input,textarea,select) {min-width:0;}
  .am9b-create-grid {grid-template-columns:1fr;}
  .am9b-role-select {min-width:0;max-width:100%;}
}
@media (prefers-reduced-motion:reduce) {
  .site-header .primary-nav>a,.btn,.show-card {transition:none;}
}
