/* =====================================================================
   RESPONSIVE.CSS — Mobil ve tablet uyarlamaları
   ---------------------------------------------------------------------
   Bu dosya head.handlebars içinde EN SON yüklenir; böylece diğer
   dosyalardaki masaüstü kurallarını sadece küçük ekranlarda ezer.
   Masaüstü görünümüne dokunmaz.

   Kırılım noktaları:
     1100px  küçük laptop / büyük tablet
      960px  tablet (hamburger menü burada başlar — topbar.css)
      768px  büyük telefon / küçük tablet
      480px  telefon
   Üst menünün (topbar) mobil kuralları topbar.css içindedir.
   Sohbet sayfasının mobil kuralları chat.css içindedir.
===================================================================== */


/* ------------------------------------------------------------------ */
/* 1. GENEL                                                           */
/* ------------------------------------------------------------------ */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    /* Yatay kaymaya karşı son güvenlik ağı (sticky menüyü bozmaz) */
    overflow-x: clip;
}

/* Klavyeyle gezinenler için görünür odak çerçevesi */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid rgba(255, 91, 0, 0.55);
    outline-offset: 2px;
}

/* Uzun kelimeler / linkler kutudan taşmasın */
p, h1, h2, h3, h4, li, td, span, strong {
    overflow-wrap: break-word;
}

@media (max-width: 768px) {
    /* iOS Safari 16px altındaki alanlara odaklanınca sayfayı yakınlaştırır */
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    select,
    textarea {
        font-size: 16px !important;
    }

    a, button, label, summary {
        -webkit-tap-highlight-color: rgba(255, 91, 0, 0.12);
    }
}

@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;
    }
}


/* Mobil menüdeki duyuru rozeti yazının yanında dursun (topbar.css'teki
   mutlak konumlandırmayı ezer) */
@media (max-width: 960px) {
    body .topbarNav a .announcementBadge {
        position: static;
        margin-left: 4px;
    }
}


/* ------------------------------------------------------------------ */
/* 2. FOOTER                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 650px) {
    .siteFooter {
        margin-top: 36px;
        padding: 28px 0 calc(16px + env(safe-area-inset-bottom));
    }

    .footerWrapper {
        width: 90%;
        gap: 24px;
        grid-template-columns: 1fr 1fr;
    }

    .footerBrand {
        grid-column: 1 / -1;
    }

    .footerSocial {
        grid-column: 1 / -1;
    }

    .footerBrand,
    .footerLinks,
    .footerContact,
    .footerSocial {
        text-align: left;
        align-items: flex-start;
    }

    .footerBrand p {
        margin: 0;
        font-size: 14px;
    }

    .footerLinkGrid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .footerContact {
        align-items: flex-start;
    }

    .footerContact a {
        word-break: break-all;
    }

    .footerSocialIcons {
        justify-content: flex-start;
    }

    .footerSocialIcons a {
        width: 44px;
        height: 44px;
    }

    .footerBottom {
        width: 90%;
        margin-top: 22px;
    }
}


/* ------------------------------------------------------------------ */
/* 3. SAYFA BAŞLIĞI (header partial)                                 */
/* ------------------------------------------------------------------ */

@media (max-width: 768px) {
    .header {
        margin-top: 0;
        overflow: hidden;
    }

    .header img {
        height: 240px;
    }

    .header h1 {
        top: 40px;
        font-size: clamp(2rem, 9vw, 3rem);
    }

    .header.active h1,
    .header h1 {
        top: 40px;
    }

    .header h3 {
        top: 120px;
        font-size: clamp(1.3rem, 6vw, 2rem);
        padding: 0 16px;
        text-align: center;
    }
}


/* ------------------------------------------------------------------ */
/* 4. ANA SAYFA                                                       */
/* ------------------------------------------------------------------ */

