/*
Theme Name: DITIB Clone
Theme URI: https://ditib.de
Author: DITIB Clone Theme
Author URI: https://ditib.de
Description: A 1:1 clone of the DITIB (Türkisch-Islamische Union der Anstalt für Religion e.V.) website design. Replicates the full homepage layout including navigation, sliders, flip cards, news tabs, and footer.
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ditib-clone
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
    font-family: "Open Sans", Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #0c8aa4;
    background-image: url('img/backround.png');
    background-repeat: repeat;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* ==========================================================================
   LAYOUT CONTAINERS
   ========================================================================== */
.wrapper {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 10px;
}

/* Grid columns */
.col_3 { width: 33.333%; float: left; padding: 0 5px; }
.col_5c { width: 20%; float: left; padding: 0 3px; }
.clearfix::after { content: ''; display: table; clear: both; }
.row { overflow: hidden; }

/* ==========================================================================
   TOP BAR (utility bar above header)
   ========================================================================== */
#topbar {
    background-color: #0a6e7f;
    padding: 5px 0;
    font-size: 12px;
    color: #fff;
}
#topbar .wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#topbar .topbar-left a,
#topbar .topbar-right a {
    color: #cce8ef;
    margin: 0 5px;
    font-size: 11px;
    transition: color 0.2s;
}
#topbar .topbar-left a:hover,
#topbar .topbar-right a:hover { color: #fff; }

#topbar .topbar-right { display: flex; align-items: center; gap: 8px; }
#topbar .topbar-right .lang-switch {
    border-right: 1px solid #cce8ef;
    padding-right: 8px;
    margin-right: 3px;
}
#topbar .topbar-right .lang-switch a {
    font-weight: 700;
    font-size: 12px;
}
#topbar .topbar-right .social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(255,255,255,0.12);
    border-radius: 3px;
    margin: 0 1px;
}
#topbar .topbar-right .social-icons a:hover { background: rgba(255,255,255,0.3); }
#topbar .topbar-right .social-icons i { font-size: 12px; color: #fff; }

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
#header {
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    position: relative;
    z-index: 1000;
}
#header .wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    height: 80px;
}
#logo {
    flex-shrink: 0;
    padding: 8px 0;
}
#logo img { height: 60px; width: auto; }

/* Main Nav */
.rownav { background-color: #134978; }
.rownav .wrapper { padding: 0; }

#cssmenu {
    display: flex;
    align-items: center;
}
#cssmenu ul {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}
#cssmenu > ul > li > a {
    display: block;
    padding: 14px 16px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.2px;
    border-right: 1px solid rgba(255,255,255,0.15);
    transition: background-color 0.2s;
}
#cssmenu > ul > li > a:hover,
#cssmenu > ul > li.active > a {
    background-color: #0c2d4f;
}

/* Dropdown menus */
#cssmenu ul li { position: relative; }
#cssmenu ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #134978;
    min-width: 220px;
    z-index: 9999;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    flex-direction: column;
}
#cssmenu ul li:hover > ul { display: flex; }
#cssmenu ul ul li a {
    display: block;
    padding: 11px 16px;
    color: #dce8f0;
    font-size: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: background-color 0.2s, color 0.2s;
}
#cssmenu ul ul li a:hover {
    background-color: #0c2d4f;
    color: #fff;
}

/* Search icon in nav */
.nav-search {
    margin-left: auto;
    padding: 0 14px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

/* ==========================================================================
   MAIN CONTENT AREA (3-column layout below nav)
   ========================================================================== */
#main-content {
    padding: 12px 0 0;
}
#main-content .wrapper { }

.content-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

/* Left column: main slider */
.col-left {
    flex: 0 0 480px;
    max-width: 480px;
}

/* Middle column: news list */
.col-middle {
    flex: 0 0 220px;
    max-width: 220px;
}

/* Right column: bxSlider banners */
.col-right {
    flex: 0 0 250px;
    max-width: 250px;
}

/* ==========================================================================
   MAIN SLIDER (SliderPro)
   ========================================================================== */
