/* =========================================================================
   Oller del Mas — Stories blog layout
   Variables del tema padre: --color-dark, --color-beige, --color-beigeDark,
                              --color-light, --font-sans, --font-body
   ========================================================================= */

:root {
    --odm-stories-max: 1280px;
    --odm-text: var(--color-dark, #242322);
    --odm-muted: #6b6660;
    --odm-line: #e6e1d8;
    --odm-cream: var(--color-light, #F8F7F5);
    --odm-gold: var(--color-beigeDark, #CB9E69);
    --odm-beige: var(--color-beige, #E5CFB4);
}

/* Suppress the parent theme title-banner — we replace with our own hero */
body.blog .title-banner,
body.archive .title-banner,
body.search .title-banner { display: none !important; }

/* ---------------------------------------------------------------------------
   Theme overrides — idealtheme has aggressive global heading rules with
   !important (h3 = 50px uppercase 12px tracking, h2 = 70px). We reset those
   inside our blog scopes so our own typography wins.
   --------------------------------------------------------------------------- */
.odm-stories-hero h1,
.odm-stories-hero p,
.odm-stories-main h1, .odm-stories-main h2, .odm-stories-main h3, .odm-stories-main h4, .odm-stories-main h5, .odm-stories-main h6,
.odm-stories-sidebar h1, .odm-stories-sidebar h2, .odm-stories-sidebar h3, .odm-stories-sidebar h4, .odm-stories-sidebar h5, .odm-stories-sidebar h6 {
    text-transform: none !important;
    letter-spacing: normal !important;
    font-weight: 400;
    color: inherit;
}

/* No rounded corners — esquinas rectas, en línea con el estilo del sitio */
.odm-stories-hero, .odm-stories-hero *,
.odm-stories-cats, .odm-stories-cats *,
.odm-stories-main, .odm-stories-main *,
.odm-stories-sidebar, .odm-stories-sidebar * {
    border-radius: 0 !important;
}

/* ============== HERO ============================================== */
.odm-stories-hero {
    position: relative;
    min-height: clamp(420px, 60vh, 640px);
    background-size: cover;
    background-position: center;
    background-color: #2a2620;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    padding: 120px 24px 80px;
    overflow: hidden;
}
.odm-stories-hero__overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(20,18,15,0.20) 0%, rgba(20,18,15,0.55) 60%, rgba(20,18,15,0.78) 100%);
    pointer-events: none;
}
.odm-stories-hero__inner {
    position: relative;
    max-width: 760px;
    z-index: 1;
}
.odm-stories-hero__kicker {
    font-family: var(--font-body, 'Source Sans 3', sans-serif);
    text-transform: uppercase;
    letter-spacing: 0.32em;
    font-size: 0.78rem;
    color: var(--odm-beige);
    margin-bottom: 18px;
    opacity: 0.95;
}
.odm-stories-hero__title {
    font-family: Sangbleu, Georgia, serif;
    font-weight: 400;
    font-size: clamp(2.6rem, 6vw, 4.6rem) !important;
    line-height: 1.05;
    margin: 0 0 24px;
    color: #fff !important;
    letter-spacing: -0.01em !important;
    text-transform: none !important;
}
.odm-stories-hero__subtitle {
    font-family: var(--font-body, sans-serif);
    font-size: clamp(1.02rem, 1.4vw, 1.15rem);
    line-height: 1.6;
    color: rgba(255,255,255,0.88);
    max-width: 640px;
    margin: 0 auto;
}
.odm-stories-hero__meta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.72);
}
.odm-stories-hero__meta .odm-dot { opacity: 0.5; }
.odm-stories-hero__scroll {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: #fff;
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    background: rgba(0,0,0,0.15);
    backdrop-filter: blur(4px);
}
.odm-stories-hero__scroll:hover {
    background: var(--odm-gold);
    border-color: var(--odm-gold);
    transform: translateX(-50%) translateY(3px);
}

