/* GraphiTee.Art — Shared Responsive Layer */

:root {
  --space-xs: 0.4rem;
  --space-sm: 0.85rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3.5rem;
  --nav-height: 58px;
  --touch-min: 40px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --section-pad-y: clamp(32px, 4.5vw, 56px);
}

/* Global UI density — slightly zoomed-out, clearer overview */
html {
  font-size: 15px;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + var(--safe-top));
}

@media (min-width: 992px) {
  html {
    font-size: 14px;
  }
}

@media (min-width: 1400px) {
  html {
    font-size: 14.5px;
  }
}

body {
  font-size: 0.9375rem;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

.container {
  max-width: 1140px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

/* Fluid section spacing */
.services,
.about,
.testimonials,
.contact,
.team,
.faq,
.cta,
.portfolio {
  padding-top: var(--section-pad-y) !important;
  padding-bottom: var(--section-pad-y) !important;
}

.section-title {
  margin-bottom: clamp(24px, 4vw, 44px);
}

.section-title h2 {
  font-size: clamp(1.35rem, 3.2vw, 2rem) !important;
  margin-bottom: 14px !important;
}

.section-title p {
  font-size: clamp(0.875rem, 1.8vw, 1rem);
  padding-left: 15px;
  padding-right: 15px;
}

.about-content h2 {
  font-size: clamp(1.35rem, 3vw, 2rem) !important;
}

.about-content h3 {
  font-size: 1.15rem !important;
}

.about-content p,
.testimonial-text,
.contact-header p {
  font-size: 0.9rem !important;
  line-height: 1.65 !important;
}

/* Navbar — compact */
.navbar {
  padding: 8px 0 !important;
}

.navbar-brand .logo-img {
  height: 52px !important;
  width: 52px !important;
  object-fit: contain !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.brand-name {
  font-size: 1.15rem !important;
}

.nav-link {
  font-size: 0.85rem !important;
  padding: 6px 12px !important;
}

/* Buttons — slightly smaller */
.btn-primary,
.btn-secondary,
.btn-custom,
.btn-outline-custom {
  padding: 12px 24px !important;
  font-size: 0.9rem !important;
}

.btn-submit {
  padding: 10px 24px !important;
  font-size: 0.9rem !important;
}

/* CTA & footer headings */
.cta h2 {
  font-size: clamp(1.35rem, 4vw, 2rem) !important;
}

.cta p {
  font-size: clamp(0.9rem, 2vw, 1.05rem) !important;
  margin-bottom: 28px !important;
}

.footer-section h3 {
  font-size: 1.1rem !important;
}

.contact-header h2 {
  font-size: clamp(1.35rem, 3vw, 2rem) !important;
}

.contact-info,
.contact-form {
  padding: 28px !important;
}

.faq-question {
  font-size: 0.92rem !important;
  padding: 16px 18px !important;
}

.testimonial-card {
  padding: 22px !important;
}

.testimonial-card::before {
  font-size: 3.5rem !important;
}

.team-member h4 {
  font-size: 1.35rem !important;
}

/* Touch targets */
.btn,
.btn-custom,
.btn-outline-custom,
.btn-submit,
.nav-link,
.view-btn,
.theme-btn,
.social-link,
.footer-social a {
  min-height: var(--touch-min);
}

/* Toast — mobile friendly */
.toast-container {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: min(92vw, 400px);
  top: calc(12px + var(--safe-top));
}

.toast-message {
  word-break: break-word;
}

/* Footer */
.footer-content {
  gap: clamp(20px, 4vw, 40px);
}

@media (max-width: 576px) {
  .footer-content {
    grid-template-columns: 1fr !important;
    text-align: center;
  }

  .footer-social {
    justify-content: center !important;
  }
}

/* ========== HERO ========== */
.hero-section {
  min-height: min(88vh, 720px) !important;
}

.hero-section .hero-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
  position: relative;
  z-index: 2;
}

.hero-section .hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 44px);
  align-items: center;
  min-height: min(72vh, 640px);
}

.hero-section .hero-title {
  font-size: clamp(1.85rem, 4vw, 3rem) !important;
  margin-bottom: 18px !important;
  line-height: 1.15 !important;
}

.hero-section .hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.1rem) !important;
  margin-bottom: 24px !important;
  max-width: 460px;
}

