/* ==========================================================================
   TGS Theme - Responsive Styles
   ========================================================================== */

/* Mobile overlay when drawer nav is open */
@media (max-width: 991.98px) {
  .tgs-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 998;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .tgs-nav-backdrop[hidden] {
    display: none !important;
  }
}

/* Extra Large (below 1400px) */
@media (max-width: 1399.98px) {
  .hero-section h1 {
    font-size: 3.5rem;
  }
}

/* Large (below 1200px) */
@media (max-width: 1199.98px) {
  .tgs-nav-links {
    gap: 4px;
  }

  .tgs-nav-link {
    padding: 8px 12px;
    font-size: 0.875rem;
  }

  .hero-stats {
    gap: 30px;
  }
}

/* Medium (below 992px) - Tablet */
@media (max-width: 991.98px) {
  /* Navbar Mobile */
  .tgs-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    box-sizing: border-box;
  }

  /* Logo height matches menu control (44×44) for a balanced bar */
  .tgs-brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 0;
  }

  .tgs-brand img {
    height: 44px;
    width: auto;
    max-height: 44px;
    object-fit: contain;
    display: block;
  }

  .tgs-navbar.scrolled .tgs-brand img {
    height: 40px;
    max-height: 40px;
  }

  .tgs-navbar.scrolled .tgs-menu-toggle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .tgs-navbar {
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }

  .tgs-navbar .container {
    padding-left: max(calc(var(--bs-gutter-x, 1.5rem) * 0.5), env(safe-area-inset-left, 0px));
    padding-right: max(calc(var(--bs-gutter-x, 1.5rem) * 0.5), env(safe-area-inset-right, 0px));
  }

  .tgs-nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    max-width: min(300px, 100vw);
    height: 100vh;
    height: 100dvh;
    background: var(--dark);
    flex-direction: column;
    align-items: flex-start;
    padding: 100px 32px 32px;
    gap: 8px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
    /* Left-offset shadow bleeds onto the viewport while the drawer is off-screen; apply only when open */
    box-shadow: none;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 999;
    overflow-y: auto;
  }

  .tgs-nav-links.show {
    right: 0;
    box-shadow: -12px 0 48px rgba(0, 0, 0, 0.45);
  }

  .tgs-nav-link {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
  }

  .tgs-nav-link.active::after {
    display: none;
  }

  .tgs-btn.tgs-btn-primary {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
  }

  .tgs-navbar .tgs-nav-cta {
    margin-left: 0;
  }

  /* Hero — stacked layout below lg (tablet + mobile) */
  .hero-section {
    min-height: auto;
    text-align: left;
    /* Fixed navbar (~72–88px) + safe area — generous top rhythm on phones */
    padding-top: max(8.75rem, calc(env(safe-area-inset-top, 0px) + 7.25rem));
    padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
  }

  .hero-section h1 {
    font-size: clamp(2.1rem, 4.2vw, 2.85rem);
    line-height: 1.12;
    letter-spacing: -0.035em;
    margin-bottom: 0.45rem;
    text-align: left;
  }

  .hero-section h3 {
    font-size: clamp(1.1rem, 2.4vw, 1.35rem);
    line-height: 1.45;
    margin-bottom: 0.85rem;
    font-weight: 600;
    text-align: left;
  }

  .hero-section p {
    margin-left: 0;
    margin-right: auto;
    text-align: left;
    font-size: 1.02rem;
    line-height: 1.65;
    max-width: 38rem;
    color: rgba(255, 255, 255, 0.78);
  }

  .hero-section .tgs-badge {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.8rem;
    padding: 0.4rem 0.95rem;
    margin-bottom: 0.9rem;
    max-width: 100%;
    text-align: left;
    line-height: 1.35;
  }

  .hero-cta-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem !important;
    margin-top: 1.4rem !important;
    max-width: 20rem;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta-row .tgs-btn {
    width: 100%;
    justify-content: center;
    gap: 0.65rem;
  }

  .hero-visual-col {
    margin-top: 0.75rem !important;
    text-align: center;
  }

  .hero-section.hero-section-animated .hero-img dotlottie-player {
    min-height: 280px;
  }

  .hero-img {
    max-width: min(400px, 100%);
    margin-left: 0;
    margin-right: auto;
  }

  .hero-visual-col .hero-img {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem 0.4rem;
    width: 100%;
    max-width: min(24rem, 100%);
    margin-top: 1.75rem;
    margin-left: 0;
    margin-right: 0;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .hero-stat {
    padding: 0.7rem 0.35rem;
    background: rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
  }

  .hero-stat h4 {
    font-size: 1.25rem;
    margin-bottom: 0.12rem;
    line-height: 1.2;
  }

  .hero-stat p {
    font-size: 0.72rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.62);
  }

  /* Sections */
  .tgs-section {
    padding: 60px 0;
  }

  .tgs-course-section {
    padding: 60px 0;
  }

  .tgs-course-header {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 1.25rem;
    padding-bottom: 1.15rem;
  }

  .tgs-course-header__cta {
    min-width: 0;
    align-items: stretch;
    align-self: stretch;
  }

  .tgs-course-header__book {
    width: 100%;
    justify-content: center;
  }

  .tgs-blog-section {
    padding: 60px 0;
  }

  .tgs-faq-section {
    padding: 60px 0;
  }

  /* App Section */
  .tgs-app-section {
    text-align: center;
    padding: 60px 0;
  }

  .tgs-app-badges {
    justify-content: center;
  }

  .app-charecter {
    max-width: 250px !important;
    margin: 30px auto 0;
  }

  /* Waves */
  .waves,
  .waves2 {
    height: 60px;
    min-height: 60px;
  }

  /* Blog Header */
  .tgs-blog-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Contact */
  .wpcf7-form {
    padding: 32px;
  }

  /* Single Post */
  .tgs-single-post .post-card .post-body {
    padding: 32px;
  }

  .tgs-single-post .post-card img.post-hero-img {
    height: 280px;
  }
}

