/* ============================================
   RESPONSIVE STYLESHEET FOR GEORGIAN COMPUTER SOCIETY
   Modern Mobile-First Responsive Design
   ============================================ */

/* === RESET & BASE STYLES === */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 6px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

table {
    max-width: 100%;
}

/* === RESPONSIVE BANNER === */
.banner {
    width: 100% !important;
    max-width: 760px;
    height: auto !important;
    min-height: 80px;
    padding: 15px;
}

.banner-title {
    font-size: clamp(18px, 4vw, 32px);
    line-height: 1.2;
}

.banner-subtitle {
    font-size: clamp(10px, 2.5vw, 14px);
}

/* === RESPONSIVE LAYOUT === */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.banner-container {
    max-width: 760px;
    margin: 0 auto;
    width: 100%;
}

/* === CONTENT WRAPPER === */
.content-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* === MOBILE MENU TOGGLE === */
.mobile-menu-toggle {
    display: none;
    background: #0066cc;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    border-radius: 4px;
    margin-bottom: 10px;
}

.mobile-menu-toggle:before {
    content: "☰ ";
    font-size: 20px;
    margin-right: 8px;
}

.mobile-menu-toggle.active:before {
    content: "✕ ";
}

/* === TABLET STYLES (768px - 1024px) === */
@media screen and (max-width: 1024px) {
    body {
        padding: 4px;
    }

    table[width="100%"] {
        width: 100% !important;
    }
}

/* === MOBILE STYLES (up to 768px) === */
@media screen and (max-width: 768px) {
    body {
        padding: 2px;
        font-size: 16px; /* Better readability on mobile */
    }

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: block;
    }

    /* Banner adjustments */
    .banner {
        min-height: 60px;
        padding: 10px;
    }

    /* Force table cells to stack vertically */
    table[width="100%"] > tbody > tr > td {
        display: block !important;
        width: 100% !important;
    }

    /* Hide sidebars on mobile by default */
    td[width="99"],
    td[width="160"],
    .sidebar-left,
    .sidebar-right {
        display: none;
    }

    /* Show sidebars when menu is active */
    .sidebar-left.mobile-visible,
    .sidebar-right.mobile-visible {
        display: block !important;
        width: 100% !important;
        margin-bottom: 15px;
    }

    /* Hide decorative spacer columns */
    td[width="2"],
    td[background*="Pat01.gif"] {
        display: none;
    }

    /* Make main content full width */
    td[bgcolor="#FFFFFF"] {
        width: 100% !important;
        padding: 10px !important;
    }

    /* Improve font sizes for mobile */
    font[size="1"] {
        font-size: 14px !important;
    }

    font[size="2"] {
        font-size: 16px !important;
    }

    font[size="3"] {
        font-size: 18px !important;
    }

    h4 {
        font-size: 20px !important;
    }

    /* Make navigation more touch-friendly */
    table[width="90"],
    table[width="87"],
    table[width="150"],
    table[width="130"] {
        width: 100% !important;
        margin-bottom: 10px;
    }

    table[width="90"] td,
    table[width="87"] td,
    table[width="150"] td,
    table[width="130"] td {
        padding: 12px 8px !important;
        font-size: 16px !important;
    }

    /* Better link tap targets */
    a {
        padding: 8px 4px;
        display: inline-block;
        min-height: 44px; /* iOS recommended tap target */
        line-height: 28px;
    }

    /* Improve blockquote readability */
    blockquote {
        margin: 0;
        padding: 10px;
    }

    /* Make tables inside content responsive */
    blockquote table {
        width: 100% !important;
    }

    blockquote table td {
        display: block !important;
        width: 100% !important;
        padding: 8px !important;
    }

    /* Language selector */
    table[width="80"] {
        width: 100% !important;
    }

    table[width="80"] td {
        width: 50% !important;
        display: inline-block !important;
    }

    /* Copyright footer */
    table[width="450"] {
        width: 100% !important;
        margin-top: 20px;
    }

    /* Border adjustments for mobile */
    .kontur {
        border-width: 1px !important;
    }
}

/* === SMALL MOBILE STYLES (up to 480px) === */
@media screen and (max-width: 480px) {
    body {
        padding: 1px;
        font-size: 15px;
    }

    .banner {
        padding: 8px;
        min-height: 50px;
    }

    .banner-title {
        font-size: 16px !important;
        padding: 0 5px;
    }

    .banner-subtitle {
        font-size: 11px !important;
        margin-top: 3px;
    }

    /* Even larger tap targets for small phones */
    a {
        min-height: 48px;
        line-height: 32px;
        padding: 8px;
    }

    /* Smaller heading for tiny screens */
    h4 {
        font-size: 18px !important;
        margin: 10px 0;
    }

    /* Reduce padding */
    blockquote {
        padding: 5px;
    }

    td[bgcolor="#FFFFFF"] {
        padding: 5px !important;
    }

    /* Compact navigation */
    table[width="90"] td,
    table[width="87"] td,
    table[width="150"] td {
        padding: 10px 6px !important;
        font-size: 15px !important;
    }
}

/* === LANDSCAPE PHONE (up to 667px height) === */
@media screen and (max-height: 667px) and (orientation: landscape) {
    .banner {
        min-height: 50px;
        padding: 5px;
    }

    .banner-title {
        font-size: 18px !important;
    }

    .banner-subtitle {
        font-size: 11px !important;
    }
}

/* === PRINT STYLES === */
@media print {
    .banner {
        background: white !important;
        color: black !important;
        border: 2px solid black;
    }

    .banner-title,
    .banner-subtitle {
        color: black !important;
        text-shadow: none !important;
    }

    .sidebar-left,
    .sidebar-right {
        display: none !important;
    }

    a {
        text-decoration: underline;
        color: black;
    }
}

/* === ACCESSIBILITY IMPROVEMENTS === */
@media (prefers-reduced-motion: reduce) {
    .banner-title,
    .banner-subtitle {
        animation: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .kontur {
        border-width: 3px !important;
    }

    a {
        text-decoration: underline !important;
    }
}

/* === UTILITY CLASSES === */
.mobile-only {
    display: none;
}

@media screen and (max-width: 768px) {
    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none;
    }
}

.text-center {
    text-align: center;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}