.hero-section .hero-ai-studio {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.hero-section .ai-mini-wrap {
  width: 100%;
  max-width: 520px;
}

.hero-section .hero-stats {
  display: flex;
  gap: clamp(8px, 2.5vw, 22px);
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.hero-section .hero-stats .stat-item > div:first-child {
  font-size: 1.5rem !important;
}

.hero-section .hero-stats .stat-item > div:last-child {
  font-size: 0.8rem !important;
}

.hero-section .hero-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.hero-section .hero-buttons a {
  padding: 12px 24px !important;
  font-size: 0.9rem !important;
}

.hero-section .btn-tertiary {
  padding: 10px 20px !important;
  font-size: 0.85rem !important;
}

.hero-section .hero-social {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.hero-section .social-link {
  width: 38px !important;
  height: 38px !important;
  font-size: 1rem !important;
}

.hero-section .premium-badge {
  padding: 6px 16px !important;
  margin-bottom: 20px !important;
  font-size: 0.8rem !important;
}

.hero-section .btn-tertiary {
  position: relative;
}

.hero-section .btn-tertiary .badge-min {
  position: absolute;
  top: -8px;
  right: -8px;
  white-space: nowrap;
}

/* Theme switcher — avoid overlapping content */
.theme-switcher-container {
  bottom: calc(20px + var(--safe-bottom));
}

.theme-btn {
  width: 42px !important;
  height: 42px !important;
}

.theme-btn i {
  font-size: 1rem !important;
}

@media (max-width: 768px) {
  .hero-section {
    padding-bottom: calc(100px + var(--safe-bottom)) !important;
    min-height: auto !important;
    overflow-x: hidden;
  }

  .hero-section .hero-container {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .hero-section .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    min-height: auto !important;
  }

  .hero-section .hero-content {
    text-align: center;
    padding: 16px 4px 8px;
    min-width: 0;
  }

  .hero-section .hero-ai-studio {
    order: -1;
    justify-content: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-bottom: 4px;
  }

  .hero-section .ai-mini-wrap {
    max-width: 100%;
    width: 100%;
  }

  .hero-section .hero-stats {
    justify-content: center;
    flex-wrap: wrap !important;
  }

  .hero-section .hero-stats .stat-item {
    flex: 1 1 80px;
    min-width: 70px;
  }

  .hero-section .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .hero-section .hero-buttons a {
    width: 100%;
    justify-content: center;
  }

  .hero-section .btn-tertiary {
    width: 100%;
    justify-content: center;
  }

  .hero-section .hero-social {
    justify-content: center;
  }

  .hero-section .hero-social > span {
    flex-basis: 100%;
    text-align: center;
    margin-bottom: 5px;
  }

  .hero-section .hero-subtitle {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .theme-switcher-container {
    z-index: 900 !important;
  }
}

@media (max-width: 480px) {
  .hero-section .hero-stats .stat-item {
    flex: 1 1 45%;
  }
}

/* ========== SERVICES IMAGE CARDS ========== */
.services .col-lg-4,
.services .col-md-6 {
  display: flex;
}

.services .service-card {
  width: 100%;
}

.services .service-card h3 {
  font-size: 1.1rem !important;
}

.services .service-card p {
  font-size: 0.85rem !important;
}

.services .service-card-body {
  padding: 16px 18px 20px !important;
}

.services .service-card-badge {
  width: 40px !important;
  height: 40px !important;
  font-size: 1rem !important;
}

.services .service-card-link {
  font-size: 0.8rem !important;
  margin-top: 12px !important;
}

/* Gallery page density */
.gallery-header {
  min-height: 220px !important;
  padding: 56px 0 36px !important;
}

.gallery-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.4rem) !important;
}

.gallery-header p {
  font-size: clamp(0.9rem, 1.8vw, 1.05rem) !important;
}

.gallery-container {
  padding: 28px 0 !important;
}

.gallery-grid {
  gap: 18px !important;
  padding: 14px !important;
}

.gallery-image {
  height: 210px !important;
}

.gallery-info {
  padding: 14px !important;
}

.gallery-info h3 {
  font-size: 1.1rem !important;
}

.gallery-controls {
  padding: 14px 0 !important;
}

.search-input {
  padding: 10px 40px 10px 16px !important;
  font-size: 0.9rem !important;
}

.view-btn {
  padding: 6px 14px !important;
  font-size: 0.85rem !important;
}

@media (max-width: 768px) {
  .service-card {
    margin-bottom: 0;
  }

  .service-card-body {
    padding: 18px 20px 22px;
  }

  .service-card h3 {
    font-size: 1.15rem;
  }

  .service-card p {
    font-size: 0.88rem;
  }

  .service-card-badge {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    top: 10px;
    left: 10px;
  }
}

@media (max-width: 576px) {
  .services .row.g-4 {
    --bs-gutter-y: 1.25rem;
  }
}

/* ========== PORTFOLIO (legacy overrides — slider in portfolio-slider.css) ========== */
.portfolio-pro .portfolio-section-title h2,
.portfolio .portfolio-section-title h2 {
  font-size: clamp(1.35rem, 4vw, 2.2rem) !important;
}

@media (max-width: 768px) {
  .portfolio-track-wrapper {
    height: auto;
    overflow: visible;
  }

  .portfolio-track-wrapper .cards-track {
    position: static !important;
    animation: none !important;
  }
}

/* ========== ABOUT ========== */
.about-image-col {
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.about-image-wrapper {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 4 / 3;
  height: auto !important;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 15px 45px var(--shadow-light);
}

.about-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .about-image-col {
    min-height: auto !important;
  }

  .about-content-col {
    padding: 20px !important;
  }
}

/* ========== TESTIMONIALS ========== */
@media (max-width: 768px) {
  .testimonial-card {
    padding: clamp(20px, 4vw, 30px) !important;
  }

  .testimonial-card::before {
    font-size: 3rem !important;
    top: 10px !important;
    left: 10px !important;
  }
}

/* ========== TEAM ========== */
@media (max-width: 480px) {
  .team-member {
    padding: 30px 20px !important;
  }
}

/* ========== CONTACT ========== */
@media (max-width: 768px) {
  .contact-info,
  .contact-form {
    padding: 20px !important;
  }

  .contact-container {
    gap: 24px !important;
  }

  .form-group input,
  .form-group textarea,
  .contact-form input,
  .contact-form textarea {
    font-size: 16px !important;
  }

  .contact-icon {
    width: 44px !important;
    height: 44px !important;
    font-size: 1.2rem !important;
  }
}

/* ========== FAQ ========== */
.faq-question {
  flex-wrap: wrap;
  gap: 10px;
}

.faq-question span:first-child {
  flex: 1 1 200px;
}

@media (max-width: 576px) {
  .faq-question {
    padding: 16px !important;
    font-size: 0.95rem;
  }
}

/* ========== CTA ========== */
.cta h2 {
  font-size: clamp(1.5rem, 5vw, 2.5rem) !important;
}

.cta p {
  font-size: clamp(1rem, 2.5vw, 1.2rem) !important;
}

@media (max-width: 576px) {
  .cta-buttons {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .cta-buttons .btn-custom,
  .cta-buttons .btn-outline-custom {
    width: 100%;
  }
}

/* ========== GALLERY PAGE ========== */
@media (max-width: 576px) {
  .gallery-controls .search-filter {
    flex-direction: column;
    width: 100%;
  }

  .gallery-controls .search-box {
    max-width: 100%;
    width: 100%;
  }

  .gallery-controls .view-toggle {
    width: 100%;
    justify-content: center;
  }
}

/* Lightbox mobile layout */
@media (max-width: 768px) {
  .lightbox {
    display: none;
    align-items: stretch;
    justify-content: center;
    padding: calc(10px + var(--safe-top)) 10px calc(10px + var(--safe-bottom));
    overflow-y: auto;
  }

  .lightbox.active {
    display: flex !important;
  }

  .lightbox-content {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    max-height: none;
    padding: 50px 0 20px;
  }

  .lightbox-image {
    max-height: 55vh !important;
    width: auto;
  }

  .lightbox-info {
    margin-top: 12px;
    width: 100%;
    max-height: 30vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 15px;
  }

  .lightbox-close {
    top: calc(10px + var(--safe-top)) !important;
    right: 15px !important;
    font-size: 1.5rem !important;
    z-index: 10;
  }

  .lightbox-nav {
    font-size: 1.25rem !important;
    padding: 12px !important;
  }

  .lightbox-prev {
    left: 5px !important;
  }

  .lightbox-next {
    right: 5px !important;
  }

  .back-btn-container {
    flex-wrap: wrap;
    max-width: calc(100% - 20px);
  }

  .breadcrumb {
    max-width: 100%;
  }
}

/* ========== MAINTENANCE PAGE ========== */
.maintenance-container {
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

.maintenance-container .logo-section img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 320px) {
  .countdown {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .countdown-number {
    font-size: 1.25rem !important;
  }
}

/* ========== GALLERY TEST PAGE ========== */
.test-container {
  padding: clamp(20px, 5vw, 40px);
}

.test-header h1 {
  font-size: clamp(1.5rem, 5vw, 2.5rem) !important;
}

@media (max-width: 768px) {
  .service-grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }
}

/* ========== PLACEHOLDER GENERATOR ========== */
.placeholder-page canvas {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px auto;
}

.placeholder-page .category {
  overflow: hidden;
}

@media (max-width: 576px) {
  .placeholder-page .container {
    padding: 20px 15px;
  }

  .placeholder-page .download-btn {
    width: 100%;
    margin: 5px 0;
    min-height: var(--touch-min);
  }
}

/* Hover only on devices that support it */
@media (hover: none) {
  .portfolio-card:hover,
  .service-card:hover,
  .testimonial-card:hover {
    transform: none;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .cards-track {
    animation: none !important;
  }
}
