/*!
Theme Name: DWAR Abante Radyo
Template: blogbyte
Requires at least: 5.3
Tested up to: 6.8
Requires PHP: 5.6
Version: 1.0
*/

:root {
  /* Color */
  --custom--color-abante: #ee1936;
  --custom--color-text-secondary: #524f4f;

  /* Font Size */
  --custom--font-detail: 13px;

  /* Line Height */
  --custom--home-line-height: 1.25;

  /* Page Width */
  --custom--page-width: 1230px;
}

.grid-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1em;
}

.mb-1 {
  margin-bottom: 1rem;
}

.flex-1 {
  display: flex;
  gap: 1em;
  margin-bottom: 1rem;
}

.flex-section-1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-size-1 {
  flex: 0 0 calc(65% - 1em);
}

.flex-size-2 {
  flex: 0 0 calc(60% - 1em);
}

.grid-section-1 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1em;
}

.grid-section-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1em;
}

.story-image {
  order: 1;
  margin-bottom: 1rem;
}

.spacer-bottom {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

/* .meta-text {
  text-transform: uppercase;
} */

/* ========== HEADER ========== */

.blogbyte-topbar-row svg {
  width: 2rem;
  height: 2rem;
}

.site-logo img {
  max-height: 4rem;
}

/* ========== HOME PAGE ========== */

.home__container {
  max-width: var(--custom--page-width);
  margin: 0 auto;
}

.content-area p,
.content-area h1,
.content-area h2,
.content-area h3,
.content-area h4,
.content-area h5,
.content-area h6 {
  margin-bottom: 5px;
  line-height: var(--custom--home-line-height);
}

.home__container {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 2rem;
}

.main__headlines-columns {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
}

.main__headlines-list {
  order: 1;
}

.main__headline-featured {
  order: 2;
}

.main__headline-featured-text {
  width: 90%;
  margin: 0 auto;
  text-align: center;
}

.main__headline-featured-post,
.main__headline-featured-stories {
  order: initial;
}

.item__border {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgb(124, 124, 124);
}

/* ========== CATEGORY PAGE ========== */
.category__container {
  max-width: var(--custom--page-width);
  margin: 0 auto;
}

.category-header-border {
  border-bottom: 1px solid rgb(81, 78, 78);
  margin-bottom: 1em;
}

.category-child {
  margin: 10px 0 1em 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--custom--color-text-secondary);
}

.child-categories {
  margin: 0;
  list-style: none;

  display: flex;
  gap: 1.5em;
}

.child-categories li {
  margin: 0;
}

.category-main {
  display: grid;
  grid-template-columns: 3fr 1fr;

  gap: 2em;
}

.featured-articles {
  display: flex;
  gap: 1em;
}

.featured-one {
  flex: 0 0 calc(60% - 1em);
}

/* .featured-two {
  flex: 0 0 calc(40% - 1em);
} */

.featured-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1em;
}

.text-author {
  text-transform: uppercase;
}

/* ========== SIDE BAR ========== */

.rss-feed-title-wrapper {
  display: flex;
  justify-content: space-between;
}

.flex-sidebar {
  display: flex;
  gap: 1em;
  justify-content: space-between;
}

/* .flex-sidebar picture {
  max-width: 100px;
  height: auto;
  object-fit: cover;
} */

.sidebar-text {
  flex: 0 0 calc(60% - 1em);
}

.sidebar-image {
  flex: 0 0 calc(40% - 1em);
}

.flex-sidebar picture img {
  max-width: 100%;
  height: auto;
  display: block;
}

.main-sidebar .story-wrapper {
  margin-bottom: 1em;
}

/* Optional styles */

.main__headline-featured picture {
  display: block;
  margin-bottom: 1rem;
}

.main__headline-featured picture img {
  margin: 0 auto;
}

/* Font */

.home__container .post-read-time {
  font-size: var(--custom--font-detail);
  color: var(--custom--color-text-secondary);
}

.text-detail {
  font-size: var(--custom--font-detail);
  color: var(--custom--color-text-secondary);
}

.rss-feed-title {
  padding: 5px 0;
  margin: 5px 5px 5px 0;
}

.rss-feed-category {
  color: white;
  background-color: var(--custom--color-abante);
  padding: 3px 5px;
  margin: 5px 5px 5px 0;
}

/* ========== SCHEDULE PAGE ========== */

.schedule-container {
  max-width: var(--custom--page-width);
  margin: 0 auto;
}

.schedule-container p {
  margin-bottom: 0;
}

.schedule-container > h1#schedule-title {
  font-size: clamp(3rem, 5vw, 5rem);
}

.schedule-tabs {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  gap: 1rem;
  padding: 0.5rem 1rem;
  -webkit-overflow-scrolling: touch;
}

