/* 123Movies shared header/footer, based on /home screenshot (public pages only).
   Shared public site header/footer styling plus unified page width and responsive poster grids. */
/* Site-wide page width: match the 1440px homepage content area.
   Older public pages used an 1180px main.css limit or a 1170px
   Bootstrap .container. This updates layout width only; components,
   columns, video players and database queries are unchanged. */
body .site-container {
  width: calc(100% - 56px);
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
}
/* Legacy detail and category pages using Bootstrap instead. */
body #main.page-detail > .container,
body #main.page-category > .container {
  width: calc(100% - 56px);
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 650px) {
  body .site-container,
  body #main.page-detail > .container,
  body #main.page-category > .container {
    width: calc(100% - 28px);
  }
}

body .ref-header, body .ref-footer { box-sizing: border-box; color: #f3f5f7; font-family: Arial, Helvetica, sans-serif; }
body .ref-header *, body .ref-footer * { box-sizing: border-box; }
body .ref-header .site-container, body .ref-footer .site-container { width: calc(100% - 56px); max-width: 1440px; margin-left: auto; margin-right: auto; }
body .ref-header { background:#0b1117; border-bottom:1px solid #252c34; position:relative; z-index:120; width:100%; }
body .ref-header .ref-header-inner { min-height:80px; display:flex; align-items:center; gap:32px; }
body .ref-header .ref-brand { flex:0 0 auto; display:flex; align-items:center; text-decoration:none; }
body .ref-header .ref-logo-text, body .ref-footer .ref-logo-text { color:#f7f9fc; font-size:26px; line-height:1; font-weight:1000; font-style:italic; letter-spacing:-.09em; white-space:nowrap; }
body .ref-header .ref-logo-text i, body .ref-footer .ref-logo-text i { font-style:italic; }
body .ref-header .ref-logo-text b, body .ref-footer .ref-logo-text b { color:#fa4350; font-weight:1000; }
body .ref-header .ref-nav { flex:1 1 auto; align-self:stretch; display:flex; align-items:stretch; gap:25px; min-width:0; }
body .ref-header .ref-nav > a, body .ref-header .ref-nav-dropdown > a { position:relative; display:flex; align-items:center; height:100%; color:#d6dce3; text-decoration:none; font:800 12px/1.2 Arial,Helvetica,sans-serif; letter-spacing:.06em; white-space:nowrap; }
body .ref-header .ref-nav > a:hover, body .ref-header .ref-nav-dropdown > a:hover, body .ref-header .ref-nav > a.is-current, body .ref-header .ref-nav-dropdown > a.is-current { color:#fff; }
body .ref-header .ref-nav > a.is-current::after, body .ref-header .ref-nav-dropdown > a.is-current::after { content:""; display:block; position:absolute; bottom:0; left:0; right:0; height:3px; background:#f24653; }
body .ref-header .ref-nav-dropdown { position:relative; }
body .ref-header .ref-dropdown-panel { min-width:166px; position:absolute; top:100%; left:-15px; display:none; padding:9px; border:1px solid #2a343f; border-radius:0 0 10px 10px; background:#121921; box-shadow:0 18px 30px rgba(0,0,0,.3); z-index:130; }
body .ref-header .ref-nav-dropdown:hover .ref-dropdown-panel, body .ref-header .ref-nav-dropdown:focus-within .ref-dropdown-panel { display:grid; gap:2px; }
body .ref-header .ref-dropdown-panel a { display:block; padding:9px 11px; color:#d6dce3; text-decoration:none; font:500 12px/1.25 Arial,Helvetica,sans-serif; border-radius:5px; letter-spacing:0; }
body .ref-header .ref-dropdown-panel a:hover { color:#fff; background:#25313c; }
/* Search is one seamless control: focus highlight wraps the entire field,
   never the text input alone. Selector strength protects against legacy form CSS. */
body .ref-header form.ref-search {
  position:relative; flex:0 1 340px; width:340px; min-width:0; height:44px;
  margin:0 0 0 auto; padding:4px 5px 4px 0;
  display:flex; align-items:center; gap:0;
  background:#121b25; border:1px solid #35404d; border-radius:11px;
  box-shadow:0 2px 9px rgba(0,0,0,.12);
  overflow:visible; transition:border-color .18s ease,box-shadow .18s ease;
}
body .ref-header form.ref-search:hover { border-color:#576779; }
body .ref-header form.ref-search:focus-within {
  border-color:#ed4957;
  box-shadow:0 0 0 3px rgba(237,73,87,.16);
}
body .ref-header form.ref-search input[type="search"] {
  appearance:none; -webkit-appearance:none;
  display:block; flex:1 1 auto; min-width:0; width:0; height:100%;
  margin:0; padding:0 15px;
  border:0!important; border-radius:0; outline:0!important;
  background:transparent!important; color:#f2f5f8;
  box-shadow:none!important; font:400 13px/1.3 Arial,Helvetica,sans-serif;
}
body .ref-header form.ref-search input[type="search"]:focus,
body .ref-header form.ref-search input[type="search"]:focus-visible {
  border:0!important; outline:0!important; box-shadow:none!important;
}
body .ref-header form.ref-search input[type="search"]::placeholder { color:#9aa9b9; opacity:1; }
body .ref-header form.ref-search input[type="search"]::-webkit-search-decoration { -webkit-appearance:none; }
body .ref-header form.ref-search button[type="submit"] {
  flex:0 0 36px; width:36px; min-width:36px; height:34px;
  margin:0; padding:0; display:grid; place-items:center;
  border:0; border-radius:8px; outline:0;
  background:#263341; color:#ecf1f6; box-shadow:none;
  cursor:pointer; transition:background-color .18s ease,color .18s ease;
}
body .ref-header form.ref-search button[type="submit"]:hover,
body .ref-header form.ref-search button[type="submit"]:focus-visible {
  background:#ed4957; color:#fff;
}
body .ref-header form.ref-search button[type="submit"] svg { display:block; width:17px; height:17px; }
body .ref-header .ref-search-suggest { position:absolute; z-index:150; top:calc(100% + 6px); right:0; left:0; max-height:420px; overflow:auto; border:1px solid #2a3745; border-radius:8px; background:#111923; box-shadow:0 18px 35px #000b; color:#eef3f7; }
body .ref-header .ref-search-suggest[hidden] { display:none!important; }
body .ref-header .ref-search-suggest a { color:#e5ebf0; }
body .ref-header .ref-search-suggest a:hover, body .ref-header .ref-search-suggest a.is-active { background:#293543; color:#fff; }
body .ref-header .ref-menu-toggle { display:none; border:0; background:transparent; padding:12px; cursor:pointer; }
body .ref-header .ref-menu-toggle span { width:22px; height:2px; display:block; margin:4px 0; background:#f2f5f8; }
body .ref-header a:focus-visible, body .ref-header button:focus-visible, body .ref-footer a:focus-visible { outline:2px solid #fb626c; outline-offset:3px; }
body .ref-header form.ref-search button[type="submit"]:focus-visible { outline:0; }
/* Shared footer, same proportions and typography as /home. */
body .ref-footer { border-top:1px solid #27313c; background:#101720; padding:67px 0 30px; width:100%; }
body .ref-footer .ref-footer-cols { display:grid; grid-template-columns:2fr repeat(4,1fr); gap:55px; }
body .ref-footer .ref-footer-home { text-decoration:none; display:inline-block; }
body .ref-footer .ref-footer-brand .ref-logo-text { display:inline-block; font-size:34px; }
body .ref-footer .ref-footer-brand p { color:#aab6c2; font-size:12px; line-height:1.7; max-width:345px; margin-top:19px; }
body .ref-footer h4 { font:800 13px/1.3 Arial,Helvetica,sans-serif; margin:0 0 16px; color:#fff; }
body .ref-footer .ref-footer-cols a, body .ref-footer .ref-footer-cols span:not(.ref-logo-text) { display:block; font:400 12px/1.4 Arial,Helvetica,sans-serif; color:#c5d0da; text-decoration:none; margin-bottom:12px; }
body .ref-footer .ref-footer-cols a:hover { color:#ff5e69; }
body .ref-footer .ref-footer-bottom { display:flex; justify-content:space-between; align-items:center; gap:20px; flex-wrap:wrap; margin-top:42px; padding-top:22px; border-top:1px solid #26303a; color:#8393a2; font-size:10px; line-height:1.5; }
body .ref-footer .ref-footer-bottom a { color:#ff777d; text-decoration:none; }
@media(max-width:1250px) {
  body .ref-header .ref-header-inner { gap:20px; }
  body .ref-header .ref-nav { gap:17px; }
  body .ref-header form.ref-search { flex-basis:265px; }
  body .ref-footer .ref-footer-cols { gap:30px; }
}
@media(max-width:980px) {
  body .ref-header .ref-menu-toggle { display:block; margin-left:auto; order:3; }
  body .ref-header .ref-header-inner { flex-wrap:wrap; min-height:70px; }
  body .ref-header .ref-nav { display:none; order:4; width:100%; flex:0 0 100%; height:auto; padding:8px 0 18px; gap:0; flex-direction:column; }
  body .ref-header .ref-nav.is-open { display:flex; }
  body .ref-header .ref-nav > a, body .ref-header .ref-nav-dropdown > a { display:block; padding:11px 13px; height:auto; }
  body .ref-header .ref-nav > a.is-current::after, body .ref-header .ref-nav-dropdown > a.is-current::after { height:auto; top:5px; bottom:5px; left:0; right:auto; width:3px; }
  body .ref-header .ref-dropdown-panel { position:static; display:none; box-shadow:none; }
  body .ref-header .ref-nav-dropdown:hover .ref-dropdown-panel, body .ref-header .ref-nav-dropdown:focus-within .ref-dropdown-panel { display:grid; }
  body .ref-header form.ref-search { margin-left:auto; flex:0 1 300px; order:2; }
  body .ref-footer .ref-footer-cols { gap:25px; }
}
@media(max-width:650px) {
  body .ref-header .site-container, body .ref-footer .site-container { width:calc(100% - 28px); }
  body .ref-header .ref-header-inner { gap:10px; padding-top:9px; padding-bottom:9px; }
  body .ref-header .ref-brand .ref-logo-text { font-size:22px; }
  body .ref-header form.ref-search { flex:1 1 100%; width:100%; order:4; height:42px; }
  body .ref-header .ref-menu-toggle { order:2; }
  body .ref-header .ref-nav { order:5; }
  body .ref-footer .ref-footer-cols { grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
  body .ref-footer .ref-footer-brand { grid-column:1 / -1; }
  body .ref-footer { padding-top:40px; }
  body .ref-footer .ref-footer-bottom { gap:12px; }
}

/* ---------------------------------------------------------
   Site-wide poster grids: match the 8-across desktop homepage.
   Only poster collections are targeted. Filter controls,
   sliders, videos, and the 6-across decade tiles are untouched.
   Keep the same breakpoints as css/home-reference.css.
   --------------------------------------------------------- */
@media (min-width: 1251px) {
  body .movies-grid,
  body .tvseries-grid,
  body .catalog-grid,
  body .discover-poster-grid,
  body .history-grid,
  body .related-grid,
  body .tv-related-grid,
  body .watch-related-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}
@media (min-width: 981px) and (max-width: 1250px) {
  body .movies-grid,
  body .tvseries-grid,
  body .catalog-grid,
  body .discover-poster-grid,
  body .history-grid,
  body .related-grid,
  body .tv-related-grid,
  body .watch-related-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
@media (min-width: 651px) and (max-width: 980px) {
  body .movies-grid,
  body .tvseries-grid,
  body .catalog-grid,
  body .discover-poster-grid,
  body .history-grid,
  body .related-grid,
  body .tv-related-grid,
  body .watch-related-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 381px) and (max-width: 650px) {
  body .movies-grid,
  body .tvseries-grid,
  body .catalog-grid,
  body .discover-poster-grid,
  body .history-grid,
  body .related-grid,
  body .tv-related-grid,
  body .watch-related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 380px) {
  body .movies-grid,
  body .tvseries-grid,
  body .catalog-grid,
  body .discover-poster-grid,
  body .history-grid,
  body .related-grid,
  body .tv-related-grid,
  body .watch-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
