/* Mobile responsive styles for GSS website */
/* Using vw units for responsive design - compiled from SCSS */

/* Mobile-first approach */
@media screen and (max-width: 768px) {
  
  /* Basic mobile styles */
  * {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }
  
  body {
    margin: 0;
    padding: 0;
    font-size: 3.733333vw; /* 28px at 750px viewport */
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  /* Hide desktop ads on mobile */
  #adarea2 {
    display: none;
  }

  /* Mobile web_ad styling - center display */
  #web_ad {
    width: 100%;
    height: auto;
    text-align: center;
    margin: 2vw 0;
    padding: 0;
    box-sizing: border-box;
    position: relative;
  }

  /* Fix #adarea positioning - remove absolute positioning on mobile */
  #web_ad #adarea {
    position: relative !important;
    width: 100% !important;
    margin: 0 !important;
    left: auto !important;
    margin-left: 0 !important;
    text-align: center;
    overflow: hidden;
  }

  /* Fix #ads container */
  #web_ad #adarea #ads {
    width: 100% !important;
    height: auto !important;
    margin: 0 auto;
    text-align: center;
    overflow: hidden;
  }

  #web_ad #adarea #ads ul {
    width: 100% !important;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  #web_ad #adarea #ads ul li {
    width: 100% !important;
    height: auto !important;
    overflow: hidden;
    display: block;
  }

  #web_ad img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
  }

  /* Mobile bts (carousel buttons) styling - below carousel */
  #web_ad #bts {
    width: auto !important;
    max-width: 100%;
    margin: 2vw auto !important;
    text-align: center;
    position: relative !important;
    z-index: 9999;
    overflow: visible;
    background: rgba(255, 255, 255, 0.9);
    padding: 2vw 0;
    border-radius: 1vw;
  }

  #web_ad #bts ul {
    width: auto !important;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 3vw;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  #web_ad #bts ul li {
    float: none !important;
    margin: 0 !important;
    width: 4vw !important;
    height: 4vw !important;
    min-width: 16px;
    min-height: 16px;
    background-size: contain !important;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    border: 0.5vw solid transparent;
  }

  #web_ad #bts ul li:hover {
    transform: scale(1.1);
    border-color: rgba(231, 121, 25, 0.3);
  }

  #web_ad #bts ul li.on {
    border-color: #E77919 !important;
    transform: scale(1.1);
  }

  /* Header section mobile optimization */
  #top {
    width: 100%;
    height: 16vw; /* 120px */
    background-size: cover;
  }
  
  #top #toparea {
    width: 100%;
    max-width: none;
    height: 16vw;
    padding: 2vw;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  #top #toparea #logo {
    width: 24vw; /* 180px */
    height: 6.667vw; /* 50px */
    margin-top: 1.333vw;
    text-align: center;
  }
  
  #top #toparea #logo img {
    max-width: 100%;
    height: auto;
  }
  
  #top #toparea #tword {
    width: 100%;
    height: auto;
    margin: 1.333vw 0;
    text-align: center;
  }
  
  #top #toparea #tword img {
    max-width: 20vw; /* 150px */
    height: auto;
  }
  
  #top #toparea #topright {
    width: 100%;
    margin-top: 1.333vw;
    text-align: center;
  }
  
  #top #toparea #topright #word {
    text-align: center;
    font-size: 2.667vw; /* 20px */
  }
  
  #top #toparea #topright #word a {
    color: #fff;
    margin: 0 2vw;
  }

  /* Mobile navigation - Sidebar Style */
  #menu {
    width: 100%;
    height: auto;
    min-height: 13.333vw; /* 100px */
    background-size: cover;
    position: relative;
  }
  
  #menu #navarea {
    width: 100%;
    max-width: none;
    height: auto;
    padding: 2vw;
    display: flex;
    flex-direction: column;
    position: relative;
    justify-content: center;
    align-items: center;
  }
  
  /* Mobile menu toggle button - Make it visible */
  .mobile-menu-toggle {
    display: block !important;
    position: absolute;
    top: 2vw;
    right: 2vw;
    background: transparent;
    /*background: rgba(231, 121, 25, 0.9);*/
    color: white;
    border: none;
    font-size: 4vw;
    padding: 2vw 2.5vw;
    border-radius: 1vw;
    cursor: pointer;
    z-index: 1001;
    /*box-shadow: 0 0.5vw 2vw rgba(0,0,0,0.2);*/
    transition: all 0.3s ease;
  }
  
  .mobile-menu-toggle:hover {
    /*background: rgba(231, 121, 25, 1);*/
    transform: scale(1.05);
  }
  
  /* Sidebar overlay */
  .mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  .mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
  }
  
  /* Sidebar navigation */
  .mobile-nav-sidebar {
    position: fixed;
    top: 0;
    left: -80vw;
    width: 80vw;
    max-width: 320px;
    height: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    z-index: 1999;
    box-shadow: 0.5vw 0 4vw rgba(0,0,0,0.3);
    transition: left 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .mobile-nav-sidebar.active {
    left: 0;
  }
  
  /* Sidebar header */
  .mobile-nav-header {
    padding: 4vw 4vw 2vw 4vw;
    border-bottom: 0.267vw solid #e0e0e0;
    background: linear-gradient(135deg, #E77919 0%, #d16613 100%);
    color: white;
    position: relative;
  }
  
  .mobile-nav-title {
    font-size: 4.8vw;
    font-weight: bold;
    margin: 0;
    text-align: center;
  }
  
  .mobile-nav-close {
    position: fixed;
    top: -1vw;
    right: 0vw;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    font-size: 4vw;
    width: 10vw;
    height: 10vw;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2000;
    box-shadow: 0 0.5vw 2vw rgba(0,0,0,0.3);
  }
  
  .mobile-nav-close:hover {
    background: rgba(0, 0, 0, 1);
    transform: scale(1.1);
  }
  
  /* Sidebar navigation list */
  #menu #navarea #nav {
    width: 100%;
    margin-bottom: 0;
    display: none; /* Hide default nav on mobile */
  }
  
  .mobile-nav-list {
    padding: 0 0;
    list-style: none;
    margin: 0;
  }
  
  .mobile-nav-item {
    margin: 0;
    border-bottom: 0.133vw solid #f0f0f0;
  }
  
  .mobile-nav-item:last-child {
    border-bottom: none;
  }
  
  .mobile-nav-link {
    display: block;
    padding: 4vw 4vw;
    color: #333;
    text-decoration: none;
    font-size: 3.7vw;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    border-left: 0.8vw solid transparent;
  }

  .mobile-nav-link:hover,
  .mobile-nav-link.active {
    background: linear-gradient(90deg, rgba(231, 121, 25, 0.1) 0%, transparent 100%);
    color: #E77919;
    border-left-color: #E77919;
    padding-left: 6vw;
  }
  
  .mobile-nav-link:hover:before,
  .mobile-nav-link.active:before {
    opacity: 1;
  }
  
  .mobile-nav-link:active {
    background: rgba(231, 121, 25, 0.2);
  }
  
  #menu #navarea #searcharea {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.333vw;
  }
  
  #menu #navarea #searcharea #keyarea {
    flex: 1;
    max-width: 40vw; /* 300px */
    height: 8vw; /* 60px */
    background-color: #fff;
    border-radius: 4vw;
    padding: 0 2.667vw;
    display: flex;
    align-items: center;
  }
  
  #menu #navarea #searcharea #keyarea input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 3.2vw;
    outline: none;
    margin: 0;
  }
  
  #menu #navarea #searcharea #keyarea input::placeholder {
    color: #999;
  }
  
  #menu #navarea #searcharea #sbt {
    width: 13.333vw; /* 100px */
  }
  
  #menu #navarea #searcharea #sbt input {
    width: 100%;
    height: 6.667vw; /* 50px */
    border-radius: 3.333vw;
  }

  /* Main content mobile layout */
  #main {
    width: 100%;
    max-width: none;
    margin-top: 4vw;
    padding: 0 2.667vw 4vw 2.667vw;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 30vw);
  }
  
  #main #mainleft {
    width: 100%;
    height: auto;
    margin-bottom: 4vw;
    background: none;
    float: none;
  }
  
  #main #mainleft #title {
    width: 100%;
    border-bottom: 0.133vw dashed #ccc;
    text-align: center;
    padding-bottom: 2vw;
    text-indent: 0;
  }
  
  #main #mainleft #title img {
    max-width: 100%;
    height: auto;
  }
  
  #main #mainleft #detail {
    width: 100%;
    margin-top: 2.667vw;
    text-align: left;
    font-size: 3.2vw;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  
  #main #mainleft #detail img {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 1.333vw 0;
    order: -1; /* Put image at top */
  }
  
  #main #mainleft #detail a[href*="aboutus.php"] {
    align-self: flex-end;
    margin-top: 2vw;
  }
  
  #main #mainright {
    width: 100%;
    margin-left: 0;
    float: none;
  }
  
  #main #mainright #titles {
    width: 100%;
    border-bottom: 0.133vw dashed #ccc;
    padding-bottom: 2vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  #main #mainright #titles #title {
    flex: 1;
    text-align: left;
    text-indent: 0;
  }
  
  #main #mainright #titles #title img {
    max-width: 100%;
    height: auto;
  }
  
  #main #mainright #titles #more {
    font-size: 2.667vw;
    width: auto;
    padding-right: 0;
  }
  
  #main #mainright #titles #more a {
    color: #E77919;
  }
  
  #main #mainright #indexpro {
    width: 100%;
    margin-top: 4vw;
  }
  
  #main #mainright #indexpro ul {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.333vw;
    padding: 0;
    margin: 0;
  }
  
  #main #mainright #indexpro ul li {
    flex: 0 0 calc(33.333% - 2vw);
    max-width: calc(33.333% - 2vw);
    text-align: center;
    margin: 0;
    float: none;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  #main #mainright #indexpro ul li img {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin-bottom: 1.333vw;
    aspect-ratio: 4/3;
    object-fit: cover;
  }
  
  #main #mainright #indexpro ul li a {
    font-size: 2.8vw;
    display: block;
    text-align: center;
    width: 100%;
  }

  /* Page main content mobile layout */
  #pagemain {
    width: 100%;
    max-width: none;
    margin-top: 0;
    background: none;
    padding: 0;
  }
  
  #pagemain #themain {
    width: 100%;
    padding: 2.667vw;
    display: flex;
    flex-direction: column;
    margin-left: 0;
  }
  
  #pagemain #themain #mainleft {
    width: 100%;
    margin: 0 0 4vw 0;
    height: auto;
    float: none;
  }
  
  #pagemain #themain #mainleft #lline {
    width: 100%;
    height: 1.067vw; /* 8px */
    background-color: #E77919;
  }
  
  #pagemain #themain #mainleft #lbg {
    width: 100%;
    background: #f8f9fa;
    border: 0.133vw solid #e0e0e0;
    border-radius: 1.067vw;
    padding: 2.667vw;
  }
  
  #pagemain #themain #mainleft #lbg #title {
    width: 100%;
    padding: 2.667vw 0;
    text-align: center;
    border-bottom: 0.133vw solid #ddd;
    font-size: 3.733vw;
    font-weight: bold;
    text-indent: 0;
  }
  
  #pagemain #themain #mainleft #lbg #mlist {
    width: 100%;
    margin-top: 2.667vw;
  }
  
  #pagemain #themain #mainleft #lbg #mlist #big {
    width: 100%;
    padding: 2vw 0;
    border-bottom: 0.133vw dashed #ddd;
    background-position: 1.333vw center;
    text-indent: 5.333vw;
    font-size: 3.2vw;
  }
  
  #pagemain #themain #mainleft #lbg #mlist #big.on {
    background-color: rgba(231, 121, 25, 0.1);
  }
  
  #pagemain #themain #mainleft #lbg #mlist #big.on a {
    color: #E77919;
    font-weight: bold;
  }
  
  #pagemain #themain #mainleft #lbg #mlist #sec {
    width: 100%;
    padding-left: 5.333vw;
  }
  
  #pagemain #themain #mainleft #lbg #mlist #sec a {
    display: block;
    padding: 1.333vw 0;
    font-size: 2.933vw;
    color: #666;
    border-bottom: 0.133vw dotted #ddd;
  }
  
  #pagemain #themain #mainleft #lbg #mlist #sec a:hover {
    color: #E77919;
  }
  
  #pagemain #themain #mainleft #lfoot {
    display: none;
  }
  
  #pagemain #themain #mainright {
    width: 100%;
    margin-left: 0;
    float: none;
  }
  
  #pagemain #themain #mainright #title {
    width: 100%;
    margin-top: 2.667vw;
    border-bottom: 0.133vw solid #ddd;
    padding-bottom: 2vw;
  }
  
  #pagemain #themain #mainright #title #name {
    width: 100%;
    text-align: center;
    font-size: 4.267vw; /* 32px */
    font-weight: bold;
    margin-bottom: 1.333vw;
    text-indent: 0;
    float: none;
  }
  
  #pagemain #themain #mainright #title #name img {
    max-width: 2.667vw;
    height: auto;
    vertical-align: middle;
    margin-right: 1.333vw;
  }
  
  #pagemain #themain #mainright #title #position {
    width: 100%;
    text-align: center;
    font-size: 2.667vw;
    color: #666;
    float: none;
    padding: 0;
  }
  
  #pagemain #themain #mainright #title #position a {
    color: #E77919;
  }
  
  #pagemain #themain #mainright #small {
    width: 100%;
    margin-top: 2vw;
    background-color: #E77919;
    color: #fff;
    text-align: center;
    padding: 2vw;
    font-size: 3.2vw;
    border-radius: 0.667vw;
    text-indent: 0;
  }
  
  #pagemain #themain #mainright #small2 {
    width: 100%;
    margin-top: 2vw;
    background-color: #f2f2f2;
    color: #E77919;
    font-weight: bold;
    text-align: center;
    padding: 2vw;
    font-size: 3.2vw;
    border-radius: 0.667vw;
    text-indent: 0;
  }
  
  #pagemain #themain #mainright #content {
    width: 100%;
    margin-top: 4vw;
    padding-bottom: 6.667vw;
    font-size: 3.2vw;
    line-height: 1.6;
  }
  
  #pagemain #themain #mainright #content img {
    max-width: 100%;
    height: auto;
    margin: 2.667vw 0;
  }
  
  #pagemain #themain #mainright #content table {
    width: 100%;
    font-size: 2.667vw;
  }
  
  #pagemain #themain #mainright #content td {
    padding: 1.333vw;
    word-break: break-all;
  }
  
  #pagemain #themain #mainright #content2 {
    width: 100%;
    background-color: #f6f4f5;
    margin-top: 4vw;
    padding: 4vw 2.667vw;
    margin-bottom: 6.667vw;
    border-radius: 1.333vw;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  #pagemain #themain #mainright #content2 #left {
    width: 100%;
    text-align: center;
    margin-bottom: 4vw;
    float: none;
    padding: 0;
  }
  
  #pagemain #themain #mainright #content2 #left img {
    max-width: 100%;
    width: auto;
    height: auto;
  }
  
  #pagemain #themain #mainright #content2 #right {
    width: 100%;
    text-align: center;
    margin: 0;
    padding: 0;
    float: none;
  }
  
  #pagemain #themain #mainright #content2 #right img {
    max-width: 100%;
    height: auto;
    margin-bottom: 4vw;
  }
  
  #pagemain #themain #mainright #prolist {
    width: 100%;
    margin-top: 4vw;
  }
  
  #pagemain #themain #mainright #prolist ul {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.667vw;
  }
  
  #pagemain #themain #mainright #prolist ul li {
    flex: 0 0 calc(50% - 1.333vw);
    max-width: 26.667vw; /* 200px */
    text-align: center;
    margin: 0;
    float: none;
  }
  
  #pagemain #themain #mainright #prolist ul li img {
    width: 100%;
    height: auto;
    margin-bottom: 1.333vw;
  }
  
  #pagemain #themain #mainright #prolist ul li a {
    font-size: 2.667vw;
    display: block;
    line-height: 1.4;
  }
  
  #pagemain #themain #mainright #prolist2 {
    width: 100%;
    margin-top: 4vw;
  }
  
  #pagemain #themain #mainright #prolist2 ul {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.667vw;
  }
  
  #pagemain #themain #mainright #prolist2 ul li {
    flex: 0 0 calc(100% - 2.667vw);
    max-width: 46.667vw; /* 350px */
    text-align: center;
    margin: 0;
    float: none;
  }
  
  #pagemain #themain #mainright #prolist2 ul li img {
    width: 100%;
    max-width: 39.2vw; /* 294px */
    height: auto;
    margin-bottom: 1.333vw;
  }
  
  #pagemain #themain #mainright #page {
    width: 100%;
    margin-top: 4vw;
    padding-bottom: 6.667vw;
    text-align: center;
  }
  
  #pagemain #themain #mainright #page .thepage {
    font-size: 2.667vw;
  }
  
  #pagemain #themain #mainright #page .thepage a,
  #pagemain #themain #mainright #page .thepage span {
    margin: 0.667vw;
    padding: 1.333vw 2vw;
    font-size: 2.667vw;
  }

  /* Gallary page mobile layout */
  #pagemain #themain #marq {
    width: 100%;
    margin-top: 4vw;
  }
  
  #pagemain #themain #marq #title {
    width: 100%;
    border-bottom: 0.133vw solid #ddd;
    padding-bottom: 2vw;
  }
  
  #pagemain #themain #marq #title #name {
    width: 100%;
    text-align: center;
    font-size: 3.733vw;
    font-weight: bold;
    margin-bottom: 1.333vw;
    float: none;
    text-indent: 0;
  }
  
  #pagemain #themain #marq #title #name img {
    max-width: 2.667vw;
    height: auto;
    vertical-align: middle;
    margin-right: 1.333vw;
  }
  
  #pagemain #themain #marq #title #position {
    width: 100%;
    text-align: center;
    font-size: 2.667vw;
    color: #666;
    float: none;
    padding: 0;
  }
  
  #pagemain #themain #marq #title #position a {
    color: #E77919;
  }
  
  #pagemain #themain #marq #words {
    width: 100%;
    margin-top: 4vw;
    padding: 0 2.667vw;
    font-size: 3.2vw;
    line-height: 1.6;
    text-align: center;
  }
  
  #pagemain #themain #marq #mq {
    width: 100%;
    height: auto;
    margin-top: 4vw;
    margin-bottom: 6.667vw;
    overflow-x: auto;
  }
  
  #pagemain #themain #marq #mq ul {
    width: auto;
    display: flex;
    gap: 2vw;
    padding: 0 2.667vw;
  }
  
  #pagemain #themain #marq #mq ul li {
    flex: 0 0 auto;
    width: 53.333vw; /* 400px */
    height: auto;
    margin: 0;
    float: none;
  }
  
  #pagemain #themain #marq #mq ul li img {
    width: 100%;
    height: auto;
    border-radius: 1.333vw;
  }

  /* Footer mobile layout */
  #footer {
    width: 100%;
    height: auto;
    min-height: 16vw;
    padding: 5.333vw 2.667vw;
    background-size: cover;
    margin-top: auto;
    flex-shrink: 0;
  }
  
  #footer #footword {
    width: 100%;
    text-align: center;
    font-size: 2.667vw;
    line-height: 1.6;
    margin-top: 0;
  }
  
  #footer #footword a,
  #footer #footword p,
  #footer #footword div,
  #footer #footword font,
  #footer #footword ins {
    color: #fff;
    font-size: 2.667vw;
  }
  
  /* Make main content grow to fill space */
  #main,
  #pagemain {
    flex-grow: 1;
  }

  /* Pagination mobile styles */
  .thepage {
    padding: 1.333vw;
    font-size: 3.2vw;
    text-align: center;
  }
  
  .thepage a {
    margin: 0.667vw;
    padding: 1.333vw 2vw;
    border: 0.133vw solid #ccc;
    background-color: #fff;
    color: #666;
    text-decoration: none;
    border-radius: 0.667vw;
    display: inline-block;
    font-size: 2.667vw;
  }
  
  .thepage a:hover {
    color: #fff;
    background-color: #E77919;
    border-color: #E77919;
  }
  
  .thepage span.current {
    margin: 0.667vw;
    padding: 1.333vw 2vw;
    background-color: #E77919;
    color: #fff;
    border: 0.133vw solid #E77919;
    border-radius: 0.667vw;
    display: inline-block;
    font-size: 2.667vw;
  }
  
  .thepage span.disabled {
    margin: 0.667vw;
    padding: 1.333vw 2vw;
    background-color: #fff;
    color: #ccc;
    border: 0.133vw solid #ccc;
    border-radius: 0.667vw;
    display: inline-block;
    font-size: 2.667vw;
  }

  /* Utility classes for mobile */
  .desktop-only {
    display: none !important;
  }
  
  .mobile-only {
    display: block !important;
  }
  
  .mobile-text-center {
    text-align: center;
  }
  
  .mobile-text-left {
    text-align: left;
  }
  
  .mobile-text-right {
    text-align: right;
  }
  
  .mobile-hidden {
    display: none;
  }
  
  .mobile-block {
    display: block;
  }
  
  .mobile-flex {
    display: flex;
  }
  
  .mobile-grid {
    display: grid;
  }
}

/* Tablet specific adjustments */
@media screen and (min-width: 769px) and (max-width: 1023px) {
  #pagemain #themain #mainleft {
    width: 35%;
    float: left;
    margin-right: 3%;
  }
  
  #pagemain #themain #mainright {
    width: 62%;
    float: left;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  a, button, input[type="submit"], input[type="button"] {
    min-height: 11.733vw; /* 88px - 44px minimum touch target doubled for vw */
    padding: 2vw 2.667vw;
  }
  
  #menu #navarea #nav ul li {
    min-height: 11.733vw;
    padding: 2.667vw 2vw;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: optimize-contrast;
  }
}