/* Small (below 768px) - Mobile */
@media (max-width: 767.98px) {
  body {
    font-size: 0.95rem;
  }

  .container,
  .container-sm {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }

  /* Long words / URLs: avoid horizontal scroll */
  .entry-content,
  .post-body,
  .tgs-single-post .post-card .post-body,
  .tgs-contact-section .wpcf7,
  .footer-description {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .entry-content table,
  .wp-block-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .entry-content iframe,
  .post-body iframe,
  .tgs-app-badges iframe {
    max-width: 100%;
  }

  /* Hero — phone refinements */
  .hero-section {
    /* Do not reduce top padding vs tablet — mobile needs the same clearance under fixed header */
    padding-top: max(8.75rem, calc(env(safe-area-inset-top, 0px) + 7.25rem));
    padding-bottom: clamp(2.25rem, 7vw, 3rem);
  }

  .hero-section h1 {
    font-size: clamp(2rem, 6.5vw, 2.65rem);
  }

  .hero-section h3 {
    font-size: clamp(1.05rem, 3.4vw, 1.2rem);
    margin-bottom: 0.75rem;
  }

  .hero-section p {
    font-size: 0.98rem;
    max-width: 36rem;
  }

  .hero-section .tgs-badge {
    font-size: 0.78rem;
    padding: 0.4rem 0.9rem;
    margin-bottom: 0.85rem;
  }

  .hero-visual-col {
    margin-top: 0.5rem !important;
  }

  .hero-section.hero-section-animated .hero-img dotlottie-player {
    min-height: 240px;
  }

  .hero-img {
    max-width: min(100%, 340px);
  }

  .hero-stats {
    gap: 0.5rem 0.35rem;
    max-width: min(22rem, 100%);
    margin-top: 1.65rem;
    padding-top: 1.35rem;
  }

  .hero-stat {
    padding: 0.65rem 0.3rem;
  }

  .hero-stat h4 {
    font-size: 1.2rem;
  }

  .hero-stat p {
    font-size: 0.68rem;
  }

  /* Course Images */
  .tgs-course-image-wrap img {
    height: 260px;
  }

  /* Sections */
  .tgs-section {
    padding: 50px 0;
  }

  .tgs-section-title {
    font-size: 1.75rem;
  }

  /* Blog Cards */
  .tgs-blog-card .card-img-wrap img {
    height: 180px;
  }

  /* Calendar */
  #calendar {
    height: auto;
    padding: 16px;
  }

  .fc .fc-toolbar-title {
    font-size: 1.1rem;
  }

  .fc .fc-toolbar {
    flex-direction: column;
    gap: 10px;
  }

  #top-bar {
    flex-direction: column;
    align-items: stretch;
  }

  #top-bar label {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  #top-bar select {
    width: 100%;
  }

  /* Contact Form */
  .wpcf7-form {
    padding: 24px;
  }

  .contact-info-card {
    padding: 32px 24px !important;
  }

  /* Footer — readable blocks: brand centered; links + contact as padded panels, left-aligned */
  /* No padding-bottom on .tgs-footer — it wraps the copyright bar; bottom padding would leave a gap under it */
  .tgs-footer {
    padding: 48px 0 0;
    margin-bottom: 0;
    text-align: left;
  }

  .tgs-footer .container {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }

  .tgs-footer .row {
    --bs-gutter-y: 1.5rem;
  }

  /* Brand column: keep logo + social visually centered; copy stays readable */
  .tgs-footer .row > .col-lg-5:first-child {
    text-align: center;
  }

  .tgs-footer .footer-logo {
    display: inline-block;
  }

  .tgs-footer .footer-description {
    margin: 0 auto 1.25rem;
    max-width: 26rem;
    text-align: center;
  }

  .tgs-footer .footer-social {
    margin-bottom: 0;
    justify-content: center;
  }

  /* Site links + Contact: explicit width + auto margins = equal inset L/R (margins alone can clip on the right with overflow-x:hidden) */
  .tgs-footer__column--links,
  .tgs-footer__column--contact {
    display: block;
    box-sizing: border-box;
    width: calc(100% - 1.5rem);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    min-width: 0;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.15rem 1.1rem;
  }

  .tgs-footer__column--links .tgs-footer__title,
  .tgs-footer__column--contact .tgs-footer__title {
    margin-bottom: 1rem;
    text-align: left;
  }

  .tgs-footer h5::after {
    left: 0;
    transform: none;
    bottom: -8px;
  }

  .tgs-footer ul.tgs-footer__nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .tgs-footer ul li {
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .tgs-footer ul li:last-child {
    border-bottom: none;
  }

  .tgs-footer ul li a {
    justify-content: flex-start;
    width: 100%;
    min-height: 48px;
    padding: 0.65rem 0.15rem 0.65rem 0;
    border-radius: 0;
  }

  .tgs-footer ul li a:hover {
    padding-left: 0.25rem;
  }

  .tgs-footer .footer-contact {
    text-align: left;
  }

  .tgs-footer .footer-contact p {
    justify-content: flex-start;
    text-align: left;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 1rem;
  }

  .tgs-footer .footer-contact p:last-child {
    margin-bottom: 0;
  }

  .tgs-footer-bottom {
    margin-top: 2rem;
    margin-bottom: 0;
    padding: 16px max(1rem, env(safe-area-inset-left, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-right, 0px));
  }

  /* Waves */
  .waves,
  .waves2 {
    height: 40px;
    min-height: 40px;
  }

  /* Modal */
  #modal .panel {
    width: 95%;
    padding: 24px;
    margin: 16px;
  }

  /* Single Post */
  .tgs-single-post {
    padding: 100px 0 50px;
  }

  .tgs-single-post .post-card .post-body {
    padding: 24px;
  }

  .tgs-single-post .post-card h1 {
    font-size: 1.4rem;
  }

  .tgs-single-post .post-card img.post-hero-img {
    height: 200px;
  }

  .tgs-single-post .post-meta {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  /* Sidebar */
  .sidebar {
    margin-top: 24px;
    position: static !important;
  }

  /* Booking */
  .tgs-booking-section,
  .tgs-blog-page,
  .tgs-archive-page {
    padding: 100px 0 50px;
  }

  #top-bar.tgs-booking-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .tgs-booking-toolbar__field {
    flex-basis: auto;
  }

  .tgs-booking-select,
  #top-bar select {
    max-width: 100%;
  }

  .tgs-booking-refresh,
  #top-bar button#refreshBtn {
    width: 100%;
    justify-content: center;
  }

  #no-slots-message.tgs-booking-alert {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  /* Buttons */
  .tgs-btn-lg {
    padding: 12px 28px;
    font-size: 0.95rem;
  }
}