/* ============== CATEGORY CHIPS ===================================== */
.odm-stories-cats {
    background: #fff;
    border-bottom: 1px solid var(--odm-line);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.92);
}
.odm-stories-cats__inner {
    max-width: var(--odm-stories-max);
    margin: 0 auto;
    padding: 18px 32px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.odm-stories-cats__inner::-webkit-scrollbar { display: none; }
.odm-stories-cat {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border: 1px solid var(--odm-line);
    border-radius: 999px;
    text-decoration: none;
    color: var(--odm-text);
    font-size: 0.92rem;
    font-family: var(--font-body, sans-serif);
    transition: all 0.2s ease;
    white-space: nowrap;
    background: #fff;
}
.odm-stories-cat:hover {
    border-color: var(--odm-gold);
    color: var(--odm-gold);
}
.odm-stories-cat em {
    font-style: normal;
    font-size: 0.78rem;
    background: var(--odm-cream);
    color: var(--odm-muted);
    padding: 2px 8px;
    border-radius: 999px;
}
.odm-stories-cat.is-active {
    background: var(--odm-text);
    color: #fff;
    border-color: var(--odm-text);
}
.odm-stories-cat.is-active em {
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
}

/* ============== MAIN LAYOUT (grid + sidebar) ======================= */
.odm-stories-main {
    background: var(--odm-cream);
    padding: 72px 0 120px;
    min-height: 50vh;
}
.odm-stories-main__inner {
    max-width: var(--odm-stories-max);
    margin: 0 auto;
    padding: 0 32px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 56px;
    align-items: start;
}
@media (max-width: 980px) {
    .odm-stories-main__inner { grid-template-columns: 1fr; gap: 64px; }
    .odm-stories-main { padding: 48px 0 80px; }
}

/* ============== FEATURED POST ====================================== */
.odm-featured {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 6px 28px rgba(36,35,34,0.06);
    margin-bottom: 56px;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 0;
}
@media (max-width: 760px) {
    .odm-featured { grid-template-columns: 1fr; }
}
.odm-featured__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    display: block;
    background: #1a1a1a;
}
.odm-featured__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.odm-featured:hover .odm-featured__media img {
    transform: scale(1.04);
}
.odm-featured__badge {
    position: absolute;
    top: 20px; left: 20px;
    background: rgba(255,255,255,0.95);
    color: var(--odm-text);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 500;
    backdrop-filter: blur(6px);
}
.odm-featured__body {
    padding: clamp(28px, 4vw, 48px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.odm-featured__title {
    font-family: Sangbleu, Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.7rem, 3vw, 2.4rem) !important;
    line-height: 1.15 !important;
    margin: 16px 0 18px;
}
.odm-featured__title a {
    color: var(--odm-text);
    text-decoration: none;
    background-image: linear-gradient(var(--odm-gold), var(--odm-gold));
    background-size: 0% 1px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size 0.5s ease;
}
.odm-featured__title a:hover { background-size: 100% 1px; }
.odm-featured__excerpt {
    color: var(--odm-muted);
    font-size: 1.02rem;
    line-height: 1.65;
    margin: 0 0 28px;
}

/* ============== META & TAGS ======================================== */
.odm-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.odm-meta__cat {
    color: var(--odm-gold);
    text-decoration: none;
    font-weight: 600;
}
.odm-meta__cat:hover { text-decoration: underline; }
.odm-meta__date { color: var(--odm-muted); }
.odm-meta__date::before { content: "·"; margin-right: 10px; opacity: 0.5; }
.odm-meta__cat + .odm-meta__cat::before {
    content: ", "; margin-right: 4px; color: var(--odm-muted); font-weight: 400;
}

/* ============== DIVIDER ============================================ */
.odm-section-divider {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0 0 40px;
}
.odm-section-divider::before,
.odm-section-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--odm-line);
}
.odm-section-divider span {
    font-family: Sangbleu, Georgia, serif;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--odm-muted);
    text-transform: lowercase;
    letter-spacing: 0.02em;
}

