/* =========================================================
   site.css — header, footer and shared components
   Loaded on every page (after style.css).
========================================================= */

html,body{max-width:100%;overflow-x:hidden}
img{max-width:100%;height:auto}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
:focus-visible{outline:3px solid rgba(208,0,25,.45);outline-offset:2px}

/* ---------- Header ---------- */
.brand{display:flex;align-items:center;text-decoration:none}
.brand-logo{display:block;width:180px;height:auto;max-width:100%;object-fit:contain}

.header-search-btn{width:44px;height:44px;min-width:44px;padding:0;border:0;border-radius:10px;background:#dc2626;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;-webkit-tap-highlight-color:transparent;transition:background .2s}
.header-search-btn:hover{background:#b91c1c}
.header-search-btn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

.mobile-menu-btn{display:none;width:44px;height:44px;min-width:44px;padding:0;border:0;background:transparent;color:inherit;cursor:pointer;flex-direction:column;align-items:center;justify-content:center;gap:5px;flex-shrink:0;-webkit-tap-highlight-color:transparent}
.mobile-menu-btn span{display:block;width:22px;height:2px;border-radius:2px;background:currentColor;transition:transform .2s,opacity .2s}
.mobile-menu-btn.is-open span:nth-child(1){transform:translateY(7px) rotate(45deg)}
.mobile-menu-btn.is-open span:nth-child(2){opacity:0}
.mobile-menu-btn.is-open span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}
.mobile-nav-extra{display:none}

/* Search popup */
.search-popup{position:fixed;inset:0;z-index:20000;display:none}
.search-popup.is-open{display:flex;align-items:flex-start;justify-content:center}
.search-popup-overlay{position:absolute;inset:0;background:rgba(0,0,0,.55)}
.search-popup-box{position:relative;z-index:1;width:min(560px,calc(100% - 32px));margin-top:120px;padding:24px;background:#fff;border-radius:16px;box-shadow:0 25px 70px rgba(0,0,0,.2);box-sizing:border-box}
.search-popup-header{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:18px}
.search-popup-header h2{margin:0;color:#111827;font-size:22px;font-weight:800}
.search-popup-close-icon{width:40px;height:40px;padding:0;border:0;border-radius:8px;background:#f3f4f6;color:#374151;font-size:25px;line-height:1;cursor:pointer}
.search-popup-form input{width:100%;height:50px;padding:0 14px;border:1px solid #d1d5db;border-radius:10px;background:#fff;color:#111827;font-size:16px;outline:none;box-sizing:border-box}
.search-popup-form input:focus{border-color:#dc2626;box-shadow:0 0 0 3px rgba(220,38,38,.1)}
.search-popup-actions{display:flex;gap:10px;margin-top:14px}
.search-submit-btn,.search-cancel-btn{min-height:44px;padding:0 18px;border-radius:9px;font-size:14px;font-weight:700;cursor:pointer}
.search-submit-btn{border:1px solid #dc2626;background:#dc2626;color:#fff}
.search-submit-btn:hover{background:#b91c1c}
.search-cancel-btn{border:1px solid #d1d5db;background:#fff;color:#374151}

@media (min-width:901px){
  .site-header{display:flex;align-items:center}
  .brand{flex:0 0 auto}
  .main-nav{margin-left:auto}
  .header-actions{margin-left:18px;display:flex;align-items:center}
}

@media (max-width:900px){
  body.menu-open,body.search-open{overflow:hidden}
  .topbar{min-height:36px;padding:7px 16px;display:flex;align-items:center;justify-content:center;text-align:center;box-sizing:border-box}
  .topbar-message{font-size:12px;line-height:1.4}
  .toplinks{display:none}
  .site-header{position:relative;z-index:10000;width:100%;min-height:68px;box-sizing:border-box;padding:10px 16px;display:flex;align-items:center;gap:8px}
  .brand{min-width:0;flex:1}
  .brand-logo{width:150px}
  .header-actions{display:flex;align-items:center;justify-content:flex-end;gap:2px;flex-shrink:0}
  .header-search-btn{background:transparent;color:#111827;width:44px;min-width:44px;height:44px}
  .header-search-btn:hover{background:transparent}
  .mobile-menu-btn{display:flex}
  .main-nav{position:absolute!important;top:calc(100% + 1px);left:0;right:0;z-index:10001!important;display:none;flex-direction:column;width:100%;box-sizing:border-box;padding:8px 16px 16px;background:#fff;border-top:1px solid rgba(0,0,0,.06);border-bottom:1px solid rgba(0,0,0,.08);box-shadow:0 15px 35px rgba(0,0,0,.1);max-height:calc(100vh - 105px);overflow-y:auto}
  .main-nav.mobile-open{display:flex!important}
  .main-nav>a{width:100%;min-height:46px;box-sizing:border-box;padding:12px 10px;display:flex;align-items:center;border-radius:10px;font-size:15px;text-decoration:none}
  .mobile-nav-extra{display:flex;flex-direction:column;margin-top:8px;padding-top:8px;border-top:1px solid rgba(0,0,0,.08)}
  .mobile-nav-extra a{min-height:44px;box-sizing:border-box;padding:11px 10px;display:flex;align-items:center;font-size:14px;text-decoration:none;border-radius:10px}
  .search-popup-box{width:calc(100% - 24px);margin-top:90px;padding:20px}
}
@media (max-width:480px){
  .topbar,.site-header{padding-left:12px;padding-right:12px}
  .brand-logo{width:135px}
}

/* ---------- Footer newsletter ---------- */
.newsletter .newsletter-title{margin:0 0 8px;font-size:22px;line-height:1.25;font-weight:800}

/* ---------- Footer ---------- */
.footer{background:#8b0000!important;color:#fff}
.footer a,.footer p,.footer-bottom,.footer-bottom span{color:#fff}
.footer-heading{margin:0 0 12px;font-size:16px;line-height:1.3;font-weight:800;color:#fff}
.footer-logo{display:block;width:190px;height:auto;max-width:100%;object-fit:contain}
.footer-bottom{border-top:1px solid rgba(255,255,255,.18)}

@media (min-width:901px){
  .footer-grid{display:grid;grid-template-columns:minmax(340px,1.6fr) repeat(3,minmax(150px,1fr));column-gap:55px;align-items:start}
  .footer-links{display:flex;flex-direction:column;align-items:flex-start}
  .footer-links>a{display:block;margin:0 0 8px;line-height:1.5;padding:2px 0}
  .footer-bottom{display:flex;align-items:center;justify-content:space-between;gap:30px}
}
@media (max-width:900px){
  .newsletter{width:100%;box-sizing:border-box;padding:34px 16px;display:flex;flex-direction:column;align-items:center;gap:22px;text-align:center}
  .newsletter-content{max-width:600px}
  .newsletter p{max-width:520px;margin:0 auto;line-height:1.6}
  .newsletter form{width:100%;max-width:520px;display:flex;flex-direction:column;gap:10px}
  .newsletter input,.newsletter button{width:100%;min-height:48px;box-sizing:border-box;font-size:16px;border-radius:10px}
  .footer{text-align:center}
  .footer-grid{display:flex;flex-direction:column;gap:28px;padding:34px 18px 30px;box-sizing:border-box}
  .footer-about{display:flex;flex-direction:column;align-items:center}
  .footer-logo{width:155px;margin:0 auto}
  .footer-about>p{max-width:390px;margin:12px auto 0;line-height:1.6}
  .footer-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:12px;row-gap:3px}
  .footer-links .footer-heading{grid-column:1/-1;margin:0 0 7px}
  .footer-links>a{min-height:44px;display:flex;align-items:center;justify-content:center;text-decoration:none;border-radius:7px}
  .footer-bottom{display:flex;flex-direction:column;align-items:center;gap:7px;padding:17px 16px calc(17px + env(safe-area-inset-bottom));background:rgba(0,0,0,.12)}
}

/* Back to top */
.back-to-top{position:fixed;right:24px;bottom:24px;z-index:9998;width:46px;height:46px;display:flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:50%;background:#111827;color:#fff;cursor:pointer;opacity:0;visibility:hidden;transform:translateY(12px);transition:opacity .2s,visibility .2s,transform .2s;box-shadow:0 8px 24px rgba(0,0,0,.18)}
.back-to-top span{font-size:23px;line-height:1}
.back-to-top.visible{opacity:1;visibility:visible;transform:none}
@media (max-width:900px){.back-to-top{right:16px;bottom:calc(16px + env(safe-area-inset-bottom));width:44px;height:44px}}

/* =========================================================
   SHARED PAGE COMPONENTS (homepage + lyrics page)
========================================================= */
.page-wrap{width:calc(100% - 112px);max-width:1422px;margin:0 auto;padding:24px 0 42px;color:#111;box-sizing:border-box}
.page-layout{display:grid;grid-template-columns:minmax(0,1fr) 372px;gap:40px;align-items:start}
.page-main,.page-sidebar{min-width:0}

.home-section{margin:0 0 28px}
.home-section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px}
.home-section-heading h2{font-size:22px;line-height:1.2;letter-spacing:-.5px;margin:0;font-weight:850;color:#101418}
.home-section-heading h2::before{content:"";display:inline-block;width:7px;height:22px;background:#d00019;border-radius:3px;margin-right:11px;vertical-align:-4px}
.home-section-heading>a{font-size:13px;font-weight:700;color:#b80016;text-decoration:none;white-space:nowrap;padding:8px 0}
.sidebar-heading h2{font-size:18px}

.home-song-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:13px}
.home-song-card{display:block;min-width:0;text-decoration:none;color:#101418}
.home-song-cover{position:relative;aspect-ratio:1.36/1;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#69211b,#e0a25d)}
.home-song-cover img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .25s}
.home-song-card:hover .home-song-cover img{transform:scale(1.04)}
.home-song-title{display:block;font-size:13px;line-height:1.25;font-weight:800;margin-top:7px;overflow-wrap:anywhere}
.home-song-artist{display:block;color:#5f6773;font-size:12px;line-height:1.3;margin-top:4px}
.home-song-card.home-hidden{display:none!important}
.home-view-more-wrap{text-align:center;margin:16px 0 0}
.home-view-more{display:inline-block;min-width:150px;min-height:44px;box-sizing:border-box;border:1px solid #d00019;border-radius:7px;padding:12px 22px;background:#fff;color:#b80016;font-size:13px;font-weight:800;cursor:pointer;text-decoration:none}
.home-view-more:hover{background:#b80016;color:#fff}

.home-sidebar-card{border:1px solid #eceef1;border-radius:11px;background:#fff;padding:16px;margin-bottom:18px}
.home-trending-row{display:grid;grid-template-columns:20px 64px minmax(0,1fr) 14px;gap:11px;align-items:center;padding:6px 0;border-bottom:1px solid #eee;text-decoration:none;color:#111}
.home-trending-row:last-child{border-bottom:0}
.home-trending-rank{font-size:14px;font-weight:800;text-align:center}
.home-trending-thumb{width:64px;height:48px;border-radius:6px;overflow:hidden;background:#eee}
.home-trending-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.home-trending-info{min-width:0}
.home-trending-info strong{display:block;font-size:13px;line-height:1.2;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.home-trending-info small{display:block;color:#5f6773;font-size:12px;margin-top:4px}
.home-trending-arrow{color:#6b7280;font-size:21px}

.home-newsletter{background:linear-gradient(115deg,#79000b,#c40019 70%,#a30012);color:#fff;border-radius:10px;padding:18px 16px;margin-bottom:17px}
.home-newsletter h2{font-size:16px;margin:0 0 6px;font-weight:850;color:#fff}
.home-newsletter p{font-size:12px;line-height:1.45;margin:0 0 12px;max-width:300px}
.home-newsletter form{display:flex;background:#fff;border-radius:8px;padding:3px;gap:4px}
.home-newsletter input{width:100%;min-width:0;border:0;outline:0;padding:10px 8px;font-size:14px;border-radius:6px}
.home-newsletter button{border:0;border-radius:7px;background:#b80016;color:#fff;font-size:12px;font-weight:800;padding:0 13px;min-height:40px;cursor:pointer}

.home-blog-row{display:grid;grid-template-columns:99px minmax(0,1fr);gap:12px;align-items:center;text-decoration:none;color:#111;margin:0 0 10px}
.home-blog-thumb{width:99px;height:55px;border-radius:6px;overflow:hidden;background:#eee}
.home-blog-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.home-blog-row strong{display:block;font-size:12px;line-height:1.25;font-weight:750}
.home-blog-row small{display:block;font-size:11px;color:#5f6773;margin-top:4px}

@media (min-width:901px) and (max-width:1200px){
  .page-wrap{width:calc(100% - 48px)}
  .page-layout{grid-template-columns:minmax(0,1fr) 300px;gap:24px}
  .home-song-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media (max-width:900px){
  .page-wrap{width:calc(100% - 44px)}
  .page-layout{grid-template-columns:1fr}
  .page-sidebar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
  .home-sidebar-card,.home-newsletter{margin-bottom:0}
  .home-song-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:600px){
  .page-wrap{width:auto;padding:18px 14px 30px}
  .page-sidebar{display:block}
  .home-sidebar-card,.home-newsletter{margin-bottom:15px}
  .home-section{margin-bottom:25px}
  .home-section-heading h2{font-size:19px}
  .home-song-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 11px}
  .home-trending-thumb{width:58px;height:45px}
  .home-trending-row{grid-template-columns:18px 58px minmax(0,1fr) 12px;gap:8px}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

/* Thin red outline below the header */
.site-header {
    border-bottom: 1px solid #b00000;
}