.schedule-tab {
  flex: 0 0 auto;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.schedule-tab.active {
  background-color: #ee1432;
  color: white;
}

.schedule-tab-content {
  padding: 10px;
  display: none;
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

.schedule-tab-content.fade-out {
  opacity: 0;
}

.schedule-tab-content-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5em;
  padding-bottom: 1.25em;
  margin-bottom: 1.25em;
  border-bottom: 1px solid #949494;
}

.schedule-tab-content-item-details {
  flex: 1;
  max-width: 650px;
}

.schedule-tab-content-item-image {
  flex-shrink: 0;
  align-self: flex-start;
  margin-left: auto;
  max-width: 300px;
}

.schedule-tab-content-item-time {
  font-size: clamp(1.25rem, 1.75em, 2rem);
  text-transform: uppercase;
}

.schedule-item-title {
  font-size: clamp(1.5rem, 2em, 2.5rem);
}

.schedule-item-desc {
  font-size: clamp(1.05rem, 1.35em, 1.65rem);
}

/* ========== VIDEOS PAGE ========== */

.livestream-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2em;
  width: 100%;
  margin-bottom: 2em;
}

.youtube-video {
  flex: 2;
  width: 100%;
  position: relative;
  aspect-ratio: 16 / 9;
}

.youtube-video > iframe {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border: none;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.youtube-title {
  flex: 1;
}

.youtube-video-title > h3 {
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: bold;
  text-transform: capitalize;
  margin-bottom: 10px;
}

#youtube-live-status {
  color: red;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2em;
  margin-bottom: 2em;
  justify-content: center;
  overflow: visible; /* make sure container shows overflow */
}

/** DEBUG LAYOUT **/

/* .video-grid > * {
  border: 1px solid red;
} */

.playlist-section {
  margin-bottom: 2rem;
  border-bottom: 1px solid #ababab;
}

.video-card {
  min-height: 180px;
  transition: transform 0.2s ease;
}

.video-card img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 10px;
}

.video-card p {
  margin: 0;
  font-size: var(--global--font-size-xs);
  font-weight: bold;
  line-height: 1.4em;
}

.playlist-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.playlist-title h4 {
  margin: 0;
}

.see-all-link {
  text-decoration: none;
}

/* ========== RESPONSIVE DESIGN ========== */

@media (max-width: 600px) {
  .grid-featured,
  .home__container,
  .main__headlines-columns {
    grid-template-columns: 1fr; /* Still stacked */
    gap: 1rem; /* Slightly smaller gap for tight spaces */
  }

  .main__headline-featured {
    order: 1;
  }

  .main__headline-list {
    order: 2;
  }

  .schedule-tab-content-item {
    flex-direction: column;
    gap: 0;
  }

  .schedule-tab-content-item-details {
    order: 3;
  }

  .schedule-tab-content-item-image {
    order: 1;
    max-width: 400px;
  }

  .schedule-tab-content-item-time {
    order: 2;
    flex: 1;
  }

  .livestream-container {
    flex-direction: column;
    gap: 1em;
  }

  .youtube-video {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 992px) {
  .main__headlines-columns {
    grid-template-columns: 1fr;
  }

  .main__headline-featured {
    display: contents; /* allows children to break out of the parent for ordering */
  }

  .main__headline-featured-post {
    order: 1;
  }

  .main__headline-featured picture img {
    margin: unset;
  }

  .main__headline-featured-text {
    text-align: unset;
    width: 100%;
    margin: unset;
  }

  .main__headlines-list {
    order: 2;
  }

  .main__headline-featured-stories {
    order: 3;
  }

  .flex-1 {
    flex-direction: column;
    gap: 0;
  }

  .story-image {
    order: 0;
  }

  .grid-section-2 {
    grid-template-columns: 1fr;
  }

  /* CATEGORIES PAGE */

  .featured-articles {
    flex-direction: column;
  }
  .category-main {
    display: unset;

    gap: 2em;
  }

  .featured-list {
    display: unset;
    gap: 1em;
  }
}

@media (min-width: 601px) and (max-width: 992px) {
  .grid-featured,
  .home__container,
  .main__headlines-columns {
    grid-template-columns: 1fr; /* Stack columns vertically */
  }

  .schedule-tab-content-item-image {
    order: 1;
    max-width: 300px;
  }

  .livestream-container {
    flex-direction: column;
    gap: 0;
  }

  .youtube-video {
    aspect-ratio: 16 / 9;
  }
}

/* ========== SKELETON LOADER ========== */

.skeleton-loader div,
.skeleton-loader p {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0% {
    background-color: #ebebeb;
  }
  50% {
    background-color: #e0e0e0;
  }
  100% {
    background-color: #ebebeb;
  }
}