@media (max-width: 768px) {
    .home-hero {
        height: min(460px, 70vh);
        height: min(460px, 70svh);
    }

    .hero-content {
        margin-top: 0;
        padding: 0 16px;
    }

    .hero-desc {
        font-size: 13px !important;
        padding: 9px 18px !important;
        letter-spacing: 0.5px !important;
    }

    .home-section {
        padding: 44px 0;
    }

    .section-container {
        width: 92%;
    }

    /* Kaydırmalı kart şeridi: bir sonraki kartın ucu görünsün ki kaydırılabildiği anlaşılsın */
    .home-grid {
        gap: 14px;
        padding: 6px 4px 24px;
        scroll-padding-left: 4px;
    }

    .home-card {
        width: min(78vw, 300px);
    }

    .equipment-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .eq-card {
        padding: 14px;
        gap: 10px;
    }
}

@media (max-width: 420px) {
    .equipment-grid {
        grid-template-columns: 1fr;
    }
}


/* ------------------------------------------------------------------ */
/* 5. GİRİŞ / KAYIT / ŞİFRE SAYFALARI                                 */
/* Form ilk ekranda görünsün diye tanıtım kısmı sadeleştirilir        */
/* ------------------------------------------------------------------ */

@media (max-width: 768px) {
    .authPage {
        padding: 20px 0 32px;
    }

    .authContainer {
        width: 92%;
        gap: 20px;
    }

    .authInfo h1 {
        font-size: clamp(28px, 8vw, 38px);
        letter-spacing: -1px;
        margin-bottom: 0;
    }

    .authInfo p,
    .authFeatures {
        display: none;
    }

    .authLogo {
        font-size: 24px;
    }

    .authCard {
        padding: 22px 18px;
        border-radius: 20px;
    }

    .authBottom {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        text-align: center;
    }
}


/* ------------------------------------------------------------------ */
/* 6. HATA SAYFASI                                                    */
/* ------------------------------------------------------------------ */

.error {
    min-height: calc(100vh - 160px);
    height: auto;
    padding: 40px 20px;
    text-align: center;
}

.error i {
    font-size: clamp(9rem, 40vw, 20rem);
}

.error span {
    font-size: clamp(1.8rem, 7vw, 4.5rem);
    line-height: 1.2;
}


/* ------------------------------------------------------------------ */
/* 7. PROFİL SAYFASI                                                  */
/* ------------------------------------------------------------------ */

/* Grid sütunları içeriğin en geniş kelimesine göre büyümesin (taşmanın sebebi buydu) */
.profileContainer {
    grid-template-columns: 390px minmax(0, 1fr);
}

.profileContainer > *,
.securityStrip > *,
.profileInputRow > *,
.profileSocialGrid > * {
    min-width: 0;
}