/* Extra Small (below 480px) */
@media (max-width: 479.98px) {
  .hero-section {
    padding-top: max(8.5rem, calc(env(safe-area-inset-top, 0px) + 7rem));
  }

  .hero-section h1 {
    font-size: clamp(1.6rem, 7.5vw, 1.95rem);
    line-height: 1.14;
  }

  .hero-section.hero-section-animated .hero-img dotlottie-player {
    min-height: 200px;
  }

  .hero-stats {
    gap: 0.4rem 0.28rem;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .hero-stat {
    padding: 0.55rem 0.2rem;
  }

  .hero-stat h4 {
    font-size: 1.05rem;
  }

  .hero-stat p {
    font-size: 0.62rem;
  }

  .tgs-section-title {
    font-size: clamp(1.35rem, 5.5vw, 1.5rem);
    line-height: 1.25;
  }

  .tgs-course-header {
    grid-template-columns: 1fr;
    margin-bottom: 1.35rem;
    padding-bottom: 1.1rem;
  }

  .tgs-course-header__heading {
    font-size: 1.25rem;
  }

  .tgs-course-header__subtitle {
    font-size: 0.8125rem;
  }

  .tgs-course-header__book {
    width: 100%;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }

  .tgs-course-image-wrap img {
    height: 200px;
  }

  .tgs-nav-links {
    width: 100%;
  }

  .tgs-app-badges a img {
    height: 44px;
  }
}
