/* ==========================================================================
   RESPONSIVE STYLES
   dogaakcayoz.com - Uzman Diyetisyen Doğa Akçayöz
   ========================================================================== */

/* ===== Large Desktops (max-width: 1280px) ===== */
@media (max-width: 1280px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 1.5rem;
  }

  .hero-content {
    padding-left: clamp(0.5rem, 2vw, 2rem);
  }

  .hero-image-wrapper {
    padding-right: clamp(0.5rem, 2vw, 2rem);
  }
}

/* ===== Large Tablets & Small Desktops (max-width: 1024px) ===== */
@media (max-width: 1024px) {
  :root {
    --header-height: 72px;
  }

  .brand-logo img {
    height: 48px;
  }

  /* Hero */
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .hero-content {
    padding-left: 0;
  }

  .hero-image-wrapper {
    padding-right: 0;
  }

  .hero-image-container {
    max-width: 100%;
  }

  /* Trust Bar */
  .trust-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  /* Specialties */
  .specialties-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .specialties-intro {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    padding-right: 0;
  }

  .specialties-intro-text {
    margin-bottom: 0;
    max-width: 600px;
  }

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

  /* About */
  .about-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .about-credentials-col {
    grid-column: span 2;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .about-bio-col .section-title {
    white-space: normal;
  }

  /* Hakkımda Biyografi Section */
  .biyografi-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  /* Publications */
  .publications-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .academic-center-illustration {
    display: none;
  }

  /* Instagram */
  .insta-feed-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }

  /* Contact Page */
  .contact-hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-hero-photo-wrapper {
    height: 320px;
  }

  .contact-options-strip {
    grid-template-columns: 1fr;
  }

  .contact-option-card {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .contact-option-card:last-child {
    border-bottom: none;
  }
}

/* ===== Navigation Breakpoint (max-width: 1150px) ===== */
@media (max-width: 1150px) {
  .site-header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #FAF8F5 !important;
  }

  .site-header nav {
    display: contents !important;
  }

  /* Hide desktop appointment CTA */
  .header-actions .btn-header-appointment {
    display: none !important;
  }

  /* Show hamburger */
  .mobile-nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 6px;
    border-radius: 8px;
    color: #1E251F;
    background: transparent;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-toggle svg {
    width: 28px;
    height: 28px;
    stroke-width: 2.2;
    pointer-events: none;
  }

  /* Mobile Nav Drawer (Full Screen) */
  .nav-menu {
    display: none !important;
    position: fixed !important;
    top: var(--header-height, 68px) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: calc(100vh - var(--header-height, 68px)) !important;
    height: calc(100dvh - var(--header-height, 68px)) !important;
    background: #FFFFFF !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 1.25rem 1.5rem 3.5rem !important;
    gap: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18) !important;
    z-index: 99999 !important;
    box-sizing: border-box !important;
  }

  .nav-menu.open {
    display: flex !important;
  }

  .nav-item {
    width: 100% !important;
    border-bottom: 1px solid #EBE7DD !important;
    box-sizing: border-box !important;
  }

  .nav-link {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    font-size: 1.08rem !important;
    font-weight: 600 !important;
    color: #1E251F !important;
    padding: 1rem 0.25rem !important;
    text-decoration: none !important;
    border-bottom: none !important;
    box-sizing: border-box !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .nav-link svg.arrow-icon {
    width: 16px !important;
    height: 16px !important;
    transition: transform 0.25s ease !important;
    flex-shrink: 0 !important;
  }

  .nav-item.open-dropdown > .nav-link svg.arrow-icon {
    transform: rotate(180deg) !important;
  }

  /* Submenu Dropdowns in Mobile */
  .nav-item.has-dropdown .dropdown-menu,
  .dropdown-menu {
    position: static !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;
    min-width: 0 !important;
    width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0.25rem 0 0.85rem !important;
    display: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    background: transparent !important;
    box-sizing: border-box !important;
  }

  .nav-item.open-dropdown > .dropdown-menu,
  .nav-item.has-dropdown.open-dropdown > .dropdown-menu {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.35rem !important;
  }

  .dropdown-link {
    display: block !important;
    padding: 0.75rem 0.95rem !important;
    font-size: 0.94rem !important;
    font-weight: 500 !important;
    color: #2D392F !important;
    background: #F8F7F3 !important;
    border-radius: 6px !important;
    border-left: 3px solid var(--color-primary-dark) !important;
    text-decoration: none !important;
    transition: background 0.15s ease !important;
    box-sizing: border-box !important;
  }

  .dropdown-link:hover,
  .dropdown-link:active {
    background: #ECEAE1 !important;
  }

  /* Mobile Language Bar inside drawer */
  .mobile-lang-bar-item {
    display: block !important;
    width: 100% !important;
    padding: 1.25rem 0 0.75rem !important;
    border-bottom: none !important;
  }

  .mobile-lang-bar {
    display: flex !important;
    gap: 0.5rem !important;
    justify-content: center !important;
    width: 100% !important;
  }

  .mobile-lang-btn {
    flex: 1 !important;
    max-width: 58px !important;
    height: 40px !important;
    border: 1px solid #D5DCD4 !important;
    background: #FFFFFF !important;
    color: #3C4A3E !important;
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .mobile-lang-btn.active,
  .mobile-lang-btn:hover {
    background: #2D392F !important;
    color: #FFFFFF !important;
    border-color: #2D392F !important;
  }

  /* Mobile CTA Button in drawer */
  .nav-menu-mobile-cta {
    display: block !important;
    width: 100% !important;
    padding: 0.75rem 0 1rem !important;
    border-bottom: none !important;
  }

  .nav-menu-mobile-cta .btn {
    width: 100% !important;
    padding: 0.95rem 1rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
  }
}


/* ===== Medium Tablets & Mobile Landscape (max-width: 768px) ===== */
@media (max-width: 768px) {
  :root {
    --spacing-3xl: 3rem;
    --spacing-4xl: 4rem;
  }

  .site-header {
    height: 68px;
  }

  :root {
    --header-height: 68px;
  }

  .brand-logo img {
    height: 42px;
    width: auto;
  }

  /* ===== HERO MOBILE & BREADCRUMB SPACING ===== */
  .breadcrumb-nav {
    padding: 0.35rem 1rem 0.15rem !important;
    padding-top: calc(var(--header-height, 68px) + 0.45rem) !important;
    margin-bottom: 0 !important;
  }

  .keto-breadcrumb {
    padding: 0.25rem 0 !important;
    margin-bottom: 0.35rem !important;
  }

  /* Home page hero (no breadcrumb) */
  .hero-section {
    padding-top: calc(var(--header-height, 68px) + 1rem) !important;
    padding-bottom: 2rem;
  }

  /* Inner pages hero (with breadcrumb) - eliminate double gap */
  .breadcrumb-nav + main .hero-section,
  .breadcrumb-nav + main .section,
  .breadcrumb-nav + main .section:first-child,
  .breadcrumb-nav + #main-content .hero-section,
  .breadcrumb-nav + #main-content .section:first-child,
  body:has(.breadcrumb-nav) .hero-section,
  body:has(.breadcrumb-nav) .section.hero-section,
  body:has(.breadcrumb-nav) main > .section:first-child {
    padding-top: 0.35rem !important;
    padding-bottom: 1.5rem !important;
  }

  /* Subpages where breadcrumb is inside hero (e.g. keto-hero-section) */
  .keto-hero-section {
    padding-top: calc(var(--header-height, 68px) + 0.45rem) !important;
    padding-bottom: 1.5rem !important;
  }

  .hero-grid,
  .keto-hero-grid,
  .classic-hero-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Show image above text on mobile */
  .hero-image-wrapper,
  .keto-hero-image-wrapper {
    order: -1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 0.5rem;
    margin-top: 0.15rem;
    margin-bottom: 0.5rem;
    width: 100%;
    box-sizing: border-box;
  }

  .hero-image-container,
  .keto-hero-image-container {
    position: relative;
    aspect-ratio: 3 / 3.4;
    max-width: 340px;
    width: 100%;
    margin: 0 auto;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-shadow: 0 12px 32px rgba(45, 57, 47, 0.12) !important;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
  }

  .hero-image-container picture,
  .hero-image-container img {
    border-radius: 24px !important;
    overflow: hidden !important;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 12%;
    display: block;
  }

  .hero-content {
    padding-left: 0;
    align-items: center;
    text-align: center;
  }

  .hero-handwritten-note-wrapper {
    display: flex;
    justify-content: center;
  }

  .hero-handwritten-note-wrapper img {
    max-width: 420px !important;
    width: 100% !important;
  }

  .hero-title {
    white-space: normal;
    font-size: 1.65rem;
    text-align: center;
  }

  .hero-badge {
    justify-content: center;
  }

  .hero-description {
    text-align: center;
    max-width: 100%;
  }

  .hero-specialties-list {
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
    width: 100%;
  }

  /* Trust Bar */
  .trust-bar {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem !important;
    padding: 1.25rem;
  }

  .trust-text h4 {
    font-size: 0.85rem;
  }

  .trust-text p {
    font-size: 0.78rem;
  }

  /* ===== SPECIALTIES MOBILE ===== */
  .specialties-intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .specialties-cards-grid,
  .specialties-grid {
    grid-template-columns: 1fr;
  }

  /* ===== ABOUT MOBILE ===== */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-image-wrapper {
    max-width: 320px;
    margin: 0 auto;
  }

  .about-bio-col .section-title {
    white-space: normal;
    font-size: 1.5rem;
  }

  .about-credentials-col {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }

  /* ===== HAKKIMDA BIYOGRAFI MOBILE ===== */
  .biyografi-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .biyografi-title {
    font-size: clamp(1.65rem, 5.5vw, 1.95rem);
    margin-bottom: 1.25rem;
  }

  .biyografi-p {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.15rem;
  }

  .biyografi-signature {
    justify-content: flex-end;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
  }

  .biyografi-signature img {
    max-width: 250px;
  }

  .biyografi-resume-card {
    padding: 1.5rem 1.25rem;
    border-radius: var(--radius-lg);
  }

  .biyografi-resume-title {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
  }

  /* ===== APPROACH SECTION MOBILE ===== */
  .approach-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .approach-cards-grid {
    grid-template-columns: 1fr;
  }

  /* ===== PUBLICATIONS MOBILE ===== */
  .publications-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .publication-card.with-book-preview,
  .publication-card.with-preview {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .publication-thumb,
  .book-preview-thumb {
    max-width: 220px;
    margin: 0.5rem auto 0 auto;
  }

  .academic-card-body {
    padding: 1.25rem;
  }

  .academic-card-title {
    font-size: 1.1rem;
  }

  .academic-meta-list {
    font-size: 0.8rem;
    padding: 0.85rem 1rem;
  }

  .academic-meta-list li {
    flex-direction: column;
    gap: 0.15rem;
  }

  /* ===== INSTAGRAM MOBILE ===== */
  .insta-showcase-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .insta-header-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .insta-header-actions .btn {
    font-size: 0.85rem;
    padding: 0.65rem 1rem;
  }

  .insta-card {
    flex: 0 0 160px;
  }

  .insta-feed-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0.85rem;
    padding-bottom: 0.75rem;
    margin-right: -1rem;
    padding-right: 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  /* ===== TESTIMONIALS MOBILE ===== */
  .testimonial-decor-left,
  .testimonial-decor-right {
    display: none;
  }

  .testimonial-quote-text {
    font-size: 1.15rem;
    padding: 0 0.5rem;
  }

  .testimonial-banner-wrapper {
    padding: 0 0.5rem;
  }

  /* ===== FOOTER MOBILE ===== */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-col:last-child {
    grid-column: span 1;
  }

  .site-footer {
    padding-top: 3rem;
    padding-bottom: 1.75rem;
  }

  .footer-sub-bar {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .footer-legal-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer-contact-item {
    flex-direction: row;
    align-items: flex-start;
  }

  /* ===== CONTACT PAGE MOBILE ===== */
  .contact-hero-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact-hero-photo-wrapper {
    height: 280px;
  }

  .contact-options-strip {
    grid-template-columns: 1fr;
  }

  .contact-option-card {
    padding: 1.25rem 1.5rem;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .contact-option-card:last-child {
    border-bottom: none;
  }

  /* Contact main section */
  .contact-main-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-info-card,
  .contact-form-card {
    padding: 1.5rem;
  }

  /* ===== DIALOG / MODAL MOBILE ===== */
  .custom-modal {
    width: 95vw;
    max-width: 95vw;
    max-height: 90vh;
    margin: auto;
  }

  .modal-body {
    padding: 1.25rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  /* ===== SUB-PAGE HERO GRIDS ===== */
  .classic-hero-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  /* ===== GENERAL TEXT OVERFLOWS ===== */
  .section-title {
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Container padding on small screens */
  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

/* ===== Small Mobile Devices (max-width: 480px) ===== */
@media (max-width: 480px) {
  /* Hero */
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn,
  .hero-actions .btn-white-pill {
    width: 100%;
    justify-content: center;
  }

  .hero-image-container {
    aspect-ratio: 3 / 3.9;
    max-width: 330px;
    border-radius: 22px !important;
  }

  .hero-image-container picture,
  .hero-image-container img {
    border-radius: 22px !important;
    object-position: center 12%;
  }

  .hero-handwritten-note-wrapper img {
    max-width: 100% !important;
  }

  /* Trust Bar single column */
  .trust-bar {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 1rem;
  }

  .trust-item {
    gap: 0.65rem;
  }

  /* Specialty cards */
  .specialty-card {
    padding: 1.25rem 1rem;
  }

  /* About image */
  .about-image-wrapper {
    max-width: 260px;
  }

  /* Hakkımda Biyografi 480px */
  .biyografi-grid {
    gap: 1.75rem;
  }

  .biyografi-title {
    font-size: 1.55rem;
  }

  .biyografi-resume-card {
    padding: 1.25rem 1rem;
  }

  .biyografi-signature {
    justify-content: center;
  }

  .biyografi-signature img {
    max-width: 210px;
  }

  /* Approach */
  .approach-card {
    padding: 1.25rem 1rem;
  }

  /* Academic cards */
  .academic-card-cover-wrap.thesis-cover-wrap,
  .academic-card-cover-wrap.book-cover-wrap {
    aspect-ratio: 16 / 10;
  }

  .academic-card-cover-wrap.book-cover-wrap {
    padding: 0.5rem 0.75rem;
  }

  .academic-card-cover-wrap.book-cover-wrap img {
    width: auto;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
  }

  .academic-card-body {
    padding: 1rem;
  }

  /* Instagram */
  .insta-card {
    flex: 0 0 140px;
  }

  .insta-header-actions .btn {
    width: 100%;
    justify-content: center;
    font-size: 0.82rem;
  }

  .insta-nav-arrows {
    display: none;
  }

  /* Footer */
  .footer-appointment-card {
    padding: 1.25rem;
  }

  .footer-brand-title {
    font-size: 1rem;
  }

  /* Modals */
  .custom-modal {
    width: 98vw;
    max-width: 98vw;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  /* Section spacing */
  .section {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  /* Contact Page */
  .contact-hero-photo-wrapper {
    height: 220px;
  }

  .contact-option-card {
    padding: 1rem 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  /* Brand logo */
  .brand-logo img {
    height: 38px;
    width: auto;
  }

  /* Container */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ===== Very Small Devices (max-width: 360px) ===== */
@media (max-width: 360px) {
  .hero-title {
    font-size: 1.35rem;
  }

  .hero-badge {
    font-size: 0.9rem;
  }

  .section-title {
    font-size: 1.35rem;
  }

  .brand-logo img {
    height: 34px;
  }

  .btn {
    font-size: 0.85rem;
    padding: 0.65rem 1.15rem;
  }

  .insta-card {
    flex: 0 0 120px;
  }

  .testimonial-quote-text {
    font-size: 1rem;
  }

  .footer-col-title {
    font-size: 0.9rem;
  }

  .academic-card-title {
    font-size: 1rem;
  }

  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* ==========================================================================
   GLOBAL RESPONSIVE UTILITIES
   ========================================================================== */

/* Prevent horizontal overflow globally */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Make all images responsive by default */
img {
  max-width: 100%;
  height: auto;
}

/* Mobile lang bar visibility (controlled by JS, hidden on desktop) */
@media (min-width: 1151px) {
  .mobile-lang-bar-item {
    display: none !important;
  }
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {
  .nav-link,
  .dropdown-link,
  .footer-links-list a,
  .footer-contact-item a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .insta-card-overlay {
    opacity: 1;
  }
}