@media (max-width: 1200px) {
    .profileContainer {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .profilePage {
        padding-top: 20px;
    }

    .profileHeader,
    .profileContainer,
    .securityStrip {
        width: 92%;
    }

    .profileHeader {
        gap: 14px;
    }

    .profileHeader h1 {
        font-size: 30px;
    }

    .profileHeaderIcon {
        width: 52px;
        height: 52px;
        flex-shrink: 0;
    }

    .profilePreviewCard,
    .profileFormCard,
    .securityStrip {
        padding: 22px 18px;
        border-radius: 20px;
    }

    .profileStats strong {
        font-size: 18px;
    }

    .profileStats span {
        font-size: 12px;
    }

    .profileSaveButton,
    .changePasswordButton {
        width: 100%;
        min-width: 0;
    }

    .formActionsArea {
        flex-direction: column;
        align-items: stretch;
    }

    .pwModalBox {
        width: 100%;
        max-height: 92dvh;
        overflow-y: auto;
        padding: 22px 18px;
        border-radius: 22px;
    }

    .pwModalGrid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .cropModalBox {
        width: 96vw;
        max-height: 92dvh;
        overflow-y: auto;
    }

    .cropActions {
        flex-direction: column-reverse;
    }

    .cropActions button {
        width: 100%;
    }
}


/* ------------------------------------------------------------------ */
/* 8. ADMIN PANELİ                                                    */
/* Mobilde yan menü, yatay kaydırılabilir sekmelere dönüşür           */
/* ------------------------------------------------------------------ */

.adminPage {
    grid-template-columns: 260px minmax(0, 1fr);
}

.adminContent,
.rolesPanel > * {
    min-width: 0;
}

.rolesPanel {
    grid-template-columns: 430px minmax(0, 1fr);
}

@media (max-width: 1200px) {
    .adminPage,
    .rolesPanel {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 960px) {
    .adminPage {
        padding: 14px;
        gap: 16px;
        min-height: auto;
    }

    .adminSidebar {
        min-height: 0;
        padding: 10px;
        border-radius: 18px;
        flex-direction: row;
        align-items: center;
        position: sticky;
        top: calc(var(--topbar-h, 64px) + 8px);
        z-index: 20;
    }

    .adminSideLogo,
    .adminVersion,
    .adminMenuDropdown {
        display: none;
    }

    .adminMenu {
        flex-direction: row;
        gap: 6px;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .adminMenu::-webkit-scrollbar {
        display: none;
    }

    .adminSubMenu,
    .adminSubMenu.show {
        display: flex;
        flex-direction: row;
        gap: 6px;
        margin: 0;
        padding: 0;
        border-left: none;
    }

    .adminMenu a,
    .adminSubMenu a {
        min-height: 42px;
        padding: 0 14px;
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 14px;
        gap: 8px;
    }

    .adminHero {
        padding: 26px 20px;
        border-radius: 20px;
    }

    .adminHero h1 {
        font-size: clamp(28px, 8vw, 40px);
    }
}

@media (max-width: 600px) {
    .adminStats {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .adminStatCard {
        padding: 16px;
    }

    .adminTableCard {
        padding: 16px;
        border-radius: 20px;
    }

    .adminTable th,
    .adminTable td {
        padding: 12px 10px;
        font-size: 13px;
        white-space: nowrap;
    }

    .rolesListCard,
    .roleDetailCard {
        border-radius: 20px;
    }

    .rolesListCard {
        padding: 16px;
    }

    .roleCreateBox,
    .userDetailBox,
    .adminConfirmBox {
        width: calc(100vw - 24px);
        max-height: 92dvh;
        overflow-y: auto;
    }
}


/* ------------------------------------------------------------------ */
/* 9. YAZI EKLE / DÜZENLE, TEK YAZI, HAKKIMDA, PROFİLLER, DUYURULAR   */
/* ------------------------------------------------------------------ */

@media (max-width: 768px) {
    .add-page,
    .addPageContainer {
        padding-left: 4%;
        padding-right: 4%;
    }

    .add-card,
    .form-container {
        padding: 22px 18px;
        border-radius: 20px;
    }

    .aboutHero {
        padding: 34px 22px;
    }

    .aboutHero h1 {
        font-size: clamp(32px, 10vw, 48px);
    }

    .aboutMainCard,
    .whyBlogCard,
    .aboutTextCard {
        padding: 22px 18px;
    }

    .aboutInfoGrid,
    .whyBlogGrid {
        grid-template-columns: 1fr;
    }
}


/* ------------------------------------------------------------------ */
/* 10. TİTANYUM PAZARI                                                */
/* (Sayfa kendi <style> etiketini en sona yüklediği için seçiciler     */
/*  "body" ile güçlendirildi)                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 600px) {
    body .top-banner {
        height: auto;
        min-height: 230px;
        margin-top: 0;
        padding: 26px 16px;
    }

    body .main-logo {
        font-size: clamp(34px, 12vw, 56px);
    }

    body .titanyum-nav-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 16px;
    }

    body .titanyum-nav-brand {
        justify-content: center;
    }

    body .t-main-title {
        font-size: clamp(26px, 8vw, 36px);
    }
}

@media (max-width: 600px) {
    body .titanyum-main-nav {
        height: auto;
        margin-bottom: 24px;
    }

    body .titanyum-search-wrapper {
        width: 100%;
    }
}


/* ------------------------------------------------------------------ */
/* 11. ADMIN — SİSTEM LOGLARI                                         */
/* ------------------------------------------------------------------ */

.logContent {
    min-width: 0;
    flex: 1;
}

@media (max-width: 600px) {
    .logItem {
        gap: 10px;
    }

    .logIcon {
        display: none;
    }

    .logHeader {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .logUser {
        flex-wrap: wrap;
        gap: 6px;
    }

    .logDate {
        font-size: 12px;
        white-space: nowrap;
    }
}


/* ===================================================================
   12. MİNİMAL MOBİL ÖLÇEK (600px ve altı)
   -------------------------------------------------------------------
   Telefonda tutarlı, daha sıkı bir ölçek:
     Sayfa başlığı (h1)   24px      Kart/bölüm başlığı   19-20px
     Form alanı / buton   46px      Bölüm dikey boşluğu  28-32px
     Banner yüksekliği    ~180px    Kenar boşluğu        14-16px
=================================================================== */

@media (max-width: 600px) {

    /* --- Genel form ögeleri --- */
    .authCard input,
    .profileGroup input,
    .add-card input,
    .form-container input,
    .input-box input,
    .input-box select {
        height: 46px;
    }

    .authSubmit,
    .publish-btn,
    .profileSaveButton,
    .changePasswordButton,
    .deleteAccountButton,
    .imageUploadButton,
    .pwSubmitBtn {
        height: 46px;
        min-height: 46px;
        font-size: 15px;
        border-radius: 12px;
    }

    /* --- Footer --- */
    .siteFooter {
        margin-top: 24px;
        padding-top: 22px;
    }

    .footerLogo {
        font-size: 22px;
        margin-bottom: 8px;
    }

    .siteFooter h4 {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .footerLinkGrid a,
    .footerContact a,
    .footerContact span {
        font-size: 14px;
    }

    .footerLinkGrid {
        gap: 9px;
    }

    .footerSocialIcons a {
        width: 40px;
        height: 40px;
    }

    .footerBottom p {
        font-size: 12px;
    }

    /* --- Ana sayfa --- */
    .home-hero {
        height: min(380px, 56svh);
    }

    .home-section {
        padding: 30px 0;
    }

    .section-header {
        margin-bottom: 14px;
        gap: 8px !important;
    }

    .section-title {
        font-size: 21px !important;
    }

    .section-subtitle {
        font-size: 13px;
    }

    .home-card {
        width: min(64vw, 240px);
    }

    .card-image {
        height: 140px;
    }

    .card-body {
        padding: 12px;
    }

    .card-body h3 {
        font-size: 15px;
    }

    .card-body p {
        font-size: 12.5px;
    }

    .equipment-grid,
    body .equipment-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .eq-card {
        padding: 10px;
        gap: 8px;
        border-radius: 12px;
    }

    .eq-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
        font-size: 14px;
        border-radius: 10px;
    }

    .eq-info h4 {
        font-size: 9.5px;
        letter-spacing: 0.4px;
    }

    .eq-info p {
        font-size: 12.5px;
        line-height: 1.3;
    }

    /* --- Giriş / Kayıt (üst barda logo zaten var) --- */
    .authLogo {
        display: none;
    }

    .authInfo h1 {
        font-size: 24px;
        letter-spacing: -0.6px;
    }

    .authBadge {
        font-size: 12px;
        padding: 6px 12px;
        margin-bottom: 8px;
    }

    .authCardHeader h2 {
        font-size: 22px;
    }

    .authCardHeader p {
        font-size: 13.5px;
    }

    .authCard {
        padding: 18px 16px;
    }

    /* --- Yazı / ilan ekleme ve düzenleme formları --- */
    .add-page {
        padding-top: 14px !important;
        padding-bottom: 20px !important;
    }

    .add-card h1,
    .form-container h1 {
        font-size: 21px !important;
    }

    .add-card,
    .form-container {
        padding: 18px 14px !important;
    }

    /* --- Tek yazı --- */
    .singlePage {
        padding-top: 14px !important;
        padding-bottom: 20px !important;
    }

    .singleTitle {
        font-size: 23px !important;
        line-height: 1.25;
    }

    /* --- Hakkımda --- */
    .aboutPage {
        padding-top: 14px;
    }

    .aboutHero {
        width: 92%;
        min-height: 0;
        margin-top: 0;
        padding: 0;
        border-radius: 18px;
    }

    .aboutHeroContent {
        padding: 22px 18px !important;
    }

    .aboutHero h1 {
        font-size: 26px;
    }

    .aboutHero p {
        font-size: 14px;
    }

    .aboutProfileCard h2,
    .aboutSectionTitle h2 {
        font-size: 21px;
    }

    .aboutAvatar {
        width: 104px;
        height: 104px;
    }

    /* --- Profil --- */
    .profileHeader h1 {
        font-size: 24px;
    }

    .profileHeader p {
        font-size: 13px;
    }

    .profileHeaderIcon {
        width: 44px;
        height: 44px;
    }

    .profileAvatarBox {
        width: 104px;
        height: 104px;
        margin-bottom: 14px;
    }

    .profileAvatarBox img {
        width: 100%;
        height: 100%;
    }

    .profileAvatarBox span {
        width: 28px;
        height: 28px;
        right: 0;
        bottom: 2px;
    }

    .profilePreviewCard h2 {
        font-size: 20px;
    }

    .profileCardTitle h2,
    .securityTitle h2 {
        font-size: 18px;
    }

    .profileCardTitle > i,
    .securityTitle > i {
        width: 38px;
        height: 38px;
    }

    .profilePreviewCard,
    .profileFormCard,
    .securityStrip {
        padding: 18px 14px;
    }

    .readonlyInput input {
        height: 46px !important;
        padding-bottom: 0 !important;
        padding-right: 110px !important;
    }

    .readonlyInput span {
        top: 50% !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
    }

    /* --- Herkese açık profil --- */
    .publicProfilePage h2,
    .postsSectionTitle h2 {
        font-size: 20px;
    }

    /* --- Duyurular --- */
    .anno-top-banner {
        height: auto;
        min-height: 0;
        padding: 26px 14px 20px;
        margin-bottom: 24px;
    }

    .anno-top-banner .banner-content h1 {
        font-size: 26px;
        letter-spacing: 2px;
        margin-bottom: 4px;
    }

    .anno-top-banner .banner-content p {
        font-size: 11px;
        letter-spacing: 1px;
        margin-bottom: 14px;
    }

    .banner-stats {
        flex-direction: row !important;
        flex-wrap: nowrap;
        gap: 8px;
        width: 100%;
    }

    .b-stat {
        flex: 1;
        min-width: 0;
        padding: 10px 6px;
        gap: 0;
        justify-content: center;
    }

    .b-stat > i {
        display: none;
    }

    .b-stat-text {
        text-align: center;
        min-width: 0;
    }

    .b-stat-text strong {
        font-size: 16px;
    }

    .b-stat-text span {
        font-size: 9px;
        letter-spacing: 0.5px;
    }

    .anno-title {
        font-size: 19px !important;
        padding-right: 36px;
    }

    .anno-preview {
        font-size: 14.5px;
        line-height: 1.55;
        margin-bottom: 16px;
    }

    /* --- Titanyum başlığı --- */
    body .top-banner {
        min-height: 170px;
        padding: 20px 14px;
    }

    body .main-logo {
        font-size: 32px;
        letter-spacing: 2px;
    }

    body .sub-logo-text {
        font-size: 10px;
        letter-spacing: 3px;
    }

    body .add-btn {
        margin-top: 10px;
        padding: 7px 18px;
        font-size: 13px;
    }

    body .titanyum-mid-header {
        padding: 6px 16px 4px;
        margin-bottom: 14px;
    }

    body .t-main-title {
        font-size: 22px;
    }

    body .t-subtitle-text {
        font-size: 13px;
    }

    body .hero-separator {
        margin-top: 12px;
    }

    /* --- İlan detayı --- */
    body .ts-title {
        font-size: 21px;
    }

    body .ts-main-img {
        height: auto;
        max-height: 320px;
        aspect-ratio: 4 / 3;
    }

    body .ts-thumb-btn {
        width: 52px;
        height: 52px;
    }

    /* --- Admin paneli --- */
    .adminHero {
        padding: 20px 16px;
    }

    .adminHero h1 {
        font-size: 24px;
    }

    .adminHero p {
        font-size: 13.5px;
    }

    .adminStatCard {
        min-height: 0;
        padding: 14px;
        border-radius: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .adminStatIcon {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .adminStatCard span,
    .adminStatCard p {
        font-size: 11.5px;
        line-height: 1.3;
    }

    .adminStatCard strong {
        font-size: 22px;
        margin: 2px 0;
    }

    .adminTableHeader h2,
    .rolesListHeader h2,
    .roleDetailHeader h2 {
        font-size: 19px;
    }

    .roleListItem {
        padding: 12px;
    }

    /* --- Hata sayfası --- */
    .error {
        min-height: 60vh;
    }
}
