/* =========================================================
   Saitebi.Net Category 
========================================================= */

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    background: #2e2e2e;
    font-family: Arial, Sylfaen, "DejaVu Sans", sans-serif;
    font-size: 13px;
    text-rendering: optimizeLegibility;
}

a { text-decoration: none; }

/* ფოკუსის ხილვადობა კლავიატურისთვის */
a:focus-visible,
.categories > span:focus-visible {
    outline: 3px solid #000080;
    outline-offset: 2px;
}

.top-menu a:focus-visible,
.top-menu .categories > span:focus-visible,
.footer a:focus-visible {
    outline-color: #ffffff;
}


/* =========================================================
   TOP MENU
========================================================= */

.top-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: #a0522d;
    z-index: 1000;
}

.top-menu-inner {
    width: 940px;
    height: 40px;
    margin: 0 auto;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.top-link {
    position: relative;
    display: flex;
    height: 40px;
    padding: 0 18px;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 15px;
    font-weight: bold;
    border-left: 3px dotted #2d2d2d;
    white-space: nowrap;
    transition: background-color .15s ease;
}

.top-link:last-child { border-right: 3px dotted #2d2d2d; }

.top-link:hover { color: #ffffff; background: #8b4513; }

.top-link img { margin-left: 5px; }


/* =========================================================
   CATEGORIES DROPDOWN
========================================================= */

.categories { position: relative; cursor: default; }

.categories > span {
    display: flex;
    height: 40px;
    padding: 0 18px;
    align-items: center;
    color: #ffffff;
    font-size: 15px;
    font-weight: bold;
    white-space: nowrap;
}

.categories-dropdown {
    position: absolute;
    top: 40px;
    left: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 500px;
    padding: 10px;
    background: #faf0e6;
    border: 6px solid #a0522d;
    box-shadow: 0 7px 18px rgba(0, 0, 0, .35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: opacity .15s ease, visibility .15s ease, transform .15s ease;
    z-index: 1100;
}

.categories:hover .categories-dropdown,
.categories:focus-within .categories-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.categories-dropdown a {
    display: block;
    padding: 5px 8px;
    color: #4f7184;
    font-size: 15px;
    line-height: 20px;
}

.categories-dropdown a:hover { color: #ffffff; background: #4f7184; }


/* =========================================================
   HEADER
========================================================= */

.header {
    width: 940px;
    height: 157px;
    margin: 0 auto;
    padding-top: 40px;
    background: #2e2e2e;
}

.header-inner { position: relative; width: 940px; height: 117px; }

.logo { position: absolute; top: 5px; left: 0; width: 115px; height: 110px; }

.logo a { position: relative; display: block; width: 115px; height: 110px; }

.logo > a > img:first-child { display: block; width: 115px; height: 110px; }

.logo-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 115px;
    height: 110px;
    opacity: 0;
    transition: opacity .15s ease;
}

.logo a:hover .logo-hover { opacity: 1; }

.header-ad { position: absolute; top: 5px; right: 0; width: 750px; height: 100px; }

.header-ad img { display: block; width: 750px; height: 100px; border: 0; }


/* =========================================================
   MAIN
========================================================= */

.main { width: 940px; min-height: 500px; margin: 0 auto; background: #a4a4a4; }

.main-line { width: 940px; height: 6px; background: #808080; }

.category { width: 888px; margin: 0 auto; padding: 18px 0 40px; }

.category-title { margin-bottom: 18px; text-align: center; }

.category-title h1 {
    margin: 0;
    color: #000080;
    font-size: 21px;
    font-weight: bold;
    line-height: 28px;
}

.title-decoration { width: 70px; height: 3px; margin: 7px auto 8px; background: #a0522d; }

.category-title p { margin: 0; color: #222222; font-size: 16px; line-height: 20px; }

/* შესავალი ტექსტი */
.category-intro {
    margin: 30px 0 0;
    padding: 12px 16px;
    background: #b5b5b5;
    border-left: 4px solid #a0522d;
    color: #1a1a1a;
    font-size: 14px;
    line-height: 22px;
}

.category-intro p { margin: 0; }

/* ქვეკატეგორიის სათაური */
.category h2 {
    margin: 26px 0 14px;
    color: #000080;
    font-size: 18px;
    font-weight: bold;
    line-height: 24px;
}


/* =========================================================
   SITE GRID + CARD
========================================================= */

.site-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px 12px;
    width: 100%;
}

.site-card {
    display: flex;
    width: 100%;
    min-height: 120px;
    padding: 8px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #b5b5b5;
    border: 1px solid #888888;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
    transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.site-card:hover,
.site-card:focus-visible {
    transform: translateY(-3px);
    background: #DEDCDC;
    box-shadow: 0 5px 12px rgba(0, 0, 0, .28);
}

.site-logo {
    position: relative;
    width: 145px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.site-logo img {
    display: block;
    width: 145px;
    height: 55px;
    object-fit: cover;
    border: 0;
    transition: transform .18s ease, box-shadow .18s ease;
}

.site-card:hover .site-logo img,
.site-card:focus-visible .site-logo img {
    transform: scale(1.07);
    box-shadow: 0 0 0 3px #a0522d, 0 3px 10px rgba(0, 0, 0, .4);
}

.site-domain {
    margin-top: 7px;
    color: #000000;
    font-size: 13px;
    line-height: 17px;
    text-align: center;
}

.site-tag {
    margin-top: 4px;
    padding: 1px 9px;
    background: #a0522d;
    color: #ffffff;
    border-radius: 10px;
    font-size: 11px;
    line-height: 16px;
}


/* =========================================================
   TOOLTIP (მხოლოდ მაუსის მქონე მოწყობილობაზე)
========================================================= */

.site-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 12px);
    transform: translateX(-50%) translateY(6px);
    width: 270px;
    padding: 12px 14px;
    background: rgba(25, 25, 25, .97);
    color: #ffffff;
    border-radius: 9px;
    font-size: 13px;
    line-height: 19px;
    text-align: center;
    box-shadow: 0 7px 20px rgba(0, 0, 0, .35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
    z-index: 5000;
}

.site-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(25, 25, 25, .97);
}

.site-tooltip strong {
    display: block;
    margin-bottom: 4px;
    color: #ffffff;
    font-size: 15px;
    line-height: 20px;
}

.site-logo:hover .site-tooltip,
.site-card:focus-visible .site-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ტელეფონზე (hover არ არსებობს) tooltip საერთოდ არ ჩანს */
@media (hover: none) {
    .site-tooltip { display: none; }
}


/* =========================================================
   FOOTER
========================================================= */

.footer {
    width: 940px;
    min-height: 120px;
    margin: 0 auto;
    padding: 30px 0 15px;
    background: #524c4c;
    color: #fffafa;
    text-align: center;
}

.footer p { margin: 0; padding: 0; font-size: 13px; line-height: 20px; }

.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
}

.footer .footer-links a:link,
.footer .footer-links a:visited {
    color: #fffafa;
    font-size: 13px;
    white-space: nowrap;
    transition: color .15s ease;
}

.footer .footer-links a:hover { color: #ffd9a8; }

.footer-links__sep { color: #aaaaaa; font-size: 13px; }


/* =========================================================
   ტაბლეტი: 3 სვეტი (600–950px)
========================================================= */

@media screen and (min-width: 600px) and (max-width: 950px) {
    .site-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


/* =========================================================
   MOBILE / TABLET (≤950px)
========================================================= */

@media screen and (max-width: 950px) {

    html, body { width: 100%; min-width: 0; overflow-x: hidden; }

    /* მენიუ */
    .top-menu {
        height: auto;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .top-menu::-webkit-scrollbar { display: none; width: 0; height: 0; }

    .top-menu-inner { width: max-content; min-width: 100%; margin: 0; justify-content: flex-start; }

    .top-link { flex: 0 0 auto; padding: 0 12px; font-size: 14px; }

    .categories > span { padding: 0 12px; font-size: 14px; }

    .categories-dropdown {
        position: fixed;
        top: 40px;
        left: 10px;
        width: calc(100vw - 20px);
        max-width: 500px;
        max-height: calc(100vh - 50px);
        overflow-y: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .categories-dropdown::-webkit-scrollbar { display: none; width: 0; height: 0; }

    .categories-dropdown a { font-size: 14px; line-height: 19px; }

    /* ჰედერი */
    .header { width: 100%; height: auto; margin: 0; padding-top: 50px; overflow: hidden; }

    .header-inner { width: 100%; height: auto; display: flex; align-items: flex-start; }

    .logo { position: relative; top: 0; left: 5px; flex: 0 0 85px; width: 85px; height: auto; overflow: hidden; }

    .logo a { width: 85px; height: auto; overflow: hidden; }

    .logo > a > img:first-child,
    .logo-hover { width: 85px; height: auto; max-height: 100px; object-fit: contain; object-position: top center; }

    .header-ad { position: relative; top: 0; right: auto; margin-left: 8px; flex: 1 1 auto; width: auto; height: auto; overflow: hidden; }

    .header-ad img { width: 100%; height: auto; object-fit: contain; object-position: left top; }

    /* მთავარი */
    .main, .main-line { width: 100%; margin: 0; }

    .category { width: calc(100% - 24px); padding: 18px 0 35px; }

    .category-title { margin-bottom: 14px; }

    .category-title p { font-size: 14px; line-height: 21px; }

    .category-intro { font-size: 13px; line-height: 21px; padding: 10px 12px; }

    .category h2 { font-size: 17px; margin: 22px 0 12px; }

    .site-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

    .site-card { padding: 6px; }

    .site-logo { width: 100%; }

    .site-logo img { width: 100%; max-width: 145px; }

    .site-domain { font-size: 12px; line-height: 16px; }

    /* ფუტერი */
    .footer { width: 100%; min-height: 0; padding: 14px 12px 12px; }

    .footer-links { gap: 4px 8px; margin-bottom: 6px; }

    .footer-links a, .footer-links__sep { font-size: 12px; }

    .footer p { font-size: 12px; line-height: 18px; }
}


/* =========================================================
   VERY SMALL PHONES (≤420px)
========================================================= */

@media screen and (max-width: 420px) {

    .top-link, .categories > span { padding: 0 10px; font-size: 13px; }

    .header { padding-top: 48px; }

    .logo { left: 3px; flex-basis: 62px; width: 62px; }

    .logo a, .logo > a > img:first-child, .logo-hover { width: 62px; }

    .logo > a > img:first-child, .logo-hover { max-height: 72px; }

    .header-ad { margin-left: 6px; }

    .category { width: calc(100% - 16px); }

    .category-title p { font-size: 13px; line-height: 19px; }

    .site-grid { gap: 10px; }

    .site-card { min-height: 112px; }

    .site-domain { font-size: 11px; }

    .footer-links { gap: 3px 6px; }

    .footer-links a, .footer-links__sep { font-size: 11px; }
}


/* =========================================================
   ანიმაციების შემცირება (სისტემის პარამეტრი)
========================================================= */

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }

    .site-card:hover,
    .site-card:focus-visible,
    .site-card:hover .site-logo img,
    .site-card:focus-visible .site-logo img { transform: none; }
}
