/* ================ GLOBAL ====================== */
*
{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body
{
    font-family: 
    "Microsoft YaHei",      /* Windows Simplified Chinese */
    "Microsoft JhengHei",   /* Windows Traditional Chinese */
    "PingFang SC",          /* macOS Simplified Chinese */
    "PingFang TC",          /* macOS Traditional Chinese */
    "WenQuanYi Micro Hei",  /* Linux Simplified */
    "Heiti TC",             /* macOS Traditional Chinese backup */
    "Arial",                /* English fallback */
    sans-serif;             /* generic fallback */
    min-height: 100vh;
    background-color: #F4F6F7;
    color: #2C3E50;
    overflow-y: auto;
}

p { padding: 5px 0 5px 0; }

/* ================ HEADER ====================== */
header
{
    position: fixed;
    top: 0;
    left: 0;
    padding: 5px 0 5px 100px;
    width: 100%;
    height: 120px;
    background: rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    z-index: 1000;
    background-image: url('images/header.png');
    background-repeat: no-repeat;
    background-size: cover;
    /*position: relative;*/
}

/* -- Brightness overlay -- */
header::before
{
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.35); /* increase brightness */
    pointer-events: none;
}

/* -- Keep header content above overlay -- */
header img, header h1
{
    position: relative;
    z-index: 2;
}
/* -- logo -- */
.header-logo
{
    max-height: 100%;        /* never taller than header */
    max-width: 100%;         /* never wider than header */
    object-fit: contain;     /* keeps whole image visible */
}
/* ================ NAV MENU BAR ================ */
nav
{
  position: fixed;
  top: 120px;
  left: 0;
  width: 100%;
  background: #441803;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 90px;
  z-index: 999;
  height: 40px;
}

/* -- left nav menu -- */
.menu-left
{
  list-style: none;
  display: flex;
  gap: 20px;
}

.menu-left span
{
  color: yellow;
  text-decoration: none;
  padding: 6px 6px;
}

.menu-left a
{
  color: white;
  text-decoration: none;
  padding: 6px 6px;
}

.menu-left a:hover
{
  color: white;
  /*background-color: #7FB3A6;*/
  background-color: #FF7421;
  border-radius: 2px;
}

/* -- right nav menu -- */
.menu-right
{
  list-style: none;
  display: flex;
  gap: 10px;
}

.menu-right a
{
  color: white;
  text-decoration: none;
  padding: 0 2px 0 2px;
}

.menu-right a:hover
{
  color: white;
  background-color: #FF7421;
  /*padding: 2px;*/
  /*border-radius: 1px;*/
}

/* -- nav menu font -- */
.menu-font-en { font-size: 16px; }
.menu-font-ch { font-size: 20px; }

.menu-word
{
  display: inline-block;       /* keeps it inline with text */
  background:#000000;
  border: 1px solid #D4AF37;
}