/* ============== CARDS GRID ========================================= */
.odm-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    margin-bottom: 56px;
}
@media (max-width: 600px) {
    .odm-grid { grid-template-columns: 1fr; gap: 24px; }
}
.odm-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(36,35,34,0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.odm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(36,35,34,0.10);
}
.odm-card__media {
    position: relative;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    display: block;
    background: #1a1a1a;
}
.odm-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.odm-card:hover .odm-card__media img { transform: scale(1.06); }
.odm-card__cat {
    position: absolute;
    bottom: 14px; left: 14px;
    background: rgba(255,255,255,0.96);
    color: var(--odm-text);
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 500;
    backdrop-filter: blur(4px);
}
.odm-card__body {
    padding: 24px 24px 28px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.odm-card__date {
    font-size: 0.78rem;
    color: var(--odm-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
}
.odm-card__title {
    font-family: Sangbleu, Georgia, serif;
    font-weight: 400;
    font-size: 1.25rem !important;
    line-height: 1.25 !important;
    margin: 0 0 12px;
}
.odm-card__title a {
    color: var(--odm-text);
    text-decoration: none;
    transition: color 0.2s ease;
}
.odm-card__title a:hover { color: var(--odm-gold); }
.odm-card__excerpt {
    color: var(--odm-muted);
    font-size: 0.96rem;
    line-height: 1.6;
    margin: 0 0 16px;
    flex: 1;
}
.odm-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 16px;
}
.odm-tag {
    font-size: 0.78rem;
    color: var(--odm-muted);
    text-decoration: none;
    background: var(--odm-cream);
    padding: 4px 10px;
    border-radius: 999px;
    transition: all 0.2s ease;
}
.odm-tag:hover {
    background: var(--odm-beige);
    color: var(--odm-text);
}
.odm-tag.is-active {
    background: var(--odm-gold);
    color: #fff;
}
.odm-card__link {
    align-self: flex-start;
    color: var(--odm-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    transition: color 0.2s ease;
}
.odm-card__link:hover { color: var(--odm-gold); }

/* ============== BUTTONS ============================================ */
.odm-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 26px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}
.odm-btn--primary {
    background: var(--odm-text);
    color: #fff;
}
.odm-btn--primary:hover {
    background: var(--odm-gold);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(203,158,105,0.32);
}
.odm-btn--ghost {
    background: transparent;
    color: var(--odm-text);
    border-color: var(--odm-text);
}
.odm-btn--ghost:hover {
    background: var(--odm-text);
    color: #fff;
}

/* ============== PAGINATION ========================================= */
.odm-pagination .nav-links {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 24px;
}
.odm-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    background: #fff;
    color: var(--odm-text);
    text-decoration: none;
    border: 1px solid var(--odm-line);
    font-size: 0.92rem;
    transition: all 0.2s ease;
}
.odm-pagination .page-numbers.current {
    background: var(--odm-text);
    color: #fff;
    border-color: var(--odm-text);
}
.odm-pagination .page-numbers:not(.current):hover {
    border-color: var(--odm-gold);
    color: var(--odm-gold);
}

/* ============== SIDEBAR ============================================ */
.odm-stories-sidebar {
    position: sticky;
    top: 90px; /* below chips bar */
    display: flex;
    flex-direction: column;
    gap: 32px;
}
@media (max-width: 980px) {
    .odm-stories-sidebar { position: static; }
}
.odm-widget {
    background: #fff;
    border-radius: 14px;
    padding: 24px 22px;
    box-shadow: 0 4px 16px rgba(36,35,34,0.04);
}
.odm-widget__title {
    font-family: Sangbleu, Georgia, serif;
    font-weight: 500;
    font-size: 0.78rem !important;
    line-height: 1.2 !important;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--odm-line);
    color: var(--odm-text);
    text-transform: uppercase !important;
    letter-spacing: 0.14em !important;
}

