/* ==========================================================================
   Patrioti Category Wheel — Frontend Styles
   Defaults match patrioti.al aesthetic (burgundy, cream, gold).
   Most visual props are overridden by Elementor-generated inline CSS.
   ========================================================================== */

.pw-root {
    --pw-accent:       #8b1a1a;  /* burgundy */
    --pw-accent-alt:   #d4af37;  /* gold */
    --pw-cream:        #f7f3ea;
    --pw-ink:          #1a1a1a;
    --pw-wheel-size:   420px;

    width: 100%;
    box-sizing: border-box;
}
.pw-root *,
.pw-root *::before,
.pw-root *::after { box-sizing: border-box; }

/* ---------- SECTION HEAD ---------- */
.pw-section-head {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 12px;
}
.pw-section-title {
    margin: 0 0 8px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--pw-ink);
    line-height: 1.15;
}
.pw-section-subtitle {
    margin: 0;
    font-family: Georgia, serif;
    font-style: italic;
    font-size: .95rem;
    color: var(--pw-accent);
    letter-spacing: .01em;
}

/* ---------- WRAPPER LAYOUT ---------- */
.pw-wrapper {
    display: flex;
    /* align-items is controlled via an Elementor setting now (default center
       so the wheel sits nicely next to posts instead of hugging the top). */
    align-items: center;
    gap: 56px;
    width: 100%;
}
.pw-wrapper.pw-pos-right { flex-direction: row-reverse; }
.pw-wrapper.pw-pos-top   { flex-direction: column; align-items: center; }

/* ---------- WHEEL COLUMN ---------- */
.pw-wheel-col {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.pw-pos-top .pw-wheel-col { justify-content: center; width: 100%; }

/* ---------- NAV BUTTONS ---------- */
.pw-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--pw-accent);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    transition: background-color .25s ease, transform .25s ease;
    flex-shrink: 0;
}
.pw-nav-btn:hover { background: var(--pw-accent-alt); transform: scale(1.08); }
.pw-nav-btn:active { transform: scale(.95); }

/* ---------- THE WHEEL ---------- */
.pw-wheel {
    position: relative;
    width: var(--pw-wheel-size);
    height: var(--pw-wheel-size);
    flex-shrink: 0;
}

/* Indicator (pointer at 12 o'clock) */
.pw-wheel-indicator {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-bottom: 22px solid var(--pw-accent-alt);
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.25));
    z-index: 5;
}

/* Rotating disc */
.pw-wheel-disc {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--pw-cream);
    border: 4px solid var(--pw-accent);
    transition: transform .9s cubic-bezier(.22, 1, .36, 1);
    box-shadow:
        inset 0 0 0 8px rgba(139,26,26,.05),
        inset 0 0 0 9px rgba(255,255,255,.8),
        0 8px 28px rgba(0,0,0,.14),
        0 0 0 1px rgba(0,0,0,.04);
    will-change: transform;
}

/* Cog teeth — sit just outside wheel border, pointing outward */
.pw-cog-tooth {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 14px;
    background: var(--pw-accent);
    border-radius: 2px 2px 0 0;
    transform-origin: center center;
    pointer-events: none;
    box-shadow: inset 0 1px 2px rgba(255,255,255,.15);
}

/* Spokes — radiate from center to just inside the edge */
.pw-spoke {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: calc(var(--pw-wheel-size) / 2 - 50px);
    margin-left: -1px;
    background: var(--pw-accent);
    opacity: .25;
    transform-origin: top center;
    pointer-events: none;
}

/* Labels around the wheel */
.pw-wheel-label {
    position: absolute;
    top: 50%;
    left: 50%;
    padding: 6px 14px;
    background: transparent;
    border: none;
    color: var(--pw-ink);
    font-family: Georgia, serif;
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .03em;
    cursor: pointer;
    /* allow long labels to wrap inside a reasonable box instead of overflowing */
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: var(--pw-label-max-width, 110px);
    text-align: center;
    line-height: 1.2;
    border-radius: 20px;
    transition: color .3s ease, background-color .3s ease, transform .3s ease;
    z-index: 2;
}
.pw-wheel-label .pw-label-text {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}
.pw-wheel-label:hover { color: var(--pw-accent); }
.pw-wheel-label.is-active {
    color: var(--pw-accent);
    background: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,.15);
    font-weight: 700;
}