/* -- Hamburger icon for top menu -- */
.hamburger
{
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.hamburger div
{
  width: 25px;
  height: 3px;
  background: white;
}

/* ================ MAIN CONTAINER ============== */
.container
{
  position: absolute;
  top: 160px;
  bottom: 35px;
  width: 100%;
  display: flex;
  overflow: hidden;
}

/* ================ SIDEBAR ===================== */
.sidebar
{
  position: fixed;
  top: 160px;
  bottom: 35px;
  width: 200px;
  padding: 10px;
  overflow-y: auto;
  background-image: url('images/linksbg.png'), url('images/leftnav.png');
  background-position: center bottom, top left;
  background-repeat: no-repeat, repeat;
  background-size: 190px auto, auto;
  z-index: 900;
    /*background: #E5E8E8;*/
}

.sidebar-menu { list-style: none; }
.sidebar-menu li { margin-bottom: 10px; }

.sidebar-menu a
{
  display: block;
  padding: 5px;
  text-decoration: none;
  color: #2C3E50;
  background: #FFFFFF;
  border-radius: 4px;
  /*font-size: 14px;*/
}

.sidebar-menu span
{
  display: block;
  padding: 5px;
  text-decoration: none;
  color: green;
  font-weight: 600;
  border-color: #FFFFFF;
  border-style: solid;
  border-radius: 4px;
}

.sidebar-font-en { font-size: 16px; }
.sidebar-font-ch { font-size: 20px; }

.sidebar-menu a:hover
{
  background: #D6EAF8;
  border-left-color: #5DADE2;
  font-weight: 600;
}

/* ================ SEPARATOR =================== */
.separator
{
  position: fixed;
  top: 160px;
  left: 200px;       /* same as sidebar width */
  bottom: 35px;
  width: 6px;
  background: #D0D3D4;
  z-index: 850;
}

/* ================ CONTENT AREA ================ */
.content
{
  position: absolute;       /* use absolute instead of fixed */
  top: 160px;               /* below header */
  left: 206px;              /* to the right of sidebar */
  right: 0px;              /* leave some margin */
  bottom: 35px;             /* above footer */
  overflow-y: auto;         /* scroll inside content if needed */
  font-family: sans-serif;
  font-size: 20px;
  color: #2C3E50;
  background-size: auto 100%;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* -- Content title -- */
.content-title
{
  font-size: 30px;
  font-weight: bold;
  color: #9A1212;
  margin: 20px 0 20px 10px;
}

section { padding: 10px; }

.sectbg
{
  background-repeat: repeat;               /* Repeat in both directions */
  background-position: top left;           /* Start at top-left corner */
  background-size: auto;                   /* Keep original size of the image */
  background-attachment: fixed;
}

.sectbg.bg1 { background-image: url('images/background/section1.png'); }
.sectbg.bg2 { background-image: url('images/background/section2.png'); }
.sectbg.bg3 { background-image: url('images/background/section3.png'); }
.sectbg.bg4 { background-image: url('images/background/section4.png'); }
.sectbg.bg5 { background-image: url('images/background/section5.png'); }

/* -- Wrapper for columns -- */
.content-wrapper
{
  display: flex;           /* side by side */
  flex-wrap: wrap;         /* wrap on smaller screens */
  gap: 20px;               /* spacing between columns */
  width: 100%;             /* full width of content area */
  padding-left: 10px;
  box-sizing: border-box;
}

/* -- Base column style -- */
.content-column { box-sizing: border-box; }

/* -- Preset sizes -- */
.content-column.small  { flex: 0 0 calc(25% - 10px); }
.content-column.medium { flex: 0 0 calc(50% - 10px); }
.content-column.large  { flex: 0 0 calc(75% - 10px); }

/* ================ FOOTER ====================== */
footer
{
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 35px;
  padding-right: 10px;
  background: #2c3e50;
  color: white;
  display: flex;
  align-items: center;
  justify-content: right;
  background-image: url('images/footer.gif');
}

/* ================ Only for Sermon table ======= */
#playerContainer { padding:10px; background:#fff;}
#sermonTableContainer { padding:15px; }
#sermonTableContainer table { width:90%; border-collapse:collapse; margin:auto; }
#sermonTableContainer table th,
#sermonTableContainer table td { border:1px solid #ddd; padding:8px; text-align:left; }
#sermonTableContainer table th { background:#ffff00; }
#sermonTableContainer table tr.active { background:#fae0b6; }
#sermonTableContainer table tr:hover { background:#ffff88; cursor:pointer; }

/* ================ Table ===================*/
table
{
  width: 100%;
  border-collapse: separate;
  border-spacing: 1px;
}

td
{
  padding: 0px;
	vertical-align: top;
}

td:first-child
{
	white-space: nowrap;
	width: 1%;
}

/* ================ Back to Top link ============ */
#backtop
{
  display: none;
  text-decoration: none;
  color: #9A1212;
  font-size: 16px;
  text-align: right;
}

/* ================ RESPONSIVE ================== */
@media (max-width: 800px)
{
  /* -- header -- */
  header
  {
    position: relative;
    padding: 5px;
    /*height: 100px;*/
  }
  .header-logo { max-height: 100%; }   /* scales down automatically */

  /* -- nav menu -- */
  nav
  {
    position: relative;
    top: 0;
    margin-top: 0;
    padding: 0 20px 0 20px;
  }

  /* -- Hamburger menu visible -- */
  .hamburger { display: flex; }
  .menu-left
  {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #34495e;
    padding: 10px 0;
    z-index: 2000;
  }
  .menu-left.active { display: flex; }

  /* -- Stack sidebar below menu bar -- */
  .container
  {
    flex-direction: column;
    position: static;
  }

    .sidebar
    {
        position: static;
        width: 100%;
        max-height: 40vh;
        overflow-y: auto;
        background-image: url('images/leftnav.png');
        background-position: top left;
        background-repeat: repeat;
        background-size: auto;
    }
  
  .separator { display: none; }

    /* Contents */
    .content
    {
        position: static;
        margin: 0;
        width: 100%;
        padding: 20px;
    }

    .content-wrapper  { flex-direction: column; }
    .content-column { flex: 0 0 100%; }

    /* Footer */
    footer
    {
        position: relative;
        width: 100%;
        bottom: 0;
        height: 35px;
    }
  
    /* Table */
    table, tbody, tr, td
    {
        display: block;
        width: 100%;
    }

  tr { margin-bottom: 5px; }
	
    td
    {
        margin-bottom: 0px;
        vertical-align: top;
        white-space: normal;
    }
  
    #backtop { display: block; }
}