/* Search */
.odm-search {
    display: flex;
    align-items: stretch;
    gap: 6px;
    background: var(--odm-cream);
    padding: 4px;
    border-radius: 999px;
}
.odm-search input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    color: var(--odm-text);
}
.odm-search input::placeholder { color: #aaa; }
.odm-search button {
    border: none;
    background: var(--odm-text);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s ease;
}
.odm-search button:hover { background: var(--odm-gold); }

/* Categories list */
.odm-cats-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.odm-cats-list li + li {
    border-top: 1px solid var(--odm-line);
}
.odm-cats-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 4px;
    color: var(--odm-text);
    text-decoration: none;
    font-size: 0.96rem;
    transition: color 0.2s ease;
}
.odm-cats-list a:hover { color: var(--odm-gold); }
.odm-cats-list a.is-active { color: var(--odm-gold); font-weight: 600; }
.odm-cats-list em {
    font-style: normal;
    font-size: 0.78rem;
    color: var(--odm-muted);
    background: var(--odm-cream);
    padding: 2px 9px;
    border-radius: 999px;
}

/* Tag cloud */
.odm-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.6;
}
.odm-tag-cloud .odm-tag {
    padding: 5px 11px;
}

/* Recent posts */
.odm-recent {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.odm-recent a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--odm-text);
    transition: color 0.2s ease;
}
.odm-recent a:hover { color: var(--odm-gold); }
.odm-recent__media {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    background: #1a1a1a;
}
.odm-recent__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.odm-recent__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.odm-recent__title {
    font-size: 0.92rem;
    line-height: 1.35;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.odm-recent__date {
    font-size: 0.74rem;
    color: var(--odm-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* CTA widget */
.odm-cta {
    padding: 0;
    background: var(--odm-text);
    color: #fff;
    overflow: hidden;
}
.odm-cta__link {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
}
.odm-cta__media {
    display: block;
    height: 160px;
    background-size: cover;
    background-position: center;
    position: relative;
}
.odm-cta__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(36,35,34,0) 40%, rgba(36,35,34,0.95) 100%);
}
.odm-cta__body {
    padding: 0 22px 24px;
    display: block;
    margin-top: -56px;
    position: relative;
    z-index: 1;
}
.odm-cta__kicker {
    display: block;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--odm-gold);
    margin-bottom: 6px;
}
.odm-cta__title {
    display: block;
    font-family: Sangbleu, Georgia, serif;
    font-size: 1.5rem;
    line-height: 1.15;
    margin-bottom: 10px;
}
.odm-cta__text {
    display: block;
    font-size: 0.9rem;
    line-height: 1.55;
    color: rgba(255,255,255,0.75);
    margin-bottom: 16px;
}
.odm-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 999px;
    font-size: 0.84rem;
    letter-spacing: 0.04em;
    transition: all 0.25s ease;
}
.odm-cta__link:hover .odm-cta__btn {
    background: var(--odm-gold);
    border-color: var(--odm-gold);
    color: #fff;
}

/* ============== EMPTY STATE ======================================== */
.odm-empty {
    text-align: center;
    padding: 64px 24px;
    background: #fff;
    border-radius: 18px;
}
.odm-empty h2 {
    font-family: Sangbleu, Georgia, serif;
    font-size: 1.6rem !important;
    line-height: 1.2 !important;
    color: var(--odm-text);
    margin-bottom: 12px;
}
.odm-empty p {
    color: var(--odm-muted);
    margin-bottom: 24px;
}

/* ============== MOBILE TWEAKS ====================================== */
@media (max-width: 600px) {
    .odm-stories-hero { min-height: 380px; padding: 90px 20px 60px; }
    .odm-stories-cats__inner { padding: 14px 18px; gap: 8px; }
    .odm-stories-main__inner { padding: 0 18px; }
    .odm-featured { margin-bottom: 40px; }
    .odm-featured__body { padding: 24px 22px 28px; }
    .odm-section-divider { margin-bottom: 28px; }
}