/* Center hub */
.pw-wheel-hub {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32%;
    height: 32%;
    border-radius: 50%;
    /* solid color so Elementor's background-color control actually takes effect.
       previous linear-gradient was a background-image which visually masked any
       background-color override coming from the editor. */
    background-color: var(--pw-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
    font-family: Georgia, serif;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
    box-shadow:
        inset 0 0 0 1px rgba(212,175,55,.3),
        0 8px 20px rgba(0,0,0,.25);
    z-index: 3;
    transition: transform .4s ease, background-color .3s ease;
}
.pw-hub-label {
    max-width: 100%;
    word-break: keep-all;
    overflow-wrap: break-word;
    hyphens: none;
    /* inherit font styling from .pw-wheel-hub so Elementor's typography
       control applies cleanly; fall back to a sensible fluid size. */
    font-size: inherit;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pw-wheel-hub.pulse { animation: pw-pulse .5s ease; }
@keyframes pw-pulse {
    0%   { transform: translate(-50%, -50%) scale(1); }
    50%  { transform: translate(-50%, -50%) scale(1.08); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* ---------- POSTS COLUMN ---------- */
.pw-posts-col {
    flex: 1;
    min-width: 0;
    position: relative;
}
.pw-pos-top .pw-posts-col { width: 100%; margin-top: 16px; }

.pw-posts-panel {
    display: none;
    animation: pw-fadein .5s ease;
}
.pw-posts-panel.is-active { display: block; }
@keyframes pw-fadein {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pw-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--pw-accent);
}
.pw-panel-title {
    margin: 0;
    font-family: Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--pw-ink);
    letter-spacing: .01em;
}
.pw-panel-viewall {
    font-family: Georgia, serif;
    font-size: .9rem;
    color: var(--pw-accent);
    text-decoration: none;
    transition: color .25s;
}
.pw-panel-viewall:hover { color: var(--pw-accent-alt); }

/* ---------- POSTS GRID ---------- */
.pw-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ---------- POST CARD ---------- */
.pw-post-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.pw-post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0,0,0,.12);
    border-color: #d4d4d4;
}

.pw-card-thumb {
    display: block;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
}
.pw-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s cubic-bezier(.22, 1, .36, 1);
    display: block;
}
.pw-post-card:hover .pw-card-thumb img { transform: scale(1.08); }

.pw-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pw-card-title {
    margin: 0 0 10px;
    font-family: Georgia, serif;
    font-size: 1.1rem;
    line-height: 1.4;
    font-weight: 700;
}
.pw-card-title a {
    color: #111;
    text-decoration: none;
    transition: color .25s ease;
}
.pw-card-title a:hover { color: var(--pw-accent); }

.pw-card-meta {
    margin: 0 0 12px;
    font-family: Georgia, serif;
    font-size: .8rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.5;
}
.pw-card-meta a {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}
.pw-card-meta a:hover { color: var(--pw-accent); }
.pw-meta-sep { opacity: .4; }

.pw-card-excerpt {
    margin: 0 0 14px;
    font-family: Georgia, serif;
    font-size: .9rem;
    line-height: 1.55;
    color: #555;
    flex: 1;
}

.pw-card-more {
    align-self: flex-start;
    margin-top: auto;
    font-family: Georgia, serif;
    font-size: .85rem;
    font-weight: 700;
    color: var(--pw-accent);
    text-decoration: none;
    letter-spacing: .03em;
    transition: color .25s, transform .25s;
}
.pw-card-more:hover {
    color: var(--pw-accent-alt);
    transform: translateX(3px);
}

.pw-no-posts,
.pw-empty {
    padding: 20px;
    background: #f9f6f0;
    border-left: 3px solid var(--pw-accent);
    font-family: Georgia, serif;
    font-style: italic;
    color: #666;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1200px) {
    .pw-wrapper { gap: 40px; }
}

@media (max-width: 1024px) {
    .pw-wrapper,
    .pw-wrapper.pw-pos-right { flex-direction: column; align-items: center; gap: 32px; }
    .pw-posts-col { width: 100%; }
    .pw-posts-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

@media (max-width: 768px) {
    .pw-section-title { font-size: 1.8rem; }
    .pw-posts-grid { grid-template-columns: repeat(2, 1fr); }
    .pw-panel-head { flex-direction: column; align-items: flex-start; gap: 8px; }
    .pw-panel-viewall { font-size: .85rem; }
}

@media (max-width: 600px) {
    .pw-section-title { font-size: 1.4rem; }
    .pw-section-subtitle { font-size: .85rem; }
    .pw-posts-grid { grid-template-columns: 1fr; gap: 16px; }
    .pw-panel-title { font-size: 1.3rem; }
    .pw-wheel-label { font-size: .65rem; padding: 4px 10px; }
    .pw-nav-btn { width: 40px; height: 40px; }
    .pw-card-title { font-size: .95rem; }
}

/* ---------- UTILITY: when wheel is dragging ---------- */
.pw-wheel-disc.is-dragging { transition: none; cursor: grabbing; }
.pw-wheel-disc { cursor: grab; }