#slider-pro-wrapper {
    position: relative;
    overflow: hidden;
    background: #111;
    border-radius: 2px;
}
.sp-slide {
    position: relative;
}
.sp-slide img {
    width: 100%;
    height: 270px;
    object-fit: cover;
}
.sp-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    padding: 20px 16px 12px;
    font-size: 13px;
    line-height: 1.4;
}
.sp-caption .slide-date {
    font-size: 11px;
    color: #ccc;
    margin-bottom: 4px;
    display: block;
}
.sp-caption h3 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.35;
}

/* Slider navigation arrows */
.sp-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s;
}
.sp-arrow:hover { background: rgba(0,0,0,0.75); }
.sp-prev { left: 0; }
.sp-next { right: 0; }

/* Thumbnail nav strip below main slider */
.sp-thumbnails {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}
.sp-thumbnail {
    flex: 1;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid transparent;
    transition: border-color 0.2s;
}
.sp-thumbnail.active { border-color: #0c8aa4; }
.sp-thumbnail img {
    width: 100%;
    height: 58px;
    object-fit: cover;
    display: block;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.sp-thumbnail:hover img,
.sp-thumbnail.active img { opacity: 1; }
.sp-thumbnail .thumb-date {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 9px;
    padding: 2px 4px;
    text-align: center;
}

/* ==========================================================================
   MIDDLE COLUMN - News List
   ========================================================================== */
.news-list-box {
    background: #fff;
    padding: 8px;
}
.news-list-box .box-title {
    background: #134978;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 10px;
    margin: -8px -8px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.news-list-box .news-item {
    border-bottom: 1px solid #e8e8e8;
    padding: 8px 0;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    cursor: pointer;
    transition: background 0.15s;
}
.news-list-box .news-item:hover { background: #f5f5f5; margin: 0 -8px; padding: 8px; }
.news-list-box .news-item:last-child { border-bottom: none; }
.news-item .news-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 45px;
    object-fit: cover;
}
.news-item .news-meta { flex: 1; }
.news-item .news-date {
    font-size: 10px;
    color: #0c8aa4;
    display: block;
    margin-bottom: 3px;
    font-weight: 600;
}
.news-item .news-title {
    font-size: 12px;
    color: #333;
    line-height: 1.3;
    font-weight: 600;
}
.news-item.active .news-title { color: #134978; }

/* ==========================================================================
   RIGHT COLUMN - bxSlider
   ========================================================================== */
.bx-slider-box {
    background: #fff;
    overflow: hidden;
}
.bx-slide img {
    width: 100%;
    height: auto;
    display: block;
}
.bx-controls {
    text-align: center;
    padding: 6px;
    background: #f5f5f5;
}
.bx-pager-item {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #ccc;
    border-radius: 50%;
    margin: 0 3px;
    cursor: pointer;
    transition: background 0.2s;
}
.bx-pager-item.active { background: #0c8aa4; }

/* ==========================================================================
   TABS SECTION (Aktuelles / Nachrichten / etc.)
   ========================================================================== */
#tabs-section {
    margin-top: 10px;
    background: #fff;
}
.tabs-nav {
    display: flex;
    border-bottom: 3px solid #134978;
}
.tab-btn {
    padding: 10px 18px;
    font-size: 12px;
    font-weight: 700;
    color: #555;
    cursor: pointer;
    border: none;
    background: #f0f0f0;
    border-right: 1px solid #ddd;
    transition: background 0.2s, color 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.tab-btn:hover { background: #e0e8ef; }
.tab-btn.active {
    background: #134978;
    color: #fff;
}
.tab-content { display: none; padding: 12px; }
.tab-content.active { display: block; }

.tab-news-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    align-items: flex-start;
}
.tab-news-item:last-child { border-bottom: none; }
.tab-news-item img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    flex-shrink: 0;
}
.tab-news-item .item-text .item-date {
    font-size: 10px;
    color: #0c8aa4;
    font-weight: 700;
}
.tab-news-item .item-text h4 {
    font-size: 13px;
    color: #134978;
    font-weight: 700;
    margin: 3px 0;
    line-height: 1.35;
}
.tab-news-item .item-text p {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* ==========================================================================
   COLORED TILES (10 flip cards / action buttons)
   ========================================================================== */
#action-tiles {
    margin-top: 10px;
}
#action-tiles .wrapper { }

.tiles-row {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

.tile {
    flex: 1;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: filter 0.25s;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 8px;
    text-decoration: none;
    color: #fff;
}
.tile:hover { filter: brightness(1.15); }
.tile:hover .tile-overlay { opacity: 1; }

.tile-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,119,145,0.35);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.tile i {
    font-size: 28px;
    margin-bottom: 6px;
    display: block;
}
.tile span {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
    display: block;
}

/* Tile colors based on ditib.de */
.tile-zsu       { background-color: #134978; }
.tile-pilgrim   { background-color: #31889F; }
.tile-position  { background-color: #C4994E; }
.tile-lv        { background-color: #996A42; }
.tile-predigt   { background-color: #634429; }
.tile-gebets    { background-color: #01576E; }
.tile-kalender  { background-color: #029BA6; }
.tile-moschee   { background-color: #2E7D9A; }
.tile-akademie  { background-color: #48698A; }
.tile-register  { background-color: #5A7B6E; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
#footer {
    background-color: #0a4d67;
    color: #cce8ef;
    margin-top: 20px;
    position: relative;
}

/* Footer toggle arrow */
#footer-toggle {
    text-align: center;
    padding: 6px 0;
    cursor: pointer;
    color: #afdbe6;
    font-size: 20px;
    transition: color 0.2s;
    background: #083d52;
}
#footer-toggle:hover { color: #fff; }
#footer-toggle i { transition: transform 0.3s; }
#footer-toggle.expanded i { transform: rotate(180deg); }

#footer-content {
    display: none;
    padding: 20px 0;
}
#footer-content.visible { display: block; }

.footer-row {
    display: flex;
    gap: 20px;
    justify-content: space-between;
}
.footer-col { flex: 1; }
.footer-col h4 {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.footer-col p,
.footer-col address {
    font-size: 12px;
    line-height: 1.7;
    color: #afdbe6;
    font-style: normal;
}
.footer-col a { color: #afdbe6; transition: color 0.2s; }
.footer-col a:hover { color: #fff; }

/* Footer bottom bar */
#footer-bottom {
    background: #06303f;
    padding: 10px 0;
    text-align: center;
    font-size: 11px;
    color: #7ab8c8;
}
#footer-bottom a {
    color: #7ab8c8;
    margin: 0 8px;
    transition: color 0.2s;
}
#footer-bottom a:hover { color: #fff; }
.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}
.footer-logo img { height: 36px; width: auto; filter: brightness(3); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
    .wrapper { max-width: 100%; padding: 0 8px; }
    .content-row { flex-wrap: wrap; }
    .col-left { flex: 0 0 100%; max-width: 100%; }
    .col-middle { flex: 0 0 50%; max-width: 50%; }
    .col-right { flex: 0 0 50%; max-width: 50%; }
}

@media (max-width: 768px) {
    #cssmenu { display: none; }
    .tiles-row { flex-wrap: wrap; }
    .tile { flex: 0 0 48%; margin-bottom: 4px; }
    .content-row { flex-direction: column; }
    .col-left, .col-middle, .col-right { flex: 0 0 100%; max-width: 100%; }
    .footer-row { flex-direction: column; }
}

/* ==========================================================================
   FONT AWESOME ICONS (local fallback - will use CDN in functions.php)
   ========================================================================== */
.fa { display: inline-block; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; }

/* ==========================================================================
   MISC / UTILITIES
   ========================================================================== */
.text-center { text-align: center; }
.clearfix::after { content: ''; display: table; clear: both; }

/* Animated opacity for sections loading */
.fade-in {
    animation: fadeIn 0.8s ease forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Hover effect matching ditib.de query.css */
.btn:hover,
.column_5.btn:hover {
    background-color: #067f94 !important;
    color: #fff !important;
}

/* ==========================================================================
   READING MODE OVERLAY
   ========================================================================== */
body.has-overlay::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 500;
}
