/*
Theme Name: TibCare
Theme URI: https://tibcare.com
Author: TibCare Medical Center
Author URI: https://tibcare.com
Description: A modern, professional WordPress theme for TibCare Medical Center — featuring a clean healthcare design, responsive layout, custom brand colors, smooth animations, and a full-featured contact form with WhatsApp integration.
Version: 3.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tibcare
Tags: healthcare, medical, one-column, custom-colors, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ============================================================
   TibCare CSS Variables
   ============================================================ */
:root {
  /* Brand Colors */
  --tib-blue: #1B4DA0;
  --tib-deep: #0C3C7A;
  --tib-navy: #052A57;
  --tib-light: #6FA8E0;
  --tib-tint: #EAF1FB;
  --tib-ink: #14233B;
  --tib-muted: #5A6A80;
  --tib-wa: #1FA971;
  --tib-wa-light: #E8F8F0;
  --tib-bg: #F8FAFC;
  --tib-white: #FFFFFF;
  --tib-gray-100: #F1F5F9;
  --tib-gray-200: #E2E8F0;
  --tib-gray-300: #CBD5E1;
  --tib-radius: 0.75rem;
}

/* ============================================================
   Base / Reset
   ============================================================ */
html {
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  border-color: var(--tib-gray-200);
  outline-color: rgba(var(--tib-light), 0.5);
}

body {
  background-color: var(--tib-bg);
  color: var(--tib-ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   TibCare Custom Utility Classes
   ============================================================ */
.tib-gradient {
  background: linear-gradient(135deg, var(--tib-navy) 0%, var(--tib-deep) 50%, var(--tib-blue) 100%);
}

.tib-gradient-light {
  background: linear-gradient(135deg, var(--tib-tint) 0%, #f0f7ff 100%);
}

.tib-hero-overlay {
  background: linear-gradient(180deg, rgba(5,42,87,0.7) 0%, rgba(12,60,122,0.5) 50%, rgba(27,77,160,0.4) 100%);
}

.tib-section-padding {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

@media (min-width: 768px) {
  .tib-section-padding {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

.tib-container {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .tib-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .tib-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ============================================================
   Hero Flip Animation
   ============================================================ */
#tib-hero-flip-container {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#tib-hero-flipper.tib-hero-flipped {
  transform: rotateY(0deg) !important;
}

@media (min-width: 768px) {
  #tib-hero-flip-container {
    min-height: 70vh;
  }
}

/* ============================================================
   Keyframe Animations
   ============================================================ */
@keyframes tibSlideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes tibSlideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes tibSlideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tibSlideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tibFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes tibScaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes tibFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes tibPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes tibSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   Animation Utility Classes (CSS-only, used with IntersectionObserver)
   ============================================================ */
.tib-animate {
  opacity: 0;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.tib-animate.tib-visible {
  opacity: 1;
  transform: none;
}

.tib-animate-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.tib-animate-right.tib-visible {
  opacity: 1;
  transform: translateX(0);
}

.tib-animate-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.tib-animate-left.tib-visible {
  opacity: 1;
  transform: translateX(0);
}

.tib-animate-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.tib-animate-up.tib-visible {
  opacity: 1;
  transform: translateY(0);
}

.tib-animate-down {
  opacity: 0;
  transform: translateY(-30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.tib-animate-down.tib-visible {
  opacity: 1;
  transform: translateY(0);
}

.tib-animate-fade {
  opacity: 0;
  transition: opacity 0.6s ease-out;
}

.tib-animate-fade.tib-visible {
  opacity: 1;
}

.tib-animate-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.tib-animate-scale.tib-visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delay classes for children */
.tib-delay-1 { transition-delay: 0.1s; }
.tib-delay-2 { transition-delay: 0.2s; }
.tib-delay-3 { transition-delay: 0.3s; }
.tib-delay-4 { transition-delay: 0.4s; }
.tib-delay-5 { transition-delay: 0.5s; }
.tib-delay-6 { transition-delay: 0.6s; }
.tib-delay-7 { transition-delay: 0.7s; }
.tib-delay-8 { transition-delay: 0.8s; }

/* ============================================================
   Custom Scrollbar
   ============================================================ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--tib-gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--tib-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--tib-blue);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--tib-light) var(--tib-gray-100);
}

/* ============================================================
   WordPress Specific Styles
   ============================================================ */

/* Caption styles */
.wp-caption {
  max-width: 100%;
}

.wp-caption-text {
  font-size: 0.875rem;
  color: var(--tib-muted);
  text-align: center;
  padding: 0.5rem 0;
}

/* Gallery styles */
.gallery {
  display: grid;
  gap: 1rem;
}

.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }

/* Alignments */
.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.alignleft {
  float: left;
  margin-right: 1.5rem;
  margin-bottom: 1rem;
}

.alignright {
  float: right;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

/* Screen reader text */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* Pagination */
.nav-links {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 2rem;
}

.nav-links .page-numbers {
  padding: 0.5rem 1rem;
  border-radius: var(--tib-radius);
  border: 1px solid var(--tib-gray-200);
  color: var(--tib-ink);
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-links .page-numbers:hover,
.nav-links .page-numbers.current {
  background-color: var(--tib-blue);
  color: white;
  border-color: var(--tib-blue);
}

/* Post navigation */
.post-navigation {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--tib-gray-200);
}

/* Comments */
.comment-list {
  list-style: none;
  padding: 0;
}

.comment-body {
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-radius: var(--tib-radius);
  background: var(--tib-white);
  border: 1px solid var(--tib-gray-200);
}

/* Contact form styles */
.tibcare-contact-form input,
.tibcare-contact-form textarea,
.tibcare-contact-form select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--tib-gray-200);
  border-radius: var(--tib-radius);
  font-size: 1rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: var(--tib-white);
}

.tibcare-contact-form input:focus,
.tibcare-contact-form textarea:focus,
.tibcare-contact-form select:focus {
  outline: none;
  border-color: var(--tib-blue);
  box-shadow: 0 0 0 3px rgba(27, 77, 160, 0.1);
}

.tibcare-contact-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tib-ink);
  margin-bottom: 0.5rem;
}

.tibcare-contact-form .form-error {
  color: #dc2626;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.tibcare-contact-form .form-success {
  color: var(--tib-wa);
  font-size: 0.9rem;
  padding: 1rem;
  background: var(--tib-wa-light);
  border-radius: var(--tib-radius);
}

/* WhatsApp floating button */
.tib-wa-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--tib-wa);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(31, 169, 113, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
}

.tib-wa-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(31, 169, 113, 0.5);
  color: white;
}

/* Loading spinner */
.tib-spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: tibSpin 0.6s linear infinite;
}

/* ============================================================
   Responsive Helpers
   ============================================================ */
.tib-hidden-mobile {
  display: none;
}

@media (min-width: 768px) {
  .tib-hidden-mobile {
    display: block;
  }
  .tib-hidden-desktop {
    display: none;
  }
}

/* ============================================================
   Selection Color
   ============================================================ */
::selection {
  background-color: var(--tib-tint);
  color: var(--tib-deep);
}
